lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210824105302.25382-4-kishon@ti.com>
Date:   Tue, 24 Aug 2021 16:23:00 +0530
From:   Kishon Vijay Abraham I <kishon@...com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mathias Nyman <mathias.nyman@...el.com>,
        Alan Stern <stern@...land.harvard.edu>
CC:     <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <chris.chiu@...onical.com>
Subject: [RFC PATCH 3/5] usb: core: hcd: Add support for registering secondary RH along with primary HCD

Add support for registering secondary roothub (RH) along with primary HCD.
It has been observed with certain PCIe USB cards that as soon as the
primary HCD is registered, port status change is handled leading to cold
plug devices getting not detected. For such cases, registering both the
root hubs along with the second HCD is useful.

Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
Suggested-by: Alan Stern <stern@...land.harvard.edu>
---
 drivers/usb/core/hcd.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 4d7a9f0e2caa..9c8df22a7d9a 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2799,6 +2799,7 @@ int __usb_add_hcd(struct usb_hcd *hcd, unsigned int irqnum, unsigned long irqfla
 {
 	int retval;
 	struct usb_device *rhdev;
+	struct usb_hcd *shared_hcd = NULL;
 
 	if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
 		hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
@@ -2961,6 +2962,15 @@ int __usb_add_hcd(struct usb_hcd *hcd, unsigned int irqnum, unsigned long irqfla
 
 	/* starting here, usbcore will pay attention to this root hub */
 	if (register_hub) {
+		shared_hcd = hcd->shared_hcd;
+		if (shared_hcd) {
+			retval = register_root_hub(shared_hcd);
+			if (retval != 0)
+				goto err_register_shared_root_hub;
+			if (shared_hcd->uses_new_polling && HCD_POLL_RH(shared_hcd))
+				usb_hcd_poll_rh_status(shared_hcd);
+		}
+
 		retval = register_root_hub(hcd);
 		if (retval != 0)
 			goto err_register_root_hub;
@@ -2972,6 +2982,8 @@ int __usb_add_hcd(struct usb_hcd *hcd, unsigned int irqnum, unsigned long irqfla
 
 err_register_root_hub:
 	usb_stop_hcd(hcd);
+err_register_shared_root_hub:
+	usb_stop_hcd(shared_hcd);
 err_hcd_driver_start:
 	if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0)
 		free_irq(irqnum, hcd);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