Re: [PATCH] net: phy: phy_remove_link_mode should not advertise new modes

2020-07-15 Thread Andrew Lunn
On Tue, Jul 14, 2020 at 10:25:42AM +0200, Helmut Grohne wrote: > When doing "ip link set dev ... up" for a ksz9477 backed link, > ksz9477_phy_setup is called and it calls phy_remove_link_mode to remove > 1000baseT HDX. During phy_remove_link_mode, phy_advertise_supported is > called. > > If one wa

Re: [PATCH] net: phy: phy_remove_link_mode should not advertise new modes

2020-07-15 Thread Andrew Lunn
> Is > > Case C: driver does not initialize advertised at all and depends on > phy_remove_link_mode() to do it > > possible? No. phylib initializes advertise to supported as part of probing the PHY. So the PHY by default advertises everything it supports, except the oddities of Pause.

Re: [PATCH] net: phy: phy_remove_link_mode should not advertise new modes

2020-07-15 Thread Andrew Lunn
> It also is not true that the current code ensures your assertion. > Specifically, phy_advertise_supported copies the pause bits from the old > advertised to the new one regardless of whether they're set in > supported. This is an oddity of Pause. The PHY should not sets Pause in supported, becau

Re: [PATCH] net: phy: phy_remove_link_mode should not advertise new modes

2020-07-15 Thread Jakub Kicinski
On Wed, 15 Jul 2020 09:03:45 +0200 Helmut Grohne wrote: > On Tue, Jul 14, 2020 at 11:07:10PM +0200, David Miller wrote: > > From: Helmut Grohne > > Date: Tue, 14 Jul 2020 10:25:42 +0200 > > > > > When doing "ip link set dev ... up" for a ksz9477 backed link, > > > ksz9477_phy_setup is called an

Re: [PATCH] net: phy: phy_remove_link_mode should not advertise new modes

2020-07-15 Thread Helmut Grohne
On Tue, Jul 14, 2020 at 11:07:10PM +0200, David Miller wrote: > From: Helmut Grohne > Date: Tue, 14 Jul 2020 10:25:42 +0200 > > > When doing "ip link set dev ... up" for a ksz9477 backed link, > > ksz9477_phy_setup is called and it calls phy_remove_link_mode to remove > > 1000baseT HDX. During ph

Re: [PATCH] net: phy: phy_remove_link_mode should not advertise new modes

2020-07-14 Thread David Miller
From: Helmut Grohne Date: Tue, 14 Jul 2020 10:25:42 +0200 > When doing "ip link set dev ... up" for a ksz9477 backed link, > ksz9477_phy_setup is called and it calls phy_remove_link_mode to remove > 1000baseT HDX. During phy_remove_link_mode, phy_advertise_supported is > called. > > If one wants

[PATCH] net: phy: phy_remove_link_mode should not advertise new modes

2020-07-14 Thread Helmut Grohne
When doing "ip link set dev ... up" for a ksz9477 backed link, ksz9477_phy_setup is called and it calls phy_remove_link_mode to remove 1000baseT HDX. During phy_remove_link_mode, phy_advertise_supported is called. If one wants to advertise fewer modes than the supported ones, one usually reduces t