diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 15:29:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 15:29:28 -0500 |
commit | c0e0f8855f7fbc0c318bf514c53b4f5d4f897cde (patch) | |
tree | 31a21b1eca5606497e8bd6015bc61e626742680e | |
parent | d85b277ed1d3ff7b6084bf13963ab0a66544e81c (diff) | |
parent | f2d9b991c549f159dc9ae81f77d8206c790cbfee (diff) |
Merge tag 'for-usb-next-2014-01-08' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next
Sarah writes:
xhci: Urgent bug fixes for usb-next and 3.14.
Hi Greg,
Please queue these two patches to usb-next for 3.14.
An xHCI driver fix for USB ethernet devices that went into 3.13 and 3.12
stable is causing usb-storage to go into an infinite loop, and these two
patches fix the issue. I would like these to get into 3.14-rc1 so we
can avoid any potential data corruption for users.
Sarah Sharp
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 09b2b551be72..a0b248c34526 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -3000,7 +3000,7 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, | |||
3000 | if (num_trbs >= TRBS_PER_SEGMENT) { | 3000 | if (num_trbs >= TRBS_PER_SEGMENT) { |
3001 | xhci_err(xhci, "Too many fragments %d, max %d\n", | 3001 | xhci_err(xhci, "Too many fragments %d, max %d\n", |
3002 | num_trbs, TRBS_PER_SEGMENT - 1); | 3002 | num_trbs, TRBS_PER_SEGMENT - 1); |
3003 | return -ENOMEM; | 3003 | return -EINVAL; |
3004 | } | 3004 | } |
3005 | 3005 | ||
3006 | nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) | | 3006 | nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) | |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index f8ffc512faf1..ad364394885a 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -4730,8 +4730,8 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) | |||
4730 | struct device *dev = hcd->self.controller; | 4730 | struct device *dev = hcd->self.controller; |
4731 | int retval; | 4731 | int retval; |
4732 | 4732 | ||
4733 | /* Accept arbitrarily long scatter-gather lists */ | 4733 | /* Limit the block layer scatter-gather lists to half a segment. */ |
4734 | hcd->self.sg_tablesize = ~0; | 4734 | hcd->self.sg_tablesize = TRBS_PER_SEGMENT / 2; |
4735 | 4735 | ||
4736 | /* support to build packet from discontinuous buffers */ | 4736 | /* support to build packet from discontinuous buffers */ |
4737 | hcd->self.no_sg_constraint = 1; | 4737 | hcd->self.no_sg_constraint = 1; |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 24344aab2107..f8416639bf31 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1279,7 +1279,7 @@ union xhci_trb { | |||
1279 | * since the command ring is 64-byte aligned. | 1279 | * since the command ring is 64-byte aligned. |
1280 | * It must also be greater than 16. | 1280 | * It must also be greater than 16. |
1281 | */ | 1281 | */ |
1282 | #define TRBS_PER_SEGMENT 64 | 1282 | #define TRBS_PER_SEGMENT 256 |
1283 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ | 1283 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ |
1284 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) | 1284 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) |
1285 | #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) | 1285 | #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) |