]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: smsc: LAN8710/20: add phy refclk in support
authorMarco Felsch <m.felsch@pengutronix.de>
Wed, 9 Sep 2020 13:45:00 +0000 (15:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Sep 2020 21:15:02 +0000 (14:15 -0700)
commit1a4d461ca55278768ba7b69c13c6a40c802f253b
treedfa264dbd791d22b130309c18985ef95c16fdb34
parent00f6781bd4a68db7f0ee7b38b6e30fcf81b31e04
net: phy: smsc: LAN8710/20: add phy refclk in support

Add support to specify the clock provider for the PHY refclk and don't
rely on 'magic' host clock setup. [1] tried to address this by
introducing a flag and fixing the corresponding host. But this commit
breaks the IRQ support since the irq setup during .config_intr() is
thrown away because the reset comes from the side without respecting the
current PHY state within the PHY library state machine. Furthermore the
commit fixed the problem only for FEC based hosts other hosts acting
like the FEC are not covered.

This commit goes the other way around to address the bug fixed by [1].
Instead of resetting the device from the side every time the refclk gets
(re-)enabled it requests and enables the clock till the device gets
removed. Now the PHY library is the only place where the PHY gets reset
to respect the PHY library state machine.

[1] commit 10eda3806656 ("net: phy: smsc: LAN8710/20: add
    PHY_RST_AFTER_CLK_EN flag")

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/smsc.c