[PATCH 07/16] USB: cypress_m8: only wake up MSR queue on changes

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

 



Only wake up MSR wait queue on actual modem-status changes.

Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
---
 drivers/usb/serial/cypress_m8.c | 5 ++++-
 drivers/usb/serial/cypress_m8.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 558605d646f3..07e003398613 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -1187,7 +1187,10 @@ static void cypress_read_int_callback(struct urb *urb)
 	if (priv->current_status != priv->prev_status) {
 		priv->diff_status |= priv->current_status ^
 			priv->prev_status;
-		wake_up_interruptible(&port->port.delta_msr_wait);
+
+		if (priv->diff_status & UART_MSR_MASK)
+			wake_up_interruptible(&port->port.delta_msr_wait);
+
 		priv->prev_status = priv->current_status;
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h
index 68bfd5197a63..119d2e17077b 100644
--- a/drivers/usb/serial/cypress_m8.h
+++ b/drivers/usb/serial/cypress_m8.h
@@ -66,6 +66,7 @@
 #define CONTROL_RTS	0x10	/* request to send */
 #define CONTROL_RESET	0x08	/* sent with output report */
 
+#define UART_MSR_MASK	0xf0
 #define UART_RI		0x80	/* ring indicator */
 #define UART_CD		0x40	/* carrier detect */
 #define UART_DSR	0x20	/* data set ready */
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux