Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4521544rwb; Tue, 6 Sep 2022 08:38:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR4bhFg4z96lQCj+ZYolmF2xAP75LL7KzXZjprGr1h2DFvGDz/dTWJWh5lx4JZN55+x5fp/G X-Received: by 2002:a05:6a00:2344:b0:53b:8c23:afd9 with SMTP id j4-20020a056a00234400b0053b8c23afd9mr16270074pfj.34.1662478696581; Tue, 06 Sep 2022 08:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662478696; cv=none; d=google.com; s=arc-20160816; b=uN7tlika+hfbpNS81x04IkaKwI1VV2q9CQ03xmpPLG/Qf6KnOgfDQkdDYJaIyYWk92 TkWXdKju6cD4WTWc8PuioCEgiPgJ/x5hwUKCPRadJe9zmoIyyDzJGw/jBqa388eenPKA sHhSpNHDEs10Dqvge68QCVv+GVjle6pDDW6hvME6T6qyk8Tw3k8z+7GYfp1wWR4bitt1 qcPa33/g+kXdvyfnVKiqXUf/AU0ol9v6ceLldnVxkT3yn8XktnSTgLH41WzG1P7ueyLs TjbY9qF0XBeCZJKPfgZl7p+j5S6UAJwPcHqhVlQvCwTT20YJXhQjRWFaDMp4gDuuBgu4 5HbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RRv1JDDNV8VhplzVLP1issGqijCONbeaFB35unS4gxk=; b=aeH5mkT4zRxXmzw81WwPI11Nddyb+rbb8K+j08zkSymDj9eD4cAg298/L0/cTD1di/ PCsDFMdB4mGz4qOQmxvCm5MQYYf+aaAy/RTJNIKw5zyi+g4oQtacW3Gi2Tmx8g1Uqmr1 Th3JYnBOFYw/Yunp4Lw5G6vyzRLtJ2iKk6+yCFTDgw0eRS9k6VU8FRv5yKCG03uDUcev q/5cGFNwCvg4XymfJY25o+N1DiLtVtnctx3gZLvGva4g9jsipvBvaoJ/Rc4Lx+ZxqUqk mt618iexEvGfR2jkuAy/6Dl3rI+ySwvCFzZ+YD/jNKIJelYtzo9Hl8w0Zzzvr9W0Qwrq PxQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=REpDvSem; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u20-20020a170902a61400b0016c049f656asi13133308plq.54.2022.09.06.08.38.04; Tue, 06 Sep 2022 08:38:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=REpDvSem; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233940AbiIFNcZ (ORCPT + 99 others); Tue, 6 Sep 2022 09:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239380AbiIFNcP (ORCPT ); Tue, 6 Sep 2022 09:32:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4878C75CFE; Tue, 6 Sep 2022 06:32:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D766B61545; Tue, 6 Sep 2022 13:32:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34F9FC433D6; Tue, 6 Sep 2022 13:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471133; bh=Ge6nj5tnABmzL+BDKM1UPJO/z89ACMeuKjn/TZ5Y7Tc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=REpDvSem/sJZwoSCtaxjHk3/x2mB+RlaG01CY0DYvVCDBS0o6SmQmr9VSX3o+V7lX 6A2Z9lJpeOq3Kuq6cNF771mGZnnV3pkhKQQzkLR/M/w/Xn1qYzIaiudHmL56aFZOSq cI9et4f0MCnzr+NdcOTBmja2vUxap2yBL/uZOnvI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman , Sasha Levin Subject: [PATCH 5.10 12/80] Revert "xhci: turn off port power in shutdown" Date: Tue, 6 Sep 2022 15:30:09 +0200 Message-Id: <20220906132817.442457181@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132816.936069583@linuxfoundation.org> References: <20220906132816.936069583@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathias Nyman [ Upstream commit 8531aa1659f7278d4f2ec7408cc000eaa8d85217 ] This reverts commit 83810f84ecf11dfc5a9414a8b762c3501b328185. Turning off port power in shutdown did cause issues such as a laptop not proprly powering off, and some specific usb devies failing to enumerate the subsequent boot after a warm reset. So revert this. Fixes: 83810f84ecf1 ("xhci: turn off port power in shutdown") Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220825150840.132216-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/xhci-hub.c | 2 +- drivers/usb/host/xhci.c | 15 ++------------- drivers/usb/host/xhci.h | 2 -- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 94adae8b19f00..1eb3b5deb940e 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -566,7 +566,7 @@ struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd) * It will release and re-aquire the lock while calling ACPI * method. */ -void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, +static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index, bool on, unsigned long *flags) __must_hold(&xhci->lock) { diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 997de5f294f15..a1ed5e0d06128 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -775,8 +775,6 @@ static void xhci_stop(struct usb_hcd *hcd) void xhci_shutdown(struct usb_hcd *hcd) { struct xhci_hcd *xhci = hcd_to_xhci(hcd); - unsigned long flags; - int i; if (xhci->quirks & XHCI_SPURIOUS_REBOOT) usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev)); @@ -792,21 +790,12 @@ void xhci_shutdown(struct usb_hcd *hcd) del_timer_sync(&xhci->shared_hcd->rh_timer); } - spin_lock_irqsave(&xhci->lock, flags); + spin_lock_irq(&xhci->lock); xhci_halt(xhci); - - /* Power off USB2 ports*/ - for (i = 0; i < xhci->usb2_rhub.num_ports; i++) - xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags); - - /* Power off USB3 ports*/ - for (i = 0; i < xhci->usb3_rhub.num_ports; i++) - xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags); - /* Workaround for spurious wakeups at shutdown with HSW */ if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) xhci_reset(xhci, XHCI_RESET_SHORT_USEC); - spin_unlock_irqrestore(&xhci->lock, flags); + spin_unlock_irq(&xhci->lock); xhci_cleanup_msix(xhci); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index f87e5fe57f225..3fd150ef8fca9 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -2162,8 +2162,6 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1); struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd); -void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index, - bool on, unsigned long *flags); void xhci_hc_died(struct xhci_hcd *xhci); -- 2.35.1