From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 638F040803C for ; Thu, 9 Jul 2026 09:58:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591101; cv=none; b=K0WtKH3O4XX6qUYudfkJ2aC2oedVGsGc3yAvRQRSxY6NbfyXwrnTVAmmTmSQKFfO6A81x+X8H7a2txPILfGQzBywcfeGGqK5oIjhi+/VJA34pyBsclOtrK2lmu6HPi4rSx2azchcDPPe2nqhdLgiFJ4YhrsyLOt1knOcaOjjuM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591101; c=relaxed/simple; bh=7Id8aIDDawUTH+Vp/qv7geyMCxiyF2kG5OxwY8VhiPc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L3g4svsxztglpAj6R3I8GvdIIOmXtisSv3sIHuU/pgNJF3ulA817TrSCkS5A/O6AWCqHvwtgrDD1TIZJVRTnyIw1bOi5aDJ/AzdROaOuy9PDCV0kzW6uYNs3xADRbwIr/MfBnq7KaEKvd5RbC2GTjXTI1yNsYF2cSWhPUc229wc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=KSX4DIYv; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KSX4DIYv" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2ccf2360620so13412685ad.3 for ; Thu, 09 Jul 2026 02:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1783591099; x=1784195899; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3NOayELjm3/+NeKg/MUGc6Z0GBz34hjktNSI4aLdsWw=; b=KSX4DIYvdXr0E4Hiuh5F79zRFeAR+8NErThzozoUr22068snis6HRCLT0GkSRMEdSv u7TLDsPKJAVGYxCtAQJAAx2LRt6OUzyKOTw2uIJQmiOvSPubkRH57HIJgXfHHBH9II+O wkaYX5FT6YksniRTKUH6JdHhT2Yma3yGWcqIs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783591099; x=1784195899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3NOayELjm3/+NeKg/MUGc6Z0GBz34hjktNSI4aLdsWw=; b=WT+/BpQ1mDjX/U9Gea81ErEpW2Fk7iMF4yrsQUk8eSDQq33rm9dYHX+GyTlF900kUK LSVA0UBPtsLsTVTpVevWIi6035Rz3ZbDHBS6BOU4CetWlZKMy3lGAfpWgmgL9hiP4YTk xUy2A1AmgV0Ji/Vww+pyg398D4cKFEsnNbkTs2e2BfeWmOtZpQ9NcWNwwOQuFdQ2Ce+t j3ZRYDDK8KLYqcHGVNCGV+mFowpl2ZfFvLQ4EvLjUqvx04tiXsF2SfGYI9FxULZFi/tr 2UBnQa4mDCxdzOkFal6pRcFY0S/7ds8sYcuR2p2AfYzF8hbG58B9oSCiEMNZbxPq/QFl AsHQ== X-Forwarded-Encrypted: i=1; AHgh+RomgGNqZzGg8ewCIcDjntwk9QSRAOsAAQt0GSIKiRCwY28n+8YFQ9Pz24e0aXXDvEJn4w7a0OMkeDul@vger.kernel.org X-Gm-Message-State: AOJu0YwWpMc3erWxE6t4fDvxMFlt/ilJMgc7tVXc9k2CdwTGeZLLPl02 lhGaaJ5jhOFbVV/G488qGVx0q2CAEtOW6wDoJDsN+WAFQRasjQEtfTWDKiyo20tp8g== X-Gm-Gg: AfdE7clj/x/wZAi4F87YP+kDqjWVYYVOLOxDLpYj7VRCPSrOcGoiR3H8A5je+RrdfXj gy2A8Cs6QfGkr2SXnCSriZG9LYyn08QCtHumYqAggi+uQ0x/PxKtcEPa6TOZBvM5zSP9sT5Co1z 2PqC7tRwCigXXqPloGwfi8THiyflJdTeEostQ8psYnMFLE2+DLRcEGseuCYur2pPRkNTzQvVZvC wKuGQPtM7vFu7N5UOqEUc69mLfTYPZ5vMBf+PQPiL6Q0OUvISX9pPcn66Xl+ceyUj4U/Zwes8qA pa55y7MCUsyjXGP9TiAFUd8KPqmgQH/HQRO+N6sfXbD2+UbXhYqB/lSzRPD+DTWUCN5FMKLjdU7 P1o/6uv1kbnwJSiO8hX6kLJ7JwTlBDGXQjXfUJrt3gJnu7Rf4ifyC5UVt1SREvnIm7LmOv6gXaM oV4fUJQUQMGFPBamHCQqpqQh5Low6Em+UwlSWShvkFCBFkXvA5W/PKO/6eTrG5MW41by3Y45Rhd fhoxxys X-Received: by 2002:a17:903:1247:b0:2ca:eea:eb5c with SMTP id d9443c01a7336-2ccea373170mr66966485ad.18.1783591098706; Thu, 09 Jul 2026 02:58:18 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:bd09:6ddb:180a:69c5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9d5bd2fsm41082155ad.78.2026.07.09.02.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 02:58:18 -0700 (PDT) From: Chen-Yu Tsai To: Bartosz Golaszewski , Greg Kroah-Hartman , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , "Rafael J. Wysocki" , Danilo Krummrich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Chen-Yu Tsai , linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Alan Stern , Bartosz Golaszewski Subject: [PATCH v4 08/14] usb: hub: Use usb_hub_set_port_power() to control port power everywhere Date: Thu, 9 Jul 2026 17:57:13 +0800 Message-ID: <20260709095726.704448-9-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.795.g602f6c329a-goog In-Reply-To: <20260709095726.704448-1-wenst@chromium.org> References: <20260709095726.704448-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There are still some instances in the USB hub driver where port power is directly controlled by toggling the USB_PORT_FEAT_POWER feature flag. Switch these instances over to usb_hub_set_port_power() so that only one unified function to do this exists. This makes adding external power control with the power sequencing API easier and consistently applied. Reviewed-by: Bartosz Golaszewski Signed-off-by: Chen-Yu Tsai --- Changes since v2: - New patch --- drivers/usb/core/hub.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index c7fa73673582..369280a217cc 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -975,11 +975,8 @@ static void hub_power_on(struct usb_hub *hub, bool do_delay) dev_dbg(hub->intfdev, "trying to enable port power on " "non-switchable hub\n"); for (port1 = 1; port1 <= hub->hdev->maxchild; port1++) - if (test_bit(port1, hub->power_bits)) - set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER); - else - usb_clear_port_feature(hub->hdev, port1, - USB_PORT_FEAT_POWER); + usb_hub_set_port_power(hub->hdev, hub, port1, + test_bit(port1, hub->power_bits)); if (do_delay) msleep(hub_power_on_good_delay(hub)); } @@ -5436,7 +5433,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, if (hub_is_port_power_switchable(hub) && !usb_port_is_power_on(port_dev, portstatus) && !port_dev->port_owner) - set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); + usb_hub_set_port_power(hdev, hub, port1, true); if (portstatus & USB_PORT_STAT_ENABLE) goto done; -- 2.55.0.795.g602f6c329a-goog