]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: gadget: u_serial: Set start_delayed during suspend
authorPrashanth K <quic_prashk@quicinc.com>
Tue, 30 Jul 2024 12:57:54 +0000 (18:27 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2024 08:39:54 +0000 (10:39 +0200)
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@vger.kernel.org
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Link: https://lore.kernel.org/r/20240730125754.576326-1-quic_prashk@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/u_serial.c

index eec7f7a2e40f08bb2e002c9014a21136439d756c..b394105e55d6cc783c8dc93bfa90e991d122519b 100644 (file)
@@ -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);