Re: rtc_cmos oops in cmos_rtc_ioctl

From: Herton Ronaldo Krzesinski
Date: Tue Sep 22 2009 - 14:15:44 EST


Em Ter 22 Set 2009, às 07:40:41, Alessandro Zummo escreveu:
> On Mon, 21 Sep 2009 15:53:38 -0300
> Herton Ronaldo Krzesinski <herton@xxxxxxxxxxxxxxx> wrote:
>
> > The problem here is the rtc char device being created early and acessible before
> > rtc_cmos does dev_set_drvdata(dev, &cmos_rtc), so dev_get_drvdata in
> > cmos_rtc_ioctl can return null, like in this example where hwclock is run right
> > after char device creation that triggers the udev rule:
> > ACTION=="add", SUBSYSTEM=="rtc", RUN+="/sbin/hwclock --hctosys --rtc=/dev/%k"
> > And makes the oops possible, in this case hwclock looks to open and close the
> > device fast enough.
>
> right. the best option would be to use the new irq api that was
> introduced after the creation of rtc_cmos (and thus remove the whole
> ioctl routine).
>
> [...]

Something like this?: