From nobody Thu Nov 14 17:33:18 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C5AEEB64D7 for ; Wed, 21 Jun 2023 18:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231681AbjFUS0z (ORCPT ); Wed, 21 Jun 2023 14:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230255AbjFUS0n (ORCPT ); Wed, 21 Jun 2023 14:26:43 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F89A19BF for ; Wed, 21 Jun 2023 11:26:25 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f918922954so38903725e9.2 for ; Wed, 21 Jun 2023 11:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687371984; x=1689963984; 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=8NBfwHB1m61Ki4N8NOLCZ9xwyv+VdQ6tisfULtxIs/U=; b=LY91tvjlXk3daG/tLcZWF2pMIfSIzSCKA0T+epijk0I7ZiwuP4ZGz08colioCb/vr2 D2tUvRqXuzXQkx5wxuJhQlOP9zYOfCfoCDY8vQcJPh1Pj4a/hha39stPhklXPBJD72L7 3KYhPskTABWgRxKJcwUiSbzOn+tesu1H8esz8vNCmcGx8OInSgQrSn65nDRqV2G4zzal aHHdpbo1Oz6kJzunPhv54dFV1VTv96G3zxljTC9OWzF7f+CSwhtxDSABeuaA8tBPqP9l LHaOeuH/7rBjbTCeg4DubTv8dvMGDEwiayO/+xnJO7bh3XtwgqXRduI8dgqcYYUsfkF/ BLuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687371984; x=1689963984; 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=8NBfwHB1m61Ki4N8NOLCZ9xwyv+VdQ6tisfULtxIs/U=; b=AcYC11mWi9tPBtcyIkbipHYYxrUxvatljBft5VbZs/opvopvcmkKiloGnglNzTe7KD s+XbO7Iuv1rG2h+JkbLFn3OBPMMTyGDYLc8vUUXglyp/+RpcRxsb1qDMKXJTOGxnh16h jpGu+NQ7v+CC+kXk0Y93D5nM4ZVNAKeNWnfyfCCjdqRE16R1KESYcXn8S/AIG9xGz7Mq 9/XsA0YTYQwKexCI6vA5TwHOQQfNwSfT1ijMHYY+BQyZ1ElYm27eT5pA82NSi1KtQNC0 EaCOD/nzLs5nspihoxktm1WNrX2PXjjdnLQA0qb5/W8NMiu3CWV+nZM+74A66mSOtjMs QhUw== X-Gm-Message-State: AC+VfDxLcZyQQoqNMQgDYOyqvFTvk+4c1c7juhfBZWt1TnB2HN07abJg 81SXOtSK+z1TDNoqbm47r5fXjA== X-Google-Smtp-Source: ACHHUZ7DgL1GaivyZZPW9f+esDGdjAfgT1i2Cblkr3bjb5WIOeh+R1SaUPjjGdazaJvf/hqXE9/+aA== X-Received: by 2002:a1c:4c0b:0:b0:3f9:b950:bb7b with SMTP id z11-20020a1c4c0b000000b003f9b950bb7bmr4150674wmf.41.1687371983980; Wed, 21 Jun 2023 11:26:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 11:26:23 -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 09/12] net: stmmac: replace the ext_snapshot_en field with a flag Date: Wed, 21 Jun 2023 20:25:55 +0200 Message-Id: <20230621182558.544417-10-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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 5 ++++- include/linux/stmmac.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index d8bcf9452197..a3d0da4e9e91 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -326,7 +326,7 @@ static int intel_crosststamp(ktime_t *device, /* Both internal crosstimestamping and external triggered event * timestamping cannot be run concurrently. */ - if (priv->plat->ext_snapshot_en) + if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) return -EBUSY; =20 priv->plat->int_snapshot_en =3D 1; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/driver= s/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index 8b50f03056b7..afd81aac6644 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -195,7 +195,7 @@ static void timestamp_interrupt(struct stmmac_priv *pri= v) */ ts_status =3D readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS); =20 - if (!priv->plat->ext_snapshot_en) + if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) return; =20 num_snapshot =3D (ts_status & GMAC_TIMESTAMP_ATSNS_MASK) >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net= /ethernet/stmicro/stmmac/stmmac_ptp.c index b4388ca8d211..3d7825cb30bb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -192,7 +192,10 @@ static int stmmac_enable(struct ptp_clock_info *ptp, write_unlock_irqrestore(&priv->ptp_lock, flags); break; case PTP_CLK_REQ_EXTTS: - priv->plat->ext_snapshot_en =3D on; + if (on) + priv->plat->flags |=3D STMMAC_FLAG_EXT_SNAPSHOT_EN; + else + priv->plat->flags &=3D ~STMMAC_FLAG_EXT_SNAPSHOT_EN; mutex_lock(&priv->aux_ts_lock); acr_value =3D readl(ptpaddr + PTP_ACR); acr_value &=3D ~PTP_ACR_MASK; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 3365b8071686..0a77e8b05d3a 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -212,6 +212,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) #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) =20 struct plat_stmmacenet_data { int bus_id; @@ -286,7 +287,6 @@ struct plat_stmmacenet_data { int int_snapshot_num; int ext_snapshot_num; bool int_snapshot_en; - bool ext_snapshot_en; int msi_mac_vec; int msi_wol_vec; int msi_lpi_vec; --=20 2.39.2