lkml.org 
[lkml]   [2008]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH, RFC] char dev BKL pushdown
Date
On Friday 16 May 2008, Jonathan Corbet wrote:

> ...and so that's what I've done. My approach was to find every
> register_chrdev() and cdev_add() call, look at the associated
> file_operations, then go back to the open() function, if any.

Note that the majority of drivers use (grep suggests up to 165
of them) uses misc_register instead of register_chrdev/cdev_add.
Your patches are still correct, because you pushed the BKL into the
misc_open function, but there is an obvious next step in pushing
it further into the misc drivers.
There are probably a few more subsystems with minor number specific
open() functions, misc is just the obvious one.

> > ...and so that's what I've done.  My approach was to find every
> register_chrdev() and cdev_add() call, look at the associated
> file_operations, then go back to the open() function, if any.  Unless it
> was almost immediately obvious to me that the function was either (1) so
> trivial as to not require locking (quite few of them are "return 0;"), or
> (2) clearly doing its own locking, I wrapped the code in the BKL.
>
> Finally, I removed the BKL from chrdev_open().

In your current git tree, this change is no longer the final one, so
bisecting the series may cause other bugs. You should probably reorder
the patches at some point to avoid this.

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

\
 
 \ /
  Last update: 2008-05-17 23:19    [W:0.149 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site