[v2,0/4] Extend time to wait for UIP for some callers

Message ID 20231120141555.458-1-mario.limonciello@amd.com
Headers
Series Extend time to wait for UIP for some callers |

Message

Mario Limonciello Nov. 20, 2023, 2:15 p.m. UTC
  A number of users have reported their system will have a failure reading
the RTC around s2idle entry or exit.

This failure manifests as UIP clear taking longer than 10ms.

By a debugging patch provided by Mateusz Jończyk it is shown that this
has taken upwards of 300ms in some cases.

This series adjusts the UIP timeout to be configurable by the caller and
changes some callers which aren't called in an interrupt context to allow
longer timeouts.

Mario Limonciello (4):
  rtc: mc146818-lib: Adjust failure return code for mc146818_get_time()
  rtc: Adjust failure return code for cmos_set_alarm()
  rtc: Add support for configuring the UIP timeout for RTC reads
  rtc: Extend timeout for waiting for UIP to clear to 1s

 arch/alpha/kernel/rtc.c        |  2 +-
 arch/x86/kernel/hpet.c         |  2 +-
 arch/x86/kernel/rtc.c          |  2 +-
 drivers/base/power/trace.c     |  2 +-
 drivers/rtc/rtc-cmos.c         | 10 ++++-----
 drivers/rtc/rtc-mc146818-lib.c | 37 +++++++++++++++++++++++++---------
 include/linux/mc146818rtc.h    |  3 ++-
 7 files changed, 39 insertions(+), 19 deletions(-)


base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263
  

Comments

Mateusz Jończyk Nov. 22, 2023, 4:58 p.m. UTC | #1
W dniu 20.11.2023 o 15:15, Mario Limonciello pisze:
> A number of users have reported their system will have a failure reading
> the RTC around s2idle entry or exit.
>
> This failure manifests as UIP clear taking longer than 10ms.
>
> By a debugging patch provided by Mateusz Jończyk it is shown that this
> has taken upwards of 300ms in some cases.
>
> This series adjusts the UIP timeout to be configurable by the caller and
> changes some callers which aren't called in an interrupt context to allow
> longer timeouts.
>
> Mario Limonciello (4):
>   rtc: mc146818-lib: Adjust failure return code for mc146818_get_time()
>   rtc: Adjust failure return code for cmos_set_alarm()
>   rtc: Add support for configuring the UIP timeout for RTC reads
>   rtc: Extend timeout for waiting for UIP to clear to 1s

Series tested on top of Linux 6.1.63, 6.6.2 and 6.7-rc2
(on a laptop that is not affected by the problems).
No problems found, can be submitted to stable.

Tested-by: Mateusz Jończyk <mat.jonczyk@o2.pl>

Patches 1 and 2:

Reviewed-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Acked-by: Mateusz Jończyk <mat.jonczyk@o2.pl>

Greetings,

Mateusz
  
Alexandre Belloni Nov. 23, 2023, 8:31 a.m. UTC | #2
On 20/11/2023 08:15:51-0600, Mario Limonciello wrote:
> A number of users have reported their system will have a failure reading
> the RTC around s2idle entry or exit.
> 
> This failure manifests as UIP clear taking longer than 10ms.
> 
> By a debugging patch provided by Mateusz Jończyk it is shown that this
> has taken upwards of 300ms in some cases.
> 
> This series adjusts the UIP timeout to be configurable by the caller and
> changes some callers which aren't called in an interrupt context to allow
> longer timeouts.
> 
> Mario Limonciello (4):
>   rtc: mc146818-lib: Adjust failure return code for mc146818_get_time()
>   rtc: Adjust failure return code for cmos_set_alarm()
>   rtc: Add support for configuring the UIP timeout for RTC reads
>   rtc: Extend timeout for waiting for UIP to clear to 1s
> 
>  arch/alpha/kernel/rtc.c        |  2 +-
>  arch/x86/kernel/hpet.c         |  2 +-
>  arch/x86/kernel/rtc.c          |  2 +-


Please also copy the x86 maintainers so they know I'm going to carry
patches that may affect them (which I doubt will cause any issues)

>  drivers/base/power/trace.c     |  2 +-
>  drivers/rtc/rtc-cmos.c         | 10 ++++-----
>  drivers/rtc/rtc-mc146818-lib.c | 37 +++++++++++++++++++++++++---------
>  include/linux/mc146818rtc.h    |  3 ++-
>  7 files changed, 39 insertions(+), 19 deletions(-)
> 
> 
> base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263
> -- 
> 2.34.1
>