]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: mscc-miim: read poll when high resolution timers are disabled
authorAntoine Tenart <antoine.tenart@bootlin.com>
Tue, 26 May 2020 16:22:56 +0000 (18:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 May 2020 22:33:56 +0000 (15:33 -0700)
commit7f47f2d6d67ee5392da6bf40b3ca238105c5838a
treec72524f7dbd6cdcdd642e998732176679ce1d6ad
parent3f77a6d0c0058a6291d3d0c1c67e6c1dfc2f4cab
net: phy: mscc-miim: read poll when high resolution timers are disabled

The driver uses a read polling mechanism to check the status of the MDIO
bus, to know if it is ready to accept next commands. This polling
mechanism uses usleep_delay() under the hood between reads which is fine
as long as high resolution timers are enabled. Otherwise the delays will
end up to be much longer than expected.

This patch fixes this by using udelay() under the hood when
CONFIG_HIGH_RES_TIMERS isn't enabled. This increases CPU usage.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/Kconfig
drivers/net/phy/mdio-mscc-miim.c