]> git.baikalelectronics.ru Git - kernel.git/commit
uio: change to use the mutex lock instead of the spin lock
authorXiubo Li <xiubli@redhat.com>
Sat, 7 Jul 2018 02:05:38 +0000 (22:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jul 2018 14:57:35 +0000 (16:57 +0200)
commitce20b2a7f295174d004a6a3c5faedb81e1de2792
treeadc110b102263f523ddf3848f9e57bedb64c0c66
parent05e93ffd8f1804f03b83b942c5c528c8eff4c923
uio: change to use the mutex lock instead of the spin lock

We are hitting a regression with the following commit:

commit 01f856da8ad584d967f54a60170c47748c839dde
Author: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Date:   Mon May 14 13:32:23 2018 +1200

    uio: Prevent device destruction while fds are open

The problem is the addition of spin_lock_irqsave in uio_write. This
leads to hitting  uio_write -> copy_from_user -> _copy_from_user ->
might_fault and the logs filling up with sleeping warnings.

I also noticed some uio drivers allocate memory, sleep, grab mutexes
from callouts like open() and release and uio is now doing
spin_lock_irqsave while calling them.

Reported-by: Mike Christie <mchristi@redhat.com>
CC: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Reviewed-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio.c
include/linux/uio_driver.h