Skip to content

Commit 9553b62

Browse files
Sebastian Andrzej Siewiordavem330
authored andcommitted
net: atlantic: Use readx_poll_timeout() for large timeout
Commit 8dcf2ad ("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: 8dcf2ad ("net: atlantic: add hwmon getter for MAC temperature") Cc: Mark Starovoytov <[email protected]> Cc: Igor Russkikh <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 957ff42 commit 9553b62

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/aquantia/atlantic/hw_atl

1 file changed

+2
-2
lines changed

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,8 +1631,8 @@ static int hw_atl_b0_get_mac_temp(struct aq_hw_s *self, u32 *temp)
16311631
hw_atl_ts_reset_set(self, 0);
16321632
}
16331633

1634-
err = readx_poll_timeout_atomic(hw_atl_b0_ts_ready_and_latch_high_get,
1635-
self, val, val == 1, 10000U, 500000U);
1634+
err = readx_poll_timeout(hw_atl_b0_ts_ready_and_latch_high_get, self,
1635+
val, val == 1, 10000U, 500000U);
16361636
if (err)
16371637
return err;
16381638

0 commit comments

Comments
 (0)