[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAD-RDUdJaL_sIqQ@gmail.com>
Date: Thu, 17 Apr 2025 14:12:36 +0100
From: Qasim Ijaz <qasdev00@...il.com>
To: Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
horms@...nel.org, linux-usb@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
syzbot+3361c2d6f78a3e0892f9@...kaller.appspotmail.com,
stable@...r.kernel.org
Subject: Re: [PATCH 5/5] net: ch9200: avoid triggering NWay restart on
non-zero PHY ID
On Tue, Apr 15, 2025 at 08:56:48PM -0700, Jakub Kicinski wrote:
> On Tue, 15 Apr 2025 20:52:30 -0700 Jakub Kicinski wrote:
> > On Tue, 15 Apr 2025 03:35:07 +0200 Andrew Lunn wrote:
> > > > @@ -182,7 +182,7 @@ static int ch9200_mdio_read(struct net_device *netdev, int phy_id, int loc)
> > > > __func__, phy_id, loc);
> > > >
> > > > if (phy_id != 0)
> > > > - return -ENODEV;
> > > > + return 0;
> > >
> > > An actually MDIO bus would return 0xffff is asked to read from a PHY
> > > which is not on the bus. But i've no idea how the ancient mii code
> > > handles this.
> > >
> > > If this code every gets updated to using phylib, many of the changes
> > > you are making will need reverting because phylib actually wants to
> > > see the errors. So i'm somewhat reluctant to make changes like this.
> >
> > Right.
> >
> > I mean most of the patches seem to be adding error checking, unlike
> > this one, but since Qasim doesn't have access to this HW they are
> > more likely to break stuff than fix. I'm going to apply the first
> > patch, Qasim if you'd like to clean up the rest I think it should
> > be done separately without the Fixes tags, if at all.
>
> Ah, no, patch 1 also does return 0. Hm. Maybe let's propagate the real
> error to silence the syzbot error and if someone with access to the HW
Hi Andrew and Jakub
Since there is uncertainty on whether these patches would break things
how about I refactor the patches to instead return what the function
already returns, this way we include error handling but maintain consistency
with what the function already returns and does so there is no chance of
breaking stuff. I think including the error handling would be a good idea
overall because we have already seen 1 bug where the root cause is insufficient
error handling right? Furthermore this driver has not been updated in 4 years,
so for the near‑term surely improving these aspects can only be a good thing.
So now going into the changes:
Patch 1: So patch 1 changes mdio_read, we can see that on failure mdio_read
already returns a negative of -ENODEV, so for the patch 1 change we can simply
just error check control_read by "if (ret < 0) return ret;" This matches
the fact that mdio_read already returns a negative so no chance of breaking anything.
Patch 2: For patch 2 I will add Cc stable to this patch since kernel test robot
flagged it, I assume backporting it would be the right thing to do since the
return statement here stops error propagation. Would you like me to add it to the other patches?
Patch 3: For patch 3 the get_mac_address and ch9200_bind function already returns a
negative on error so my changes don't change what is returned, so this should be fine i think.
Patch 4: For patch 4 it already returns a negative on error via usbnet_get_endpoints()
so i hope it is fine as is? Jakub commented on the changed usbnet_get_endpoints()
error check, if you want me to revert it back I can do that.
Patch 5: We can drop this.
Andrew and Jakub if you’re happy with this should I resend with these changes?
> comes along they can try to move this driver to more modern infra?
Powered by blists - more mailing lists