rpms/kernel/devel linux-2.6-usbmon-deficiency-workaround.patch, NONE, 1.1 kernel-2.6.spec, 1.1428, 1.1429

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Jul 12 21:24:42 UTC 2005


Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv23486

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-usbmon-deficiency-workaround.patch 
Log Message:
work around usbmon deficiency


linux-2.6-usbmon-deficiency-workaround.patch:
 transport.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

--- NEW FILE linux-2.6-usbmon-deficiency-workaround.patch ---

We have usbmon enabled now and it's good, but usb-storage moved away
from under me a little bit. It now maps everything for DMA beforehand,
which makes usbmon to miss the SCSI commands and replies.

I am going to address this problem in usbmon, where it belongs, but
it requires some work which is not done.

What do you think about carrying the attached patch for a few months
(I hope to turn around sooner, but you know how that works!)

-- Pete

diff -urp -X dontdiff linux-2.6.12/drivers/usb/storage/transport.c linux-2.6.12-lem/drivers/usb/storage/transport.c
--- linux-2.6.12/drivers/usb/storage/transport.c	2005-06-21 12:58:48.000000000 -0700
+++ linux-2.6.12-lem/drivers/usb/storage/transport.c	2005-07-06 14:00:30.000000000 -0700
@@ -948,8 +948,9 @@ int usb_stor_Bulk_max_lun(struct us_data
 
 int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
 {
-	struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
-	struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf;
+	/* Offset into iobuf a little in order to defeat pre-set DMA */
+	struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) (us->iobuf + 4);
+	struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) (us->iobuf + 4);
 	unsigned int transfer_length = srb->request_bufflen;
 	unsigned int residue;
 	int result;
@@ -960,7 +961,7 @@ int usb_stor_Bulk_transport(struct scsi_
 	/* Take care of BULK32 devices; set extra byte to 0 */
 	if ( unlikely(us->flags & US_FL_BULK32)) {
 		cbwlen = 32;
-		us->iobuf[31] = 0;
+		((unsigned char *)bcb)[31] = 0;
 	}
 
 	/* set up the command wrapper */



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1428
retrieving revision 1.1429
diff -u -r1.1428 -r1.1429
--- kernel-2.6.spec	12 Jul 2005 21:23:33 -0000	1.1428
+++ kernel-2.6.spec	12 Jul 2005 21:24:39 -0000	1.1429
@@ -316,6 +316,7 @@
 Patch1400: linux-2.6.12-usb-old_scheme_first.patch
 Patch1401: linux-2.6.12-rc3-ehci-misc-updates.patch
 Patch1402: linux-2.6.11-random-ehci-patch.patch
+Patch1403: linux-2.6-usbmon-deficiency-workaround.patch
 
 # Netdump and Diskdump bits.
 Patch1500: linux-2.6.10-crashdump-common.patch
@@ -733,6 +734,7 @@
 #%patch1401 -p1
 # Do something else originally described as "Alan's hint for ehci"
 %patch1402 -p1
+%patch1403 -p1
 
 # netdump bits
 #%patch1500 -p1
@@ -1256,6 +1258,7 @@
 * Tue Jul 12 2005 Dave Jones <davej at redhat.com>
 - 2.6.13-rc2-git5
 - Fix IDE locking bug de jour.
+- Workaround a usbmon deficiency.
 
 * Sun Jul 10 2005 Dave Jones <davej at redhat.com>
 - 2.6.13-rc2-git3




More information about the fedora-cvs-commits mailing list