From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (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 B8A0A3B4EA0 for ; Fri, 15 May 2026 14:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778855951; cv=none; b=i54GzbPJDh63SNVlGTXbMcGtvSMFlj4NBMOa0t5vqeTxLAmjbjzV1JTzmEiP8ROE9hqKMEq7hUuuYE7QZha2At63oA2Ptu7kTQ0YvW9S1q0faF2dhRXWp/5GjG3TVqGgh7bSKLySH0Fqjx9Zo/lSWEz/EW6uy/yqEgH1bV104n4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778855951; c=relaxed/simple; bh=5ei7fh/Y69tCRQ3kK/dbGYFuojcIwy3an7mcbITipcU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HZL1BFqRkidBh7Quue3McenI8PSZKPYOq1zV5io2+Z7zr5hvuobIDv30Drluo1kEJ+O0TPNpMtx54Xo/s+Z69Coor8VZ0h+HEW8VSjtjtQ2ClZ5p2n/Q+MKlFpq3lfErMGTuulDJOC1LcmiLN+BjXC3bAO0Sp8rrBF3jCGD91qs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rowland.harvard.edu; spf=fail smtp.mailfrom=g.harvard.edu; dkim=pass (2048-bit key) header.d=rowland.harvard.edu header.i=@rowland.harvard.edu header.b=r5fzMnjx; arc=none smtp.client-ip=209.85.222.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=g.harvard.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rowland.harvard.edu header.i=@rowland.harvard.edu header.b="r5fzMnjx" Received: by mail-ua1-f45.google.com with SMTP id a1e0cc1a2514c-95d04f205beso5926974241.3 for ; Fri, 15 May 2026 07:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rowland.harvard.edu; s=google; t=1778855949; x=1779460749; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BQxJjtW9NoHteCK0AjadT0ZiWp4xMo5S2G7yHBWhKm0=; b=r5fzMnjxo0qn47DQheu+8z2BqVawUayNL19uz+3HNCVkcfleHmePGSySdncjPWRlFL pyzYzWAhxGtYttSooQV6s0iEnztVj8Znl0pLey9ORkA+ry7diHDpSXXziTw4HzbpN+mL 5igrMArIrATYGLp9FMEWMoWAwbQRiX7FBxA88r1H74RNRo0QkogWc0Pfy3h0uzfgy2Ow UOJpkHXJo1G9zABJeA/iUcFWpnGwA+3ztUcjxcxYS2KuQDWaMpKQrKJt6fpQyNp5Y1lw oMcuYZtMhxuN9N0/NLYbsqbptZruq8Iv+HICmnHUG1iWpANS/ZrpA6TwTCe6khEjfn+S hMeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778855949; x=1779460749; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BQxJjtW9NoHteCK0AjadT0ZiWp4xMo5S2G7yHBWhKm0=; b=grq/iTGw7dSVzgGlQSFude/8A+bGKxjzS/oWT5A4MBHarFfGzDnH7sbF0BlDoG726a zzFa7+q/0fexP3FpxL60IYKq9tMMnRkzwjsf/kFYL8vuK76juZ58icxigRCy3+Px/HRo MrZaf9/OajQ0GHMbQngkXz4Q81/QCfNgMyEKWVNoh+dtDWGyrd1RW9BXDSu+QnOZ3Y/h 1DFq9zStlSh+WU1D9jhuWVyUuP+5hgJNObQoY0Fu8tNWYXj4KK4tcwZGm9H5lsM3ALjB OHkaYLUMmT3yeckIaRrY6d6mJX+h52F0U0Xcy4KUORrL/VxWhRvTmvbfvOC/vU4F2Xsp AbbA== X-Forwarded-Encrypted: i=1; AFNElJ8a6Mxkhc3tm66OTn8UL9NMwjQ+C2Fi8KnaqfSkih9fx+JPIPzpLAhQaGlDY1zcsYEOVF1bWVPe43T7dp8=@vger.kernel.org X-Gm-Message-State: AOJu0Yws272dINO3DEzKSAQ1SCuU5Kr2yvRQJN6z70ksz2wJj7KORpQm 5hRRMTgsZ0X6azB1kQaJQIpOhgcaanIHUYzUzcIDYxIUOUrPUboUCZ2QwINCBIUE6w== X-Gm-Gg: Acq92OEvc44Pgfw61d8fSccJ4czKS/iBsSNvTybN6SRiDAQqKFjCiv1TkBk9naQI30z 9QSVK34sqSR3xc+ur49mjjLc2Om9XB+Jv8EFs/i3L6jFJyQzraE442+w/LdhRq9OjpC6RZyZy87 Fm9YLDtfBvEKvCOd+PmrznNP9x2teN/ofGwpGX7dw57JxJVtNclrlXHRaLuSASOgH53Hqj1058r BHGh7QE81tY8AmeKy5UxTVonUmiMjXd1liu1eh3VgJyjy9GdcDbz6qvY7UDpPdWAA6oMrccCDGl rQBUKRXBpT7+6tvI0bvt5urhc6hq7OUAI5TZmVQHnR5RFx1CS6jm0YN1I1K5TzXTMq/N3h0rkqC 8u0px31lMyIdOdbLefSvLDPKDfPbpXReLbdxS+GKhPz4JXIob7PrfDF2H2+9lI8UMudH4HSEKFL ByL46BWNNROgPkVo7bErkQWceSK85UHoGFdd5DYre6+1M= X-Received: by 2002:a05:6102:e14:b0:633:1fbe:79c8 with SMTP id ada2fe7eead31-63a3f597eb4mr2246407137.23.1778855948736; Fri, 15 May 2026 07:39:08 -0700 (PDT) Received: from rowland.harvard.edu ([2601:19b:d01:d210:d62f:1911:f952:16ba]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8c90b3d0bdbsm51850896d6.24.2026.05.15.07.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 07:39:08 -0700 (PDT) Date: Fri, 15 May 2026 10:39:04 -0400 From: Alan Stern To: Chen-Yu Tsai Cc: Bartosz Golaszewski , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , 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 Subject: Re: [PATCH RFC 05/12] usb: hub: Power on connected M.2 E-key connectors Message-ID: <41260a6d-46fa-4a45-9906-e1bc5e5dd83a@rowland.harvard.edu> References: <20260515090149.3169406-1-wenst@chromium.org> <20260515090149.3169406-6-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260515090149.3169406-6-wenst@chromium.org> On Fri, May 15, 2026 at 05:01:41PM +0800, Chen-Yu Tsai wrote: > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index 90ea597d42ae..4165f71e212b 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -31,7 +31,9 @@ > #include > #include > #include > +#include > #include > +#include > #include > > #include > @@ -888,13 +890,25 @@ int usb_hub_set_port_power(struct usb_device *hdev, struct usb_hub *hub, > { > int ret; > > + if (set) > + ret = pwrseq_power_on(hub->ports[port1 - 1]->pwrseq); > + else > + ret = pwrseq_power_off(hub->ports[port1 - 1]->pwrseq); > + if (ret) > + return ret; > + > if (set) > ret = set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); > else > ret = usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_POWER); > > - if (ret) > + if (ret) { > + if (set) > + pwrseq_power_off(hub->ports[port1 - 1]->pwrseq); > + else > + pwrseq_power_on(hub->ports[port1 - 1]->pwrseq); > return ret; > + } > > if (set) > set_bit(port1, hub->power_bits); > @@ -1867,6 +1881,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) > struct usb_host_interface *desc; > struct usb_device *hdev; > struct usb_hub *hub; > + int ret; > > desc = intf->cur_altsetting; > hdev = interface_to_usbdev(intf); This change is totally useless. Didn't you get a warning from the compiler when you built it? > diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h > index 9ebc5ef54a32..6039e5f5dcd7 100644 > --- a/drivers/usb/core/hub.h > +++ b/drivers/usb/core/hub.h > @@ -85,6 +85,7 @@ struct usb_hub { > * @port_owner: port's owner > * @peer: related usb2 and usb3 ports (share the same connector) > * @connector: USB Type-C connector > + * @pwrseq: power sequencing descriptor for the port > * @req: default pm qos request for hubs without port power control > * @connect_type: port's connect type > * @state: device state of the usb device attached to the port > @@ -104,6 +105,7 @@ struct usb_port { > struct usb_dev_state *port_owner; > struct usb_port *peer; > struct typec_connector *connector; > + struct pwrseq_desc *pwrseq; > struct dev_pm_qos_request *req; > enum usb_port_connect_type connect_type; > enum usb_device_state state; The fact that hub.h uses struct pwrseq_desc indicates that it ought to #include , instead of making the .c files do so themselves. Then you wouldn't have to add the #include lines to hub.c and port.c. > diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c > index b1364f0c384c..2d09037fee93 100644 > --- a/drivers/usb/core/port.c > +++ b/drivers/usb/core/port.c > @@ -7,11 +7,14 @@ > * Author: Lan Tianyu > */ > > +#include Why is this needed? > #include > #include > #include > #include > +#include > #include > +#include > #include > #include > Alan Stern