linux/drivers
Sarah Sharp bd8a076ec0 xhci: Set slot and ep0 flags for address command.
commit d31c285b3a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 09:10:00 -08:00
..
accessibility
acpi ACPI atomicio: Convert width in bits to bytes in __acpi_ioremap_fast() 2011-11-11 09:37:11 -08:00
amba
ata ata_piix: make DVD Drive recognisable on systems with Intel Sandybridge chipsets(v2) 2011-11-11 09:35:50 -08:00
atm
auxdisplay
base drivers/base/node.c: fix compilation error with older versions of gcc 2011-11-26 09:09:59 -08:00
bcma
block xen/blkback: Report VBD_WSECT (wr_sect) properly. 2011-11-11 09:37:07 -08:00
bluetooth btusb: add device entry for Broadcom SoftSailing 2011-11-11 09:36:43 -08:00
cdrom
char TPM: Zero buffer after copying to userspace 2011-10-03 11:40:58 -07:00
clk
clocksource
connector
cpufreq drivers/cpufreq/pcc-cpufreq.c: avoid NULL pointer dereference 2011-10-03 11:40:31 -07:00
cpuidle
crypto crypto: caam - fix operator precedence in shared descriptor allocation 2011-06-30 07:43:27 +08:00
dca
dio
dma
edac i7core_edac: fixed typo in error count calculation 2011-08-29 13:29:06 -07:00
eisa
firewire firewire: sbp2: fix panic after rmmod with slow targets 2011-10-25 07:10:16 +02:00
firmware drivers/firmware/sigma.c needs MODULE_LICENSE 2011-08-04 21:58:38 -07:00
gpio gpio: wm831x: add a missing break in wm831x_gpio_dbg_show 2011-07-15 14:03:30 -06:00
gpu drm/i915/pch: Save/restore PCH_PORT_HOTPLUG across suspend 2011-11-26 09:09:53 -08:00
hid hid/apple: modern macbook airs use the standard apple function key translations 2011-11-11 09:37:22 -08:00
hwmon hwmon: (w83627ehf) Fix broken driver init 2011-11-11 09:37:00 -08:00
hwspinlock hwspinlock/core: use a mutex to protect the radix tree 2011-11-11 09:36:31 -08:00
i2c Merge branch 'for-30-rc5/all-i2c' of git://git.fluff.org/bjdooks/linux 2011-07-07 16:29:29 -07:00
ide ide-disk: Fix request requeuing 2011-10-16 14:14:51 -07:00
idle
ieee802154
infiniband cxgb3i: convert cdev->l2opt to use rcu to prevent NULL dereference 2011-10-03 11:41:08 -07:00
input input: pmic8xxx-pwrkey: Do not use mfd_get_data() 2011-07-05 10:38:43 +02:00
isdn net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared 2011-08-15 18:31:38 -07:00
leds Revert "leds: save the delay values after a successful call to blink_set()" 2011-11-21 14:31:19 -08:00
lguest
macintosh
mca
md md/raid5: abort any pending parity operations when array fails. 2011-11-21 14:31:22 -08:00
media saa7164: Add support for another HVR2200 hardware revision 2011-11-26 09:09:53 -08:00
memstick
message
mfd mfd: Fix twl4030 dependencies for audio codec 2011-11-21 14:31:23 -08:00
misc pcie-gadget-spear: Add "platform:" prefix for platform modalias 2011-11-26 09:09:59 -08:00
mmc mmc: core: ext_csd.raw_* used in comparison but never set 2011-11-11 09:35:23 -08:00
mtd mtd: nand_base: always initialise oob_poi before writing OOB data 2011-11-11 09:37:19 -08:00
net rt2x00: Fix sleep-while-atomic bug in powersaving code. 2011-11-26 09:09:54 -08:00
nfc
nubus
of
oprofile
parisc
parport
pci xen-pcifront: Update warning comment to use 'e820_host' option. 2011-11-11 09:35:46 -08:00
pcmcia pcmcia: pxa2xx/vpac270: free gpios on exist rather than requesting 2011-07-11 14:26:34 +08:00
platform WMI: properly cleanup devices to avoid crashes 2011-11-11 09:36:09 -08:00
pnp
power drivers/power/ds2780_battery.c: fix deadlock upon insertion and removal 2011-11-11 09:36:32 -08:00
pps
ps3
ptp
rapidio rapidio: fix use of non-compatible registers 2011-10-03 11:39:46 -07:00
regulator regulator: tps65910: Add missing breaks in switch/case 2011-10-03 11:40:01 -07:00
rtc rtc: Fix RTC PIE frequency limit 2011-10-03 11:40:08 -07:00
s390 ccwgroup: move attributes to attribute group 2011-11-11 09:36:09 -08:00
sbus
scsi aacraid: controller hangs if kernel uses non-default ASPM policy 2011-11-26 09:09:52 -08:00
sfi
sh
sn
spi spi/s3c64xx: Bug fix for SPI with different FIFO level 2011-07-06 15:03:08 +09:00
ssb ssb: fix init regression of hostmode PCI core 2011-07-07 13:06:08 -04:00
staging Staging: hv: Add support for >2 TB LUN in storage driver. 2011-11-11 09:35:14 -08:00
target tcm_loop: Add explict read buffer memset for SCF_SCSI_CONTROL_SG_IO_CDB 2011-11-11 09:37:01 -08:00
tc
telephony
thermal
tty TTY: ldisc, wait for ldisc infinitely in hangup 2011-11-26 09:09:58 -08:00
uio
usb xhci: Set slot and ep0 flags for address command. 2011-11-26 09:10:00 -08:00
uwb
vhost
video viafb: improve pitch handling 2011-11-11 09:36:13 -08:00
virtio virtio-pci: fix use after free 2011-11-21 14:31:14 -08:00
vlynq
w1 drivers/power/ds2780_battery.c: add a nolock function to w1 interface 2011-11-11 09:36:32 -08:00
watchdog watchdog: shwdt: fix usage of mod_timer 2011-08-04 21:58:42 -07:00
xen xen-gntalloc: signedness bug in add_grefs() 2011-11-21 14:31:24 -08:00
zorro zorro: Defer device_register() until all devices have been identified 2011-10-03 11:40:57 -07:00
Kconfig
Makefile