LKML Archive on lore.kernel.org
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 v2 3/3] xhci: Set HCD flag to defer primary roothub registration
Date: Thu, 26 Aug 2021 16:44:26 +0530	[thread overview]
Message-ID: <20210826111426.751-4-kishon@ti.com> (raw)
In-Reply-To: <20210826111426.751-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).

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-08-26 11:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 11:14 [PATCH v2 0/3] Fix cold plugged USB device on certain PCIe USB cards Kishon Vijay Abraham I
2021-08-26 11:14 ` [PATCH v2 1/3] usb: core: hcd: Modularize HCD stop configuration in usb_stop_hcd() Kishon Vijay Abraham I
2021-08-26 11:14 ` [PATCH v2 2/3] usb: core: hcd: Add support for deferring roothub registration Kishon Vijay Abraham I
2021-08-26 12:47   ` Mathias Nyman
2021-08-26 15:16   ` Alan Stern
2021-08-26 11:14 ` Kishon Vijay Abraham I [this message]
2021-08-26 12:45   ` [PATCH v2 3/3] xhci: Set HCD flag to defer primary " 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=20210826111426.751-4-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 \
    --subject='Re: [PATCH v2 3/3] xhci: Set HCD flag to defer primary roothub registration' \
    /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

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).