[net-next,v4,4/5] net: altera_tse: explicitly disable autoscan on the regmap-mdio bus
Message ID | 20230607135941.407054-5-maxime.chevallier@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp319054rwl; Wed, 7 Jun 2023 05:32:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70EwaoOlCP09xe4Yb3HUFPhWADByhVh548GbUnkkRQbLwXHWkG2tsUFF/P1tqsgN+BQusK X-Received: by 2002:a17:902:a585:b0:1ae:4562:14f1 with SMTP id az5-20020a170902a58500b001ae456214f1mr3024577plb.9.1686141152717; Wed, 07 Jun 2023 05:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686141152; cv=none; d=google.com; s=arc-20160816; b=nFZZj1mL0KlOII2PnTZAS4+b2ACIP/CglYogccwmLgUpphOIMCYctxRq/hgGXquq5/ n910TbybFdhA/tw4pgp24VIpb6qBZUF2pE0AGM4ScpvBl4FDQwgaszd1czSvNSeQGF7/ tqNeUlQWDAZKLkUBXQ60TT6UObladwmG1Pd888uRPb+FhrgTddPHHZ3Y/WiJCROl3zDm vyCvthH0hLEWQAeQ4mn2uGbOWs26YWjrtmwJ7kzQYA/MNfeogUr1YEevuMmtBrrD7Yb5 14slxMP3szKUmU6xI90thvDsgjJz692Q8HAzXHsP/QkFqn3y6wQFVIGBrW6Fr9yHbV6I y3kw== 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=uyF72a3yG09hh6hXJngvth5hjG1EY+SZikMQwCrSeCE=; b=h5C5e8+xUE8HIetgVr2ACUiJtFvtgS8tmBX2bKW6iK32jKG4RicpKD6GOr1gCwrzrw adGzdO5+JQl7pQjVogzHkhkGiziVhGpmwmLIovdzJOKwyuTVpL2zOlSfKGsn0HL//3ex 1u0CAi4d/CtvkmVmGCItFFmeEyMzi3Yb1Y00wSQJLTwJQ9kmbn9iijS/3G4ZkNa9iFnH WEaGzTEjXslKjWyt+43mkoYCSS5mMA8cxA2/fljxEQVGzPs75Bj+qj3h9JvtWl15JbqN Vdg3sAzEPwqAJFfytVRc9koGUrOJedN8gLq87iGgNsILN7a7ZdK5BqfXuKjFqcZ6Wwq/ 67yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=huXraDsy; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a170902f7ce00b001b178baf356si8771496plw.95.2023.06.07.05.32.15; Wed, 07 Jun 2023 05:32:32 -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=@bootlin.com header.s=gm1 header.b=huXraDsy; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240518AbjFGMJE (ORCPT <rfc822;literming00@gmail.com> + 99 others); Wed, 7 Jun 2023 08:09:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240525AbjFGMI3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Jun 2023 08:08:29 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB6631BEC; Wed, 7 Jun 2023 05:08:26 -0700 (PDT) X-GND-Sasl: maxime.chevallier@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686139705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uyF72a3yG09hh6hXJngvth5hjG1EY+SZikMQwCrSeCE=; b=huXraDsyHY5vwwdJ758i946FKjTZly9LWnpqdFKWI59jRDcb4XV+YLW4DqNnMHVC9j6Eu1 oLrDJxgO4yNM+6oVAGE3SqrBHk9auWZ0AiTtAW73Zn9zhFUVajpRC/X+r3GOp3EZ9TlKUu 2SI+f7nhE/mG770tZPrjx9aQXY0PJni611+6fCNXhjaN01DKEpP3aYhMNZU1I5TIvb7Fbr Cp1D8ySobPvwcGzAwxfZ2hys9wct9oheuA6pTGi2/LiLWaKUvjo8y3kONxOyPZolkshpsA FfylY6p2SBQ/JnekYg+HYknX9PaVm8vcztBsKFOzCX0qymn9U4SvN9I2xk21rQ== X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 52693E000F; Wed, 7 Jun 2023 12:08:23 +0000 (UTC) From: Maxime Chevallier <maxime.chevallier@bootlin.com> To: davem@davemloft.net Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alexis.lothore@bootlin.com, thomas.petazzoni@bootlin.com, Andrew Lunn <andrew@lunn.ch>, Jakub Kicinski <kuba@kernel.org>, Eric Dumazet <edumazet@google.com>, Paolo Abeni <pabeni@redhat.com>, Florian Fainelli <f.fainelli@gmail.com>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, Vladimir Oltean <vladimir.oltean@nxp.com>, Ioana Ciornei <ioana.ciornei@nxp.com>, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Jose Abreu <joabreu@synopsys.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Giuseppe Cavallaro <peppe.cavallaro@st.com>, Simon Horman <simon.horman@corigine.com>, Maciej Fijalkowski <maciej.fijalkowski@intel.com>, Feiyang Chen <chenfeiyang@loongson.cn>, Russell King <rmk+kernel@armlinux.org.uk> Subject: [PATCH net-next v4 4/5] net: altera_tse: explicitly disable autoscan on the regmap-mdio bus Date: Wed, 7 Jun 2023 15:59:40 +0200 Message-Id: <20230607135941.407054-5-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607135941.407054-1-maxime.chevallier@bootlin.com> References: <20230607135941.407054-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768047145285457251?= X-GMAIL-MSGID: =?utf-8?q?1768047145285457251?= |
Series |
Followup fixes for the dwmac and altera lynx conversion
|
|
Commit Message
Maxime Chevallier
June 7, 2023, 1:59 p.m. UTC
Set the .autoscan flag to false on the regmap-mdio bus, to avoid using a
random uninitialized value. We don't want autoscan in this case as the
mdio device is a PCS and not a PHY.
Fixes: db48abbaa18e ("net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx")
Suggested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
V3->V4 : No changes
V2->V3 : New patch
drivers/net/ethernet/altera/altera_tse_main.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Wed, Jun 07, 2023 at 03:59:40PM +0200, Maxime Chevallier wrote: > Set the .autoscan flag to false on the regmap-mdio bus, to avoid using a > random uninitialized value. We don't want autoscan in this case as the > mdio device is a PCS and not a PHY. Isn't this now covered by patch 1's memset of mrc?
Hello Russell, On Wed, 7 Jun 2023 13:26:41 +0100 "Russell King (Oracle)" <linux@armlinux.org.uk> wrote: > On Wed, Jun 07, 2023 at 03:59:40PM +0200, Maxime Chevallier wrote: > > Set the .autoscan flag to false on the regmap-mdio bus, to avoid using a > > random uninitialized value. We don't want autoscan in this case as the > > mdio device is a PCS and not a PHY. > > Isn't this now covered by patch 1's memset of mrc? > Yes it is, however I thought it could be fine keeping it set explicitely anyway, as we do have a PCS on that bus and we don't want any autoscan happening. Since these two drivers are the first users of mdio_regmap, my hope is that we could get these reference usages covering all fields. Should I drop this ? Maxime
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 215f9fb89c5b..2e15800e5310 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1288,6 +1288,7 @@ static int altera_tse_probe(struct platform_device *pdev) mrc.regmap = pcs_regmap; mrc.parent = &pdev->dev; mrc.valid_addr = 0x0; + mrc.autoscan = false; /* Rx IRQ */ priv->rx_irq = platform_get_irq_byname(pdev, "rx_irq");