Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1037413pxb; Fri, 26 Feb 2021 00:25:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc8Hd8KfHUVCqiXsuS1mR/a9CkEY4670iihXZZ5BJVl5r3VdOs5CgbAMX63lpNxtHRMp5o X-Received: by 2002:aa7:d4cb:: with SMTP id t11mr2001393edr.202.1614327943335; Fri, 26 Feb 2021 00:25:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614327943; cv=none; d=google.com; s=arc-20160816; b=QRgllgD/fGrrclLnKSO4ChVaY64ikNEC/mKlYegYh5mhH1oMnjEdP/lnCMYMmXIVhw qcuVyiyUL1Q1DY05ICe9Hf88RN2cQCe9VVTuJ3blmXeLlzJFf0Tmc4fl9E8MzrNKDktw Xzp1/g2VRsq9aCdGeTGWH3J6W1RjDFkdqBAwwHCR9wYxeuPXkYSRsDxlcm8bI09kt7G6 AmH6edN1rlMUHQVa2dLWY/e5F4nNF1tuPiirZeCoTbYOa+QBnuvABPSk6tAWrzW9kTOx BTieMVPcuS/T6uVx2+PAM2tAJ+h0alEIGH4//SYw/psAd4CA9eDUkjkmQBBj6z0wQdTy GCAg== 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; bh=ig7gaBmlgbUlnU24GVy1yqrkjpuGJMLtKXt+5pkCzuY=; b=zyBk1Wb/3hvFtytFCqS6gfxXP5SDs6qM46fYcZJK9SmAWI/QvU5xNqcuXPAjuCmiMB wE+0BZZiwQOzYXtyWnyNkC3zY7CU9Qw9hBQHldu8lrZq9fK8+X8GrLDpjzdDdscIpBGZ kt/bD4fNBM8HqyCnWs2JQwM53/rV3D7KpeP1AilnBge29tRDicGG4xHJhEPXGvDFaOZB /9x0gotnkpKstkF4GxeWYjd/TpcncYtsM8kSXqdtyD/S3IfkeB40FNtuHewCvZS8MNiV /JLLXhOmubvYQyNNYwIqr18uAoKyTcrSGP+0w794Qu8WiH1IBqxBSijlu7zFOxBCCTg1 pOhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si5313855eji.715.2021.02.26.00.25.20; Fri, 26 Feb 2021 00:25:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbhBZIYo (ORCPT + 99 others); Fri, 26 Feb 2021 03:24:44 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:13003 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbhBZIYm (ORCPT ); Fri, 26 Feb 2021 03:24:42 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Dn2hG3gXmzjSbW; Fri, 26 Feb 2021 16:22:22 +0800 (CST) Received: from huawei.com (10.67.165.24) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Fri, 26 Feb 2021 16:23:49 +0800 From: Longfang Liu To: , CC: , , Subject: [RFC PATCH] USB:XHCI:Modify XHCI driver for USB2.0 controller Date: Fri, 26 Feb 2021 16:21:37 +0800 Message-ID: <1614327697-1021-1-git-send-email-liulongfang@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our current XHCI hardware controller has been customized to only support USB 2.0 ports. When using the current xhci driver, an xhci controller device and an ehci controller device will be created automatically. We want the driver to create only one ehci controller. After modifying the driver as follows, an error will occur. Is there any other modification method? Signed-off-by: Longfang Liu --- drivers/usb/host/xhci-pci.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index ef513c2..7296aad 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -364,26 +364,15 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) /* USB 2.0 roothub is stored in the PCI device now. */ hcd = dev_get_drvdata(&dev->dev); xhci = hcd_to_xhci(hcd); - xhci->shared_hcd = usb_create_shared_hcd(&xhci_pci_hc_driver, &dev->dev, - pci_name(dev), hcd); - if (!xhci->shared_hcd) { - retval = -ENOMEM; - goto dealloc_usb2_hcd; - } - + xhci->shared_hcd = NULL; retval = xhci_ext_cap_init(xhci); if (retval) goto put_usb3_hcd; - retval = usb_add_hcd(xhci->shared_hcd, dev->irq, + retval = usb_add_hcd(xhci->main_hcd, dev->irq, IRQF_SHARED); if (retval) goto put_usb3_hcd; - /* Roothub already marked as USB 3.0 speed */ - - if (!(xhci->quirks & XHCI_BROKEN_STREAMS) && - HCC_MAX_PSA(xhci->hcc_params) >= 4) - xhci->shared_hcd->can_do_streams = 1; /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ pm_runtime_put_noidle(&dev->dev); -- 2.8.1