From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>,
Heiner Kallweit <hkallweit1@gmail.com>,
Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH 4/9] usb: host: xhci-plat: prepare operation w/o shared hcd
Date: Thu, 12 May 2022 01:04:45 +0300 [thread overview]
Message-ID: <20220511220450.85367-5-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <20220511220450.85367-1-mathias.nyman@linux.intel.com>
From: Heiner Kallweit <hkallweit1@gmail.com>
This patch prepares xhci-plat for the following scenario
- If either of the root hubs has no ports, then omit shared hcd
- Main hcd can be USB3 if there are no USB2 ports
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
drivers/usb/host/xhci-plat.c | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 5d752b384de2..c512ec2148ae 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -180,7 +180,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
struct device *sysdev, *tmpdev;
struct xhci_hcd *xhci;
struct resource *res;
- struct usb_hcd *hcd;
+ struct usb_hcd *hcd, *usb3_hcd;
int ret;
int irq;
struct xhci_plat_priv *priv = NULL;
@@ -327,21 +327,26 @@ static int xhci_plat_probe(struct platform_device *pdev)
if (ret)
goto disable_usb_phy;
- xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,
- dev_name(&pdev->dev), hcd);
- if (!xhci->shared_hcd) {
- ret = -ENOMEM;
- goto dealloc_usb2_hcd;
- }
+ if (!xhci_has_one_roothub(xhci)) {
+ xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,
+ dev_name(&pdev->dev), hcd);
+ if (!xhci->shared_hcd) {
+ ret = -ENOMEM;
+ goto dealloc_usb2_hcd;
+ }
- xhci->shared_hcd->tpl_support = hcd->tpl_support;
+ xhci->shared_hcd->tpl_support = hcd->tpl_support;
+ }
- if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
- xhci->shared_hcd->can_do_streams = 1;
+ usb3_hcd = xhci_get_usb3_hcd(xhci);
+ if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4)
+ usb3_hcd->can_do_streams = 1;
- ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
- if (ret)
- goto put_usb3_hcd;
+ if (xhci->shared_hcd) {
+ ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
+ if (ret)
+ goto put_usb3_hcd;
+ }
device_enable_async_suspend(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
--
2.25.1
next prev parent reply other threads:[~2022-05-11 22:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 22:04 [PATCH 0/9] xhci features for usb-next Mathias Nyman
2022-05-11 22:04 ` [PATCH 1/9] xhci: factor out parts of xhci_gen_setup() Mathias Nyman
2022-05-11 22:04 ` [PATCH 2/9] xhci: prepare for operation w/o shared hcd Mathias Nyman
2022-05-11 22:04 ` [PATCH 3/9] usb: host: xhci-plat: create shared hcd after having added main hcd Mathias Nyman
2022-05-11 22:04 ` Mathias Nyman [this message]
2022-05-11 22:04 ` [PATCH 5/9] usb: host: xhci-plat: omit shared hcd if either root hub has no ports Mathias Nyman
2022-05-11 22:04 ` [PATCH 6/9] xhci: use generic command timer for stop endpoint commands Mathias Nyman
2022-05-11 22:04 ` [PATCH 7/9] xhci: prevent U2 link power state if Intel tier policy prevented U1 Mathias Nyman
2022-05-11 22:04 ` [PATCH 8/9] xhci: Remove quirk for over 10 year old evaluation hardware Mathias Nyman
2022-05-11 22:04 ` [PATCH 9/9] xhci: Allow host runtime PM as default for Intel Alder Lake N xHCI Mathias Nyman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220511220450.85367-5-mathias.nyman@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hkallweit1@gmail.com \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.