Skip to content

Instantly share code, notes, and snippets.

@oakwhiz
Created May 20, 2014 05:17
Show Gist options
  • Save oakwhiz/1dcec793e5f728556459 to your computer and use it in GitHub Desktop.
Save oakwhiz/1dcec793e5f728556459 to your computer and use it in GitHub Desktop.
Problem with VIA USB controller in Linux on Gigabyte motherboards

Gigabyte GA-990FXA-UD3 revision 4.0

IOMMU enabled

Linux 3.13

Problem:

VIA USB 3.0 controller doesn't work in Linux. The AMD IOMMU is enabled in the BIOS. Checking kernel messages (dmesg) shows that the USB controller is shut down due to an error, and there are also many error messages pertaining to AMD-Vi and access to a certain memory address through the IOMMU. Some USB ports do not work.

Cause:

I am not totally certain, but it seems that something is wrong with the BIOS. The USB controller seems to want direct access to some memory region. When the IOMMU is enabled, the USB controller gets mapped to different addresses, but it still wants to access that same memory region. The IOMMU blocks this, because the device is only allowed to use the new mapped region, interfering with normal operation and the USB controller is unable to initialize.

Solution:

To fix the problem, add the following kernel parameters before booting: (e.g. in /boot/grub/grub.cfg)

amd_iommu=on iommu=pt iommu=1

This places the IOMMU into passthrough mode, so that the IOMMU remaps all addresses to the same addresses that would normally be used without the IOMMU, thus enabling normal operation. I am uncertain of the ramifications of this, however it seems to solve the problem for now. Hopefully it does not interfere with KVM/Xen PCI passthrough. If it does not interfere with PCI passthrough, I am still not yet certain as to whether or not the VIA USB controller can be placed into PCI passthrough using the IOMMU, as this might require remapping the addresses, which could impede normal operation.

Gigabyte needs to fix this problem in a BIOS update. However in the meantime it may be possible to work around the problem further, using a kernel patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment