net: phylink: fix PHY validation with rate adaption
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 24 Nov 2022 09:06:48 +0000 (09:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Nov 2022 11:12:39 +0000 (11:12 +0000)
commit7642cc28fd37a15feacff0ccf0e5a8466630df5d
tree6b8720d29e1a0894f90ce2a5a82690493f572d72
parent9256db4e45e8b497b0e993cc3ed4ad08eb2389b6
net: phylink: fix PHY validation with rate adaption

Tim Harvey reports that link modes which he does not expect to be
supported are being advertised, and this is because of the workaround
we have for PHYs that switch interface modes.

Fix this up by checking whether rate matching will be used for the
requested interface mode, and if rate matching will be used, perform
validation only with the requested interface mode, rather than invoking
this workaround.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c