From patchwork Wed Jun 21 18:25:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 111259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4564203vqr; Wed, 21 Jun 2023 11:34:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wZqlGxMLPeky/XLnythbDBj+nZFs86i2cFOx2CqufNgzPL9AmOknuMs6sA3I9I9t+a3Se X-Received: by 2002:a05:6a21:7896:b0:121:c372:6d57 with SMTP id bf22-20020a056a21789600b00121c3726d57mr14177486pzc.12.1687372475755; Wed, 21 Jun 2023 11:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687372475; cv=none; d=google.com; s=arc-20160816; b=RQAios1O0Pbr743BjnmJTioG2aqIR+o8ywWOgHkjZtXyP1C+IKshK8LrlLflnaU8G8 CLEUU3qzHygVLMr/fulLnt2m0jczj9341BY1H2Kxcec5IYAVbI+lLHeYL3i3ouMhnNlR VTKiBcrdd5pHTN1ivU0mo6+/D4E6h5I8GvwWxv8EwqdS9IIhGDAn9QIyqyeQU5CreXo2 TmDJR0hiVpS+Pe8MWQQMEwFUMlCS92RydofB2tbJ5I04ZZECbc/QP0YRPF1n5iZluJ0B X0O59AUDjrVrkW4YtlqJeV6qvZr7yn4aTJvPYU+c6qxuEhTV4E6miDSl43VPQYr6ib4O V2Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tZoPiuKyiNxA5Jm5ZMWEJ6HMm0QfTiaA8bIFviBXOuA=; b=BeosENGQ+h/hweOjg5sJkFZBE9USrCBPUrHcoCBwfb8Iii1C6Weq8HmcQacE78JV6v HbAtL650XibbAMwsGMLHQcpKWE97qdqqfZTvFvC2Q53nc7akPHG11WVjp0qXIaB05uew j6m4wli3IbEdZWO8QAdq+m4J6Lz+8dNa0wODhhtUAysnoUcS4yICvkSZA/uBwv5gtUsC UjyE4RnvdC9wC1dI/ZsBXnHzOsYUo4cUcLxjE/wEZpTcrQ795E++MVIOK54CweGXp6JQ qvWtk0lRSrBsQtby1w0xNUi+9BX1D9JNobDywsa0BB72HfRdD2tPP1DTuRMRqaJImXlR TjLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=BGRlcdZC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h64-20020a638343000000b0053f163363c0si4630608pge.95.2023.06.21.11.34.21; Wed, 21 Jun 2023 11:34:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=BGRlcdZC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231139AbjFUS07 (ORCPT + 99 others); Wed, 21 Jun 2023 14:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231458AbjFUS0o (ORCPT ); Wed, 21 Jun 2023 14:26:44 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DB21BD7 for ; Wed, 21 Jun 2023 11:26:26 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3112c11fdc9so4287100f8f.3 for ; Wed, 21 Jun 2023 11:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687371985; x=1689963985; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tZoPiuKyiNxA5Jm5ZMWEJ6HMm0QfTiaA8bIFviBXOuA=; b=BGRlcdZCyKur3g15bwV1zzi6jmOTAm2u3A5RtfTRJ9cWrTSiNVLGm2zcn7T7U360Pd NZZ6R006ZtnKytneWPK9hSOfLGCEc7yjJdLqlpXvvs/EP4t3GyWVKavkPIfj25NxqMsH oOWlcCV08FgSzUCBjngx+crQrWN+YJpA2+61RdKBRCJoTUpHgVDyoTYxNuoOO9M0bsn1 BcojsUgvUu/hlzHstQDAjI4FW2kQ6ej8Qzy8c0DlLsL6DvGzYc0tkDIU+bn3NkFDXf/o Z5OzOY/Wdftotx3GO4L9NhmhBgBaMlvSIto7ubaLN0wbZgBQeL5JBOYxmH0+4Kw4vF6n tiqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687371985; x=1689963985; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tZoPiuKyiNxA5Jm5ZMWEJ6HMm0QfTiaA8bIFviBXOuA=; b=i3D/Vo2MYsyiUNEbseC3NdZxAqTyMZ188u8JmasBBVFErlelLDTyfHtg+lmSKoLX/j bvBLvFMAjZcFzVDaaxPX3xjmQ5IINRiGDtTe4UlWQgXGizo7WzfdzKdJZiW4BiTFGa7o xiXqB1EchPl+gbv8F81p7uqibS02U3IYKS2H79UrUpDrh3yKkTL23xQzw6mYpKgE3yZO YQnb9LvVHYuN7gu2jsdYWSJ5gknYRZDgc55xUbKY9u8bues7icIY12nVaH7NuEdM5iEl xIo2iliNqY9edlNuvWQpLFGHlS8eJ+CWJw8L3MeImgfpHlgxnXglVUeh6S+weNADRWvL Jc9w== X-Gm-Message-State: AC+VfDxVWp2fNjvVvtWECOtApkMgdV8tPBpvoPKEwhIH2Bw6xtHm7Hl6 eGN2eBNqJbys8NtA6b2YGtjrkQ== X-Received: by 2002:a5d:63c5:0:b0:30a:efd2:c170 with SMTP id c5-20020a5d63c5000000b0030aefd2c170mr10726903wrw.37.1687371985426; Wed, 21 Jun 2023 11:26:25 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a69f:8ee3:6907:ccdf]) by smtp.gmail.com with ESMTPSA id z13-20020adff74d000000b0030af15d7e41sm5176994wrp.4.2023.06.21.11.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 11:26:24 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next 10/12] net: stmmac: replace the int_snapshot_en field with a flag Date: Wed, 21 Jun 2023 20:25:56 +0200 Message-Id: <20230621182558.544417-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230621182558.544417-1-brgl@bgdev.pl> References: <20230621182558.544417-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769338280801854078?= X-GMAIL-MSGID: =?utf-8?q?1769338280801854078?= From: Bartosz Golaszewski Drop the boolean field of the plat_stmmacenet_data structure in favor of a simple bitfield flag. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 10 +++++----- drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 2 +- include/linux/stmmac.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index a3d0da4e9e91..f194a905d04f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -329,7 +329,7 @@ static int intel_crosststamp(ktime_t *device, if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) return -EBUSY; - priv->plat->int_snapshot_en = 1; + priv->plat->flags |= STMMAC_FLAG_INT_SNAPSHOT_EN; mutex_lock(&priv->aux_ts_lock); /* Enable Internal snapshot trigger */ @@ -350,7 +350,7 @@ static int intel_crosststamp(ktime_t *device, break; default: mutex_unlock(&priv->aux_ts_lock); - priv->plat->int_snapshot_en = 0; + priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN; return -EINVAL; } writel(acr_value, ptpaddr + PTP_ACR); @@ -376,7 +376,7 @@ static int intel_crosststamp(ktime_t *device, if (!wait_event_interruptible_timeout(priv->tstamp_busy_wait, stmmac_cross_ts_isr(priv), HZ / 100)) { - priv->plat->int_snapshot_en = 0; + priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN; return -ETIMEDOUT; } @@ -395,7 +395,7 @@ static int intel_crosststamp(ktime_t *device, } system->cycles *= intel_priv->crossts_adj; - priv->plat->int_snapshot_en = 0; + priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN; return 0; } @@ -609,7 +609,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->ext_snapshot_num = AUX_SNAPSHOT0; plat->crosststamp = intel_crosststamp; - plat->int_snapshot_en = 0; + priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN; /* Setup MSI vector offset specific to Intel mGbE controller */ plat->msi_mac_vec = 29; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index afd81aac6644..fa2c3ba7e9fe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -180,7 +180,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv) u64 ptp_time; int i; - if (priv->plat->int_snapshot_en) { + if (priv->plat->flags & STMMAC_FLAG_INT_SNAPSHOT_EN) { wake_up(&priv->tstamp_busy_wait); return; } diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 0a77e8b05d3a..47708ddd57fd 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -213,6 +213,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) #define STMMAC_FLAG_MULTI_MSI_EN BIT(7) #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) +#define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9) struct plat_stmmacenet_data { int bus_id; @@ -286,7 +287,6 @@ struct plat_stmmacenet_data { struct pci_dev *pdev; int int_snapshot_num; int ext_snapshot_num; - bool int_snapshot_en; int msi_mac_vec; int msi_wol_vec; int msi_lpi_vec;