Re: [PATCH 1/2] rtc-ds1511: Fix races around device registration

From: Atsushi Nemoto
Date: Mon Oct 12 2009 - 13:06:26 EST


On Mon, 12 Oct 2009 18:47:39 +0200, Alessandro Zummo <alessandro.zummo@xxxxxxxxxxxx> wrote:
> > * Call dev_set_drvdata before rtc device creation
> > * Use its own spinlock instead of rtc->irq_lock
>
> why?

Because pdata->rtc must be initialized to use the irq_lock
(pdata->rtc->irq_lock). There is a small window which rtc methods can
be called before pdata->rtc is initialized.

And there is no need use the irq_lock to protect hardware registers.
The driver's own spinlock shoule be enough.

---
Atsushi Nemoto
--
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/