[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b07b19ce-7f04-409c-bcb9-6deba059f57a@roeck-us.net>
Date: Wed, 23 Aug 2023 09:50:47 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Alessandro Zummo <a.zummo@...ertech.it>,
Benson Leung <bleung@...omium.org>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Thomas Gleixner <tglx@...utronix.de>,
John Stultz <jstultz@...gle.com>,
Stephen Boyd <sboyd@...nel.org>, linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Brian Norris <briannorris@...omium.org>
Subject: Re: [PATCH v2 1/7] rtc: Add support for limited alarm timer offsets
Hi Alexandre,
On Thu, Aug 17, 2023 at 03:55:31PM -0700, Guenter Roeck wrote:
> Some alarm timers are based on time offsets, not on absolute times.
> In some situations, the amount of time that can be scheduled in the
> future is limited. This may result in a refusal to suspend the system,
> causing substantial battery drain.
>
> Some RTC alarm drivers remedy the situation by setting the alarm time
> to the maximum supported time if a request for an out-of-range timeout
> is made. This is not really desirable since it may result in unexpected
> early wakeups.
>
> To reduce the impact of this problem, let RTC drivers report the maximum
> supported alarm timer offset. The code setting alarm timers can then
> decide if it wants to reject setting alarm timers to a larger value, if it
> wants to implement recurring alarms until the actually requested alarm
> time is met, or if it wants to accept the limited alarm time.
>
> Only introduce the necessary variable into struct rtc_device.
> Code to set and use the variable will follow with subsequent patches.
>
> Cc: Brian Norris <briannorris@...omium.org>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
I guess it is a bit late to get the series into v6.6, but would it be
possible to apply it to a -next branch to get some more test coverage ?
Either case, do you have any additional comments / feedback ?
Thanks,
Guenter
> ---
> v2: Rename range_max_offset -> alarm_offset_max
>
> include/linux/rtc.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/rtc.h b/include/linux/rtc.h
> index 1fd9c6a21ebe..4c0bcbeb1f00 100644
> --- a/include/linux/rtc.h
> +++ b/include/linux/rtc.h
> @@ -146,6 +146,7 @@ struct rtc_device {
>
> time64_t range_min;
> timeu64_t range_max;
> + timeu64_t alarm_offset_max;
> time64_t start_secs;
> time64_t offset_secs;
> bool set_start_time;
Powered by blists - more mailing lists