[Bug 210425] Plugging in or unplugging power cord while system is suspended does not trigger updates

From
<hidden>
Date
2021-10-29 19:28:02
https://bugzilla.kernel.org/show_bug.cgi?id=210425
--- Comment #7 from Méven Car (meven29@gmail.com) ---
I have this naive patch that fix the main issue:
diff --git drivers/usb/typec/ucsi/ucsi.c drivers/usb/typec/ucsi/ucsi.c
index d0c63afaf345..a679359c98be 100644
--- drivers/usb/typec/ucsi/ucsi.c
+++ drivers/usb/typec/ucsi/ucsi.c
@@ -187,11 +187,22 @@ EXPORT_SYMBOL_GPL(ucsi_send_command);
 int ucsi_resume(struct ucsi *ucsi)
 {
        u64 command;
+       int ret;
+       int i;

        /* Restore UCSI notification enable mask after system resume */
        command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;

-       return ucsi_send_command(ucsi, command, NULL, 0);
+       ret = ucsi_send_command(ucsi, command, NULL, 0);
+       if (ret)
+               return ret;
+
+       /* update all connectors */
+       for (i = 0; i < ucsi->cap.num_connectors; i++) {
+               ucsi_connector_change(ucsi, i);
+       }
+
+       return ret;
 }
 EXPORT_SYMBOL_GPL(ucsi_resume);
 /* --------------------------------------------------------------------------
*/


Will probably post to LKML

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
Thread (1 message) 1 message, 1 author, last reply 2021-10-29
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help