Skip to content

Commit

Permalink
xhci: fix write to USB3_PSSEN and XUSB2PRM pci config registers
Browse files Browse the repository at this point in the history
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 <burzalodowa@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
  • Loading branch information
Xenia Ragiadakou authored and Sarah Sharp committed Oct 9, 2013
1 parent 455f589 commit e459933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/host/pci-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)
* switchable ports.
*/
pci_write_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN,
cpu_to_le32(ports_available));
ports_available);

pci_read_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN,
&ports_available);
Expand All @@ -821,7 +821,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)
* host.
*/
pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR,
cpu_to_le32(ports_available));
ports_available);

pci_read_config_dword(xhci_pdev, USB_INTEL_XUSB2PR,
&ports_available);
Expand Down

0 comments on commit e459933

Please sign in to comment.