mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
UPSTREAM: usb: typec: ucsi: Clear pending after acking connector change
It's possible that the interrupt handler for the UCSI driver signals a connector changes after the handler clears the PENDING bit, but before it has sent the acknowledge request. The result is that the handler is invoked yet again, to ack the same connector change. At least some versions of the Qualcomm UCSI firmware will not handle the second - "spurious" - acknowledgment gracefully. So make sure to not clear the pending flag until the change is acknowledged. Any connector changes coming in after the acknowledgment, that would have the pending flag incorrectly cleared, would afaict be covered by the subsequent connector status check. Fixes:217504a055("usb: typec: ucsi: Work around PPM losing change information") Cc: stable <stable@vger.kernel.org> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-By: Benjamin Berg <bberg@redhat.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20210516040953.622409-1-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit8c9b3caab3) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I142eb812234d8c0960a69c683cb5cec9033acdc9
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
37af541faf
commit
b6996d317c
@@ -717,8 +717,8 @@ static void ucsi_handle_connector_change(struct work_struct *work)
|
||||
ucsi_send_command(con->ucsi, command, NULL, 0);
|
||||
|
||||
/* 3. ACK connector change */
|
||||
clear_bit(EVENT_PENDING, &ucsi->flags);
|
||||
ret = ucsi_acknowledge_connector_change(ucsi);
|
||||
clear_bit(EVENT_PENDING, &ucsi->flags);
|
||||
if (ret) {
|
||||
dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret);
|
||||
goto out_unlock;
|
||||
|
||||
Reference in New Issue
Block a user