2008-10-09 08:55:46

by David John

[permalink] [raw]
Subject: [PATCH] HPET: Remove the BKL.

Concurrent access is protected by the spin lock hpet_lock. The
BKL is not required.

Signed-off-by: David John <[email protected]>
---
drivers/char/hpet.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index b3f5dbc..00765f9 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -194,7 +194,6 @@ static int hpet_open(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE)
return -EINVAL;

- lock_kernel();
spin_lock_irq(&hpet_lock);

for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
@@ -209,7 +208,6 @@ static int hpet_open(struct inode *inode, struct file *file)

if (!devp) {
spin_unlock_irq(&hpet_lock);
- unlock_kernel();
return -EBUSY;
}

@@ -217,7 +215,6 @@ static int hpet_open(struct inode *inode, struct file *file)
devp->hd_irqdata = 0;
devp->hd_flags |= HPET_OPEN;
spin_unlock_irq(&hpet_lock);
- unlock_kernel();

return 0;
}


2008-10-09 10:31:50

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] HPET: Remove the BKL.

David John <[email protected]> writes:

> Concurrent access is protected by the spin lock hpet_lock. The
> BKL is not required.

You should probably also convert the .ioctl = ... to .unlocked_ioctl.
Otherwise you still got implicit BKL for the ioctls.

-Andi

--
[email protected]

2008-10-09 11:08:26

by David John

[permalink] [raw]
Subject: Re: [PATCH] HPET: Remove the BKL.

Andi Kleen wrote:
> David John <[email protected]> writes:
>
>> Concurrent access is protected by the spin lock hpet_lock. The
>> BKL is not required.
>
> You should probably also convert the .ioctl = ... to .unlocked_ioctl.
> Otherwise you still got implicit BKL for the ioctls.
>
> -Andi
>

Thanks. I'll fix it up.

David.