Skip to contentSkip to conversation

patch "usb: misc: usbtest: fix pattern tests for scatterlists." added to usb-testing

PATCH [email protected] 1 participant 1 message May 3, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: misc: usbtest: fix pattern tests for scatterlists.

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.

If you have any questions about this process, please let me know.

Quoted 1 line

From cdc77c82a8286b1181b81b6e5ef60c8e83ded7bc Mon Sep 17 00:00:00 2001

From: Mathias Nyman <[email protected]>
Date: Mon, 2 May 2016 11:39:03 +0300
Subject: usb: misc: usbtest: fix pattern tests for scatterlists.

The current implemenentation restart the sent pattern for each entry in the sg list. The receiving end expects a continuous pattern, and test will fail unless scatterilst entries happen to be aligned with the pattern

Fix this by calculating the pattern byte based on total sent size instead of just the current sg entry.

Fixes 8b5249019352 ("[PATCH] USB: usbtest: scatterlist OUT data pattern testing")
Cc <[email protected]> # v2.6.18+
---
 drivers/usb/misc/usbtest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/misc/usbtest.c +3 -1
index de485d8a5beb..6b978f04b8d7 100644
@@ -532,6 +532,7 @@ static struct scatterlist *
 alloc_sglist(int nents, int max, int vary, struct usbtest_dev *dev, int pipe)
 {
 	struct scatterlist	*sg;
+	unsigned int		n_size = 0;
 	unsigned		i;
 	unsigned		size = max;
 	unsigned		maxpacket =
@@ -564,7 +565,8 @@ alloc_sglist(int nents, int max, int vary, struct usbtest_dev *dev, int pipe)
 			break;
 		case 1:
 			for (j = 0; j < size; j++)
-				*buf++ = (u8) ((j % maxpacket) % 63);
+				*buf++ = (u8) (((j + n_size) % maxpacket) % 63);
+			n_size += size;
 			break;
 		}
 
Signature · 1 line
2.8.2