Re: [PATCH] cris: gpio: do not callcopy_to_user()/copy_from_user() while holding spinlocks
From: Vasiliy Kulikov
Date: Mon Aug 02 2010 - 08:47:19 EST
On Mon, Aug 02, 2010 at 13:33 +0200, Jesper Nilsson wrote:
> On Thu, Jul 29, 2010 at 03:32:18PM +0200, Kulikov Vasiliy wrote:
> > copy_to_user()/copy_from_user() must not be used with spinlocks held.
> > Move all cases of interaction with userspace out of global switch and
> > lock spinlocks only where they are needed.
> Thanks, but I'm thinking we should move the spinlock inside each case instead,
> as in the below patch.
> Unless there's any protests I'll add it to the cris-tree in the next couple of days:
I'm fine with this.
> CRIS: gpio: don't call copy_to_user()/copy_from_user() while holding spinlocks
> copy_to_user()/copy_from_user() must not be used with spinlocks held.
> Move locks inside each case so we have better control of when the locks
> are held.
> Also, since we use spinlocks, we don't need to hold the BKL, so remove it.
> Reported-by: Kulikov Vasiliy <segooon@xxxxxxxxx>
> Signed-off-by: Jesper Nilsson <jesper.nilsson@xxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/