From nobody Tue Apr 7 06:27:19 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0C6720C038 for ; Sun, 15 Mar 2026 22:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773614079; cv=none; b=SpoAi3YVE58EY/at40pz41Z2PQfNH4l7ZdwpNa7lVHTAqD/92qAEmAohq+H/Favgw9HaJeY78dZddzUh7z2aQMJ0gGrdFkChvSFUL3CTC6DfPwNyT6TrrFlo9Dj0Vx/iQD8s/9AEwoZSK/FXvIovhd18M8oMstgDkpwpFZe/Zik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773614079; c=relaxed/simple; bh=hAz0ibag7bUIPe9VwHZNmnJA1+qUWoSc81esR02kZZU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=itAhOmNRhLg9N0fMMKwMwkVLmS4PJ/y+L9mahegJEIshUAVvozwLuRq8ZnhLgM2kaBR8QutlWdJV7ETXxJzb9yRqR6rNu5vM2w1yDxgqsmkcvD/lLgoypT8CNLzEsea/ZZNvrBQ2wAkUQv4onhI9QasF2lQ1SJiwIs41q+IUzZY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=starlabs.systems; spf=pass smtp.mailfrom=starlabs.systems; dkim=pass (2048-bit key) header.d=starlabs-systems.20230601.gappssmtp.com header.i=@starlabs-systems.20230601.gappssmtp.com header.b=b5T4Vr2R; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=starlabs.systems Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starlabs.systems Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=starlabs-systems.20230601.gappssmtp.com header.i=@starlabs-systems.20230601.gappssmtp.com header.b="b5T4Vr2R" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-48534b59cf3so34922895e9.2 for ; Sun, 15 Mar 2026 15:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20230601.gappssmtp.com; s=20230601; t=1773614076; x=1774218876; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kHszhjlpTaqduGutGNkiYLzruvsG77pTCC6OqoYXjFk=; b=b5T4Vr2ROEW3JVNgBX2qE3mraXLC5mTdwRXgZT/QNTHfWw9SIqEf4bALcAuJmqeVLh YKUHMljQjXPZt2h+hx1FaBr8WXDV3gQYzaGvJeIW1OlnitYuChSaUd60Yixf8+KT70qP NAQB01pyQRwUReX58LCCpYusEHDsyfxZlU3WPsxB6bkhn1ZT50fZPCUMp/KLMm34LhER yikItIEbdkYgy4f/09kp/dmrojvjWH5d3I9xiQzUhvDLSy6XJfB/nbcMm/kbQePUhgKg 71/nPm91X1j305yU7phbk+xGm2W5U2Z9BmPrvedE0zAw4zcvF9+zE5BomsJXvDrlNuve v3AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773614076; x=1774218876; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kHszhjlpTaqduGutGNkiYLzruvsG77pTCC6OqoYXjFk=; b=JDIZDpL5lGpFAzuiCUnxFShnDLtUZCveyg6gyXdIFoUCejbER3jizvYGyibiC+F4xx Xdfx/bUMVHF9LdMEwhNpnxEGmWT88OgvegVXoQjgm0CeA78b6wsQpTwfQSKWrCngKnVm l+Qd4VTyEkPYLYpY4Pe8R6EqU1uVbkeaBaeyYu4KCN/XuYO9AzZTeyG2KYFzuhKYOFoD 4Je68VUoKos33R6Sn2ImbBYXPGG/NRkDp7/Iv2hvQE56BLvXOW46RBcQ0cmMx/bAf+OV UulNEXE8dRAAkouFzWiYBNWZCxyXCG7wGAYpnhWVKCvw5XT3o85hFYbR2k2JlhpayKcg L/IQ== X-Forwarded-Encrypted: i=1; AJvYcCUc1GSINbwNQj6dvQahT24S3vnSpfT/X00vSHdIKmtfg3QwZHpny5+AnDmO/A/qrOqGWK1/jgQUukOCzK4=@vger.kernel.org X-Gm-Message-State: AOJu0YxkrYZe9rQZEJR0I2quCYPsKJvoUjPw7gXqxWHVPWtEnFWYi+gT 7T0n25Q35POVJ0V1HT+23wbqN64mZb9iK6d7GF9EpnYh/TFLcO31qQRMpOw5lAtMVw== X-Gm-Gg: ATEYQzxYyRPWh9emPebXYZOhpibHKNcht9OgklwmsP/4+kXO18/1xEAjOjs4lBXOqDQ Spq3l2lKMiIapMHPmz94jy5R7W0yrreAe6wZY+Be83ElBHQhe0udzm1NxmEsKXhvJRY2ZPLX35Z 0+UqVHXVRKQFiB+WKZaXWvpioBb38vEx+9KwZbDX2iHbIUtJjODihsTKn97xT423ffkvMZy3SLV vb8+VFCtOHEuZeAnGj/F8LbrScUah/DQnnRAfPsOuyHvoU4tABBQXnXAcLfHiuIjTD8D6ysHvP8 yrStJ7Mxb09wnOmQdOkvDsP3ctJJlTJzVkoG15uERPTaCIIzohy9B2NO9ieKq+JL84TCQE/euzP 91HMEcfDoK58V3L8o81XhCAV0EcPUTlwiUnisDPXxCJthW7xLAJ80kUzQ+n8dMUEPYI4JBEQfrf dQvIiyH6D0Z3qbwzpgF7Dw50SIsTfgtLX8uiMthLXGd5FBn4L2kkc= X-Received: by 2002:a05:600c:4f8f:b0:485:40c6:f507 with SMTP id 5b1f17b1804b1-48556711c6cmr203900915e9.30.1773614075520; Sun, 15 Mar 2026 15:34:35 -0700 (PDT) Received: from starbook ([217.155.46.38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48556433b94sm76294215e9.11.2026.03.15.15.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 15:34:34 -0700 (PDT) From: Sean Rhodes To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: core: allow ACPI-managed hard-wired ports to power off Date: Sun, 15 Mar 2026 22:34:33 +0000 Message-ID: <20260315223433.23452-1-sean@starlabs.systems> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- drivers/usb/core/port.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index f54198171b6a..6445d05a33be 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -21,6 +21,20 @@ static int usb_port_block_power_off; =20 static const struct attribute_group *port_dev_group[]; =20 +static bool usb_port_allow_power_off(struct usb_device *hdev, + struct usb_hub *hub, + struct usb_port *port_dev) +{ + if (hub_is_port_power_switchable(hub)) + return true; + + if (!IS_ENABLED(CONFIG_ACPI)) + return false; + + return port_dev->connect_type =3D=3D USB_PORT_CONNECT_TYPE_HARD_WIRED && + usb_acpi_power_manageable(hdev, port_dev->portnum - 1); +} + static ssize_t early_stop_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -805,10 +819,10 @@ int usb_hub_create_port_device(struct usb_hub *hub, i= nt port1) device_enable_async_suspend(&port_dev->dev); =20 /* - * Keep hidden the ability to enable port-poweroff if the hub - * does not support power switching. + * Keep hidden the ability to enable port-poweroff if neither the + * USB hub nor platform firmware can manage downstream port power. */ - if (!hub_is_port_power_switchable(hub)) + if (!usb_port_allow_power_off(hdev, hub, port_dev)) return 0; =20 /* Attempt to let userspace take over the policy. */ --=20 2.51.0