From 5f6df08acda147b4d6f7bd6cf84fd963e03a88fc Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Fri, 19 Nov 2010 18:10:58 -0800 Subject: [PATCH] mdm6600: Enable the wake irq when ttyUSB4 is suspended Instead of enabling it when the first opened port is suspended. It is working because the modem only triggers this interrupt when all ttys are suspended and the bus is suspended. This fixes an issue when mdm6600_suspended_ports is not reset to 0 after a disconnect/attach and the irq is never enabled. Change-Id: I2a1a020ccd510b8c57c9f0b56988cb6de8aaff15 Signed-off-by: Benoit Goby --- drivers/usb/serial/mdm6600.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/mdm6600.c b/drivers/usb/serial/mdm6600.c index 43f5b3cc607f..cf791c3f0116 100644 --- a/drivers/usb/serial/mdm6600.c +++ b/drivers/usb/serial/mdm6600.c @@ -106,7 +106,6 @@ static int mdm6600_wake_irq; * changed if other ttyUSB have been registered before. */ static int mdm6600_attached_ports; -static int mdm6600_suspended_ports; static void mdm6600_read_bulk_work(struct work_struct *work); static void mdm6600_read_bulk_cb(struct urb *urb); @@ -801,11 +800,12 @@ static int mdm6600_suspend(struct usb_interface *intf, pm_message_t message) spin_lock_irq(&modem->susp_lock); - if (!modem->susp_count++ && modem->opened) { - if (!mdm6600_suspended_ports++) - enable_irq(mdm6600_wake_irq); + if (modem->number == MODEM_INTERFACE_NUM) + enable_irq(mdm6600_wake_irq); + if (!modem->susp_count++ && modem->opened) { spin_unlock_irq(&modem->susp_lock); + dbg("%s: kill urbs", __func__); mdm6600_kill_urbs(modem); return 0; @@ -826,10 +826,10 @@ static int mdm6600_resume(struct usb_interface *intf) spin_lock_irq(&modem->susp_lock); - if (!--modem->susp_count && modem->opened) { - if (!--mdm6600_suspended_ports) - disable_irq(mdm6600_wake_irq); + if (modem->number == MODEM_INTERFACE_NUM) + disable_irq(mdm6600_wake_irq); + if (!--modem->susp_count && modem->opened) { dbg("%s: submit urbs", __func__); spin_unlock_irq(&modem->susp_lock); -- 2.34.1