xhci: Cleanups, non-urgent fixes for 3.14.

Happy Holidays, Greg!
 
 Here's four patches to be queued to usb-next for 3.14.
 
 One adds a module parameter to the xHCI driver to allow users to enable
 xHCI quirks without recompiling their kernel, which you've already said
 is fine.  The second patch is a bug fix for new usbtest code that's only
 in usb-next.  The third patch is simple cleanup.
 
 The last patch is a non-urgent bug fix for xHCI platform devices.  The
 bug has been in the code since 3.9.  You've been asking me to hold off
 on non-urgent bug fixes after -rc4/-rc5, so it can go into usb-next, and
 be backported to stable once 3.14 is out.
 
 These have all been tested over the past week.  I did run across one
 oops, but it turned out to be a bug in 3.12, and therefore not related
 to any of these patches.
 
 Please queue these for usb-next and 3.14.
 
 Thanks,
 Sarah Sharp
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJStMtLAAoJEBMGWMLi1Gc5uxMQAIXOL38n53yfNETU+DJMLaWB
 +DY/RJjJ0zAZuRL9emOvR+BYEsQpd2q6aT3F2MryjJT/dhEKwJgHLTLOv0EQEWS7
 dfLXX/NKNI+iRNyJkSATriytWMmMwv13kTXkreu99ZAw2PWWt7mM4BPHaWJ6sz5G
 MjWS3v6LE59zjZatdzZyg4wlgUeNmO8cc4CV8YSqv0rFiVrKBL8IJsxwgQkWXI+2
 J19hZcEpgeVMPo7aPlkMGoS1Ze9SxTviALBVLBWwwR028UfWCELFWsSFGVfJ6RgJ
 /3DsE+jhQBn/1Y1o6hrlU/arDj7N/iJ3Gz5Ru5l+BtJw56fdaI/ToaHzzIDarONE
 DGLiziDIknlSPsuX6X81kqXqROz1Zt624aqLipvqGCk0FMrLZz5BMaPEslkmW4Wb
 /TQRX6KnTVzK4uMjv5yNVaGtnyoTStJeRE7dIF4/9e2YDLo4SCmm2Y9necr4C3Ls
 7FzT8t6m9F74ZHAkmPpKFlEkYTYOy3yv/KBlhHF/OVFo9FAxAwUEY69QVrvhaHVX
 GhLANc4NOuJb1eIwQarVkub2+lLI3N9zwEWliepKKUTQ8OTFDkDFM/+bwDHd4RzD
 PO23wuFHVLj9N2BZbIAV2OkDyJLU2FOl+ZiEG6NUDXssihiZj4AVfIRiOU1c3EMc
 g27X+N4FI2fnpqvAYq/a
 =PRbx
 -----END PGP SIGNATURE-----

Merge tag 'for-usb-next-2013-12-20' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next

Sarah writes:

xhci: Cleanups, non-urgent fixes for 3.14.

Happy Holidays, Greg!

Here's four patches to be queued to usb-next for 3.14.

One adds a module parameter to the xHCI driver to allow users to enable
xHCI quirks without recompiling their kernel, which you've already said
is fine.  The second patch is a bug fix for new usbtest code that's only
in usb-next.  The third patch is simple cleanup.

The last patch is a non-urgent bug fix for xHCI platform devices.  The
bug has been in the code since 3.9.  You've been asking me to hold off
on non-urgent bug fixes after -rc4/-rc5, so it can go into usb-next, and
be backported to stable once 3.14 is out.

These have all been tested over the past week.  I did run across one
oops, but it turned out to be a bug in 3.12, and therefore not related
to any of these patches.

Please queue these for usb-next and 3.14.

Thanks,
Sarah Sharp
This commit is contained in:
Greg Kroah-Hartman 2013-12-21 15:58:40 -08:00
commit e2a3a64855
3 changed files with 10 additions and 7 deletions

View File

@ -156,8 +156,6 @@ static void next_trb(struct xhci_hcd *xhci,
*/ */
static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring) static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring)
{ {
unsigned long long addr;
ring->deq_updates++; ring->deq_updates++;
/* /*
@ -186,8 +184,6 @@ static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring)
ring->dequeue++; ring->dequeue++;
} }
} while (last_trb(xhci, ring, ring->deq_seg, ring->dequeue)); } while (last_trb(xhci, ring, ring->deq_seg, ring->dequeue));
addr = (unsigned long long) xhci_trb_virt_to_dma(ring->deq_seg, ring->dequeue);
} }
/* /*
@ -212,7 +208,6 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring,
{ {
u32 chain; u32 chain;
union xhci_trb *next; union xhci_trb *next;
unsigned long long addr;
chain = le32_to_cpu(ring->enqueue->generic.field[3]) & TRB_CHAIN; chain = le32_to_cpu(ring->enqueue->generic.field[3]) & TRB_CHAIN;
/* If this is not event ring, there is one less usable TRB */ /* If this is not event ring, there is one less usable TRB */
@ -264,7 +259,6 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring,
ring->enqueue = ring->enq_seg->trbs; ring->enqueue = ring->enq_seg->trbs;
next = ring->enqueue; next = ring->enqueue;
} }
addr = (unsigned long long) xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue);
} }
/* /*

View File

@ -40,6 +40,10 @@ static int link_quirk;
module_param(link_quirk, int, S_IRUGO | S_IWUSR); module_param(link_quirk, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB"); MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB");
static unsigned int quirks;
module_param(quirks, uint, S_IRUGO);
MODULE_PARM_DESC(quirks, "Bit flags for quirks to be enabled as default");
/* TODO: copied from ehci-hcd.c - can this be refactored? */ /* TODO: copied from ehci-hcd.c - can this be refactored? */
/* /*
* xhci_handshake - spin reading hc until handshake completes or fails * xhci_handshake - spin reading hc until handshake completes or fails
@ -321,6 +325,9 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
struct usb_hcd *hcd = xhci_to_hcd(xhci); struct usb_hcd *hcd = xhci_to_hcd(xhci);
struct pci_dev *pdev = to_pci_dev(hcd->self.controller); struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
if (xhci->quirks & XHCI_PLAT)
return;
xhci_free_irq(xhci); xhci_free_irq(xhci);
if (xhci->msix_entries) { if (xhci->msix_entries) {
@ -4770,6 +4777,8 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
xhci->hcc_params = readl(&xhci->cap_regs->hcc_params); xhci->hcc_params = readl(&xhci->cap_regs->hcc_params);
xhci_print_registers(xhci); xhci_print_registers(xhci);
xhci->quirks = quirks;
get_quirks(dev, xhci); get_quirks(dev, xhci);
/* In xhci controllers which follow xhci 1.0 spec gives a spurious /* In xhci controllers which follow xhci 1.0 spec gives a spurious

View File

@ -1232,7 +1232,7 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param *param)
len = le16_to_cpu(udev->bos->desc->wTotalLength); len = le16_to_cpu(udev->bos->desc->wTotalLength);
else else
len = sizeof(struct usb_bos_descriptor); len = sizeof(struct usb_bos_descriptor);
if (udev->speed != USB_SPEED_SUPER) if (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0201)
expected = -EPIPE; expected = -EPIPE;
break; break;
default: default: