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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=210425

Méven Car (meven29@xxxxxxxxx) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |meven29@xxxxxxxxx

--- Comment #5 from Méven Car (meven29@xxxxxxxxx) ---
It seems to me `ucsi_resume()` should take into account that connectors can be
plugged-in/out while the system is suspended.

Upon wake-up it should someway scan its connectors and notify userspace then.

Instead resume only hook the notification after the fact and does not check
current state. 

> int ucsi_resume(struct ucsi *ucsi)
> {
>       u64 command;
>
>       /* Restore UCSI notification enable mask after system resume */
>       command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
>
>       return ucsi_send_command(ucsi, command, NULL, 0);
> }

Consequently after suspending, unplugging AC and resuming

> cat /sys/class/power_supply/ucsi-source-psy-USBC000\:001/online
> 1
Regardless of the connector state (re-plugging is not signaled either).
We don't get any `udevadm monitor` notification from the usci subsystem.

AFAICT We should have a call to
"power_supply_changed(usci->connector[i]->psy);" somewhere for the usci
connector concerned resulting from `ucsi_resume` after the connector state has
been updated with `ucsi_handle_connector_change()` for instance. But I don't
know about the work_struct API. 
Either this or a bug in `ucsi_handle_connector_change()` not taking into
account the unplugged-during-suspend usecase. 

I would welcome any code hint to come up with a proper patch or a patch that I
would be happy to test.

My hardware is a DELL XPS 9370.

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

You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux