netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Simon Horman <horms@kernel.org>
Cc: Woojung Huh <woojung.huh@microchip.com>,
	Thangaraj Samynathan <Thangaraj.S@microchip.com>,
	netdev@vger.kernel.org, Phil Elwell <phil@raspberrypi.org>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	linux-kernel@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	kernel@pengutronix.de,
	Rengarajan Sundararajan <Rengarajan.S@microchip.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net-next v3 1/7] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management
Date: Tue, 18 Mar 2025 06:07:57 +0100	[thread overview]
Message-ID: <Z9j_rcK23cO4rmZM@pengutronix.de> (raw)
In-Reply-To: <20250317153611.GB688833@kernel.org>

On Mon, Mar 17, 2025 at 03:36:11PM +0000, Simon Horman wrote:
> On Mon, Mar 10, 2025 at 12:57:31PM +0100, Oleksij Rempel wrote:
> 
> ...
> 
> > +static struct phy_device *lan7801_phy_init(struct lan78xx_net *dev)
> > +{
> >  	struct phy_device *phydev;
> > +	int ret;
> 
> nit: not strictly related to this patch as the problem already existed,
>      but ret is set but otherwise unused in this function. Perhaps
>      it can be removed at some point?
> 
>      Flagged by W=1 builds.

Ack. This is addresses in 3. patch

> > +	u32 buf;
> >  
> >  	phydev = phy_find_first(dev->mdiobus);
> >  	if (!phydev) {
> > -		netdev_dbg(dev->net, "PHY Not Found!! Registering Fixed PHY\n");
> > -		phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
> > -		if (IS_ERR(phydev)) {
> > -			netdev_err(dev->net, "No PHY/fixed_PHY found\n");
> > -			return NULL;
> > -		}
> > -		netdev_dbg(dev->net, "Registered FIXED PHY\n");
> > -		dev->interface = PHY_INTERFACE_MODE_RGMII;
> > +		netdev_dbg(dev->net, "PHY Not Found!! Forcing RGMII configuration\n");
> >  		ret = lan78xx_write_reg(dev, MAC_RGMII_ID,
> >  					MAC_RGMII_ID_TXC_DELAY_EN_);
> >  		ret = lan78xx_write_reg(dev, RGMII_TX_BYP_DLL, 0x3D00);
> 
> ...
> 
> > @@ -4256,13 +4281,13 @@ static void lan78xx_delayedwork(struct work_struct *work)
> >  		}
> >  	}
> >  
> > -	if (test_bit(EVENT_LINK_RESET, &dev->flags)) {
> > +	if (test_bit(EVENT_PHY_INT_ACK, &dev->flags)) {
> >  		int ret = 0;
> >  
> > -		clear_bit(EVENT_LINK_RESET, &dev->flags);
> > -		if (lan78xx_link_reset(dev) < 0) {
> > -			netdev_info(dev->net, "link reset failed (%d)\n",
> > -				    ret);
> > +		clear_bit(EVENT_PHY_INT_ACK, &dev->flags);
> > +		if (lan78xx_phy_int_ack(dev) < 0) {
> > +			netdev_info(dev->net, "PHY INT ack failed (%pe)\n",
> > +				    ERR_PTR(ret));
> 
> nit: ret is always 0 here. So I'm unsure both why it is useful to include
>      in the error message, and why ERR_PTR() is being used.
> 
>      Flagged by Smatch.

Thank you, i'll take a look on it.

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2025-03-18  5:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 11:57 [PATCH net-next v3 0/7] Convert LAN78xx to PHYLINK Oleksij Rempel
2025-03-10 11:57 ` [PATCH net-next v3 1/7] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management Oleksij Rempel
2025-03-15  3:48   ` kernel test robot
2025-03-17 15:36   ` Simon Horman
2025-03-18  5:07     ` Oleksij Rempel [this message]
2025-03-10 11:57 ` [PATCH net-next v3 2/7] net: usb: lan78xx: improve error reporting on PHY attach failure Oleksij Rempel
2025-03-10 11:57 ` [PATCH net-next v3 3/7] net: usb: lan78xx: Improve error handling for PHY init path Oleksij Rempel
2025-03-10 11:57 ` [PATCH net-next v3 4/7] net: usb: lan78xx: Use ethtool_op_get_link to reflect current link status Oleksij Rempel
2025-03-11 17:04   ` Maxime Chevallier
2025-03-10 11:57 ` [PATCH net-next v3 5/7] net: usb: lan78xx: port link settings to phylink API Oleksij Rempel
2025-03-11 17:11   ` Maxime Chevallier
2025-03-15  7:16   ` kernel test robot
2025-03-10 11:57 ` [PATCH net-next v3 6/7] net: usb: lan78xx: Transition get/set_pause to phylink Oleksij Rempel
2025-03-11 17:31   ` Maxime Chevallier
2025-03-15 10:58   ` kernel test robot
2025-03-10 11:57 ` [PATCH net-next v3 7/7] net: usb: lan78xx: Integrate EEE support with phylink LPI API Oleksij Rempel

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=Z9j_rcK23cO4rmZM@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=Rengarajan.S@microchip.com \
    --cc=Thangaraj.S@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phil@raspberrypi.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=woojung.huh@microchip.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).