Skip to content

Commit e459933

Browse files
elbeastoSarah Sharp
authored andcommitted
xhci: fix write to USB3_PSSEN and XUSB2PRM pci config registers
The function pci_write_config_dword() sets the appropriate byteordering internally so the value argument should not be converted to little-endian. This bug was found by sparse. This patch is not suitable for stable. Since cpu_to_lei32 is a no-op on little endian systems, this bug would only affect big endian Intel systems with the EHCI to xHCI port switchover, which are non-existent, AFAIK. Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
1 parent 455f589 commit e459933

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/host/pci-quirks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)
799799
* switchable ports.
800800
*/
801801
pci_write_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN,
802-
cpu_to_le32(ports_available));
802+
ports_available);
803803

804804
pci_read_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN,
805805
&ports_available);
@@ -821,7 +821,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)
821821
* host.
822822
*/
823823
pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR,
824-
cpu_to_le32(ports_available));
824+
ports_available);
825825

826826
pci_read_config_dword(xhci_pdev, USB_INTEL_XUSB2PR,
827827
&ports_available);

0 commit comments

Comments
 (0)