All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: xhci-pci: Disable 64-bit DMA for VIA VL805
@ 2026-06-23  7:32 Xincheng Zhang
  2026-06-23 10:18 ` Michal Pecio
  0 siblings, 1 reply; 2+ messages in thread
From: Xincheng Zhang @ 2026-06-23  7:32 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Xincheng Zhang

The VIA VL805 XHCI controller (Device ID 0x3483) fails to handle DMA
addresses correctly when they exceed 0x1000000000 (64GB). On systems
with large amounts of RAM, this hardware limitation causes device failures.

Add the XHCI_NO_64BIT_SUPPORT quirk to restrict DMA addressing to 32-bit,
preventing the controller from receiving addresses beyond its hardware
limit.

Signed-off-by: Xincheng Zhang <zhangxincheng@ultrarisc.com>
---
 drivers/usb/host/xhci-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 039c26b241d0..99c2dc3cebfe 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -448,6 +448,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 	if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == PCI_DEVICE_ID_VIA_VL805) {
 		xhci->quirks |= XHCI_LPM_SUPPORT;
 		xhci->quirks |= XHCI_TRB_OVERFETCH;
+		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
 	}
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&

---
base-commit: 502d801f0ab03e4f32f9a33d203154ce84887921
change-id: 20260623-xhci-via-dma-fix-c563b889ea54

Best regards,
--  
Xincheng Zhang <zhangxincheng@ultrarisc.com>


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

* Re: [PATCH] usb: xhci-pci: Disable 64-bit DMA for VIA VL805
  2026-06-23  7:32 [PATCH] usb: xhci-pci: Disable 64-bit DMA for VIA VL805 Xincheng Zhang
@ 2026-06-23 10:18 ` Michal Pecio
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Pecio @ 2026-06-23 10:18 UTC (permalink / raw)
  To: Xincheng Zhang
  Cc: Mathias Nyman, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Forest Crossman

On Tue, 23 Jun 2026 15:32:02 +0800, Xincheng Zhang wrote:
> The VIA VL805 XHCI controller (Device ID 0x3483) fails to handle DMA
> addresses correctly when they exceed 0x1000000000 (64GB). On systems
> with large amounts of RAM, this hardware limitation causes device
> failures.
> 
> Add the XHCI_NO_64BIT_SUPPORT quirk to restrict DMA addressing to
> 32-bit, preventing the controller from receiving addresses beyond its
> hardware limit.
> 
> Signed-off-by: Xincheng Zhang <zhangxincheng@ultrarisc.com>

It could make sense to put a fix for this in stable too.

But I don't like this abuse of the quirk. Firstly, it causes
unnecessary bouncing on systems with >4GB RAM and no IOMMU.
I found other drivers that use DMA_BIT_MASK(36) or even weirder
numbers, so it seems that we too could request 64 gigs exactly
with a bit of driver refactoring.

Secondly, it makes the driver pretend that AC64 capability is absent.
Differences go beyond address bits, notably including register width
and whether QWORD or only DWORD writes cane be used. For example, if
we want to improve command abort on AC64 chips using QWORD writes, we
will need to know the true state of this capability, regarless of
whether the chip really implements all 64 address bits or not.

Forest, you have added a number of similar quirks for ASMedia chips.
Do you happen to know what is their real address width? I think it
might prove useful to have this on record.

Regards,
Michal

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

end of thread, other threads:[~2026-06-23 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23  7:32 [PATCH] usb: xhci-pci: Disable 64-bit DMA for VIA VL805 Xincheng Zhang
2026-06-23 10:18 ` Michal Pecio

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.