Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5903430iob; Tue, 10 May 2022 06:24:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBWTZq096GQgTnQKjVykhQFQ9w9rAJwn57/lgtv9GTL4wiiylej3yS30TTmAh0m8R+tDgR X-Received: by 2002:a92:ca4e:0:b0:2cf:168e:8014 with SMTP id q14-20020a92ca4e000000b002cf168e8014mr9119160ilo.81.1652189056862; Tue, 10 May 2022 06:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652189056; cv=none; d=google.com; s=arc-20160816; b=UhqTh/kYzXduFBnxQndPe11EV/ElqjgCOc6JK4QNWIrP9nVZJ8hCXTUjyaRFkVHei5 NA/aY6l+jSf8LJb6+1zXWy6W085wxvX576qJOO2fApq/E9GqlT2WWh2DmjkvSR1h8zBE FYQNMw8Rj+Kff9vs1yYZ42fYHsIb/A/QucoxxKNOzJk0dx1dCPFeHQPXC9VSVzgAVKQi fEpoe6z5+2nG1zgztIBeAWmDNJNc2cpS54PFrv45WP69UKblL/aVWpwgdx4FswPiRF4u kix3l1wc+ihQlLLNxhrD+JBiZ+O0xJofoZBmvbnjCTXTaGjhcrDxnj983KNR9O/mUa28 U5tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HCLvsLcceoS32V+c9Kah6D+bZwM7/UEjPIu3cYvdX5c=; b=nAnfE7OJi4zQR+ft208Z0GxOUsun75kgqodhyYy1f0l4D8R549oTi+sEOhnanCWT8o p/isVBcVK1K/O7BzB7XxWkenmXY+pcx3sPGM6YmfVVnUyTrK2wA91G9KfLAAiX4byjRQ W1MuOgbYX6YlAM56VCJlt50pVFZrUQqmRgtJc21v8qd5d4mJ7awBYciKaEz9pB2QrfvV qejLQ2t3KDfKRtwcVWY25UXnKTW94j9Cn1NXWoaieP5of1GLClCgmpFzsgqn2Zhxt99c G3GeYIQAwAj7sEekVRMPg7obvdGi+OSj2cdGz+siv05Vp514stCo+WgszC7+AW5ELPfO ggLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Lj+WmdLK; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a92cec2000000b002caa99a5194si6284538ilq.21.2022.05.10.06.24.02; Tue, 10 May 2022 06:24: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=@ti.com header.s=ti-com-17Q1 header.b=Lj+WmdLK; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238550AbiEJJUx (ORCPT + 99 others); Tue, 10 May 2022 05:20:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238514AbiEJJUr (ORCPT ); Tue, 10 May 2022 05:20:47 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71CA3209B4E; Tue, 10 May 2022 02:16:50 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 24A9GgVC090455; Tue, 10 May 2022 04:16:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1652174202; bh=HCLvsLcceoS32V+c9Kah6D+bZwM7/UEjPIu3cYvdX5c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Lj+WmdLKnScDKuCm4RVky7ExCzikaUphlFlJQuaDNpbML30X9huH2uRIuLbskuuvx w8rzfNnprgHK9htLJaXkNjeZzAThimhlAAeU/ABNgQty+soS1gucuNGsb3fxtk5OES AEHCUqbzK61/7UzDQf8/uqC4MUpAmPqtKbJQIRVo= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 24A9GgdQ105134 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 10 May 2022 04:16:42 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 10 May 2022 04:16:42 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Tue, 10 May 2022 04:16:42 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 24A9GYeK127131; Tue, 10 May 2022 04:16:39 -0500 From: Kishon Vijay Abraham I To: Greg Kroah-Hartman , Mathias Nyman , Alan Stern CC: Kishon Vijay Abraham I , , , Subject: [RESEND PATCH v2 2/2] xhci: Set HCD flag to defer primary roothub registration Date: Tue, 10 May 2022 14:46:30 +0530 Message-ID: <20220510091630.16564-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220510091630.16564-1-kishon@ti.com> References: <20220510091630.16564-1-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Set "HCD_FLAG_DEFER_RH_REGISTER" to hcd->flags in xhci_run() to defer registering primary roothub in usb_add_hcd() if xhci has two roothubs. This will make sure both primary roothub and secondary roothub will be registered along with the second HCD. This is required for cold plugged USB devices to be detected in certain PCIe USB cards (like Inateck USB card connected to AM64 EVM or J7200 EVM). This patch has been added and reverted earier as it triggered a race in usb device enumeration. That race is now fixed in 5.16-rc3, and in stable back to 5.4 commit 6cca13de26ee ("usb: hub: Fix locking issues with address0_mutex") commit 6ae6dc22d2d1 ("usb: hub: Fix usb enumeration issue due to address0 race") [minor rebase change, and commit message update -Mathias] CC: stable@vger.kernel.org # 5.4+ Suggested-by: Mathias Nyman Tested-by: Chris Chiu Signed-off-by: Kishon Vijay Abraham I --- drivers/usb/host/xhci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 25b87e99b4dd..2be38d9de8df 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -696,6 +696,8 @@ int xhci_run(struct usb_hcd *hcd) xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Finished xhci_run for USB2 roothub"); + set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags); + xhci_create_dbc_dev(xhci); xhci_debugfs_init(xhci); -- 2.17.1