FROMLIST: net: atlantic: Use readx_poll_timeout() for large timeout
Commit
8dcf2ad39f ("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.
Cc: Mark Starovoytov <mstarovoitov@marvell.com>
Cc: Igor Russkikh <irusskikh@marvell.com>
Link: https://lkml.kernel.org/r/20200818161439.3dkf6jzp3vuwmvvh@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5ba7041e31be3445d209aeeed2f8933962b3fcb0
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
92f13cd6bd
commit
10278602dc
@@ -1631,8 +1631,8 @@ static int hw_atl_b0_get_mac_temp(struct aq_hw_s *self, u32 *temp)
|
||||
hw_atl_ts_reset_set(self, 0);
|
||||
}
|
||||
|
||||
err = readx_poll_timeout_atomic(hw_atl_b0_ts_ready_and_latch_high_get,
|
||||
self, val, val == 1, 10000U, 500000U);
|
||||
err = readx_poll_timeout(hw_atl_b0_ts_ready_and_latch_high_get, self,
|
||||
val, val == 1, 10000U, 500000U);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user