]> git.baikalelectronics.ru Git - kernel.git/commit
net: atlantic: Use readx_poll_timeout() for large timeout
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 18 Aug 2020 16:14:39 +0000 (18:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Aug 2020 23:25:29 +0000 (16:25 -0700)
commit8695a99307768a607c84a3f7f09258156a0c8b4a
tree2ac058fe257d0d119980644369a968582dcf608f
parent3030bcba27d123fe2eb8175695224ef3ae5bb8b0
net: atlantic: Use readx_poll_timeout() for large timeout

Commit
   2b5d95ab36c9a ("net: atlantic: add hwmon getter for MAC temperature")

implemented a read callback with an udelay(10000U). This fails to
compile on ARM because the delay is >1ms. I doubt that it is needed to
spin for 10ms even if possible on x86.

>From looking at the code, the context appears to be preemptible so using
usleep() should work and avoid busy spinning.

Use readx_poll_timeout() in the poll loop.

Fixes: 2b5d95ab36c9a ("net: atlantic: add hwmon getter for MAC temperature")
Cc: Mark Starovoytov <mstarovoitov@marvell.com>
Cc: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c