# \[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 
- List: linux-usb
- Page: https://ratatoskr.run/linux-usb/2021/10/8879327
- Thread: https://ratatoskr.run/linux-usb/2021/10/8879327/t.md

```text
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.
```
