Skip to content

Commit 8f873c1

Browse files
jwrdegoedegregkh
authored andcommitted
xhci: Blacklist using streams on the Etron EJ168 controller
Streams on the EJ168 do not work as they should. I've spend 2 days trying to get them to work, but without success. The first problem is that when ever you ring the stream-ring doorbell, the controller starts executing trbs at the beginning of the first ring segment, event if it ended somewhere else previously. This can be worked around by allowing enqueing only one td (not a problem with how streams are typically used) and then resetting our copies of the enqueueing en dequeueing pointers on a td completion to match what the controller seems to be doing. This way things seem to start working with uas and instead of being able to complete only the very first scsi command, the scsi core can probe the disk. But then things break later on when td-s get enqueued with more then one trb. The controller does seem to increase its dequeue pointer while executing a stream-ring (data transfer events I inserted for debugging do trigger). However execution seems to stop at the final normal trb of a multi trb td, even if there is a data transfer event inserted after the final trb. The first problem alone is a serious deviation from the spec, and esp. dealing with cancellation would have been very tricky if not outright impossible, but the second problem simply is a deal breaker altogether, so this patch simply disables streams. Note this will cause the usb-storage + uas driver pair to automatically switch to using usb-storage instead of uas on these devices, essentially reverting to the 3.14 and earlier behavior when uas was marked CONFIG_BROKEN. https://bugzilla.redhat.com/show_bug.cgi?id=1121288 https://bugzilla.kernel.org/show_bug.cgi?id=80101 Cc: [email protected] # 3.15 Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e2875c3 commit 8f873c1

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
143143
pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
144144
xhci->quirks |= XHCI_RESET_ON_RESUME;
145145
xhci->quirks |= XHCI_TRUST_TX_LENGTH;
146+
xhci->quirks |= XHCI_BROKEN_STREAMS;
146147
}
147148
if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
148149
pdev->device == 0x0015)
@@ -230,7 +231,8 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
230231
goto put_usb3_hcd;
231232
/* Roothub already marked as USB 3.0 speed */
232233

233-
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
234+
if (!(xhci->quirks & XHCI_BROKEN_STREAMS) &&
235+
HCC_MAX_PSA(xhci->hcc_params) >= 4)
234236
xhci->shared_hcd->can_do_streams = 1;
235237

236238
/* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */

drivers/usb/host/xhci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,8 @@ int xhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev,
31483148
num_streams);
31493149

31503150
/* MaxPSASize value 0 (2 streams) means streams are not supported */
3151-
if (HCC_MAX_PSA(xhci->hcc_params) < 4) {
3151+
if ((xhci->quirks & XHCI_BROKEN_STREAMS) ||
3152+
HCC_MAX_PSA(xhci->hcc_params) < 4) {
31523153
xhci_dbg(xhci, "xHCI controller does not support streams.\n");
31533154
return -ENOSYS;
31543155
}

drivers/usb/host/xhci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,8 @@ struct xhci_hcd {
15581558
#define XHCI_PLAT (1 << 16)
15591559
#define XHCI_SLOW_SUSPEND (1 << 17)
15601560
#define XHCI_SPURIOUS_WAKEUP (1 << 18)
1561+
/* For controllers with a broken beyond repair streams implementation */
1562+
#define XHCI_BROKEN_STREAMS (1 << 19)
15611563
unsigned int num_active_eps;
15621564
unsigned int limit_active_eps;
15631565
/* There are two roothubs to keep track of bus suspend info for */

0 commit comments

Comments
 (0)