linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] xhci: Fix Renesas PCIe controllers passthrough issue
@ 2022-10-20 10:39 wangwenmei168
  2022-10-20 11:11 ` Greg KH
  2022-10-20 15:13 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: wangwenmei168 @ 2022-10-20 10:39 UTC (permalink / raw)
  To: mathias.nyman, gregkh, linux-usb, linux-kernel; +Cc: gehao

From: gehao <gehao@kylinos.cn>

When we use uPD720201 USB 3.0 Host Controller passthrough to VM
guest os will report follow errors and it can not working.

xhci_hcd 0000:09:00.0: Host took too long to start, waited 16000
microseconds.
xhci_hcd 0000:09:00.0: startup error -19.

Because when we passthroug some device to our guest os,
dev->iommu_group =NULL,so it will return from this function,
Actually it still control by host os.
I think that this condition is not necessary.

For host os with IOMMU,it is safe.
For host os with noiommu,doing anything when there is no
iommu is definitely.
For guest os,the addresses we can access are restricted.

After add this path,they all work well.

Signed-off-by: gehao <gehao@kylinos.cn>
---
 drivers/usb/host/xhci.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 5176765c4013..e8f4c4ee3ea3 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -241,12 +241,8 @@ static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
 	 * changing the programming leads to extra accesses even if the
 	 * controller is supposed to be halted. The controller ends up with
 	 * a fatal fault, and is then ripe for being properly reset.
-	 *
-	 * Special care is taken to only apply this if the device is behind
-	 * an iommu. Doing anything when there is no iommu is definitely
-	 * unsafe...
 	 */
-	if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !device_iommu_mapped(dev))
+	if (!(xhci->quirks & XHCI_ZERO_64B_REGS))
 		return;
 
 	xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-20 15:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20 10:39 [RESEND PATCH] xhci: Fix Renesas PCIe controllers passthrough issue wangwenmei168
2022-10-20 11:11 ` Greg KH
2022-10-20 15:13 ` kernel test robot

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