Re: [rtc-linux] [PATCH 6/6] rtc/mc13783: implement alarm

From: Uwe Kleine-König
Date: Mon Mar 01 2010 - 06:10:22 EST


On Mon, Mar 01, 2010 at 11:56:25AM +0100, Alessandro Zummo wrote:
> On Mon, 1 Mar 2010 11:53:45 +0100
> Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
>
> > for now this just ignores the possible race to trigger an alarm when
> > setting the time. Should I resolve that, if so, what is the prefered
> > way to do that?
>
> I saw you email on the topic but I haven't had
> the time to answer appropriately.
>
> I'd suggest to disable the alarm irq while setting
> the time.
I have two possibilities, I'm not sure if you mean the first or just any
of the two:

1)
pending = is_alarm_pending
mask_alarm_irq
set time and date
if (!pending)
ack_alarm_irq
unmask_alarm_irq

2)
alarmtime = read_alaram
program_alarm(invalid)
set time and date
program_alarm(alarmtime)

I'd prefer 2), is that OK for you, too?

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
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/