Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fsi: sbefifo: Use interruptible mutex locking

Some SBE operations have extremely large responses and can require
several minutes to process the response. During this time, the device
lock must be held. If another process attempts an operation, it will
wait for the mutex for longer than the kernel hung task watchdog
allows. Therefore, use the interruptible function to lock the mutex.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20210803213016.44739-1-eajames@linux.ibm.com
Signed-off-by: Joel Stanley <joel@jms.id.au>

authored by

Eddie James and committed by
Joel Stanley
7cc2f34e 82628034

+9 -3
+9 -3
drivers/fsi/fsi-sbefifo.c
··· 752 752 iov_iter_kvec(&resp_iter, WRITE, &resp_iov, 1, rbytes); 753 753 754 754 /* Perform the command */ 755 - mutex_lock(&sbefifo->lock); 755 + rc = mutex_lock_interruptible(&sbefifo->lock); 756 + if (rc) 757 + return rc; 756 758 rc = __sbefifo_submit(sbefifo, command, cmd_len, &resp_iter); 757 759 mutex_unlock(&sbefifo->lock); 758 760 ··· 834 832 iov_iter_init(&resp_iter, WRITE, &resp_iov, 1, len); 835 833 836 834 /* Perform the command */ 837 - mutex_lock(&sbefifo->lock); 835 + rc = mutex_lock_interruptible(&sbefifo->lock); 836 + if (rc) 837 + goto bail; 838 838 rc = __sbefifo_submit(sbefifo, user->pending_cmd, cmd_len, &resp_iter); 839 839 mutex_unlock(&sbefifo->lock); 840 840 if (rc < 0) ··· 891 887 user->pending_len = 0; 892 888 893 889 /* Trigger reset request */ 894 - mutex_lock(&sbefifo->lock); 890 + rc = mutex_lock_interruptible(&sbefifo->lock); 891 + if (rc) 892 + goto bail; 895 893 rc = sbefifo_request_reset(user->sbefifo); 896 894 mutex_unlock(&sbefifo->lock); 897 895 if (rc == 0)