Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: core: allow ACPI-managed hard-wired ports to power off

USB core only relaxes the default PM_QOS_FLAG_NO_POWER_OFF policy when
an upstream hub reports switchable port power. That misses internal
ports whose power is managed by platform firmware instead of the USB
hub descriptor.

Allow the port-poweroff policy to be exposed for hard-wired ports with
an ACPI-managed power resource. The existing runtime PM path still
requires the child usage count to drop and remote wakeup to be clear
before it will power the port down.

This lets internal devices such as CNVi Bluetooth use the existing USB
ACPI runtime power path even when the root hub reports no USB-standard
port power switching.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Link: https://patch.msgid.link/20260315223433.23452-1-sean@starlabs.systems
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sean Rhodes and committed by
Greg Kroah-Hartman
8020c41b 1f50332c

+17 -3
+17 -3
drivers/usb/core/port.c
··· 21 21 22 22 static const struct attribute_group *port_dev_group[]; 23 23 24 + static bool usb_port_allow_power_off(struct usb_device *hdev, 25 + struct usb_hub *hub, 26 + struct usb_port *port_dev) 27 + { 28 + if (hub_is_port_power_switchable(hub)) 29 + return true; 30 + 31 + if (!IS_ENABLED(CONFIG_ACPI)) 32 + return false; 33 + 34 + return port_dev->connect_type == USB_PORT_CONNECT_TYPE_HARD_WIRED && 35 + usb_acpi_power_manageable(hdev, port_dev->portnum - 1); 36 + } 37 + 24 38 static ssize_t early_stop_show(struct device *dev, 25 39 struct device_attribute *attr, char *buf) 26 40 { ··· 819 805 device_enable_async_suspend(&port_dev->dev); 820 806 821 807 /* 822 - * Keep hidden the ability to enable port-poweroff if the hub 823 - * does not support power switching. 808 + * Keep hidden the ability to enable port-poweroff if neither the 809 + * USB hub nor platform firmware can manage downstream port power. 824 810 */ 825 - if (!hub_is_port_power_switchable(hub)) 811 + if (!usb_port_allow_power_off(hdev, hub, port_dev)) 826 812 return 0; 827 813 828 814 /* Attempt to let userspace take over the policy. */