Message ID | 20230602190455.3123018-1-brgl@bgdev.pl |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1254051vqr; Fri, 2 Jun 2023 12:35:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5EG1awA1gDe/YLkOlbforBN8lwLALf6Jn7n5cbDPs7rQVgT8enaFqtTOV+Jmo9myEUGI5h X-Received: by 2002:a05:6a21:999f:b0:102:a593:a17c with SMTP id ve31-20020a056a21999f00b00102a593a17cmr7173266pzb.0.1685734509794; Fri, 02 Jun 2023 12:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685734509; cv=none; d=google.com; s=arc-20160816; b=Jd9A3KRn8F0iKKoSh+vKrttvaNbYtEsGWngQDdKKUp33zeXHPUauVLysnchSRqCM3M 79DIO/Bag5bOB+N4Zx0gH34DDOSKBvQX0AL2xDAShzfXZP8hChJ3ghVKPwzfT6ruU2Fe x0xosj/PycIXpAxP/i7S8R+y6nnVOeuZeaWis0BliD99ZUV5JteCKmLGld26aGyEgZiq PbuTXij0lvZGaHVnMLHANNCuglta7CIDK0Mjvpbus1bN6O1wBKEe2IuTDl3Qz9EtJIV9 H/E51V7NdKHzK3CuuAVgQxwMM/s56lOSZJh1kULv7R8JoMTNdnWYGky81Lut19qL1hGr W7aQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=If31y072xq4e6P4sxZ7wENONrwovu6qw7j2QcnCLwYM=; b=GD9hqUwMstv66Bgi7BCCAw5zo5Psfw0DB3v/b90b4HRzpiLXw6XideMDe7V1hHfeoU Denc3H9yieDqCqPiAF2c/qjaEf8UpeO3mOU3uy85o7MqlRPYLgxFNMh8gwJ/78AFnB62 QO1MNtnrz6VDbcs1Lif/GAb8HTnhNqq7nrNlznGsm9Ei9wZWTnVOvIwkBFwnj0YPajJz taKBRP1CUYiQudGSHS2fhTmg/2/mwg8rCg+zTlb/6/tv9FrsODF1DUH19Ej2Nx3dvtTB Z38/VHAW9iuQ+aykl+oQzv6qhiKBX9lnUqgEQNeN4mQD2/Fpe+hnAg74t88s5by5yfXr 1Ddg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=iw2od1eb; 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 v62-20020a638941000000b0053f047e96a2si701883pgd.94.2023.06.02.12.34.57; Fri, 02 Jun 2023 12:35: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=iw2od1eb; 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 S237115AbjFBTF2 (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Fri, 2 Jun 2023 15:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237133AbjFBTFY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Jun 2023 15:05:24 -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 788FCE76 for <linux-kernel@vger.kernel.org>; Fri, 2 Jun 2023 12:05:13 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-30aeee7c8a0so1879964f8f.1 for <linux-kernel@vger.kernel.org>; Fri, 02 Jun 2023 12:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1685732712; x=1688324712; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=If31y072xq4e6P4sxZ7wENONrwovu6qw7j2QcnCLwYM=; b=iw2od1eb1LLnTIiTck7tEolOQHlCSsiuiuK5Az1wQSsyQuGpmGKl+Ddz6oaTtYMOzE T5Pnesq+GFxqESCem3TjpoUlvFNgtO2PKO1B0wmLT590vpkWUz+hZIgTV49nhewaoPhO /R3iGhEYJouZbX9L1pxez8SCfqDXal7HKVE7A29/lYBlkkB14Z+itAmcRkIA7BlSJAZl iooncu6iVfqshI8TqaN7O8K152pq1VBbizt+FTAQSLTp9nsQ2Srm5C/AJJlUFwbKsC1K s3o/b2T4EwBTJ8ng314F/99Imw/npLH8nX8MwWUCryUxytFt+vMpaQRNOed9724L0UZZ LKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685732712; x=1688324712; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=If31y072xq4e6P4sxZ7wENONrwovu6qw7j2QcnCLwYM=; b=i67HJEdbJLYasBiuI3PCGCB1w3EdVWtc4tytsNsbF2rHlPyltqDcLwrpYnx6N892O6 ncLw6VAg0V14RMB8UiVPZM3g5WrCBWvZM6ft5/wo9jY5Wa71bu9Y4jdnjkT/y7n8RsQK sx7eMfzCf3yrBBDJixDT1RYcaPGvKd/2m6KbuPa8BfrWA6ZOo0Hy4s5SwdTY7B8bOVVL BYeQ3W/DaluWXHisaYEIofPVyXoEC8cEN0uKeWBzo3W6tWW3jEdi9a0AkkMzQQ95Gs6T Ozv65JFSJ+zsvHU4sI4I+caFjrDJKTOn6kFTXN8Bg0ms3Dwh+wHoSx0ug5NFip/AtqnN C9DA== X-Gm-Message-State: AC+VfDysV/KsKxcEHujGkZBrq2mJn92apdhHvcltoIbB/h6LnWOVThnO Qq9fiJ7/OVB/VDgOSRtkCT0t3g== X-Received: by 2002:a5d:6b0a:0:b0:2fb:92c7:b169 with SMTP id v10-20020a5d6b0a000000b002fb92c7b169mr585237wrw.10.1685732711749; Fri, 02 Jun 2023 12:05:11 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:7569:c0c0:3a0e:c54d]) by smtp.gmail.com with ESMTPSA id y8-20020a056000108800b002ff2c39d072sm2361029wrw.104.2023.06.02.12.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 12:05:11 -0700 (PDT) From: Bartosz Golaszewski <brgl@bgdev.pl> To: Vinod Koul <vkoul@kernel.org>, Bhupesh Sharma <bhupesh.sharma@linaro.org>, Giuseppe Cavallaro <peppe.cavallaro@st.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Jose Abreu <joabreu@synopsys.com>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Andrew Halaney <ahalaney@redhat.com>, Jesse Brandeburg <jesse.brandeburg@intel.com> Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Subject: [PATCH net] net: stmmac: dwmac-qcom-ethqos: fix a regression on EMAC < 3 Date: Fri, 2 Jun 2023 21:04:55 +0200 Message-Id: <20230602190455.3123018-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767620642971998439?= X-GMAIL-MSGID: =?utf-8?q?1767620749216338714?= |
Series |
[net] net: stmmac: dwmac-qcom-ethqos: fix a regression on EMAC < 3
|
|
Commit Message
Bartosz Golaszewski
June 2, 2023, 7:04 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> We must not assign plat_dat->dwmac4_addrs unconditionally as for structures which don't set them, this will result in the core driver using zeroes everywhere and breaking the driver for older HW. On EMAC < 2 the address should remain NULL. Fixes: b68376191c69 ("net: stmmac: dwmac-qcom-ethqos: Add EMAC3 support") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 03-06-2023 00:34, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > We must not assign plat_dat->dwmac4_addrs unconditionally as for > structures which don't set them, this will result in the core driver > using zeroes everywhere and breaking the driver for older HW. On EMAC < 2 > the address should remain NULL. > > Fixes: b68376191c69 ("net: stmmac: dwmac-qcom-ethqos: Add EMAC3 support") > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com> > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > index 16a8c361283b..f07905f00f98 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > @@ -644,7 +644,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) > plat_dat->fix_mac_speed = ethqos_fix_mac_speed; > plat_dat->dump_debug_regs = rgmii_dump; > plat_dat->has_gmac4 = 1; > - plat_dat->dwmac4_addrs = &data->dwmac4_addrs; > + if (ethqos->has_emac3) > + plat_dat->dwmac4_addrs = &data->dwmac4_addrs; > plat_dat->pmt = 1; > plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); > if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
On 02-06-23, 21:04, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > We must not assign plat_dat->dwmac4_addrs unconditionally as for > structures which don't set them, this will result in the core driver > using zeroes everywhere and breaking the driver for older HW. On EMAC < 2 > the address should remain NULL. Reviewed-by: Vinod Koul <vkoul@kernel.org>
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Fri, 2 Jun 2023 21:04:55 +0200 you wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > We must not assign plat_dat->dwmac4_addrs unconditionally as for > structures which don't set them, this will result in the core driver > using zeroes everywhere and breaking the driver for older HW. On EMAC < 2 > the address should remain NULL. > > [...] Here is the summary with links: - [net] net: stmmac: dwmac-qcom-ethqos: fix a regression on EMAC < 3 https://git.kernel.org/netdev/net/c/9bc009734774 You are awesome, thank you!
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 16a8c361283b..f07905f00f98 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -644,7 +644,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->fix_mac_speed = ethqos_fix_mac_speed; plat_dat->dump_debug_regs = rgmii_dump; plat_dat->has_gmac4 = 1; - plat_dat->dwmac4_addrs = &data->dwmac4_addrs; + if (ethqos->has_emac3) + plat_dat->dwmac4_addrs = &data->dwmac4_addrs; plat_dat->pmt = 1; plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))