[PATCH 03/18] staging: xillybus: Non-interruptible mutex_lock() on release method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Responding to an interrupt while handling the "release" method can't end
well anyhow. In practical cases, this can force the user to wait up to
one second while flushing remaining data is attempted (a timeout on the flush
mechanism limits the time for flushing).

Suggested-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Eli Billauer <eli.billauer@xxxxxxxxx>
---
 drivers/staging/xillybus/xillybus_core.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c
index 61699fa..3e14198 100644
--- a/drivers/staging/xillybus/xillybus_core.c
+++ b/drivers/staging/xillybus/xillybus_core.c
@@ -1588,7 +1588,6 @@ unlock_wr:
 
 static int xillybus_release(struct inode *inode, struct file *filp)
 {
-	int rc;
 	unsigned long flags;
 	struct xilly_channel *channel = filp->private_data;
 
@@ -1599,13 +1598,7 @@ static int xillybus_release(struct inode *inode, struct file *filp)
 		return -EIO;
 
 	if (filp->f_mode & FMODE_WRITE) {
-		rc = mutex_lock_interruptible(&channel->rd_mutex);
-
-		if (rc) {
-			dev_warn(channel->endpoint->dev,
-				 "Failed to close file. Hardware left in messy state.\n");
-			return rc;
-		}
+		mutex_lock(&channel->rd_mutex);
 
 		channel->rd_ref_count--;
 
@@ -1625,12 +1618,7 @@ static int xillybus_release(struct inode *inode, struct file *filp)
 	}
 
 	if (filp->f_mode & FMODE_READ) {
-		rc = mutex_lock_interruptible(&channel->wr_mutex);
-		if (rc) {
-			dev_warn(channel->endpoint->dev,
-				 "Failed to close file. Hardware left in messy state.\n");
-			return rc;
-		}
+		mutex_lock(&channel->wr_mutex);
 
 		channel->wr_ref_count--;
 
-- 
1.7.2.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux