From patchwork Fri Jun 23 10:08:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5663036vqr; Fri, 23 Jun 2023 03:17:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72fAS/Z5nEVJtD1f6aJzwoftLroIEjEbMvdcfEpci/CTBtJU5MtHbBCyjlhQahna+0lEDK X-Received: by 2002:a05:6a00:2d04:b0:65c:2ea:2c5e with SMTP id fa4-20020a056a002d0400b0065c02ea2c5emr21860070pfb.29.1687515456213; Fri, 23 Jun 2023 03:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515456; cv=none; d=google.com; s=arc-20160816; b=jQn6JjSqREFfEo538tyqqe1uN6MjH+ToMezry4WiMiF2aCig6xSa9SaUZO6Zcd76/8 PI3UBLrunpCcFdtkRV8shmvnJTmisGgrYzxad0gD8eD4bP5/8DVaNtvy+ezbUecSOE0N TLljmTPAyOh/TNaQHrc6e6yemG5vsP4EV5SJp6Fz+PLQKv2oJi6m2OGNfDCnTElgcO1j gR+m1r1jJ4aXcTiGW2i2tIPWqqYq0o94UgjOeuXF9Nk6Yla+PPcRGtorTECggU/kIUtt nKD5cfTWVPA90/cW2s4G2V8KWChJGz2iW3lRI+ebdm0fS+L8dRGn1pjbN341FqtGxltN SDmg== 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=XnVUt9Dh0UjANbDqrVAk/dG3mwlxSAljXxYJAiOkMWs=; b=qZud04StQaGhQa2R+rqfl6BXJzd5O9srWyzHVJLRwKoo3U4rNPX95zoxm9HVaVMIJ/ gCkdVgD10Txkkn3EhZIxlmqVLERrE/WTr6NzWtuSu2bA5vFHSgFlyWIqk8Qp6DWgWgHu 8wwvO5xEI+7qZeGeuGoLIkt/g6ie5tB021rR0SZ5SS4Q9kS0Ui2hF/RRQRhWVUdnv5l/ 7I/rAGNB/iHwPGQF8TRQHZZ22WXZQp3jPeTvW3d5H/Bc4dzhWPRxSG77vBLtUpNtAWVo vR4116WV6BOHoq5S8eth2a/K1bIKOEkFDxS1fffTKVZ3xCQ/3qFI0fHug/T4wIpPSqVN uwLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=LLP1s9L8; 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 s23-20020a632c17000000b00543fcc5dee4si8285708pgs.205.2023.06.23.03.17.23; Fri, 23 Jun 2023 03:17:36 -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=LLP1s9L8; 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 S232082AbjFWKKk (ORCPT + 99 others); Fri, 23 Jun 2023 06:10:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbjFWKKC (ORCPT ); Fri, 23 Jun 2023 06:10:02 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D8B72D66 for ; Fri, 23 Jun 2023 03:08:52 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4f875b267d9so538569e87.1 for ; Fri, 23 Jun 2023 03:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514930; x=1690106930; 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=XnVUt9Dh0UjANbDqrVAk/dG3mwlxSAljXxYJAiOkMWs=; b=LLP1s9L824mf/hPGjZfQH7SiopJXYfdyiDTM59jz/jNc3AiZxxW/BgOlJBkA3DlLwk qTAs4+1dw61llSqfMyZDkYAM6HQqE4aDeJvBSpjvYMWlHs5qZKSVeLivKVXaXH4u9MCt O0SxZe2JVIg6f6DN8tMUOoiGbaE8XkOCbpvrzbU3c8d0iG30sMtWN/BnUsYvB8rM2s1N MFClusI3KoRjf8dnmIgxF/FoE5Xwy3/ZPq4saYQ4K4pPwI5sutaqwDS1PJ7SMkYs3gst XRUZC+Ml/kyLvZchqlOeqh7fxxSj0uyrdIePhQ2ICoh+sLUMCvqEIWsQezMzBJfaGH4I 4jqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514930; x=1690106930; 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=XnVUt9Dh0UjANbDqrVAk/dG3mwlxSAljXxYJAiOkMWs=; b=hcE2D8sS0ckj2xrcWbyKl0YnaRGi5ATIvCD6Nl1h2pBwYM7mpx5j2B3KNVHa3CAlNc FKUeY/ay2g3vWFBp/hw+6kHEjgvnNT+3KL4//yjdGUb7LMJLzQMRZSwCPGOOnSehpnZD RBUko9BT/AI0f+TGZxGSbXL/l/PpcYEsrf0JYzLkswoKvzyGFF9eznNbfp37cbzGfrxD Yyz+13Q9p/xMekOyqO/iQjOsvH2IVIBHHDJiFytg8sAoK0mAAZmIaBSw/x8u7Wxwe5Pz nuQ5QLPz6oTQJTzhwu/8H0ARLYVFKFB0Ef98BnInMkMLRrHyw3cNH1O9DShZM2zitlK1 ZPKg== X-Gm-Message-State: AC+VfDz/Ck+LnNwbRqAVGH+5FXBZYa5djRnApNJ3ZbeMRsLWUFlsWmoO rxzNmB1vYtXlKfycTcis2GSRFw== X-Received: by 2002:a05:6512:32a1:b0:4f8:589d:647b with SMTP id q1-20020a05651232a100b004f8589d647bmr11737753lfe.34.1687514930651; Fri, 23 Jun 2023 03:08:50 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:50 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 01/12] net: stmmac: replace the has_integrated_pcs field with a flag Date: Fri, 23 Jun 2023 12:08:34 +0200 Message-Id: <20230623100845.114085-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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=unavailable 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?1769488207114893756?= X-GMAIL-MSGID: =?utf-8?q?1769488207114893756?= From: Bartosz Golaszewski struct plat_stmmacenet_data contains several boolean fields that could be easily replaced with a common integer 'flags' bitfield and bit defines. Start the process with the has_integrated_pcs field. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index fa0fc53c56a3..44151e69f9ce 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -790,7 +790,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) plat_dat->rx_clk_runs_in_lpi = 1; - plat_dat->has_integrated_pcs = data->has_integrated_pcs; + if (data->has_integrated_pcs) + plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS; if (ethqos->serdes_phy) { plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 4727f7be4f86..38b6cbd8a133 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5798,7 +5798,8 @@ static void stmmac_common_interrupt(struct stmmac_priv *priv) } /* PCS link status */ - if (priv->hw->pcs && !priv->plat->has_integrated_pcs) { + if (priv->hw->pcs && + !(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS)) { if (priv->xstats.pcs_link) netif_carrier_on(priv->dev); else diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 06090538fe2d..8e7511071ef1 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -204,6 +204,8 @@ struct dwmac4_addrs { u32 mtl_low_cred_offset; }; +#define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) + struct plat_stmmacenet_data { int bus_id; int phy_addr; @@ -293,6 +295,6 @@ struct plat_stmmacenet_data { bool sph_disable; bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; - bool has_integrated_pcs; + unsigned int flags; }; #endif From patchwork Fri Jun 23 10:08:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5665997vqr; Fri, 23 Jun 2023 03:24:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7NqX/QCHu0gs2sBOg1g9GVI5SLIS/JnCIxExi8UExlHQbNI5xRzz+e0EVw5p9/PM4Lq6Yv X-Received: by 2002:a05:6a20:8e09:b0:122:fa3f:f23f with SMTP id y9-20020a056a208e0900b00122fa3ff23fmr9546970pzj.54.1687515853825; Fri, 23 Jun 2023 03:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515853; cv=none; d=google.com; s=arc-20160816; b=HC/gRDSRw1X35i6xX9QpbXONEqG2YjouldB/jy4jwliGJsR5gKIw4/GZOi85HdQpPI 3bRLnGra4+yrGVIg/N0QMuXE4xZoBc13mvM6jwbUjbi4lVRu7ZTgGPM9KzoleydbVh8F NHsBSfVh1JtbGfo6w902/VevKwI2JOzDEGRg1uopdnDj+sUe5h0RcUHtg0RyP3ed1ItC i4sD5Hek8QwhnLwegB8gh6aRSJAUoFBM7V8EwbWnO0NuZ1Ta22apE7xesoDCAKVXmbaj ZKxV0PjncdfusxOBy91efGH3AM74gH+fEXQtBwZj0ag5q5QNc/AeWY2+tqrueOZCbRzl Atxg== 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=ew/OjzgYg2nsW0kAROkz29zhVp2ggSYw8qH9w/3MfWE=; b=ZcQLfz6rIjoklA7fi96KjN7lYHBT+WH6yh6fbQHmxamZc7/DXVpSHPRQhhrXvVh8cU BDM8WNGr9VHFsu/jU6U/OC6uC8EZVQ9NsOjk9Z6OLyoSQzjMLRH7mTcnmGelkWQns1lk C0rcwQrpqQO8Tuk4gxHJRPbDaU55gMrY50KgBQi6IOM9ThnZVEGyHu+e92nznICjHsDM bYjA+0agaZFRnuE9NSQ7o9jTVf96F/NkrWbOGfGyXKG4JKzqGdYikHImt3bEsZ0piWoj my84A2NasJMx4fzGOdRjek5CV/8VhmEMQilRuvvDZmj+AdLvC8tzAFWtXwolucQ7Zbvd 3v6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=C8u+ZXCH; 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 d7-20020a170902cec700b001b3d6c68bd1si899496plg.643.2023.06.23.03.24.00; Fri, 23 Jun 2023 03:24:13 -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=C8u+ZXCH; 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 S230180AbjFWKKc (ORCPT + 99 others); Fri, 23 Jun 2023 06:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232096AbjFWKKB (ORCPT ); Fri, 23 Jun 2023 06:10:01 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EDE52D67 for ; Fri, 23 Jun 2023 03:08:53 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f9c2913133so5916955e9.1 for ; Fri, 23 Jun 2023 03:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514932; x=1690106932; 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=ew/OjzgYg2nsW0kAROkz29zhVp2ggSYw8qH9w/3MfWE=; b=C8u+ZXCHQdPKodiM5v7/b2mSTYm4069RdqKcGt2d3qQ3M0hMOVzAtCHLEGcydsb9H5 ezLk1y5ZIDblnE7dNeLg+BehZmNh49pBMfSPETU+4kQXzgpcU5iGT1L5ytBxl4yG3z11 3zfOvc8zrbW74LSoOg4yEjoy7nK6pBCWG+1owflHbdBU36HiEZhbhvmFXzwR21kn7RGx hsJiHOWrOuxoFTE7cie99DPxLl6R3ced0Nrc9TX3PA/Oa+/fa5uiyuZf3B2apnzOrHLZ ucec1zb/DS7XqppiySHzdUpwHpzH3jOZvIVEi9t6dm1B/YpVhZcULrDKxp75c8pR7DNO 85oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514932; x=1690106932; 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=ew/OjzgYg2nsW0kAROkz29zhVp2ggSYw8qH9w/3MfWE=; b=l+OgvHPH+FOK2Bi8d/kpXkmvGfC+AGu2QEuo4F3EVHqg/zCn/8SBO4m0/nXX9UCHus pY2ddOtGZktYMSwdOQHkMBXlLFumjd6VVLKgeTaVjG6+CpN18+3qoXK1Bthjqm1wIX6v eWwmfG59dCwnx+u7QIV+Vc1HoQ/S3lgSkYcknIE1/BzArwmc/ix1AXDMaPGiZVGKl6PO pY01f2tnxB1Z4ducjT7FFQ9u69J/5WiWNJ16UMsw5XWrm2pZqDVO0JuM2MUm8Kr9Mzmf 6je0AJtFuzbSSzYg9DSMuydcsMcA8k0ZerTy8ddlI7XVg77uuGrdxdeg2Bxd4sTpYv9r 7zrQ== X-Gm-Message-State: AC+VfDwWOJO7SGgKVpSG3HfkW32fqwfHFp77PpSSgKdehg4eFS7Dy9rt TfP3C2EEugI3vMDUKFm9iHm0tA== X-Received: by 2002:a05:600c:248:b0:3f9:b3b4:4367 with SMTP id 8-20020a05600c024800b003f9b3b44367mr9685508wmj.15.1687514931873; Fri, 23 Jun 2023 03:08:51 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:51 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 02/12] net: stmmac: replace the sph_disable field with a flag Date: Fri, 23 Jun 2023 12:08:35 +0200 Message-Id: <20230623100845.114085-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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?1769488623477101515?= X-GMAIL-MSGID: =?utf-8?q?1769488623477101515?= 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-dwc-qos-eth.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index 9f88530c5e8c..0c12ab67c27b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -359,7 +359,7 @@ static int tegra_eqos_probe(struct platform_device *pdev, data->fix_mac_speed = tegra_eqos_fix_speed; data->init = tegra_eqos_init; data->bsp_priv = eqos; - data->sph_disable = 1; + data->flags |= STMMAC_FLAG_SPH_DISABLE; err = tegra_eqos_init(pdev, eqos); if (err < 0) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index ab9f876b6df7..70e91bbef2a6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -459,7 +459,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->has_gmac4 = 1; plat->force_sf_dma_mode = 0; plat->tso_en = 1; - plat->sph_disable = 1; + data->flags |= STMMAC_FLAG_SPH_DISABLE; /* Multiplying factor to the clk_eee_i clock time * period to make it closer to 100 ns. This value diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 38b6cbd8a133..18e56299363d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7258,7 +7258,8 @@ int stmmac_dvr_probe(struct device *device, dev_info(priv->device, "TSO feature enabled\n"); } - if (priv->dma_cap.sphen && !priv->plat->sph_disable) { + if (priv->dma_cap.sphen && + !(priv->plat->flags & STMMAC_FLAG_SPH_DISABLE)) { ndev->hw_features |= NETIF_F_GRO; priv->sph_cap = true; priv->sph = priv->sph_cap; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 8e7511071ef1..1b02f866316c 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -205,6 +205,7 @@ struct dwmac4_addrs { }; #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) +#define STMMAC_FLAG_SPH_DISABLE BIT(1) struct plat_stmmacenet_data { int bus_id; @@ -292,7 +293,6 @@ struct plat_stmmacenet_data { int msi_rx_base_vec; int msi_tx_base_vec; bool use_phy_wol; - bool sph_disable; bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; unsigned int flags; From patchwork Fri Jun 23 10:08:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112037 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5666436vqr; Fri, 23 Jun 2023 03:25:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5N+F4aO6nFDV6YFioxB568NHlQORtgv3QJMW/3v6cr0Qwh8tXCnwivDOYLuA55+ePBRyYm X-Received: by 2002:a17:90a:e647:b0:25e:d550:6b3a with SMTP id ep7-20020a17090ae64700b0025ed5506b3amr10557302pjb.3.1687515909388; Fri, 23 Jun 2023 03:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515909; cv=none; d=google.com; s=arc-20160816; b=a7dsVLP/arfd5qz1ks3IW2ydkgC9Hh59q0WXNo/IazbDhxSNvyUVx38fZ98gmY3k5O XCEKDBwdae/+2ysuIYZ+nON3Um47bOAYLO4NkBu9RYcK5eQJFz7aPu/2GQPlQg+n1och F1b9n2BhwLDB024sHvLtuqfShOBXVRGQP2Ycvp3y1J6YNlFDrvr0yQtLVEiVMVV+CN30 dY6Q17RjonrpTVX7Hc1If0T3SITTT52gKJePwgfpT0n0BMnubqK6nUP+269z3ZgB/3m4 I/xd3VQPuhugG2AWGmqoijYzeLlnM13G4q5vUf9sn06uSbG+u2lnG4FxjUAT/qucOGtu 9l5w== 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=R0OwBqk57PhsZ04IZ/thQPvSHwVfxueGqzoT1EHd/f0=; b=ua97+/kjXoht21Wp9c0tZ3RIRVD46dFQclb8yZkP9tACGbr/CNw2DpYdp+Ehlo9gAO mTzcgsyYnn/gOsXh5ov3qEM0eiTfI2aoGesLt+BzO0ac0j971UxTFhKuZ1HYLrbsOiuG FYFyBAA1PEhL2eWTd1W9phIXwjRl65I0XKFWvPZZ1PKAV1QMHPP+1aAP1G7oEhBC8imv T8e6MUGlZOyN2tzZ98Ma1TNP1zmr/yvVnRA6+LxjKQ+dIPicYZLvwkeiwCgKngnMq+Gh wSOyATUCS1+M8bK1cUoPPrQ2g8gEi/9GOSN9UKCeZIyndknZIYn08PVlvSd4W5ES7j+r nOlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=nsJ3vuYI; 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 lb14-20020a17090b4a4e00b0024e2afd72a3si1772457pjb.182.2023.06.23.03.24.57; Fri, 23 Jun 2023 03:25:09 -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=nsJ3vuYI; 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 S231874AbjFWKLH (ORCPT + 99 others); Fri, 23 Jun 2023 06:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232134AbjFWKKC (ORCPT ); Fri, 23 Jun 2023 06:10:02 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D18FD2D6B for ; Fri, 23 Jun 2023 03:08:54 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31114b46d62so516439f8f.3 for ; Fri, 23 Jun 2023 03:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514933; x=1690106933; 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=R0OwBqk57PhsZ04IZ/thQPvSHwVfxueGqzoT1EHd/f0=; b=nsJ3vuYI6e3FoAMZ0apcFXcPaydnCwLytfC1cTdjOXl92U2Np0gHmmBW4gDWn/eTli g+70iNTnVMDiA0/HTa3nxxwbmFyYVXq2uPFpOv8qojKmDSbivCbwbrSysMUSgRJH7OJj uU0WGv0mz9Jd37gLORq9fuoUSavJ/vGaTqDF0zrASI1eiv/tD2Uxn+j68dHedd9ksHUf qClIx49hXVA4QgUhbLtIzJdjzQZfC5AGId4mQ8wXVD3yNq02NS4gHjfUQebERnPc9QeC 14VEFLVpn7z27xlMrvOOsu8xnhm8DkkOkXILwevML/r1M7HYuaNRjPye1+5cP+99Niel FjYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514933; x=1690106933; 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=R0OwBqk57PhsZ04IZ/thQPvSHwVfxueGqzoT1EHd/f0=; b=OmOwC/5yZNC/IAqXR9irDfxIvk5NsMLnEpLrZ8i9m7zBWbgSUJzW9NTsFuuLPUQmBC Ecua1m2OKcSpOa9v4XZWwj6y1O7LwMKnfK4BIeC2/BlkuGwTNrni2Y629kQT7gkHURYF VWZsDKh1SVK3pJOIm5pAGlMgdkjoHx1vVzFa7IcoBr8UyT8G1QyOiCCN0P/N/kwrRSq/ i7SIA8dXPm21Z8IEiY5Ik+T6/x56f1Rax2Pe/kb24E/tbL9nkxnDVI7WRetkmTxx9vZG LrdbDlx/btVYTPRLFGHWcc/wyTnaj7Sy2dnSmra9BeWP66359tds5qEYK4iwOdWtk1mp x2hg== X-Gm-Message-State: AC+VfDyhQQBsCAmZvPPSMEyLS0uxknav7smYuCFcHCvmgcVYVhGNORPQ 7Gu94+rRXId6J9tgbGOHZCqdoA== X-Received: by 2002:adf:d848:0:b0:309:3bb5:7968 with SMTP id k8-20020adfd848000000b003093bb57968mr19091200wrl.16.1687514933088; Fri, 23 Jun 2023 03:08:53 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:52 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 03/12] net: stmmac: replace the use_phy_wol field with a flag Date: Fri, 23 Jun 2023 12:08:36 +0200 Message-Id: <20230623100845.114085-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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?1769488682021236919?= X-GMAIL-MSGID: =?utf-8?q?1769488682021236919?= 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/dwmac-mediatek.c | 5 ++++- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 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/net/ethernet/stmicro/stmmac/dwmac-intel.c index 70e91bbef2a6..44a84a6c18ce 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -628,7 +628,7 @@ static int ehl_common_data(struct pci_dev *pdev, { plat->rx_queues_to_use = 8; plat->tx_queues_to_use = 8; - plat->use_phy_wol = 1; + plat->flags |= STMMAC_FLAG_USE_PHY_WOL; plat->safety_feat_cfg->tsoee = 1; plat->safety_feat_cfg->mrxpee = 1; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c index 73c1dfa7ecb1..4d877d75642d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c @@ -588,7 +588,10 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev, int i; plat->interface = priv_plat->phy_mode; - plat->use_phy_wol = priv_plat->mac_wol ? 0 : 1; + if (priv_plat->mac_wol) + plat->flags |= STMMAC_FLAG_USE_PHY_WOL; + else + plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL; plat->riwt_off = 1; plat->maxmtu = ETH_DATA_LEN; plat->host_dma_width = priv_plat->variant->dma_bit_mask; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 18e56299363d..a1a59af3961d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6877,7 +6877,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) */ priv->plat->enh_desc = priv->dma_cap.enh_desc; priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up && - !priv->plat->use_phy_wol; + !(priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL); priv->hw->pmt = priv->plat->pmt; if (priv->dma_cap.hash_tb_sz) { priv->hw->multicast_filter_bins = diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 1b02f866316c..15fb07cc89c8 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -206,6 +206,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) #define STMMAC_FLAG_SPH_DISABLE BIT(1) +#define STMMAC_FLAG_USE_PHY_WOL BIT(2) struct plat_stmmacenet_data { int bus_id; @@ -292,7 +293,6 @@ struct plat_stmmacenet_data { int msi_sfty_ue_vec; int msi_rx_base_vec; int msi_tx_base_vec; - bool use_phy_wol; bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; unsigned int flags; From patchwork Fri Jun 23 10:08:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5666442vqr; Fri, 23 Jun 2023 03:25:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IJDlqvlMPDmYG1GhLjwMXFLux9docTSxoJHNltFNKPnfI/MrViasB48v2ucodlf/vDJ+q X-Received: by 2002:a17:902:7e85:b0:1b6:9c8e:11ae with SMTP id z5-20020a1709027e8500b001b69c8e11aemr9031090pla.21.1687515909959; Fri, 23 Jun 2023 03:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515909; cv=none; d=google.com; s=arc-20160816; b=Tw2RhZykWICDaWb5DqUecse2tQH0RSjFoynBg1IbOgi4eJlK4v95NaR9N/HjsFCPw9 3wVnIxCyiwIQAOZDEuWbeBLoJMQt9uRu8Jr8OEdb4XbjT4w8SqwnHfbE/qzWxS5Tpod+ bkOQxS2AbpDBYsaWx7WsDlXjytqMiF5MyhanbutHqTuK3m4jSz9L6edWmfBKXynh3Qy5 p6Jkp4Q2cSStHujHDMHWLplCBpkIu/jhwN7CwlcZnRPWzBARZ1cLxf+v3nopKQfGpTK7 0gMfSJETtfE9AQYzqJOofAIwVU791IlweNcUa6FvJG4D95YEDGt40V9MA+HIBb4aFhBE QBpw== 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=LzNmZCXlSWOYlmr4PSAR1znItM6ZQApvKlAxUdPBEws=; b=W3tLCEaWwN5S7PMZoVOkiHeLobs99zexDZiPRwJd/07ZfAJ/QT7b+5T9TxnzBInHW4 gNpsfI26MVAjdJR5yUJ4Ldyrihc2A8rUqCJM1dMRSbTboHzqUXvqbrnZpr/hmpy+Q4fG TmXI1bhbVDPQAHumdM7s+cBqNgrKOCINXr5sC9QtjuU0NuR2j36XGMUpkcd+mrLYFEqI xQw2rFlKvW/VTvuh6oJ1aRifCnOCrWiDitzXyoSVICf8RR5aYJKQByGDCgR3CRdfb5yE /aCHlwx7tlhbN8k28PKsPMxSv0KdSfc5fUQofpQ0xPnmAyTagmqqhWHaFDrKuhS+IW9q MdzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=m+lqn4q2; 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 e15-20020a170902cf4f00b001b3c90461d4si4211470plg.411.2023.06.23.03.24.57; Fri, 23 Jun 2023 03:25:09 -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=m+lqn4q2; 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 S232147AbjFWKLC (ORCPT + 99 others); Fri, 23 Jun 2023 06:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232139AbjFWKKC (ORCPT ); Fri, 23 Jun 2023 06:10:02 -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 D4E732D63 for ; Fri, 23 Jun 2023 03:08:55 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3094910b150so519737f8f.0 for ; Fri, 23 Jun 2023 03:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514934; x=1690106934; 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=LzNmZCXlSWOYlmr4PSAR1znItM6ZQApvKlAxUdPBEws=; b=m+lqn4q2SooX00NS4Dml0tE6JJZccoPX5TY5ceXotOMd/L+lksc+Jpn7FR6TrAAIPp 93YrgGEfYKMtcGh0S4vgyWvFtock3FeSKKqO8WC/zfFvAZ1z/WnGyAt7hJN+7ARE9ctc po0rYqwGxjlCrfYK7Uhjh0G3hopGhXB8fpFuL47fS5Ton+/6W7N566raNprAnCYlLJ83 MUjD2jF4ubeR3YzbRoX9oQ6kxXp1dfzeSy8L7fKb2G7SoKjYx00Pc/IBdBBuJK1Fgn4i bgA+1yPT0dxjU722jVjLMmMAjWA131xBILYUTsKDzmr32MaJTBzXVWpER8VtnOOEd7pk BH2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514934; x=1690106934; 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=LzNmZCXlSWOYlmr4PSAR1znItM6ZQApvKlAxUdPBEws=; b=GlUX6Ff9nX+skoVdv5LezDaGFp9N2sp91B0xIBpwTCxTccVQTHqYxF+da54a5j/rbm 8YwLSF87WiYBrtNvr7F3jJ+AJdaa4/EMh6GKAqP2yUrnVmm03Vwh7q7mXGS+kO1C7DBm onPmQhSGM2/iVfqoeBK4FSYwyPRs/F2LZq1URZnczw/OBDEWF58PvrknEDLLCOS0ST0c 65Vhvcgc+6Eniuou8zYnnHb3HxjmwBwVzqEy4b9neN1JQ4h9Rg3ywyE6A0BOpcNq83o7 oWU3wmBp0OQJ4GUWx4mTAz/0iGcAniXLZY8GM7cIizUx8AuKwrnRn6UcmfBbY02XNMMO S3rA== X-Gm-Message-State: AC+VfDz/SJya0TflWTKO9bCby0KhnixSW56WOGvv4aI7FjuDDEJQcCV2 nGNAcges8kis6DbHskNm+uxEAw== X-Received: by 2002:adf:ea06:0:b0:30f:b912:e13c with SMTP id q6-20020adfea06000000b0030fb912e13cmr16787123wrm.43.1687514934332; Fri, 23 Jun 2023 03:08:54 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:53 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 04/12] net: stmmac: replace the has_sun8i field with a flag Date: Fri, 23 Jun 2023 12:08:37 +0200 Message-Id: <20230623100845.114085-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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?1769488682936787308?= X-GMAIL-MSGID: =?utf-8?q?1769488682936787308?= 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-sun8i.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 1e714380d125..2b5ebb15bfda 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1227,7 +1227,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) plat_dat->interface = interface; plat_dat->rx_coe = STMMAC_RX_COE_TYPE2; plat_dat->tx_coe = 1; - plat_dat->has_sun8i = true; + plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I; plat_dat->bsp_priv = gmac; plat_dat->init = sun8i_dwmac_init; plat_dat->exit = sun8i_dwmac_exit; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a1a59af3961d..3df32658b5bb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -325,7 +325,7 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv) priv->clk_csr = STMMAC_CSR_250_300M; } - if (priv->plat->has_sun8i) { + if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) { if (clk_rate > 160000000) priv->clk_csr = 0x03; else if (clk_rate > 80000000) @@ -6856,7 +6856,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) int ret; /* dwmac-sun8i only work in chain mode */ - if (priv->plat->has_sun8i) + if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) chain_mode = 1; priv->chain_mode = chain_mode; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 15fb07cc89c8..66dcf84d024a 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -207,6 +207,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) #define STMMAC_FLAG_SPH_DISABLE BIT(1) #define STMMAC_FLAG_USE_PHY_WOL BIT(2) +#define STMMAC_FLAG_HAS_SUN8I BIT(3) struct plat_stmmacenet_data { int bus_id; @@ -270,7 +271,6 @@ struct plat_stmmacenet_data { struct reset_control *stmmac_ahb_rst; struct stmmac_axi *axi; int has_gmac4; - bool has_sun8i; bool tso_en; int rss_en; int mac_port_sel_speed; From patchwork Fri Jun 23 10:08:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112040 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5667047vqr; Fri, 23 Jun 2023 03:26:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7yt3k6bolvajAAw/AYZSulj5rcHl91rbSC67MFs9jHEA3dbKAr1HeEtAAf5YKCYivRtJ5O X-Received: by 2002:a05:6358:51cc:b0:131:b4c:b876 with SMTP id 12-20020a05635851cc00b001310b4cb876mr7320051rwl.1.1687515993962; Fri, 23 Jun 2023 03:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515993; cv=none; d=google.com; s=arc-20160816; b=BUirKZKT+NZUPS0XXIBrx0wV8DAigpItqjSJD6tE5U4klENPevVyrLKBWfZQVn40DH sJzvJmslHudJfq4WE8Sv4JyshSDI/xste8vGkOEnD/CB7SgTcyJvZNd9oMLSPYBfvpbF 3Ko65bYyh7KeSR8jhnssYgLmgtLuwZaryS3BjK+o2M+VpjCIpMEzlB26EjT3OkA4JDoe EBPKdH/+RtsfJGBJhjZeOxZW8xqYI54bBUZCsPvgtmxFIO3zduWrzKza71kXq0eGgtaZ 4VRS5vVo36uMla9ctnjxxPRl69i2hmHfV8vN0fPFROVQVhJS19sTLtMbppHiEr68D4xx lHIQ== 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=1HRVKBhefxoQaIrrk1E+lF53Gj3p4Z+uWDwMbBoofOY=; b=V+wfj/8XaDp9ivJKJNxx+SZtx8pAqv4JbOE8UNIMFqqIKWqse21X9dFIIkLTNS0I7O 3J8zxmLZn/h1dJJQHj4aCHK9SjWUBf4bJKf6jimEysiQ0Vl2O/J6LB8pgGufLBVRZIfR 9iWk/Ghu0ozbameyIZHqtEKlaJXvfATPq2IKpgl/E7rkh+s7VqpftlX9EBViZVK5DOBy YxxVOp/uj0O/VCzO6qVnCYUKxGUqzv+l8Yhiu6frTELgrpQT3ywiLjNRkYjRFZWI8vm+ S4ELKMZeQncwye8s7+Nb0YjLMU0Ce1Hza7f7xjFLRsXZ2LcIMZqWJ/YpEI4WLfAFhJTP GKyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=OemuTJCW; 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 n23-20020a638f17000000b0054fb23f1018si1694100pgd.656.2023.06.23.03.26.20; Fri, 23 Jun 2023 03:26:33 -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=OemuTJCW; 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 S231764AbjFWKK5 (ORCPT + 99 others); Fri, 23 Jun 2023 06:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230189AbjFWKKD (ORCPT ); Fri, 23 Jun 2023 06:10:03 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 071FB2D77 for ; Fri, 23 Jun 2023 03:08:57 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f9ede60140so5385945e9.0 for ; Fri, 23 Jun 2023 03:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514935; x=1690106935; 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=1HRVKBhefxoQaIrrk1E+lF53Gj3p4Z+uWDwMbBoofOY=; b=OemuTJCWfC5VWij5fB4MS4ju7PFwOzlbykJyaXqedjZ+76URX44WT/HdxYIMwy8WVb EDioSsGVE22zZ24I2YyJsgPd0ATIyEY50xkU+Xm39nJ1MjkhgwS3owOV8EuYxKHPpETc aIpWXmGrn2GCP3/abQ40aC/U4dE46esG0ULnxgiK8YLcwxNbNDx98asXbZ/a3dMa94Lr 4uYdP+lELTweB056/N/i52IkUKzRSMZ/u5uLn/vDZAcVv7r+CJQbV4T22wvCixtIGOFQ pHHUjz1Q3xlpIhavVcBeihW/cgN2j4yCrGpT3thENVf81rckuX3uPt7wXPvI+N3P2R0h yZMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514935; x=1690106935; 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=1HRVKBhefxoQaIrrk1E+lF53Gj3p4Z+uWDwMbBoofOY=; b=iYXI50u+R1EMDuRdJo74be4ATP4kwE0Xw2FumpzYAfAEPeFh0kCREk7UT+EUPFpOTs 5V7SBbrXKpWZtTHbf7ZfF5+p12PLtg2P/Qeqgpx4wsXbcOQDSKT/lVRlB3kAZ7yUoai5 53gR3FrE0toAHHd6eNS58+I9K0DNEH+tuRFc/IXAKQ4Ss+hrJdqPk3uTJMrimq2tTnMu capzV+2MPz+BPFlro1lZRsLObhr/840mST+SehRhMacP5UQgTfoMa0s8beWU1/Fzq567 SzeVKjaQ+SsyQXDjwFMT+M/RUgcfWE01M2748c4WwToNgxiSrVWnG1IEhg216WaEc4mx Qycg== X-Gm-Message-State: AC+VfDxFV6PcpmKaoXDlPYX3vVyB7vqreLymx6AhTi7FV+dM3F0+pReo DhqIc/BsxA9fS2hIXrMb2ORCMg== X-Received: by 2002:a1c:7c17:0:b0:3fa:76e2:e6e3 with SMTP id x23-20020a1c7c17000000b003fa76e2e6e3mr2712678wmc.34.1687514935529; Fri, 23 Jun 2023 03:08:55 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:55 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 05/12] net: stmmac: replace the tso_en field with a flag Date: Fri, 23 Jun 2023 12:08:38 +0200 Message-Id: <20230623100845.114085-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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=unavailable 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?1769488770920254827?= X-GMAIL-MSGID: =?utf-8?q?1769488770920254827?= 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-dwc-qos-eth.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 3 +-- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ++++-- include/linux/stmmac.h | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index 0c12ab67c27b..b5efd9c2eac7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -113,7 +113,7 @@ static int dwc_eth_dwmac_config_dt(struct platform_device *pdev, /* dwc-qos needs GMAC4, AAL, TSO and PMT */ plat_dat->has_gmac4 = 1; plat_dat->dma_cfg->aal = 1; - plat_dat->tso_en = 1; + plat_dat->flags |= STMMAC_FLAG_TSO_EN; plat_dat->pmt = 1; return 0; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 44a84a6c18ce..faa6f4ec6838 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -458,8 +458,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->has_gmac = 0; plat->has_gmac4 = 1; plat->force_sf_dma_mode = 0; - plat->tso_en = 1; - data->flags |= STMMAC_FLAG_SPH_DISABLE; + plat->flags |= (STMMAC_FLAG_TSO_EN | STMMAC_FLAG_SPH_DISABLE); /* Multiplying factor to the clk_eee_i clock time * period to make it closer to 100 ns. This value diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 44151e69f9ce..79e196397aea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -787,7 +787,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs = &data->dwmac4_addrs; plat_dat->pmt = 1; - plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); + if (of_property_read_bool(np, "snps,tso")) + plat_dat->flags |= STMMAC_FLAG_TSO_EN; if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) plat_dat->rx_clk_runs_in_lpi = 1; if (data->has_integrated_pcs) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c index f8367c5b490b..5e8aa03cffae 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c @@ -290,7 +290,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) } plat->has_xgmac = 1; - plat->tso_en = 1; + plat->flags |= STMMAC_FLAG_TSO_EN; plat->pmt = 1; plat->bsp_priv = mgbe; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 3df32658b5bb..73002ed923aa 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5677,7 +5677,7 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev, features &= ~NETIF_F_CSUM_MASK; /* Disable tso if asked by ethtool */ - if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { + if ((priv->plat->flags & STMMAC_FLAG_TSO_EN) && (priv->dma_cap.tsoen)) { if (features & NETIF_F_TSO) priv->tso = true; else @@ -7250,7 +7250,7 @@ int stmmac_dvr_probe(struct device *device, ndev->hw_features |= NETIF_F_HW_TC; } - if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { + if ((priv->plat->flags & STMMAC_FLAG_TSO_EN) && (priv->dma_cap.tsoen)) { ndev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6; if (priv->plat->has_gmac4) ndev->hw_features |= NETIF_F_GSO_UDP_L4; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 644bb54f5f02..352b01678c22 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -77,7 +77,7 @@ static int snps_gmac5_default_data(struct pci_dev *pdev, plat->clk_csr = 5; plat->has_gmac4 = 1; plat->force_sf_dma_mode = 1; - plat->tso_en = 1; + plat->flags |= STMMAC_FLAG_TSO_EN; plat->pmt = 1; /* Set default value for multicast hash bins */ diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 3c6b55b60461..5a67af4526c7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -524,7 +524,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) plat->has_gmac4 = 1; plat->has_gmac = 0; plat->pmt = 1; - plat->tso_en = of_property_read_bool(np, "snps,tso"); + if (of_property_read_bool(np, "snps,tso")) + plat->flags |= STMMAC_FLAG_TSO_EN; } if (of_device_is_compatible(np, "snps,dwmac-3.610") || @@ -537,7 +538,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) if (of_device_is_compatible(np, "snps,dwxgmac")) { plat->has_xgmac = 1; plat->pmt = 1; - plat->tso_en = of_property_read_bool(np, "snps,tso"); + if (of_property_read_bool(np, "snps,tso")) + plat->flags |= STMMAC_FLAG_TSO_EN; } dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 66dcf84d024a..47ae29a98835 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -208,6 +208,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_SPH_DISABLE BIT(1) #define STMMAC_FLAG_USE_PHY_WOL BIT(2) #define STMMAC_FLAG_HAS_SUN8I BIT(3) +#define STMMAC_FLAG_TSO_EN BIT(4) struct plat_stmmacenet_data { int bus_id; @@ -271,7 +272,6 @@ struct plat_stmmacenet_data { struct reset_control *stmmac_ahb_rst; struct stmmac_axi *axi; int has_gmac4; - bool tso_en; int rss_en; int mac_port_sel_speed; bool en_tx_lpi_clockgating; From patchwork Fri Jun 23 10:08:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5663660vqr; Fri, 23 Jun 2023 03:18:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QlElURjMCRR9bfxd+7RUjKVxsZ22H6uqsdPGWHVLJA/Sl1QajUlPH7vhinmz+x1Fg7SrL X-Received: by 2002:a05:6808:10c9:b0:395:f4fd:9fe9 with SMTP id s9-20020a05680810c900b00395f4fd9fe9mr14728427ois.50.1687515531354; Fri, 23 Jun 2023 03:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515531; cv=none; d=google.com; s=arc-20160816; b=qNvlh6eZfbT1YBFm0g2xbi6cLg2rPU/UiX4lG6N+6hyaksGLlEtnNuPgZ8U4xv1Pdr KJUqPbJeP5f8zwM64DVn1jaXoFCDqIOHwDe5V/mPCw1U83x5IG0H/hJXsenF17y7c15Z taKXp96XkzvUj3cf8RtOZEcFMvxkF/w7XPvMmdb4Os7CGtr33AY4kFBtvP7cmcqCBU7o J7dpu3+j4+jGehfVo8HlgaJCX3e547tpxOrx+ChWEigZLXrEP8xAnMaGwWLbpww+mGwr YCy/KjWIS/ONAfeqn7W21UYBpuc0xnpxl1yZBC04fsJSlXSd80baxlw7pLz+3tBExe7h rOvA== 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=lNP6LkxylJsTZb04Lj9SoU8dCYBcHfZtyvvvsQ9AlHo=; fh=CjrQ1Q0TGO+1bZC/jGx+ZNc6f9ZTEmlvHOZ7TvVPWuo=; b=RxCD3eIcpX2RdxjMRok2c74C6fESA75Bz/yW0ZgufGK38iJFkTuFzhSdBjhzlggRwB 7ExPllAAmW6ce03SpuF7SsUt8jsnNBPa1CvAtdxBPQL8ZM+o637h7GG89TbT/HqiBrjm UimL3kYOU8n77ec0vWnuj1cFK5R9RwcvPLgn+NEQyAr/T0yPzJj5Gt5HmdgjTDyPS56t BVGuFtMTgI2A9nNulT4M6zZ6uh7xYaOZEGHjlVeUSwBBHqVj90NeuZYx+cdzENl9M2XR EKpjwPwDEG1CQILjP404Ub4HAlB2DzuZIRBxOknKCkKbIHK3Zp4JOCytsKacWIoQ3Ior epJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=PvMz0b+j; 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 lw3-20020a17090b180300b0025672fbdad5si1687869pjb.178.2023.06.23.03.18.38; Fri, 23 Jun 2023 03:18:51 -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=PvMz0b+j; 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 S229853AbjFWKKx (ORCPT + 99 others); Fri, 23 Jun 2023 06:10:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbjFWKKD (ORCPT ); Fri, 23 Jun 2023 06:10:03 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EA1B2D4A for ; Fri, 23 Jun 2023 03:08:58 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f96d680399so495045e87.0 for ; Fri, 23 Jun 2023 03:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514937; x=1690106937; 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=lNP6LkxylJsTZb04Lj9SoU8dCYBcHfZtyvvvsQ9AlHo=; b=PvMz0b+jSap43nhn4QJaLQonQdi2SD8yAay0iiQfX4Lu0Rv3crnP0MseXmLoRA8F0M bQwOsyO0oYcQCtTDU4WfsA4BMsVem8Ti7WTwX+ten58hF5BzvkABmYOxQ55n3g4OZXW4 i4P+I2H+3MAQriJ1kAWdZH389h5BcJUtJqcaP0OOXTLQuFPth5IY6+j+AluewzLIIyOJ NxAesZkFA4Oj1qgtEtV60U7CyHmGbKRQkHShzz7w+PBJAbbCahThmWwDuAq7s27YNjit nWAjJqBn2Tyl6BmNFP4ZulFhqPj+6pNv0eFa8lZEqcKd5xgY42eUdcQAFTaBDUfMrMiP ZWVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514937; x=1690106937; 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=lNP6LkxylJsTZb04Lj9SoU8dCYBcHfZtyvvvsQ9AlHo=; b=hRaZXqQtGylAAc8B1Nscgimq6cJfcwucqNZbUMAmxY06ER+UFecMLdRCaZ2uhboMbV Vo45ItaidmZ5X32DeIByA3wSoArZLtkkfnQor3O3baRzaQC1S+UJMGR/Ex1qE5ZHQt+K ilclqu+WapXBViyk0njmVb3ehTZRFZpMmruTymPkktR1omCbNAhslWEwGXzIOI2NjAxM 6nGAZKB/lTD0tYLhlChg/fkE+z+F9C5RhbnKqlEeFo0aQ5y893TCqbByZ8n5ePxBiYna VEiSXX1pbp8dtGcd/6XE/KjDxRjJA0keDSjyuvx2qGgj9yTyKNxJmoXQUrQZK8Z6S2vy /+gg== X-Gm-Message-State: AC+VfDyoQ2sgJG0legEsNqII0UoBYErDGkD0oSF+o9Q4DmPLVY6DIWhG OOaK7tQDDJbjU85jDpgRYYlwwQ== X-Received: by 2002:a19:7718:0:b0:4f8:6e6e:3f42 with SMTP id s24-20020a197718000000b004f86e6e3f42mr9627135lfc.14.1687514936795; Fri, 23 Jun 2023 03:08:56 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:56 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 06/12] net: stmmac: replace the serdes_up_after_phy_linkup field with a flag Date: Fri, 23 Jun 2023 12:08:39 +0200 Message-Id: <20230623100845.114085-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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?1769488286050400536?= X-GMAIL-MSGID: =?utf-8?q?1769488286050400536?= 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-tegra.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++--- include/linux/stmmac.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c index 5e8aa03cffae..99e2e5a5cd60 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c @@ -337,7 +337,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) /* Program SID */ writel(MGBE_SID, mgbe->hv + MGBE_WRAP_AXI_ASID0_CTRL); - plat->serdes_up_after_phy_linkup = 1; + plat->flags |= STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP; err = stmmac_dvr_probe(&pdev->dev, plat, &res); if (err < 0) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 73002ed923aa..d444514db07e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -991,7 +991,8 @@ static void stmmac_mac_link_up(struct phylink_config *config, struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev)); u32 old_ctrl, ctrl; - if (priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) + if ((priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) && + priv->plat->serdes_powerup) priv->plat->serdes_powerup(priv->dev, priv->plat->bsp_priv); old_ctrl = readl(priv->ioaddr + MAC_CTRL_REG); @@ -3838,7 +3839,8 @@ static int __stmmac_open(struct net_device *dev, stmmac_reset_queues_param(priv); - if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) { + if (!(priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) && + priv->plat->serdes_powerup) { ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv); if (ret < 0) { netdev_err(priv->dev, "%s: Serdes powerup failed\n", @@ -7623,7 +7625,8 @@ int stmmac_resume(struct device *dev) stmmac_mdio_reset(priv->mii); } - if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) { + if (!(priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) && + priv->plat->serdes_powerup) { ret = priv->plat->serdes_powerup(ndev, priv->plat->bsp_priv); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 47ae29a98835..aeb3e75dc748 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -209,6 +209,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_USE_PHY_WOL BIT(2) #define STMMAC_FLAG_HAS_SUN8I BIT(3) #define STMMAC_FLAG_TSO_EN BIT(4) +#define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) struct plat_stmmacenet_data { int bus_id; @@ -293,7 +294,6 @@ struct plat_stmmacenet_data { int msi_sfty_ue_vec; int msi_rx_base_vec; int msi_tx_base_vec; - bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; unsigned int flags; }; From patchwork Fri Jun 23 10:08:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5663155vqr; Fri, 23 Jun 2023 03:17:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Anv9+yROfysyeZeNoQGtB5fz1EWFGgVUNtxwqBLHupUX65aC9uKL2X8d+C3m//5w+zEw/ X-Received: by 2002:a9d:734a:0:b0:6b4:6221:c66e with SMTP id l10-20020a9d734a000000b006b46221c66emr13210032otk.11.1687515469617; Fri, 23 Jun 2023 03:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515469; cv=none; d=google.com; s=arc-20160816; b=QjQ2awuLEKJvgFzgjbWaUzggJqKjfCJmTx+VcBEtTkz1d6cv/2nJL0FMoVuIgZsuC4 8Pw9SPqknvqyGvTqmh1ZvUQy2ku6ANyTxNn60oMdlYlFYKlXBtgNAjFRzAn7f3qj2mcS Q59xcxJwKe40RjPeAGrkUZzcOpr1dbOkUgm7gP/rNAzpUYkSRD5im1JK0NrDpw9OlxB0 +H1QWBWpr8lMc8QPL5s8wZQ+uWoTV4tjrglGdfLHFp/7tRLUnyv/62c/NuMqQbaShpZo xnCj9Hb1dKUVCMURi4I/RwNFDQKWwevnVwV02tm5FHQwpJ58B4m33tdakleDDQUsaHEj a3ig== 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=zYsPM0znkqN61dd+ZblYn0iKga8HXqcuyw6SkrjlQfc=; b=YFXRtjo80LWKotLZWsUAUVMtrp+mQ8PZYP7DGN1o15ZanhPpX3Q6Nw9eKfBtn5jCq8 +9fgEK64xRQM3T7rwFkrwsi3YeBIcpbRabzf3koeDOhruaX7H57j76onB5v3mDxM8J8A wCV/fBGX0XmUdi2mHi/xMVSQ0zBOC1Wj9PPx29DkSWP4SlNKtjLDcTf5iPI3R5yliRIJ Urkhnw8Id5ERTObrHHNHyOK8SJ5/0pN35ecmjs5TTwbO1Z4N69du7zajHMTUvm3Nt7vY zMXlXPmbDeSQWh+5Fxe5oLNq8Xe8sWiYIJlYaTL7QqyF0kDSRGIouUHUcB/VjZCnVaF5 kP/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=t7DoDBXh; 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 x4-20020a63db44000000b005526bd13605si8316696pgi.775.2023.06.23.03.17.37; Fri, 23 Jun 2023 03:17:49 -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=t7DoDBXh; 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 S232091AbjFWKKn (ORCPT + 99 others); Fri, 23 Jun 2023 06:10:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231169AbjFWKKE (ORCPT ); Fri, 23 Jun 2023 06:10:04 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D31D2D7E for ; Fri, 23 Jun 2023 03:09:00 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31122c346f4so680567f8f.3 for ; Fri, 23 Jun 2023 03:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514938; x=1690106938; 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=zYsPM0znkqN61dd+ZblYn0iKga8HXqcuyw6SkrjlQfc=; b=t7DoDBXh+qjcmsLYlF54Co4CxG2yA9retQMT5sBA82x+exLmrhSN5Npx0GPVjj3Gyi AgRR3V6GX4ilj/GxSz4DXW3/de0jb5HNsuxVHA2ROFIU6lBftCaGkWsgqwAMcIwr792b s2Yr9Zkz2B+Z5es4KxhF98suZ5PY0Sp04tAjXyIFCRcU9rqW+WzdW+IfblqIIszCVmxm YjDzR7cBCQe9UuqmNfGrK0w12bfwtpDntT0G9T2bTDqAHnBm9zHGrbRapnZnC5zWIC3z jXhOR6xzOkPxjw5xtRdP1AMWXcCJ2kP7JBc6Nn6GxBJV7Dem9yCFYqW1zjg3q8/F13al mFrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514938; x=1690106938; 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=zYsPM0znkqN61dd+ZblYn0iKga8HXqcuyw6SkrjlQfc=; b=XbfRbCrWREDVp+YEuc0GtEpKGmuldY4NFuUqoL3MgpTIhVlbf3WZRp+UGNGLDVO3Ho H0os24xBo8AnJPjeVedvRB48pJQqkdoLOMEiRcjcsYOsdGbZ2JROwRi1B1X0efMmEOqc E+aYzNh6PE6oMm4WOBauKHvgOr9zuEftNFsyS+wOcGbO5sKEI2UqhqDJkyQEkxEbdagd WEkDWu+aVKTdIIr0GJIPJ6UYIfaFoHUW4UirdFJ04sxUMEeQr8gA32Xq9i0MNZcm6Hln xHtedGJoA0RXtV7Wzrma/HyfER5FZIJKZB8YhI3YeC/YnqKChAjhG54x8qc9UedV4LmT 3wJw== X-Gm-Message-State: AC+VfDzVF9YEzbNa3T9GGJ/qWL8XQy8kuqM3YhbTiRetHuGkyH2jQI2i eZlm1dmicCdDc9Mbc8bYB6QJbw== X-Received: by 2002:a5d:6452:0:b0:307:7ae6:fe98 with SMTP id d18-20020a5d6452000000b003077ae6fe98mr21132722wrw.22.1687514938545; Fri, 23 Jun 2023 03:08:58 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:57 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 07/12] net: stmmac: replace the vlan_fail_q_en field with a flag Date: Fri, 23 Jun 2023 12:08:40 +0200 Message-Id: <20230623100845.114085-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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=unavailable 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?1769488220924191975?= X-GMAIL-MSGID: =?utf-8?q?1769488220924191975?= 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_main.c | 3 ++- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index faa6f4ec6838..1f1bc99571a5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -560,7 +560,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, /* Set the maxmtu to a default of JUMBO_LEN */ plat->maxmtu = JUMBO_LEN; - plat->vlan_fail_q_en = true; + plat->flags |= STMMAC_FLAG_VLAN_FAIL_Q_EN; /* Use the last Rx queue */ plat->vlan_fail_q = plat->rx_queues_to_use - 1; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index d444514db07e..c5763f60c6ef 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6923,7 +6923,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv) if (priv->dma_cap.tsoen) dev_info(priv->device, "TSO supported\n"); - priv->hw->vlan_fail_q_en = priv->plat->vlan_fail_q_en; + priv->hw->vlan_fail_q_en = + (priv->plat->flags & STMMAC_FLAG_VLAN_FAIL_Q_EN); priv->hw->vlan_fail_q = priv->plat->vlan_fail_q; /* Run HW quirks, if any */ diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index aeb3e75dc748..155cb11b1c8a 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -210,6 +210,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_HAS_SUN8I BIT(3) #define STMMAC_FLAG_TSO_EN BIT(4) #define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) +#define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) struct plat_stmmacenet_data { int bus_id; @@ -278,7 +279,6 @@ struct plat_stmmacenet_data { bool en_tx_lpi_clockgating; bool rx_clk_runs_in_lpi; int has_xgmac; - bool vlan_fail_q_en; u8 vlan_fail_q; unsigned int eee_usecs_rate; struct pci_dev *pdev; From patchwork Fri Jun 23 10:08:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5664587vqr; Fri, 23 Jun 2023 03:20:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VX3nzDorUBXq5Gii0UaZ2gFlq3EK55GQ7s+KdRoGst/E3Mxb3Cm9dV/pEFublfXZn2ak6 X-Received: by 2002:a05:620a:29cd:b0:763:b49f:84c2 with SMTP id s13-20020a05620a29cd00b00763b49f84c2mr13190923qkp.43.1687515648979; Fri, 23 Jun 2023 03:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515648; cv=none; d=google.com; s=arc-20160816; b=QebxsT5B3nHJIEYLiZ28mkAWcv964PZn9U2tYrtiCr8oOKM9/2DNb8A5jaF48OwiwN UcZqP7OmpYFdqrXudEsiXCzbZrZyo7CgFjXdI4yoEZTzOzMUSBxK+qT/oQuR3gDQvvZb 6GNcn3AUuvxmT1fLiFpCoGvP92/pycOuliorTImY1O/sqEbhJEN8wpPFbWgdfjDRyppm NZYv2aaexZxLfT4FyqgJcWZuozrtD0AOwEo1o8aaFMCnYCJ+o7pZ9B+G8zK8Yr6BLmLC sflygoBkgyPsb96nrPVjoToJp8ys/PJsw47iynigElI2WjvS0/LyOM5wQbfBlMOwYpuy cg2A== 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=pZwW4TXAaWjhQ6+iv6Z0bS3QoIIROteF83Ru7jzSEKU=; b=Y7JVvw+rbiay9HzdSsIIoP7TxcofJUx6A69XgrqR67ooXXaPaz/YRL8QqRCa8tdhDx A/K/rsRk1FCGj/b6IGlLrrf3Tb3XYhMH+HW/eHUIKrUXo43jWEEoaykNooHUR3qF0cET flhbc+Qi1E6zB3misQ5NjcIZDB/Zfh+ryk98ZOqdQ26+3un5lwL3TrilRmrq7IYlf2PX VnvqgqoAPIZtIeUt74kEPeQ7bny/+6A3r9fOsK2G7EBZAwncMGwDO/8/27IYfXBNG3J3 MZE50QhXoPXHJHxCYdUaSY9ooNOOn9doulLC+dRfymAeBdLyLUbd35HoyrYa2gimfpCg lpqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=b4BnAz9A; 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 z128-20020a633386000000b0054ff8cce912si8562003pgz.281.2023.06.23.03.20.36; Fri, 23 Jun 2023 03:20:48 -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=b4BnAz9A; 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 S232102AbjFWKKs (ORCPT + 99 others); Fri, 23 Jun 2023 06:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231243AbjFWKKF (ORCPT ); Fri, 23 Jun 2023 06:10:05 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D77E30C5 for ; Fri, 23 Jun 2023 03:09:01 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-31114b46d62so516554f8f.3 for ; Fri, 23 Jun 2023 03:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514939; x=1690106939; 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=pZwW4TXAaWjhQ6+iv6Z0bS3QoIIROteF83Ru7jzSEKU=; b=b4BnAz9AgIa8cRDsXI7XVVQICTNqShRa9vwMstK6i0g8rPRmA3CWyR2hShEo3PfQmZ e0rTai/P9+k1b/GyEX5PijoV5z7aycHL46dJSLgUW3sYtG9k1V7x5ZQOB3QogwQHUIZw sUoF7cEgiY3HBhfOlanrRYjRXpFWSEqWh8hk1PMIT1m2ZzCjCDoG7vMEhb9ASoK8aT78 GY5zMJdiiex8t2dD3gF+kxx/eS519FmDMii9luQ52HIPhpD9QNtFuYqlMbgx01Hk7gSC /Jmr68O6wzpM/Pj+3oelDd3ozq3XJiOVV8xnYfvhqVM22hLPNLa8qNPCSD6TRLNTnmfF K8SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514939; x=1690106939; 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=pZwW4TXAaWjhQ6+iv6Z0bS3QoIIROteF83Ru7jzSEKU=; b=cdYvJaXrtupdmnG/LR/oXqzfG2paZfTzkI+Q6j73+JgKG9q8A1j/f5JKjH41SK3jMb 6NFQo+BOQSUQ+jgXH4Csm5v2TBeX2yYWnlZn+3mG2M5Z5oWeOl5ohfpFsSb7iYHdzWZj f03xmDJIzCF6lUQV//TTMf0I87GopjnLDbCDkY1B/RK30t7kMS0O24N6SQY297/cK8WX fNGlwCW1WD+jceUKnN/4oIShKGRSAFFGOeitf22Wn1Zf6/Cmh+0/DgIRvBGVHOAidiAN hZhEpv5DgHnSBsjlnfnK7m3tTNr8yAbLJaPShUt4gK7u+X/2TJ7OjuiS1tOWJSDZZRYq rH8A== X-Gm-Message-State: AC+VfDy7ir++NxXzOOeyj2MxF4erKQWkmYYpjm9Cx8Fbjtg7Oi2MI5p+ nAA0x5ouWDpALu4dx5WfNS+eUQ== X-Received: by 2002:a5d:5684:0:b0:311:1bd3:6c7b with SMTP id f4-20020a5d5684000000b003111bd36c7bmr17405269wrv.32.1687514939730; Fri, 23 Jun 2023 03:08:59 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:08:59 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 08/12] net: stmmac: replace the multi_msi_en field with a flag Date: Fri, 23 Jun 2023 12:08:41 +0200 Message-Id: <20230623100845.114085-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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=unavailable 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?1769488409044957500?= X-GMAIL-MSGID: =?utf-8?q?1769488409044957500?= 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 | 4 ++-- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++--- include/linux/stmmac.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 1f1bc99571a5..d8bcf9452197 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -953,7 +953,7 @@ static int stmmac_config_single_msi(struct pci_dev *pdev, res->irq = pci_irq_vector(pdev, 0); res->wol_irq = res->irq; - plat->multi_msi_en = 0; + plat->flags &= ~STMMAC_FLAG_MULTI_MSI_EN; dev_info(&pdev->dev, "%s: Single IRQ enablement successful\n", __func__); @@ -1005,7 +1005,7 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev, if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX) res->sfty_ue_irq = pci_irq_vector(pdev, plat->msi_sfty_ue_vec); - plat->multi_msi_en = 1; + plat->flags |= STMMAC_FLAG_MULTI_MSI_EN; dev_info(&pdev->dev, "%s: multi MSI enablement successful\n", __func__); return 0; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index c5763f60c6ef..ebe82e7b50fc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3711,7 +3711,7 @@ static int stmmac_request_irq(struct net_device *dev) int ret; /* Request the IRQ lines */ - if (priv->plat->multi_msi_en) + if (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN) ret = stmmac_request_irq_multi_msi(dev); else ret = stmmac_request_irq_single(dev); @@ -5954,7 +5954,7 @@ static void stmmac_poll_controller(struct net_device *dev) if (test_bit(STMMAC_DOWN, &priv->state)) return; - if (priv->plat->multi_msi_en) { + if (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN) { for (i = 0; i < priv->plat->rx_queues_to_use; i++) stmmac_msi_intr_rx(0, &priv->dma_conf.rx_queue[i]); @@ -7169,7 +7169,8 @@ int stmmac_dvr_probe(struct device *device, priv->plat = plat_dat; priv->ioaddr = res->addr; priv->dev->base_addr = (unsigned long)res->addr; - priv->plat->dma_cfg->multi_msi_en = priv->plat->multi_msi_en; + priv->plat->dma_cfg->multi_msi_en = + (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN); priv->dev->irq = res->irq; priv->wol_irq = res->wol_irq; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 155cb11b1c8a..3365b8071686 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -211,6 +211,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_TSO_EN BIT(4) #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) struct plat_stmmacenet_data { int bus_id; @@ -286,7 +287,6 @@ struct plat_stmmacenet_data { int ext_snapshot_num; bool int_snapshot_en; bool ext_snapshot_en; - bool multi_msi_en; int msi_mac_vec; int msi_wol_vec; int msi_lpi_vec; From patchwork Fri Jun 23 10:08:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5671497vqr; Fri, 23 Jun 2023 03:35:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AdXYOsiDsBobs/LLyTFAthowFnIzeIHxqOuywFNzjdNwI83+jRKBJcQnOKvVH0yuhKBFx X-Received: by 2002:a9d:6b89:0:b0:6b5:ee8f:73ab with SMTP id b9-20020a9d6b89000000b006b5ee8f73abmr4770269otq.30.1687516552380; Fri, 23 Jun 2023 03:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687516552; cv=none; d=google.com; s=arc-20160816; b=ScRqF8vcQs2awmMZPnJDoxnLK1SPLKLXXeY/c8X9FMk8H0XpK6FlfH1f5ObCclI+yA O42vWwCYYw9ywJbZc09sW/XHHX7JDFZUPMgY1qPc6DBy8zkAokHcpMJA0zxPOtyT7nqx gnamlRatXEhoSvE+59ikteIENkaURHa61+t/N9Pc08VaWy3wMbtk0ImTO4/4G0zZv6oA z+almmfCOT1IMvHQwfde5xJkrxK7AYmchnSKdwMrFlLqosbfqhVcXv1KNfDduna7mUEJ /rSLBQCxz8zROGQAEuLKsTW0iHcIbiienYd5an/1f/8YWOjkdGSNQBiu1Nfw2rFlsEhf 3NMg== 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=8NBfwHB1m61Ki4N8NOLCZ9xwyv+VdQ6tisfULtxIs/U=; b=rLkemKwP7eQiKKJEQBnJWG692CTxz9JPuqDqFt+tjYAxqjqToG5V3OxtZtJZdf/idH Pjm3zPctfteCJDrZ6+4ZQEY2U8fi0sbObYacTYQLxK5/kIG1tlFbWVSoSiYOkXctNPpE twuNsY50VOoryh4InKk1eMVHPkgMKDyIgKFty+ydd6/bMiAMTicn9dO2J8R5yqXNZxzU JsyP5ZRWSUgk1crQhe/2CC9ovKVExZvb9bcUjjlZDdlnCEVOmxz/Y17GS1edPFXFZkRo BrybJ1PMySOrfrZaUMZCaJQwdxHE/fvbfuXpnD+QYp+8kxgJ/1UuRvAnDSgZ7jCnROEU qTZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Xqqbvtrr; 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 l76-20020a633e4f000000b0053fb768afc8si4996679pga.748.2023.06.23.03.35.23; Fri, 23 Jun 2023 03:35:52 -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=Xqqbvtrr; 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 S232159AbjFWKLJ (ORCPT + 99 others); Fri, 23 Jun 2023 06:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231559AbjFWKKH (ORCPT ); Fri, 23 Jun 2023 06:10:07 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C8130D0 for ; Fri, 23 Jun 2023 03:09:03 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31110aea814so519649f8f.2 for ; Fri, 23 Jun 2023 03:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514941; x=1690106941; 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=Xqqbvtrr+T9ovr4Km5D6kknfBFx6z/ui+26AR/uvCaZDO5tZ2BHzg23OcbtvFmQxJA khtEcnOMUracH2du55BSB+PBuJgO58h4V9QNIm9OF5LJ8lzA1VflejtvXldY43WbgOyn v1zRm1fr9Xg7lvG6/y54PO0CHT1jao9H5W7y1nxJCSLNUP/p3Su2owknd4hsegO9lY0v LDCSlE0HqvuWhnHw4t3cgrHDvvhw8V+DIc6IGGUJYwZNZgmGXmArKo/z9YRMHAiTL1zZ /3VrgsrRoUdMpVuM26ElMyqjvCRWMLx1Wg0sldoq4lMZ76rdxl35xVooqWFJq1KE9pge aCcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514941; x=1690106941; 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=SPzXKYCHW9okxGKCkVT9AZc9pYvT46XwGfaHAhQq1HQp2oPK3luOr/OyvMSPmafltK 3QdGIQNs0yJn/BxuvVH9uMLUeJ0sBAuBWKYpDlCVUsx9Hsc9PWFxx3A8qbD5FEFd1SpX iE04torf6qNePbSaPicrbpaV6Dy93+eJMWBm7m+IsVXwiOgpi6nrK435/aMctU2sIJa2 DaV8LZmjY+czaW+cExj14fhPzvI61eW2iG2FXj/hZ9i/OWlMnsECOJO8nB8N5yB1efHD sdOKriIusx/S4XuKdX1gVS1FNNTBTDSa2mZ6H4zmI3JUBIKRdq8ces/xg8gRibJnexWs kCmA== X-Gm-Message-State: AC+VfDzKWC42j1To4gjmpXmSjKIUDPJSynikiSoV6NiXweSoMuBpveQ8 Efhq7j5rNvvmLI4yifZ3VNaYNw== X-Received: by 2002:a05:6000:14d:b0:311:143c:7bd1 with SMTP id r13-20020a056000014d00b00311143c7bd1mr17192221wrx.49.1687514941665; Fri, 23 Jun 2023 03:09:01 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:09:01 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 09/12] net: stmmac: replace the ext_snapshot_en field with a flag Date: Fri, 23 Jun 2023 12:08:42 +0200 Message-Id: <20230623100845.114085-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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=unavailable 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?1769489356310425700?= X-GMAIL-MSGID: =?utf-8?q?1769489356310425700?= 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/net/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; priv->plat->int_snapshot_en = 1; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/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 *priv) */ ts_status = readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS); - if (!priv->plat->ext_snapshot_en) + if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) return; num_snapshot = (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 = on; + if (on) + priv->plat->flags |= STMMAC_FLAG_EXT_SNAPSHOT_EN; + else + priv->plat->flags &= ~STMMAC_FLAG_EXT_SNAPSHOT_EN; mutex_lock(&priv->aux_ts_lock); acr_value = readl(ptpaddr + PTP_ACR); acr_value &= ~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) 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; From patchwork Fri Jun 23 10:08:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5673091vqr; Fri, 23 Jun 2023 03:39:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fez/0h4Cbtqo3GqtySG7RGKIcF8zd8vAUnj8KaKAPDbwXq4J4KNcwUuJVi2I7gmx6LH6d X-Received: by 2002:a17:902:e54a:b0:1b6:7c9a:3a26 with SMTP id n10-20020a170902e54a00b001b67c9a3a26mr12035872plf.36.1687516775014; Fri, 23 Jun 2023 03:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687516775; cv=none; d=google.com; s=arc-20160816; b=KTXtMMh1WJn4GsIR7YGdo2+HeZaxJgeLGewlgKyuFbT6iQjyA2y7VRNsvSBkH7BuTQ 7BhRn7OfeqvG6O2od9jDeU5VCcQGlTpNEmXdb61C1iax+jk5joWBieTpzxSiqxxqwBDk QXOuVJGmUOidwKmcUWDKZFhzjaKzS+pLeta+JsF0HuJ5WLNPIoRCslY5RSZ5DLAVGZqv DTwqt+zmjcbhUDFX7VCCEL0HUYCsq0AzKi3tOzn00OjFzC5BzGMpBgvSsnOaRd8qdG7U HfIq8gez67tpx13zkBYmZiLSb0T1b9rTkoL1y7fsdF5fvtDzg6OuP9iTIZPXzBetzc3j mjKg== 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=AXLmQoTjoeXO9UdxG4BxiuLilLfncmL1ryydj7qwo7o=; b=avCf0idf5cdcXk1kB2dSJ9Yd+aO93q877W3NrDkbSpNnfoQwBgqSXCAym1xmIoH4Kp AnJUh5OIPHvawcziaFxiX0CprvfhmB2RCYgT49KEEoxW+/sJfyEicjSD77bh63RmpEk3 mTApxEVlxDzXU1akeAthcXMI3H6OhHRVzE9gbOZu2lapd5HyZTaDNBG4no228mdFhqRH /qoa2hqtPcGjE20wlNomojbu+lPeiUaNXKulH1/+hgqWYWWS9TEjTQ4Dhmf0LgBa7LFu r5oF9hHVXc7eFbyy684ienK8UNBxUI/ztg7GoLB7YTctnWIqjXEFNChi3UdwCHHnvZLj zDYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=iuwXz7mi; 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 b11-20020a170902d50b00b001a643dfb884si1312013plg.451.2023.06.23.03.39.21; Fri, 23 Jun 2023 03:39:34 -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=iuwXz7mi; 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 S232165AbjFWKLN (ORCPT + 99 others); Fri, 23 Jun 2023 06:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230503AbjFWKKP (ORCPT ); Fri, 23 Jun 2023 06:10:15 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8650D30E8 for ; Fri, 23 Jun 2023 03:09:05 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f9c532fa45so5314105e9.2 for ; Fri, 23 Jun 2023 03:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514944; x=1690106944; 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=AXLmQoTjoeXO9UdxG4BxiuLilLfncmL1ryydj7qwo7o=; b=iuwXz7mi6f6iU0NcWp3IDb41yk29667vEnsshk9+azB14/0XRb4tvgzz6w39k3UTHI j2vrD+bdyXkKEaao49viU132lD8XiB25y1YMMpENHRdDdLKEcum9oFqEvdbKjP9y8da5 X52/sVYz4RUXsng3XhH2hPu2lKWOiqKCGdDn3pRVnL98PbYqq/rf9NPcW/5o2btPrvg+ Sk8hWAQFTveGNcA6uCue2YXhwwf96LNTNp+YupxiQO05jM9DUMnk2sR6heUMz7ev+uyV /ynJkqHrj/9s+iRGxHi8vNNiaP50BFq9jrS8Dd1LpWOdRl60B/CABBpBNcsavWpemlVF h5YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514944; x=1690106944; 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=AXLmQoTjoeXO9UdxG4BxiuLilLfncmL1ryydj7qwo7o=; b=fqRt7wpV38HIVRVjSV9nFPAv12U4jJfAQ83nb5ren4pRgggpDrZZFPQ8eMS0UY5xMT odHGzGCeIblrQuL0V6a4YB/My4T6rqVz4x2VI7/d6XfUo5KD1M9mml8Ae3NFKwN/dfAl plU0cRjGAHEQYQVrCc0mLg19vMco9OI/+nFIOXI5SyA2GGWewOGhSG5riFp5F2DxoyOP QzCjjmlt+yNsWHf2L6HmOzrQjJA+xHBshPWGrbYFFYHkdb3oCS3yN8FSFdnsp6rd0Eul DMX4gh2BZCQYXthbgQ7/t3Eb3q7FAAowXqO9PatGyVy3ksPoCs28pQsWPes7PZL5qUok MmtQ== X-Gm-Message-State: AC+VfDwe16/9BQzqzjRK6ucART2Hfq18X66eXRQjqrKt9b0vsbeJWN9T kND1teiAcyP3qMOKhbpYhEg7pQ== X-Received: by 2002:a05:6000:8d:b0:311:db0:8aff with SMTP id m13-20020a056000008d00b003110db08affmr3377766wrx.70.1687514943901; Fri, 23 Jun 2023 03:09:03 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:09:03 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 10/12] net: stmmac: replace the int_snapshot_en field with a flag Date: Fri, 23 Jun 2023 12:08:43 +0200 Message-Id: <20230623100845.114085-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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?1769489590158735341?= X-GMAIL-MSGID: =?utf-8?q?1769489590158735341?= 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..0ffae785d8bd 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; + 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; From patchwork Fri Jun 23 10:08:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112035 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5665749vqr; Fri, 23 Jun 2023 03:23:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jlljsmR3XxEeiU4ZwDa/u9rKNOzHMP6IA8rsjCxfuAp2amoDrOiLY8xIX2zNJ4nHMtJmI X-Received: by 2002:a05:6830:1618:b0:6b5:e816:b650 with SMTP id g24-20020a056830161800b006b5e816b650mr5573054otr.25.1687515820106; Fri, 23 Jun 2023 03:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515820; cv=none; d=google.com; s=arc-20160816; b=lRVPURpHq42h66CHMMTqeIefbUuh0f+AIjhMfh9ss7mPX6Yrttxn0MSl6eAfsBRFGV E4NK8EbKLRBxCeolSvCrj4Rbtt+1o/K0g1+HAQdbJ8ZlR2jLOYe0ntvRJkeGaiLZec5+ fSL1VnjYBkhZVIDuh/4H1tkBWJOxwhFxaUMFv0lDv57xg16qxGAX9xMGAWYEqodnR2YD mim6/+sDS0brC4dfU1G967Zd6nV7EPKZZMoi/UE9Lv+ZrB4kDMnB7GWKaK+ewC4IwxY0 Nuz8T0gngjxq91YdaXHwYg7ae16RWVdhajIU/5u1JvU+qEAeUFNJpm7V0aYFwN/Sy6Z4 lHqQ== 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=QwyUb1LcLxFuKvlYDOLM+hUXxmW+mTunlzrn4iVWnOo=; b=VN+oKbFZZMBzFn7NQErnfB0fpHnIHAuYjTrP87JVXtLEWGKBsKQGePLm9TXVGjJNqS iyJvNLyTuqLz4wND2KuzqVj2iMBhDmOF5pGlyIT5+80U0HZC8v7Uk0k3hRoUKIdRNfp6 JYXBi6oH795Yhi7vv4SxKqatz3qCrtGuz9dsTT0yKHFozJA2xD95q/rtSnGkP3tiweIY HPCaNn1t4WIbQVcPT/QKESSx/X30/mMCL6ApcKpjTpTLwUNyuSNnTKjFmbVEGCnbr6U4 dGsJa1KZN5Bv8yuT3/bAg5oO8Unry0Yjm6iVArQue3Gn0gEI9WPTf1mwvxWjOzCy0nJc ZJGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=0mmVBYGr; 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 u11-20020a63b54b000000b0054fdafd5b45si883278pgo.740.2023.06.23.03.23.27; Fri, 23 Jun 2023 03:23:40 -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=0mmVBYGr; 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 S231905AbjFWKLR (ORCPT + 99 others); Fri, 23 Jun 2023 06:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbjFWKKS (ORCPT ); Fri, 23 Jun 2023 06:10:18 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A9BB3A8E for ; Fri, 23 Jun 2023 03:09:07 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3113da5260dso443023f8f.2 for ; Fri, 23 Jun 2023 03:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514946; x=1690106946; 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=QwyUb1LcLxFuKvlYDOLM+hUXxmW+mTunlzrn4iVWnOo=; b=0mmVBYGrvOJOt+Jg5VZ0+zKW+YJWPhN5BKjhv/JMmHRQ99euFJfiQ7hDBHFm8wxebQ x9x3aNpCzEamSQrRKJBoatuR16RXW0X0LVYv0toaMt/AijJGi6BNlS+aG1iuPW6WAZu3 5MURUoFjAQLiREdG+zzRQ5v9m/sc4rrD6uzBuGvVydh+4Adk0pn0Wkn3sjGblzXQAmki I0o+KmZru/W8iSIyURvKsEtkhcVoS7MpfRS4V41ILnn6IfuVYT46pRIM9gqAaUIlvs2I 7CAZQiPTPKtuMhKui7b1fBzbVppytynni412lmmMYFToE3aNbmR5dbsiZ/1QPVCdNUDE AswA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514946; x=1690106946; 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=QwyUb1LcLxFuKvlYDOLM+hUXxmW+mTunlzrn4iVWnOo=; b=i+eX1VNUBR+tdM62Cv2+qIGz4zAWzi6nQw37hLjUm2MVJDUmgVraKD0aT6Fu6POr6i hn8KR7EmPG9dzUBLhp/9boK9TV4abNB2S8c2KT6EEVL/Jes5MyOqfWXNvzv+1EdUi6nr 2kY7C6Q8Lb2QUv1rP/PPZBTC9leoJzpgPTy7OnspzsrQVh9ICAhRnANfo3PLEpUDnV5r /vABqxuQd5XhOdY6N6N0G2nxlExAXY5jS38OoYrX6chwKE+j0lzr7C6JtjdBMjI83jhw d49z2MYmqFhmhXTaZ8zSPKIij1okjeAdrflTnzkIBgmQI62EAeCaWCTG2lX9KnljY0aT Qvew== X-Gm-Message-State: AC+VfDyplQtqakXrAPnKN3/dWOPb3JDBNckhxam8UntkpLdcPrKcOTxB kLwogikYlmph0OzowSQOMazsWw== X-Received: by 2002:a5d:43c2:0:b0:30f:c00d:8a7 with SMTP id v2-20020a5d43c2000000b0030fc00d08a7mr3285754wrr.44.1687514946092; Fri, 23 Jun 2023 03:09:06 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:09:05 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 11/12] net: stmmac: replace the rx_clk_runs_in_lpi field with a flag Date: Fri, 23 Jun 2023 12:08:44 +0200 Message-Id: <20230623100845.114085-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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=unavailable 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?1769488588791100248?= X-GMAIL-MSGID: =?utf-8?q?1769488588791100248?= 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-qcom-ethqos.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 79e196397aea..743f2261b964 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -790,7 +790,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (of_property_read_bool(np, "snps,tso")) plat_dat->flags |= STMMAC_FLAG_TSO_EN; if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) - plat_dat->rx_clk_runs_in_lpi = 1; + plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; if (data->has_integrated_pcs) plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ebe82e7b50fc..2d68a6e84b0e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1085,7 +1085,8 @@ static void stmmac_mac_link_up(struct phylink_config *config, stmmac_mac_set(priv, priv->ioaddr, true); if (phy && priv->dma_cap.eee) { priv->eee_active = - phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >= 0; + phy_init_eee(phy, !(priv->plat->flags & + STMMAC_FLAG_RX_CLK_RUNS_IN_LPI)) >= 0; priv->eee_enabled = stmmac_eee_init(priv); priv->tx_lpi_enabled = priv->eee_enabled; stmmac_set_eee_pls(priv, priv->hw, true); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 47708ddd57fd..c3769dad8238 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -214,6 +214,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_MULTI_MSI_EN BIT(7) #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) #define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9) +#define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10) struct plat_stmmacenet_data { int bus_id; @@ -280,7 +281,6 @@ struct plat_stmmacenet_data { int rss_en; int mac_port_sel_speed; bool en_tx_lpi_clockgating; - bool rx_clk_runs_in_lpi; int has_xgmac; u8 vlan_fail_q; unsigned int eee_usecs_rate; From patchwork Fri Jun 23 10:08:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112056 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5672341vqr; Fri, 23 Jun 2023 03:37:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7l/JDQALLGOg9oyU3Gb0fqbF5T1YBrWbTyslyumEGagaC7l6wi/JnlMn1XqxX6Des2fbQw X-Received: by 2002:a17:902:ec8a:b0:1ae:6947:e63b with SMTP id x10-20020a170902ec8a00b001ae6947e63bmr28824390plg.16.1687516662141; Fri, 23 Jun 2023 03:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687516662; cv=none; d=google.com; s=arc-20160816; b=P1YhQZcjE9LOKP6PVt55bG34Uiqh0C7QdDURQH71N2ejce2CTcoxMMmugyVwTT63z1 kMvYsfGj63UMjtBqM4eRqV55fzPUJcQlRhDJKsSvmvqxEuCezSj5pDIzuiTdDaoO35S2 HTdvQ2/RyLN75ep+AvGr5HmGFszKqF2q2J2hqTSYApU9XkcjIpj6jaNy1Mmw7S/WJnGQ wCod6Iu4vciYEnBc3i7GmgrZE0QtSOkRxr/su4acCjE2kcLWjjZBxQYxylckCNRELhnE 73jLP73douQfB3srY51gl8iImHzqjd0xc/Qi1KryGmuY8RtlHatyAybR5M0hzXVIlUjN kUMA== 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=/ds8NiiaWx7S6UP8O9D/ooCMxtDTCkVYtSDsiDSpfu8=; b=kXV7nYJuLhGDuv6/Uon8UnfXSS4PIdV24vgH1CqwK6Xs05DiFwgIg04BAwZdSPWKYE jMcNWm2OGIwTNCzD5sr9SeIgGKFGB8ug0U7abhQ9Miq54k05E5bXHMzpsWbh5I2VuNOu fEQJJMpCSRiXr8wgP4DuZduG/GEXkyWqpDjLpybVsFjxyQDm0jJdl0HlRlGA5ctNurWY g6C7w421S4P5ewNBjgSCoPpjM1dDCixNx51roVjbthxSTvNrCLqpLcyeBJHlwlQHkFYA uboftI9v3axLAEUXwrCpwemzYkHSjjRaU78Yp+OJRpVqqlCjJOhbdlZWF57XzEFkh16J dDkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=05CEclI0; 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 j18-20020a170902da9200b001a1bbc5bea5si4312937plx.537.2023.06.23.03.37.28; Fri, 23 Jun 2023 03:37:42 -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=05CEclI0; 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 S232177AbjFWKLW (ORCPT + 99 others); Fri, 23 Jun 2023 06:11:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbjFWKKT (ORCPT ); Fri, 23 Jun 2023 06:10:19 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3B7930EE for ; Fri, 23 Jun 2023 03:09:08 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3111cb3dda1so705926f8f.0 for ; Fri, 23 Jun 2023 03:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514947; x=1690106947; 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=/ds8NiiaWx7S6UP8O9D/ooCMxtDTCkVYtSDsiDSpfu8=; b=05CEclI0RNBG811nHybT4Wf80lxO/5ncTBmCTBZUwmnZJB+wENLgDJW7YoVimVGpsw QbEv1xphO/vYaGbskQWEgUFe2Kvn4oRjin1OYZh4LYRrjviR8fy4G/sc4g2su6mEcnT8 KKvz9uCVulrGi537aPDOocdZt4Wkpa0uBYxI9Blbu6aA0R+jAnuUEbgdDlHZy+hlTINu a0n9x6klMBJM6soYf5rOYX7X7auxd+l/YMQmNtj2DA22uNSlf6dBq7QYjYqF5SpMchKC H7530d/4fhVzqZ/TAABdazsKCEVMFA2MbHN/qQo0E4ldvwJyY9Yu2odiwa43pSwCJdY9 ZWPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514947; x=1690106947; 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=/ds8NiiaWx7S6UP8O9D/ooCMxtDTCkVYtSDsiDSpfu8=; b=iobX77iu2V3tHWHBlYH5suk80hAdO4ksxGX+XpPPVsn0kw+bjls9mSyloilFCMy3Sc bDNxAvTq11rpZGzokkpr3JqSD3wh43re9wog9jQbQY6OjgQkBIZL1RsLEhqHhzRDhnhS VtLHLmUaeG03O3yrnsYksfIstmbNSXFYO2VaRI75/xZgrEWWBHElXUBzTWcJVpaDi8Zj fi9di79WHzHLJm6b/Ck4gptdYgiN+pcIgD+xEV0jIsCDTAWJ2yeBDOOMY691GsnUjuId 7qcW3kZpYVxVm+jJex5Xj0ntWDWZisuua8l0lFZLLOXG3RGfWJ0KO6JVYdc5Sb//auz1 gPTA== X-Gm-Message-State: AC+VfDx7PtspMR7B52QomRCHKavwMOq6nAGY0NJ+j7X35nJ403EK7Mzi mLuBoKOmphw0NOvmFiRVvrgjPw== X-Received: by 2002:adf:df81:0:b0:311:1cd7:68b3 with SMTP id z1-20020adfdf81000000b003111cd768b3mr21982343wrl.57.1687514947319; Fri, 23 Jun 2023 03:09:07 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:09:06 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 12/12] net: stmmac: replace the en_tx_lpi_clockgating field with a flag Date: Fri, 23 Jun 2023 12:08:45 +0200 Message-Id: <20230623100845.114085-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-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=unavailable 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?1769489471226226284?= X-GMAIL-MSGID: =?utf-8?q?1769489471226226284?= 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/stmmac_main.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ++-- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 2d68a6e84b0e..efe85b086abe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -421,7 +421,7 @@ static int stmmac_enable_eee_mode(struct stmmac_priv *priv) /* Check and enter in LPI mode */ if (!priv->tx_path_in_lpi_mode) stmmac_set_eee_mode(priv, priv->hw, - priv->plat->en_tx_lpi_clockgating); + priv->plat->flags & STMMAC_FLAG_EN_TX_LPI_CLOCKGATING); return 0; } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 5a67af4526c7..0be3113197b1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -465,8 +465,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) plat->force_sf_dma_mode = of_property_read_bool(np, "snps,force_sf_dma_mode"); - plat->en_tx_lpi_clockgating = - of_property_read_bool(np, "snps,en-tx-lpi-clockgating"); + if (of_property_read_bool(np, "snps,en-tx-lpi-clockgating")) + plat->flags |= STMMAC_FLAG_EN_TX_LPI_CLOCKGATING; /* Set the maxmtu to a default of JUMBO_LEN in case the * parameter is not present in the device tree. diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index c3769dad8238..ef67dba775d0 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -215,6 +215,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) #define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9) #define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10) +#define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING BIT(11) struct plat_stmmacenet_data { int bus_id; @@ -280,7 +281,6 @@ struct plat_stmmacenet_data { int has_gmac4; int rss_en; int mac_port_sel_speed; - bool en_tx_lpi_clockgating; int has_xgmac; u8 vlan_fail_q; unsigned int eee_usecs_rate;