[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070326203017.GA4014@infomag.infomag.iguana.be>
Date: Mon, 26 Mar 2007 22:30:17 +0200
From: Wim Van Sebroeck <wim@...ana.be>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: Semi-typical watchdog bug re early misc_register()
Hi Alexey,
> It seems that some watchdog drivers are doing following mistake:
>
> rv = misc_register();
> if (rv < 0)
> return rv;
> rv = request_region();
> if (rv < 0) {
> misc_deregister();
> return rv;
> }
>
> But, right after misc_register() returns, misc device can be opened and
> ioctls interacting with hardware issued, and driver can do outb() to
> port it doesn't own yet, because request_region() is still pending.
Totally agree. patch has been added to linux-2.6-watchdog-mm tree.
> Also, is there similar ordering between register_reboot_notifier() and
> misc_register() ? Some drivers do misc_register() last, some register
> reboot notifiers.
I prefer that the reboot notifiers are loaded before you give userspace the
ability to communicate with the driver.
Greetings,
Wim.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists