Porting 2.6.32 driver to 3.0, what to do about BKL?

Nikolaus Rath Nikolaus at rath.org
Wed Mar 28 15:41:30 EDT 2012


Hello,

I'm trying to update a third-party driver for kernel 2.6.32 to kernel
3.x and struggling with the BKL.

I have replaced the .ioctl field in struct file_operations with
.unlocked_ioctl, and removed the inode parameter from the handler
function.

However, I am unsure what (if any) locks I need to take now that the
function will be called without the BKL.

Can someone give me some guidance? How do I recognize where I need to
add a lock?

The driver calls the following kernel functions:

COPY_FROM_USER
writel
readl
list_empty_careful
spin_lock, spin_unlock
set_bit
udelay
init_waitqueue_head
wait_event_interruptible_timeout
wake_up_interruptible
disable_irq_nosync
local_irq_disable
enable_irq


Thanks,

   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C



More information about the Kernelnewbies mailing list