Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1737560

Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms

From Shuah Khan <shuahkh@osg.samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms
Date 2017-09-22 16:50 +0200
Message-ID <usxrd-7fo-53@gated-at.bofh.it> (permalink)
References <usfDY-57h-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi John/Greg,

On 09/21/2017 01:45 PM, Shuah Khan wrote:
> When timer_create() fails on a bootime or realtime clock, setup_timer()
> returns 0 as if timer has been set. Callers wait forever for the timer
> to expire.
> 
> This hang is seen on a system that doesn't have support for:
> 
> CLOCK_REALTIME_ALARM   ABSTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED]
> 
> Test hangs waiting for a timer that hasn't been set to expire.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  tools/testing/selftests/timers/set-timer-lat.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c
> index 9c92b7bd5641..ab2fe225e051 100644
> --- a/tools/testing/selftests/timers/set-timer-lat.c
> +++ b/tools/testing/selftests/timers/set-timer-lat.c
> @@ -143,7 +143,8 @@ int setup_timer(int clock_id, int flags, int interval, timer_t *tm1)
>  			printf("%-22s %s missing CAP_WAKE_ALARM?    : [UNSUPPORTED]\n",
>  					clockstring(clock_id),
>  					flags ? "ABSTIME":"RELTIME");
> -			return 0;
> +			/* Indicate timer isn't set, so caller doesn't wait */
> +			return 1;
>  		}
>  		printf("%s - timer_create() failed\n", clockstring(clock_id));
>  		return -1;
> 

I assume you are good with this fix. I plan to apply it to linux-kselftest fixes
today. Please let me know if you have any objections.

thanks,
-- Shuah

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-21 21:50 +0200
  Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing  unsupported alarms Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-22 16:50 +0200
    Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing  unsupported alarms Greg Hackmann <ghackmann@google.com> - 2017-09-22 18:00 +0200
      Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing  unsupported alarms Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-22 18:30 +0200

csiph-web