From patchwork Tue Aug 24 10:52:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 502691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0163C4338F for ; Tue, 24 Aug 2021 10:53:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6BE261371 for ; Tue, 24 Aug 2021 10:53:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236416AbhHXKx7 (ORCPT ); Tue, 24 Aug 2021 06:53:59 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:59742 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236305AbhHXKx6 (ORCPT ); Tue, 24 Aug 2021 06:53:58 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 17OAr6gj066435; Tue, 24 Aug 2021 05:53:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1629802386; bh=S0OVBAatI84KIbShrBm5yBL8uU+nTOrTxMrx2mLEoHY=; h=From:To:CC:Subject:Date; b=aX/HRPTvjAxb+FkNeA4Vjx/p0oBkN4Tyr3fXoQ1OFGIatvCQQc770HGRmHBje3SJf S1v3FDud76qNGqh4TjyEM7RBuCp95Z6AB5w8CDFqeXpF5+E5G57l6R5dsXkh0VjYj7 kCawd93aKUpwPxb8gYEWsS4ZImcqizr5G1rDRe0I= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 17OAr6rf072332 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Aug 2021 05:53:06 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 24 Aug 2021 05:53:06 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Tue, 24 Aug 2021 05:53:06 -0500 Received: from a0393678-lt.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 17OAr3Dc129176; Tue, 24 Aug 2021 05:53:04 -0500 From: Kishon Vijay Abraham I To: Greg Kroah-Hartman , Mathias Nyman , Alan Stern CC: , , Subject: [RFC PATCH 0/5] Fix cold plugged USB device on certain PCIe USB cards Date: Tue, 24 Aug 2021 16:22:57 +0530 Message-ID: <20210824105302.25382-1-kishon@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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. This series performs some cleanups and implements the suggested solution. Kishon Vijay Abraham I (5): usb: core: hcd: Modularize HCD stop configuration in usb_stop_hcd() usb: core: hcd: Let usb_add_hcd() indicate if roothub has to be registered usb: core: hcd: Add support for registering secondary RH along with primary HCD usb: core: hcd-pci: Let usb_hcd_pci_probe() indicate if RH has to be registered xhci-pci: Use flag to not register roothub while adding primary HCD drivers/usb/core/hcd-pci.c | 11 +++--- drivers/usb/core/hcd.c | 72 ++++++++++++++++++++++++------------- drivers/usb/host/xhci-pci.c | 2 +- include/linux/usb/hcd.h | 16 ++++++--- 4 files changed, 65 insertions(+), 36 deletions(-)