All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>, Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Feiyang Chen <chenfeiyang@loongson.cn>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Vladimir Zapolskiy <vz@mleia.com>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Samin Guo <samin.guo@starfivetech.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-sunxi@lists.linux.dev, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next] net: stmmac: clarify difference between "interface" and "phy_interface"
Date: Tue, 29 Aug 2023 14:10:40 +0100	[thread overview]
Message-ID: <ZO3uUIFgtkIHHqjL@shell.armlinux.org.uk> (raw)
In-Reply-To: <12274852.O9o76ZdvQC@steina-w>

On Tue, Aug 29, 2023 at 02:38:33PM +0200, Alexander Stein wrote:
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index
> > ff330423ee66..35f4b1484029 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > @@ -419,9 +419,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8
> > *mac) return ERR_PTR(phy_mode);
> > 
> >  	plat->phy_interface = phy_mode;
> > -	plat->interface = stmmac_of_get_mac_mode(np);
> > -	if (plat->interface < 0)
> > -		plat->interface = plat->phy_interface;
> > +	plat->mac_interface = stmmac_of_get_mac_mode(np);
> > +	if (plat->mac_interface < 0)
> 
> This check is never true as mac_interface is now an unsigned enum 
> (phy_interface_t). Thus mac_interface is not set to phy_interface resulting in 
> an invalid mac_interface. My platform (arch/arm64/boot/dts/freescale/imx8mp-
> tqma8mpql-mba8mpxl.dts) fails to probe now.

Thanks for catching that. Does this patch fix it for you?

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 231152ee5a32..0451d2c2aa43 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -420,9 +420,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 		return ERR_PTR(phy_mode);
 
 	plat->phy_interface = phy_mode;
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+
+	rc = stmmac_of_get_mac_mode(np);
+	plat->interface = rc < 0 ? plat->phy_interface : rc;
 
 	/* Some wrapper drivers still rely on phy_node. Let's save it while
 	 * they are not converted to phylink. */

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


WARNING: multiple messages have this Message-ID (diff)
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>, Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Feiyang Chen <chenfeiyang@loongson.cn>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Vladimir Zapolskiy <vz@mleia.com>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Samin Guo <samin.guo@starfivetech.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-sunxi@lists.linux.dev, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next] net: stmmac: clarify difference between "interface" and "phy_interface"
Date: Tue, 29 Aug 2023 14:10:40 +0100	[thread overview]
Message-ID: <ZO3uUIFgtkIHHqjL@shell.armlinux.org.uk> (raw)
In-Reply-To: <12274852.O9o76ZdvQC@steina-w>

On Tue, Aug 29, 2023 at 02:38:33PM +0200, Alexander Stein wrote:
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index
> > ff330423ee66..35f4b1484029 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > @@ -419,9 +419,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8
> > *mac) return ERR_PTR(phy_mode);
> > 
> >  	plat->phy_interface = phy_mode;
> > -	plat->interface = stmmac_of_get_mac_mode(np);
> > -	if (plat->interface < 0)
> > -		plat->interface = plat->phy_interface;
> > +	plat->mac_interface = stmmac_of_get_mac_mode(np);
> > +	if (plat->mac_interface < 0)
> 
> This check is never true as mac_interface is now an unsigned enum 
> (phy_interface_t). Thus mac_interface is not set to phy_interface resulting in 
> an invalid mac_interface. My platform (arch/arm64/boot/dts/freescale/imx8mp-
> tqma8mpql-mba8mpxl.dts) fails to probe now.

Thanks for catching that. Does this patch fix it for you?

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 231152ee5a32..0451d2c2aa43 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -420,9 +420,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 		return ERR_PTR(phy_mode);
 
 	plat->phy_interface = phy_mode;
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+
+	rc = stmmac_of_get_mac_mode(np);
+	plat->interface = rc < 0 ? plat->phy_interface : rc;
 
 	/* Some wrapper drivers still rely on phy_node. Let's save it while
 	 * they are not converted to phylink. */

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-08-29 13:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26 10:02 [PATCH net-next] net: stmmac: clarify difference between "interface" and "phy_interface" Russell King (Oracle)
2023-08-26 10:02 ` Russell King (Oracle)
2023-08-28 20:00 ` patchwork-bot+netdevbpf
2023-08-28 20:00   ` patchwork-bot+netdevbpf
2023-08-29 12:38 ` Alexander Stein
2023-08-29 12:38   ` Alexander Stein
2023-08-29 13:10   ` Russell King (Oracle) [this message]
2023-08-29 13:10     ` Russell King (Oracle)
2023-08-29 13:20     ` Alexander Stein
2023-08-29 13:20       ` Alexander Stein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZO3uUIFgtkIHHqjL@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chenfeiyang@loongson.cn \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=festevam@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=kernel@esmil.dk \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=s.hauer@pengutronix.de \
    --cc=samin.guo@starfivetech.com \
    --cc=samuel@sholland.org \
    --cc=shawnguo@kernel.org \
    --cc=vz@mleia.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.