From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 D09BF3D9558 for ; Fri, 4 Sep 2026 08:43:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788511392; cv=none; b=kgfQQE4KXPigG7BK60FIYW+XiO69m7EZ9KlDAptvt3WMA2S01o7fFSzxERsRAPje9be6aXbfA3lWSyYOm5GsdIszVjlYNpl/l2wE3c8YHGqErWr5wPmM8FUDBx6BS8xVNb1bAu2Dzc685I74vsd0lTaVYZETv9G5nB4fcdaoBAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788511392; c=relaxed/simple; bh=k4P8O6O1bZN0BviRcm5rHj8gLkm4KLla0pyDEJs44j0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UyFBpE7apewZQl3xk6Q7jvuANlS58j87Mf4sR/heOOVlOuLF11uJgvPL5RtrozEG6MfNL8d8TSmAFpHJUB+32JMx98L5XxfMR+0iOK8SZS9pB9XM8I/qAlzf/jQ5rHrYp0utNqXbVloeE+6IuEvhHPx0+kmVB7TA2+TX92hp/Mg= 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=b9I83p3G; arc=none smtp.client-ip=209.85.214.174 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="b9I83p3G" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2db18e5cb56so4078425ad.0 for ; Fri, 04 Sep 2026 01:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1788511387; x=1789116187; 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=Bo+9+1CvfJ71hhRjJqHX7wWrfIVVnPJvwTAuLV2zMPo=; b=b9I83p3GB2Np56mdhqhsSbTAz+2Z1AvsREg4rzk71ni1TKMmew2j+w4krqcYmavOpW W4B72lpYkAqvp8a72htsbsfGYPqVeWsr8/7WWY6RuN+XD7PXQAPnZE5vCmY9HXs2dYzu LdHIezwu3hboKSvIrwnTyAuCMj1jaoKZN1C4A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788511387; x=1789116187; 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=Bo+9+1CvfJ71hhRjJqHX7wWrfIVVnPJvwTAuLV2zMPo=; b=lj/bJ9xmYCWb0kdfTsBImjR10+BLPPcVGBfu+gS01bAFHpxozO02M+EHGHxbCg+YEi eGWHlM4lmEXxRjog+ZjOSiyWGorQPSdEZCJwkyJ4g/1Zgqnmu5tMHqf4AGueIHGDci1O Rp++YUe45WmoAwF3w7y2rgMMEiZ4YTCELlv0PkwFt0oNXtgGKKzA0vcasm9Uie90yTX1 p/J8NEgN4X8/zqfoJ7gMq02ztUv9aNnkYE8ypz2Gtbj+/LolhlvVboM2hUQZ0Pgk2HFU XxIVZGj2faq1320oYNPxRV41feCtHox/IHU/u9gIWgGIdQ6DbWBDDKjbeCuuB2eKmLtU EHgg== X-Forwarded-Encrypted: i=1; AKwUvBzNJz8ZHHdTCQ5H1P4R/O324eIlsx+jlt7vqDoCChE++xHTLQO3oe9peRp11ZylaE3OMHY9DgQYNcK2@vger.kernel.org X-Gm-Message-State: AFuF++nCchzcEGUdLWM57dm6CP5xsqKPHCe70NzLzZ4IDAeFCpQ9gOqI zw7Qdxs1VEtHQ5FxqrxuIzgw3UDXt+COfey1Bfx+wGLRGRj2VhWBBPK8GNs269iZzg== X-Gm-Gg: AYBFou2UrwffYIpuPh/cMDwpYdd9cHDh9TCEAjY5VynC0g3QXF+gLzPOEJq0290jaI3 Ehdif/pj5cRZzZS9pAqFAO+mJp8UEkpJe1x9n/U6Iz3Ry4Alpuq3P3M+k/I/h+S55pdVxRpwLF2 nuTup76m7XIQT1PuK8SdY1Cq/aRC7t0LOQJZKn8I+eV369DbNvjnr3rhxxWhvpgIOsBHrCElGij k4dZc6lQUtJCBz5VTl41WkCBKoOrQ8Ywg5q+2ns0OHr3kPuDzjdlY9GO3x02w+kQ6rLlW1Ein/4 GJvxKaJr4hJ3J2FMgLHG0/LPHhWWoPlTa8Uw/AEav1Kq8C+2WyIBXhROycgrYbiNdhsFHplnZCg grZAMZyO+m8VkX/Ew2L+xwpMwRFRKILDxYgYlZ5YpfrFLmSMvotQhiH5DblQOLRacqYUnC+ba3V JoXT46R62FhmgzIqrTr70eiVijtFrIvbes+oDNHuu7hqdMjdsPQ9VG+hLwIr7OeI2olHftBcI3g FTtgZhSJeEaR8H+6F3vXacCjSFTollrUo3BCEZ15Tlk X-Received: by 2002:a17:90b:1d52:b0:38f:de97:b06 with SMTP id 98e67ed59e1d1-39b260d338bmr6986016a91.5.1788511386742; Fri, 04 Sep 2026 01:43:06 -0700 (PDT) Received: from wenst-7875.tpe.corp.google.com ([2a00:79e0:201d:8:343:bf21:3095:9c5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39b260fdf9asm3343538a91.9.2026.09.04.01.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2026 01:42:36 -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: Wei Deng , Konrad Dybcio , 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 v8 05/16] usb: hub: Return actual error from hub_configure() in hub_probe() Date: Fri, 4 Sep 2026 16:41:44 +0800 Message-ID: <20260904084158.1341550-6-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.979.g7e5102b832-goog In-Reply-To: <20260904084158.1341550-1-wenst@chromium.org> References: <20260904084158.1341550-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 The addition of power sequencing descriptor handling in the USB hub code requires dealing with deferred probing from pwrseq_get(). The power sequencing provider may not yet be available when the USB hub probes. Return the actual error code from hub_configure() when it fails, so that the driver core can notice the deferred probe request. Also rewrite this section into the standard error handling pattern: if (error) { # handle error return error; } # do more work return 0; Reviewed-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Rewrite into standard error handling pattern Changes since v1: - Moved "int ret" declaration in hub_configure() over here from the next patch --- drivers/usb/core/hub.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 16e03ec8d1ab..c19c9912c740 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1870,6 +1870,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); @@ -2001,14 +2002,15 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) usb_set_interface(hdev, 0, 0); } - if (hub_configure(hub, &desc->endpoint[0].desc) >= 0) { - onboard_dev_create_pdevs(hdev, &hub->onboard_devs); - - return 0; + ret = hub_configure(hub, &desc->endpoint[0].desc); + if (ret < 0) { + hub_disconnect(intf); + return ret; } - hub_disconnect(intf); - return -ENODEV; + onboard_dev_create_pdevs(hdev, &hub->onboard_devs); + + return 0; } static int -- 2.55.0.979.g7e5102b832-goog