Re: [PATCH] remove BKL from drivers' release functions

Alan Cox
2001-11-29T01:40:16Z

> Does everyone agree that we need to get the BKL out of common areas like
> this? For starters, what about adding a pair of spinlocks for block

Ideally the BKL itself should die.

> devices and character devices to take the place of the BKL in
> serializing opens? Or, should we make it the driver's responsibility
> completely?

It needs to be the drivers job, to be documented as such and to be
implemented properly in some drivers. In paticular there are some extremely
interesting closedown races in existing drivers where it goes

CPU1 CPU2
release
[do slow thing]
open
ioctl
setting stuff up
slow thing done
trash the chip setup
turn the chip off
return
ouch bang splat Oops!!!

Alan