Mathias Nyman 7895086afd xhci: fix off by one error in TRB DMA address boundary check
We need to check that a TRB is part of the current segment
before calculating its DMA address.

Previously a ring segment didn't use a full memory page, and every
new ring segment got a new memory page, so the off by one
error in checking the upper bound was never seen.

Now that we use a full memory page, 256 TRBs (4096 bytes), the off by one
didn't catch the case when a TRB was the first element of the next segment.

This is triggered if the virtual memory pages for a ring segment are
next to each in increasing order where the ring buffer wraps around and
causes errors like:

[  106.398223] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 0 comp_code 1
[  106.398230] xhci_hcd 0000:00:14.0: Looking for event-dma fffd3000 trb-start fffd4fd0 trb-end fffd5000 seg-start fffd4000 seg-end fffd4ff0

The trb-end address is one outside the end-seg address.

Cc: <stable@vger.kernel.org>
Tested-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 14:41:48 -07:00
..
2015-06-10 22:46:34 -07:00
2015-06-26 11:54:29 -07:00
2015-07-17 16:39:53 -07:00
2015-07-08 15:14:13 +08:00
2015-07-17 16:39:53 -07:00
2015-07-23 14:17:39 +02:00
2015-07-25 11:24:58 -07:00
2015-06-13 08:44:14 -07:00
2015-07-17 16:39:53 -07:00
2015-06-26 14:51:15 -07:00
2015-07-01 19:40:18 -07:00
2015-07-15 20:02:09 +05:30
2015-06-23 13:32:38 -07:00
2015-07-23 13:07:04 -07:00
2015-07-23 13:07:04 -07:00
2015-07-02 14:40:49 -07:00
2015-06-28 12:32:13 -07:00
2015-07-23 13:07:04 -07:00
2015-07-03 16:02:25 -07:00