Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5921545iob; Tue, 10 May 2022 06:47:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6WP7vXS9wlOkg5tDlYFxbjIIsqqrvNRX0yCtb737Lpcnhlbijn1l+Cz/J1G0tyttXrEcg X-Received: by 2002:a17:906:cf9c:b0:6f5:108c:a5a with SMTP id um28-20020a170906cf9c00b006f5108c0a5amr18983055ejb.397.1652190419754; Tue, 10 May 2022 06:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652190419; cv=none; d=google.com; s=arc-20160816; b=bLqlqA3bOMZDNnslSCiReyNcjysqdvBj5HCtB5OQfbqiUOmZwOg0D9EhIJXfqxEw/R UmiNkZChoGShjnK8BNwj8EWxAetGtfgh2JGdqAfs+pWF17ZGkOSY+yDGXlfnKFjQ82eL UT2tSNj15H2p9DXzplzoG9Dz2MuC7IS81FhS2ROB6YIX4Ba4dPZbkTu3ASnSlOax4RKt 0buNASDKjVrcN0ONgLlIGKG13/OtsaYoIH7+2xyaCsEBpYDRoo2a0knDihqXXQSQDaqw 2ZspkPUz49AuNi2L4BR7OHR2rKKBA2spsKU9q6o/Xt0Q7odse5qU1SwrvLMv0g708Q6V dmxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=7snpbKn5zSFuGNb0yU6RHqm+dmazdYnH7kTAEoqr7IM=; b=VZO6mAf3S6BA7/MmKaIUohKyEw6xra2SgRFNKnaAQAew+L0sS/Cahs7n4kdFf/Nbrd dzNHOe6MU6/iNCO45GLQQBf0mSbcZOUj/SggMybXM1aL+X4OxmvKdq6xz/iGV4eDKkFF RSiLVNtGzNkhOGh3eMAk/fcMLQCKI4qJ4H4VN2z+K71Mn6D09J7yxefRlauwdpJsb77P gOEc6oEYiqCIaC+1o63b2YXhL+zyzLuZ34KpuP9ugN0XVQ+MAJ6WuXDBGejbOrjDqofh 4FMIz7G1NddpqvCZn+0rwHs5ahAc9SZoBto/vVlSl6XtGSsYRElrIQGMSE/nViqgEYOQ 5kCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=zC09k5H2; 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 z19-20020a056402275300b00425d8612a53si20995577edd.302.2022.05.10.06.46.35; Tue, 10 May 2022 06:46:59 -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=zC09k5H2; 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 S238540AbiEJJUu (ORCPT + 99 others); Tue, 10 May 2022 05:20:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238513AbiEJJUr (ORCPT ); Tue, 10 May 2022 05:20:47 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91F34209B49; Tue, 10 May 2022 02:16:50 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 24A9GbMA075025; Tue, 10 May 2022 04:16:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1652174197; bh=7snpbKn5zSFuGNb0yU6RHqm+dmazdYnH7kTAEoqr7IM=; h=From:To:CC:Subject:Date; b=zC09k5H2n1JRLu8ze2oLLRtaNL4S91zf54O9tqNFXvqpUxNicxtceLdYW8aPU7Crj tYk5GMO/jXCL8kR+CtZ3ob9DGuwTnxk4wQ/0nY8EaIpWyQW0MBkl/74j35cEDixFSG gwRPjglF2dH7DIJJ1Pkb1ODxqae9Jd9JSLq6EIk0= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 24A9GbvC026194 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 10 May 2022 04:16:37 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE106.ent.ti.com (10.64.6.27) 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:36 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE112.ent.ti.com (10.64.6.33) 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:36 -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 24A9GYeI127131; Tue, 10 May 2022 04:16:34 -0500 From: Kishon Vijay Abraham I To: Greg Kroah-Hartman , Mathias Nyman , Alan Stern CC: Kishon Vijay Abraham I , , Subject: [RESEND PATCH v2 0/2] Fix cold plugged USB device on certain PCIe USB cards Date: Tue, 10 May 2022 14:46:28 +0530 Message-ID: <20220510091630.16564-1-kishon@ti.com> X-Mailer: git-send-email 2.17.1 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 Cold plugged USB device was not detected on certain PCIe USB cards (like Inateck card connected to AM64 EVM or connected to J7200 EVM). Re-plugging the USB device always gets it enumerated. This issue was discussed in https://lore.kernel.org/r/772e4001-178e-4918-032c-6e625bdded24@ti.com and https://bugzilla.kernel.org/show_bug.cgi?id=214021 So the suggested solution is to register both root hubs along with the second hcd for xhci. RFC Patch series can be found at [1] v1 Patch series can be found at [3] v2 PATCH series can be found at [4] Changes from v2: 1) No Change (rebased to latest mainline kernel). V2 was reverted from mainline after it triggered a race in USB enumeration. Posting the patch (as attached in https://bugzilla.kernel.org/attachment.cgi?id=300800 after validating this fixes the issue using TI AM654 IDK EVM). Changes from RFC: 1) Mathias identified potential issues with the RFC patch [2] and suggested the solution to use HCD flags. This series implements it. Changes from v1: 1) Fixed code comments pointed out by Alan Stern 2) Renamed the HCD flag variable to "HCD_FLAG_DEFER_RH_REGISTER" from "HCD_FLAG_DEFER_PRI_RH_REGISTER" [1] -> https://lore.kernel.org/linux-usb/20210824105302.25382-1-kishon@ti.com/ [2] -> https://lore.kernel.org/linux-usb/06693934-28f2-d59e-b004-62cabd3f9e8e@linux.intel.com [3] -> https://lore.kernel.org/r/20210825105132.10420-1-kishon@ti.com [4] -> http://lore.kernel.org/r/20210826111426.751-1-kishon@ti.com Kishon Vijay Abraham I (2): usb: core: hcd: Add support for deferring roothub registration xhci: Set HCD flag to defer primary roothub registration drivers/usb/core/hcd.c | 29 +++++++++++++++++++++++------ drivers/usb/host/xhci.c | 2 ++ include/linux/usb/hcd.h | 2 ++ 3 files changed, 27 insertions(+), 6 deletions(-) -- 2.17.1