[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240730125754.576326-1-quic_prashk@quicinc.com>
Date: Tue, 30 Jul 2024 18:27:54 +0530
From: Prashanth K <quic_prashk@...cinc.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: <linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>,
Prashanth K
<quic_prashk@...cinc.com>, <stable@...r.kernel.org>
Subject: [PATCH] usb: gadget: u_serial: Set start_delayed during suspend
Upstream commit aba3a8d01d62 ("usb: gadget: u_serial: add suspend
resume callbacks") added started_delayed flag, so that new ports
which are opened after USB suspend can start IO while resuming.
But if the port was already opened, and gadget suspend kicks in
afterwards, start_delayed will never be set. This causes resume
to bail out before calling gs_start_io(). Fix this by setting
start_delayed during suspend.
Fixes: aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks")
Cc: <stable@...r.kernel.org>
Signed-off-by: Prashanth K <quic_prashk@...cinc.com>
---
drivers/usb/gadget/function/u_serial.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
index eec7f7a2e40f..b394105e55d6 100644
--- a/drivers/usb/gadget/function/u_serial.c
+++ b/drivers/usb/gadget/function/u_serial.c
@@ -1441,6 +1441,7 @@ void gserial_suspend(struct gserial *gser)
spin_lock(&port->port_lock);
spin_unlock(&serial_port_lock);
port->suspended = true;
+ port->start_delayed = true;
spin_unlock_irqrestore(&port->port_lock, flags);
}
EXPORT_SYMBOL_GPL(gserial_suspend);
--
2.25.1
Powered by blists - more mailing lists