From: Simon Horman <horms@kernel.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Woojung Huh <woojung.huh@microchip.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Russell King <rmk+kernel@armlinux.org.uk>,
Thangaraj Samynathan <Thangaraj.S@microchip.com>,
Rengarajan Sundararajan <Rengarajan.S@microchip.com>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, UNGLinuxDriver@microchip.com,
Phil Elwell <phil@raspberrypi.org>
Subject: Re: [PATCH net-next v3 1/7] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management
Date: Mon, 17 Mar 2025 15:36:11 +0000 [thread overview]
Message-ID: <20250317153611.GB688833@kernel.org> (raw)
In-Reply-To: <20250310115737.784047-2-o.rempel@pengutronix.de>
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.
> + 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.
> }
> }
>
...
next prev parent reply other threads:[~2025-03-17 15:37 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 [this message]
2025-03-18 5:07 ` Oleksij Rempel
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=20250317153611.GB688833@kernel.org \
--to=horms@kernel.org \
--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=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--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).