linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<chris.chiu@canonical.com>,
	Kishon Vijay Abraham I <kishon@ti.com>, <lokeshvutla@ti.com>
Subject: [PATCH v4 2/3] xhci: Set HCD flag to defer primary roothub registration
Date: Thu, 9 Sep 2021 12:11:59 +0530	[thread overview]
Message-ID: <20210909064200.16216-3-kishon@ti.com> (raw)
In-Reply-To: <20210909064200.16216-1-kishon@ti.com>

Set "HCD_FLAG_DEFER_RH_REGISTER" to hcd->flags in xhci_run() to defer
registering primary roothub in usb_add_hcd(). This will make sure both
primary roothub and secondary roothub will be registered along with the
second HCD. This is required for cold plugged USB devices to be detected
in certain PCIe USB cards (like Inateck USB card connected to AM64 EVM
or J7200 EVM).

CC: stable@vger.kernel.org # 5.4+
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Suggested-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Tested-by: Chris Chiu <chris.chiu@canonical.com>
---
 drivers/usb/host/xhci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 3618070eba78..7176058c7f3e 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -692,6 +692,7 @@ int xhci_run(struct usb_hcd *hcd)
 		if (ret)
 			xhci_free_command(xhci, command);
 	}
+	set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags);
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"Finished xhci_run for USB2 roothub");
 
-- 
2.17.1


  parent reply	other threads:[~2021-09-09  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  6:41 [PATCH v4 0/3] Fix cold plugged USB device on certain PCIe USB cards Kishon Vijay Abraham I
2021-09-09  6:41 ` [PATCH v4 1/3] usb: core: hcd: Add support for deferring roothub registration Kishon Vijay Abraham I
2021-09-09 14:31   ` Alan Stern
2021-09-09  6:41 ` Kishon Vijay Abraham I [this message]
2021-09-09  6:42 ` [PATCH v4 3/3] usb: core: hcd: Modularize HCD stop configuration in usb_stop_hcd() Kishon Vijay Abraham I

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=20210909064200.16216-3-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=chris.chiu@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).