linux-kernel-test/drivers/usb/host
Sarah Sharp d31c285b3a xhci: Set slot and ep0 flags for address command.
Matt's AsMedia xHCI host controller was responding with a Context Error
to an address device command after a configured device reset.  Some
sequence of events leads both the slot and endpoint zero add flags
cleared to zero, which the AsMedia host doesn't like:

[  223.701839] xhci_hcd 0000:03:00.0: Slot ID 1 Input Context:
[  223.701841] xhci_hcd 0000:03:00.0: @ffff880137b25000 (virt) @ffffc000 (dma) 0x000000 - drop flags
[  223.701843] xhci_hcd 0000:03:00.0: @ffff880137b25004 (virt) @ffffc004 (dma) 0x000000 - add flags
[  223.701846] xhci_hcd 0000:03:00.0: @ffff880137b25008 (virt) @ffffc008 (dma) 0x000000 - rsvd2[0]
[  223.701848] xhci_hcd 0000:03:00.0: @ffff880137b2500c (virt) @ffffc00c (dma) 0x000000 - rsvd2[1]
[  223.701850] xhci_hcd 0000:03:00.0: @ffff880137b25010 (virt) @ffffc010 (dma) 0x000000 - rsvd2[2]
[  223.701852] xhci_hcd 0000:03:00.0: @ffff880137b25014 (virt) @ffffc014 (dma) 0x000000 - rsvd2[3]
[  223.701854] xhci_hcd 0000:03:00.0: @ffff880137b25018 (virt) @ffffc018 (dma) 0x000000 - rsvd2[4]
[  223.701857] xhci_hcd 0000:03:00.0: @ffff880137b2501c (virt) @ffffc01c (dma) 0x000000 - rsvd2[5]
[  223.701858] xhci_hcd 0000:03:00.0: Slot Context:
[  223.701860] xhci_hcd 0000:03:00.0: @ffff880137b25020 (virt) @ffffc020 (dma) 0x8400000 - dev_info
[  223.701862] xhci_hcd 0000:03:00.0: @ffff880137b25024 (virt) @ffffc024 (dma) 0x010000 - dev_info2
[  223.701864] xhci_hcd 0000:03:00.0: @ffff880137b25028 (virt) @ffffc028 (dma) 0x000000 - tt_info
[  223.701866] xhci_hcd 0000:03:00.0: @ffff880137b2502c (virt) @ffffc02c (dma) 0x000000 - dev_state
[  223.701869] xhci_hcd 0000:03:00.0: @ffff880137b25030 (virt) @ffffc030 (dma) 0x000000 - rsvd[0]
[  223.701871] xhci_hcd 0000:03:00.0: @ffff880137b25034 (virt) @ffffc034 (dma) 0x000000 - rsvd[1]
[  223.701873] xhci_hcd 0000:03:00.0: @ffff880137b25038 (virt) @ffffc038 (dma) 0x000000 - rsvd[2]
[  223.701875] xhci_hcd 0000:03:00.0: @ffff880137b2503c (virt) @ffffc03c (dma) 0x000000 - rsvd[3]
[  223.701877] xhci_hcd 0000:03:00.0: Endpoint 00 Context:
[  223.701879] xhci_hcd 0000:03:00.0: @ffff880137b25040 (virt) @ffffc040 (dma) 0x000000 - ep_info
[  223.701881] xhci_hcd 0000:03:00.0: @ffff880137b25044 (virt) @ffffc044 (dma) 0x2000026 - ep_info2
[  223.701883] xhci_hcd 0000:03:00.0: @ffff880137b25048 (virt) @ffffc048 (dma) 0xffffe8e0 - deq
[  223.701885] xhci_hcd 0000:03:00.0: @ffff880137b25050 (virt) @ffffc050 (dma) 0x000000 - tx_info
[  223.701887] xhci_hcd 0000:03:00.0: @ffff880137b25054 (virt) @ffffc054 (dma) 0x000000 - rsvd[0]
[  223.701889] xhci_hcd 0000:03:00.0: @ffff880137b25058 (virt) @ffffc058 (dma) 0x000000 - rsvd[1]
[  223.701892] xhci_hcd 0000:03:00.0: @ffff880137b2505c (virt) @ffffc05c (dma) 0x000000 - rsvd[2]
...
[  223.701927] xhci_hcd 0000:03:00.0: // Ding dong!
[  223.701992] xhci_hcd 0000:03:00.0: Setup ERROR: address device command for slot 1.

