Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-usb-linus-2013-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus

Sarah writes:

xhci: Bug fixes, now with more tags!

Hi Greg,

Here's five bug fixes for 3.12.

The three patches are marked for stable. Two fix NULL pointer dereferences.
The third marked for stable suppresses some serious log spam from unnecessary
xHCI driver warnings, whenever an isochronous short packet happens on an xHCI
1.0 host.

The other two patches fix build warnings.

Sarah Sharp

+14 -7
+1
drivers/usb/host/pci-quirks.h
··· 13 13 void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); 14 14 void sb800_prefetch(struct device *dev, int on); 15 15 #else 16 + struct pci_dev; 16 17 static inline void usb_amd_quirk_pll_disable(void) {} 17 18 static inline void usb_amd_quirk_pll_enable(void) {} 18 19 static inline void usb_amd_dev_put(void) {}
-1
drivers/usb/host/xhci-pci.c
··· 93 93 } 94 94 if (pdev->vendor == PCI_VENDOR_ID_INTEL && 95 95 pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) { 96 - xhci->quirks |= XHCI_SPURIOUS_SUCCESS; 97 96 xhci->quirks |= XHCI_EP_LIMIT_QUIRK; 98 97 xhci->limit_active_eps = 64; 99 98 xhci->quirks |= XHCI_SW_BW_CHECKING;
+1 -1
drivers/usb/host/xhci-ring.c
··· 434 434 435 435 /* A ring has pending URBs if its TD list is not empty */ 436 436 if (!(ep->ep_state & EP_HAS_STREAMS)) { 437 - if (!(list_empty(&ep->ring->td_list))) 437 + if (ep->ring && !(list_empty(&ep->ring->td_list))) 438 438 xhci_ring_ep_doorbell(xhci, slot_id, ep_index, 0); 439 439 return; 440 440 }
+12 -5
drivers/usb/host/xhci.c
··· 329 329 return; 330 330 } 331 331 332 - static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) 332 + static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) 333 333 { 334 334 int i; 335 335 ··· 1181 1181 } 1182 1182 1183 1183 xhci = hcd_to_xhci(hcd); 1184 - if (xhci->xhc_state & XHCI_STATE_HALTED) 1185 - return -ENODEV; 1186 - 1187 1184 if (check_virt_dev) { 1188 1185 if (!udev->slot_id || !xhci->devs[udev->slot_id]) { 1189 1186 printk(KERN_DEBUG "xHCI %s called with unaddressed " ··· 1195 1198 return -EINVAL; 1196 1199 } 1197 1200 } 1201 + 1202 + if (xhci->xhc_state & XHCI_STATE_HALTED) 1203 + return -ENODEV; 1198 1204 1199 1205 return 1; 1200 1206 } ··· 3898 3898 * Issue an Evaluate Context command to change the Maximum Exit Latency in the 3899 3899 * slot context. If that succeeds, store the new MEL in the xhci_virt_device. 3900 3900 */ 3901 - static int xhci_change_max_exit_latency(struct xhci_hcd *xhci, 3901 + static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci, 3902 3902 struct usb_device *udev, u16 max_exit_latency) 3903 3903 { 3904 3904 struct xhci_virt_device *virt_dev; ··· 4891 4891 xhci_print_registers(xhci); 4892 4892 4893 4893 get_quirks(dev, xhci); 4894 + 4895 + /* In xhci controllers which follow xhci 1.0 spec gives a spurious 4896 + * success event after a short transfer. This quirk will ignore such 4897 + * spurious event. 4898 + */ 4899 + if (xhci->hci_version > 0x96) 4900 + xhci->quirks |= XHCI_SPURIOUS_SUCCESS; 4894 4901 4895 4902 /* Make sure the HC is halted. */ 4896 4903 retval = xhci_halt(xhci);