Skip to content

Commit

Permalink
usb: typec: ucsi: Clear EVENT_PENDING bit if ucsi_send_command fails
Browse files Browse the repository at this point in the history
commit a00e197 upstream.

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: [email protected] # 5.16
Fixes: 512df95 ("usb: typec: ucsi: Better fix for missing unplug events issue")
Signed-off-by: Prashanth K <[email protected]>
Acked-by: Heikki Krogerus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Prashanth K authored and gregkh committed Oct 19, 2023
1 parent 522b7d7 commit 3039b7d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/typec/ucsi/ucsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,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;
}

Expand Down

0 comments on commit 3039b7d

Please sign in to comment.