Re: [rtc-linux] [patch 2.6.26-rc7] rtc_read_alarm() handleswraparound

From: Alessandro Zummo
Date: Wed Jun 25 2008 - 04:59:25 EST


On Sun, 22 Jun 2008 20:42:13 -0700
David Brownell <david-b@xxxxxxxxxxx> wrote:

> While 0e36a9a4a788e4e92407774df76c545910810d35 made sure that active
> alarms were never returned with invalid "wildcard" fields (negative),
> it can still report (wrongly) that the alarm triggers in the past.
>
> Example, if it's now 10am, an alarm firing at 5am will be triggered
> TOMORROW not today. (Which may also be next month or next year...)
>
> This updates that alarm handling in three ways:
>
> * Handle alarm rollover in the common cases of RTCs that don't
> support matching on all date fields.
>
> * Skip the invalid-field logic when it's not needed.
>
> * Minor bugfix ... tm_isdst should be ignored, it's one of the
> fields Linux doesn't maintain.
>
> A warning is emitted for some of the unhandled rollover cases, but
> the possible combinations are a bit too numerous to handle every
> bit of potential hardware and firmware braindamage.
>
> Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

Acked-by: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>

--

Best regards,

Alessandro Zummo,
Tower Technologies - Torino, Italy

http://www.towertech.it

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/