The xHCI spec says that both flags must be set to one for the Address
Device command.  When the device is first enumerated,
xhci_setup_addressable_virt_dev() does set those flags.  However, when
the device is addressed after it has been reset in the configured state,
xhci_setup_addressable_virt_dev() is not called, and
xhci_copy_ep0_dequeue_into_input_ctx() is called instead.  That function
relies on the flags being set up by previous commands, which apparently
isn't a good assumption.

Move the setting of the flags into the common parent function.

This should be queued for stable kernels as old as 2.6.35, since that
was the first introduction of xhci_copy_ep0_dequeue_into_input_ctx.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Matt <mdm@iinet.net.au>
Cc: stable@vger.kernel.org
2011-11-04 12:33:25 -07:00
..
whci treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-ath79.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-atmel.c USB: EHCI: Support controllers with big endian capability regs 2011-05-03 11:43:21 -07:00
ehci-au1xxx.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-cns3xxx.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-dbg.c EHCI: workaround for MosChip controller bug 2011-10-18 13:49:33 -07:00
ehci-fsl.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-fsl.h USB: ehci-fsl: add MPC5121E specific suspend and resume 2011-05-02 16:59:36 -07:00
ehci-grlib.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-hcd.c EHCI: workaround for MosChip controller bug 2011-10-18 13:49:33 -07:00
ehci-hub.c Merge 3.1-rc4 into usb-next 2011-08-29 08:56:17 -07:00
ehci-ixp4xx.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-lpm.c USB: Mark EHCI LPM functions as __maybe_unused 2011-02-17 10:47:55 -08:00
ehci-mem.c
ehci-msm.c ehci-msm : use ehci_setup 2011-07-08 14:51:29 -07:00
ehci-mxc.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-octeon.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-omap.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-orion.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-pci.c EHCI: workaround for MosChip controller bug 2011-10-18 13:49:33 -07:00
ehci-pmcmsp.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-ppc-of.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-ps3.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-pxa168.c USB: pxa168: Add onchip USB host controller support 2011-08-22 15:38:30 -07:00
ehci-q.c usb: ehci: remove the 1st wmb in qh_append_tds 2011-09-18 01:38:59 -07:00
ehci-s5p.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-sched.c EHCI: workaround for MosChip controller bug 2011-10-18 13:49:33 -07:00
ehci-sh.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-spear.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-sysfs.c USB: EHCI: Allow users to override 80% max periodic bandwidth 2011-07-08 14:51:33 -07:00
ehci-tegra.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-vt8500.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ehci-w90x900.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-xilinx-of.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ehci-xls.c usb: OHCI/EHCI support for Netlogic XLS processor. 2011-08-22 15:54:38 -07:00
ehci.h EHCI: workaround for MosChip controller bug 2011-10-18 13:49:33 -07:00
fhci-dbg.c
fhci-hcd.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c QE/FHCI: fixed the CONTROL bug 2011-10-18 13:51:34 -07:00
fhci-tds.c Fix common misspellings 2011-03-31 11:26:23 -03:00
fhci.h Fix common misspellings 2011-03-31 11:26:23 -03:00
fsl-mph-dr-of.c USB: ehci-fsl: Fix 'have_sysif_regs' detection 2011-01-22 18:38:58 -08:00
hwa-hc.c
imx21-dbg.c treewide: fix a few typos in comments 2011-05-10 10:16:21 +02:00
imx21-hcd.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
imx21-hcd.h
isp116x-hcd.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
isp116x.h Fix common misspellings 2011-03-31 11:26:23 -03:00
isp1362-hcd.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
isp1362.h
isp1760-hcd.c usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB. 2011-10-19 13:29:06 -07:00
isp1760-hcd.h usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB. 2011-10-19 13:29:06 -07:00
isp1760-if.c usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB. 2011-10-19 13:29:06 -07:00
Kconfig usb: gadget: renesas_usbhs: add mod_host support 2011-10-13 20:41:52 +03:00
Makefile usb/xhci: remove CONFIG_PCI in xhci.c's probe function 2011-09-26 15:51:14 -07:00
octeon2-common.c usb: Configure octeon2 glue logic for proper uSOF cycle period. 2011-05-03 10:09:32 -07:00
ohci-at91.c
ohci-ath79.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-au1xxx.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-cns3xxx.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ohci-da8xx.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-dbg.c
ohci-ep93xx.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-hcd.c usb: OHCI/EHCI support for Netlogic XLS processor. 2011-08-22 15:54:38 -07:00
ohci-hub.c USB: Fix runtime wakeup on OHCI 2011-10-18 13:42:07 -07:00
ohci-jz4740.c
ohci-mem.c
ohci-octeon.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-omap3.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-omap.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-pci.c OHCI: fix regression caused by nVidia shutdown workaround 2011-05-17 11:20:23 -07:00
ohci-pnx4008.c Merge branch 'gpio' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-27 08:39:10 +02:00
ohci-pnx8550.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-ppc-of.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-ppc-soc.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-ps3.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-pxa27x.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-q.c USB: use usb_endpoint_maxp() instead of le16_to_cpu() 2011-08-23 09:47:40 -07:00
ohci-s3c2410.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-sa1111.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-sh.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-sm501.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-spear.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-ssb.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-tmio.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
ohci-xls.c usb: OHCI/EHCI support for Netlogic XLS processor. 2011-08-22 15:54:38 -07:00
ohci.h Merge branch 'remove' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-03-16 19:05:40 -07:00
oxu210hp-hcd.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
oxu210hp.h
pci-quirks.c usb/host/pci-quirks.c: correct annotation of `ehci_dmi_nohandoff_table' 2011-08-08 14:00:14 -07:00
pci-quirks.h Intel xhci: Support EHCI/xHCI port switching. 2011-05-27 12:07:36 -07:00
r8a66597-hcd.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
r8a66597.h usb: r8a66597-hcd: add function for external controller 2011-07-08 14:57:11 -07:00
sl811_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
sl811-hcd.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
sl811.h
u132-hcd.c usb: u132-hcd: Drop __TIME__ usage 2011-04-13 16:36:06 -07:00
uhci-debug.c USB: UHCI: Add support for big endian descriptors 2011-05-19 16:43:20 -07:00
uhci-grlib.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
uhci-hcd.c USB: UHCI: improve comments and logic for root-hub suspend 2011-09-26 15:58:18 -07:00
uhci-hcd.h USB: UHCI: Add support for big endian descriptors 2011-05-19 16:43:20 -07:00
uhci-hub.c USB: UHCI: Wrap I/O register accesses 2011-05-06 18:24:01 -07:00
uhci-pci.c USB: UHCI: Move PCI specific functions to uhci-pci.c 2011-05-06 18:24:00 -07:00
uhci-q.c USB: use usb_endpoint_maxp() instead of le16_to_cpu() 2011-08-23 09:47:40 -07:00
xhci-dbg.c Merge 3.0-rc2 into usb-linus as it's needed by some USB patches 2011-06-14 06:51:23 -07:00
xhci-ext-caps.h xHCI: Check host USB2 LPM capability 2011-09-26 15:51:09 -07:00
xhci-hub.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2011-10-25 12:23:15 +02:00
xhci-mem.c xhci: Set slot and ep0 flags for address command. 2011-11-04 12:33:25 -07:00
xhci-pci.c usb/xhci: remove CONFIG_PCI in xhci.c's probe function 2011-09-26 15:51:14 -07:00
xhci-ring.c usb, xhci: fix lockdep warning on endpoint timeout 2011-11-02 13:07:59 -07:00
xhci.c xhci: Set slot and ep0 flags for address command. 2011-11-04 12:33:25 -07:00
xhci.h usb/xhci: remove CONFIG_PCI in xhci.c's probe function 2011-09-26 15:51:14 -07:00