linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response
@ 2024-11-04  8:50 Stanislaw Gruszka
  2024-11-04  8:50 ` [PATCH 2/3] usb: misc: ljca: set small runtime autosuspend delay Stanislaw Gruszka
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Stanislaw Gruszka @ 2024-11-04  8:50 UTC (permalink / raw)
  To: linux-usb; +Cc: Wentong Wu, Sakari Ailus

Do not mark interface as ready to suspend when we are still waiting
for response messages from the device.

Fixes: acd6199f195d ("usb: Add support for Intel LJCA device")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
---
 drivers/usb/misc/usb-ljca.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c
index 01ceafc4ab78..dcb3c5d248ac 100644
--- a/drivers/usb/misc/usb-ljca.c
+++ b/drivers/usb/misc/usb-ljca.c
@@ -332,9 +332,6 @@ static int ljca_send(struct ljca_adapter *adap, u8 type, u8 cmd,
 
 	ret = usb_bulk_msg(adap->usb_dev, adap->tx_pipe, header,
 			   msg_len, &transferred, LJCA_WRITE_TIMEOUT_MS);
-
-	usb_autopm_put_interface(adap->intf);
-
 	if (ret < 0)
 		goto out;
 	if (transferred != msg_len) {
@@ -353,6 +350,8 @@ static int ljca_send(struct ljca_adapter *adap, u8 type, u8 cmd,
 	ret = adap->actual_length;
 
 out:
+	usb_autopm_put_interface(adap->intf);
+
 	spin_lock_irqsave(&adap->lock, flags);
 	adap->ex_buf = NULL;
 	adap->ex_buf_len = 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-11-05 14:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04  8:50 [PATCH 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Stanislaw Gruszka
2024-11-04  8:50 ` [PATCH 2/3] usb: misc: ljca: set small runtime autosuspend delay Stanislaw Gruszka
2024-11-04 13:50   ` Hans de Goede
2024-11-05 14:42     ` Stanislaw Gruszka
2024-11-04 15:13   ` Sakari Ailus
2024-11-05  6:41     ` Stanislaw Gruszka
2024-11-04  8:50 ` [PATCH 3/3] usb: misc: ljca: print firmware version Stanislaw Gruszka
2024-11-04 13:51   ` Hans de Goede
2024-11-04 22:32   ` Sakari Ailus
2024-11-04 13:39 ` [PATCH 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Hans de Goede
2024-11-04 14:37   ` Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).