public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* usb: typec: ucsi: Clear EVENT_PENDING bit if ucsi_send_command fails
@ 2023-09-11  9:04 Prashanth K
  2023-09-11 12:49 ` Heikki Krogerus
  2023-09-18 14:26 ` Heikki Krogerus
  0 siblings, 2 replies; 10+ messages in thread
From: Prashanth K @ 2023-09-11  9:04 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Prashanth K, # 5 . 16

Currently if ucsi_send_command() fails, then we bail out without
clearing EVENT_PENDING flag. So when the next connector change
event comes, ucsi_connector_change() won't queue the con->work,
because of which none of the new events will be processed.

Fix this by clearing EVENT_PENDING flag if ucsi_send_command()
fails.

Cc: <stable@vger.kernel.org> # 5.16
Fixes: 512df95b9432 ("usb: typec: ucsi: Better fix for missing unplug events issue")
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index c6dfe3d..509c67c 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -884,6 +884,7 @@ static void ucsi_handle_connector_change(struct work_struct *work)
 	if (ret < 0) {
 		dev_err(ucsi->dev, "%s: GET_CONNECTOR_STATUS failed (%d)\n",
 			__func__, ret);
+		clear_bit(EVENT_PENDING, &con->ucsi->flags);
 		goto out_unlock;
 	}
 
-- 
2.7.4


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

end of thread, other threads:[~2023-09-18 16:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11  9:04 usb: typec: ucsi: Clear EVENT_PENDING bit if ucsi_send_command fails Prashanth K
2023-09-11 12:49 ` Heikki Krogerus
2023-09-12 11:07   ` Prashanth K
2023-09-15 12:32     ` Heikki Krogerus
2023-09-15 13:40       ` Prashanth K
2023-09-15 13:57         ` Heikki Krogerus
2023-09-16  8:28           ` Prashanth K
2023-09-18 14:25             ` Heikki Krogerus
2023-09-18 15:18               ` Prashanth K
2023-09-18 14:26 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox