* [PATCH] usb: typec: ucsi: Update power_supply on power role change
@ 2025-07-21 6:32 Myrrh Periwinkle
2025-07-21 9:48 ` Heikki Krogerus
0 siblings, 1 reply; 2+ messages in thread
From: Myrrh Periwinkle @ 2025-07-21 6:32 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, stable, Myrrh Periwinkle
The current power direction of an USB-C port also influences the
power_supply's online status, so a power role change should also update
the power_supply.
Fixes an issue on some systems where plugging in a normal USB device in
for the first time after a reboot will cause upower to erroneously
consider the system to be connected to AC power.
Cc: stable@vger.kernel.org
Fixes: 0e6371fbfba3 ("usb: typec: ucsi: Report power supply changes")
Signed-off-by: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
---
drivers/usb/typec/ucsi/ucsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 01ce858a1a2b3466155db340e213c767d1e79479..8ff31963970bb384e28b460e5307e32cf421396b 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1246,6 +1246,7 @@ static void ucsi_handle_connector_change(struct work_struct *work)
if (change & UCSI_CONSTAT_POWER_DIR_CHANGE) {
typec_set_pwr_role(con->port, role);
+ ucsi_port_psy_changed(con);
/* Complete pending power role swap */
if (!completion_done(&con->complete))
---
base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
change-id: 20250721-fix-ucsi-pwr-dir-notify-8a953aab42e5
Best regards,
--
Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] usb: typec: ucsi: Update power_supply on power role change
2025-07-21 6:32 [PATCH] usb: typec: ucsi: Update power_supply on power role change Myrrh Periwinkle
@ 2025-07-21 9:48 ` Heikki Krogerus
0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2025-07-21 9:48 UTC (permalink / raw)
To: Myrrh Periwinkle; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, stable
On Mon, Jul 21, 2025 at 01:32:51PM +0700, Myrrh Periwinkle wrote:
> The current power direction of an USB-C port also influences the
> power_supply's online status, so a power role change should also update
> the power_supply.
>
> Fixes an issue on some systems where plugging in a normal USB device in
> for the first time after a reboot will cause upower to erroneously
> consider the system to be connected to AC power.
>
> Cc: stable@vger.kernel.org
> Fixes: 0e6371fbfba3 ("usb: typec: ucsi: Report power supply changes")
> Signed-off-by: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/ucsi/ucsi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 01ce858a1a2b3466155db340e213c767d1e79479..8ff31963970bb384e28b460e5307e32cf421396b 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1246,6 +1246,7 @@ static void ucsi_handle_connector_change(struct work_struct *work)
>
> if (change & UCSI_CONSTAT_POWER_DIR_CHANGE) {
> typec_set_pwr_role(con->port, role);
> + ucsi_port_psy_changed(con);
>
> /* Complete pending power role swap */
> if (!completion_done(&con->complete))
>
> ---
> base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
> change-id: 20250721-fix-ucsi-pwr-dir-notify-8a953aab42e5
>
> Best regards,
> --
> Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
--
heikki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-21 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-21 6:32 [PATCH] usb: typec: ucsi: Update power_supply on power role change Myrrh Periwinkle
2025-07-21 9:48 ` Heikki Krogerus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®