public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Patch "usb: misc: usbtest: fix pattern tests for scatterlists." has been added to the 4.5-stable tree
@ 2016-05-30 20:22 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-05-30 20:22 UTC (permalink / raw)
  To: mathias.nyman, felipe.balbi, gregkh, stern; +Cc: stable, stable-commits


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 the 4.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-misc-usbtest-fix-pattern-tests-for-scatterlists.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From cdc77c82a8286b1181b81b6e5ef60c8e83ded7bc Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman@linux.intel.com>
Date: Mon, 2 May 2016 11:39:03 +0300
Subject: usb: misc: usbtest: fix pattern tests for scatterlists.

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit cdc77c82a8286b1181b81b6e5ef60c8e83ded7bc upstream.

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.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Fixes: 8b5249019352 ("[PATCH] USB: usbtest: scatterlist OUT data pattern testing")
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/misc/usbtest.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -529,6 +529,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 =
@@ -561,7 +562,8 @@ alloc_sglist(int nents, int max, int var
 			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;
 		}
 


Patches currently in stable-queue which might be from mathias.nyman@linux.intel.com are

queue-4.5/usb-misc-usbtest-fix-pattern-tests-for-scatterlists.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-30 20:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-30 20:22 Patch "usb: misc: usbtest: fix pattern tests for scatterlists." has been added to the 4.5-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox