OSDN Git Service

soc: renesas: rmobile-sysc: Convert to readl_poll_timeout_atomic()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 2 Jun 2023 08:50:41 +0000 (10:50 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 5 Jun 2023 13:43:27 +0000 (15:43 +0200)
commita00d47f7645d6e840a38a62fd961c8aa2c8fed6c
tree9e60954654eaa8a1eb081a41a7df489d3780be49
parenta1b1dd71882f7b9e80e3d1cd4314d17613aafda4
soc: renesas: rmobile-sysc: Convert to readl_poll_timeout_atomic()

Use readl_poll_timeout_atomic() instead of open-coding the same
operation.

  1. rmobile_pd_power_down(): as typically less than 20 retries are
     needed, PSTR_RETRIES (100) µs is a suitable timeout value.

  2. __rmobile_pd_power_up(): the old method of first polling some
     cycles with a 1 µs delay, followed by more polling cycles without
     any delay didn't make much sense, as the latter was insignificant
     compared to the former.  Furthermore, typically no retries are
     needed.  Hence just retain the polling with delay.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/ae4bf03ab8fd5a557c683086958d6764babc0723.1685692810.git.geert+renesas@glider.be
drivers/soc/renesas/rmobile-sysc.c