Re: Regression - Linux 4.9: ums_eneub6250 broken: transfer buffer not dma capable - Trace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 19 Apr 2017, Andreas Hartmann wrote:

> Am 19.04.2017 um 17:49 schrieb Alan Stern:
> > On Tue, 18 Apr 2017, Andreas Hartmann wrote:
> >
> >> Am 18.04.2017 um 21:31 schrieb Alan Stern:
> >>> On Mon, 17 Apr 2017, Andreas Hartmann wrote:
> >>>
> >>>>> Good start, but there are five (!) other places in this driver where
> >>>>> the same bug occurs, at lines 904, 1350, 1577, 2088, and 2157.  Would
> >>>>> you like to fix them too?
> >>>>>
> >>>>> Maybe it would be easier for the driver to allocate a single 512-byte
> >>>>> buffer at the start, and use it for all of these I/O requests.
> >>>>
> >>>> Yes, it doesn't work yet:
> >>>
> >>> Okay, please try this patch instead.
> >>
> >> Thanks for your patch! It's working mostly. Sometimes, there are errors.
> >> The short sequences are the broken one. They are not always behaving equal!
> >
> > Can you collect a usbmon trace showing a good sequence and a trace
> > showing a bad sequence?
> 
> Hello Alan,
> 
> attached are 4 files, 2 examples for good and 2 for bad. Hope it helps!

I don't see anything wrong in the usbmon traces.

> This is the corresponding log:
> 
> ok 1:
> 
> Apr 19 19:25:37 notebook2 kernel: usb 1-1.1: new high-speed USB device number 20 using ehci-pci
> Apr 19 19:25:37 notebook2 kernel: usb 1-1.1: New USB device found, idVendor=0cf2, idProduct=6250
> Apr 19 19:25:37 notebook2 kernel: usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=4
> Apr 19 19:25:37 notebook2 kernel: usb 1-1.1: Product: UB6250
> Apr 19 19:25:37 notebook2 kernel: usb 1-1.1: Manufacturer: ENE Flash
> Apr 19 19:25:37 notebook2 kernel: usb 1-1.1: SerialNumber: 606569746801
> Apr 19 19:25:37 notebook2 kernel: ums_eneub6250 1-1.1:1.0: USB Mass Storage device detected
> Apr 19 19:25:37 notebook2 kernel: scsi host6: usb-storage 1-1.1:1.0
> Apr 19 19:25:37 notebook2 mtp-probe[22976]: checking bus 1, device 20: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1"
> Apr 19 19:25:37 notebook2 mtp-probe[22976]: bus: 1, device: 20 was not an MTP device
> Apr 19 19:25:38 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init1.bin
> Apr 19 19:25:38 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init2.bin
> Apr 19 19:25:39 notebook2 kernel: scsi host6: scsi scan: INQUIRY result too short (5), using 36

But that is wrong!  Even though it's for a working test.  It means the 
usb_stor_set_xfer_buf() subroutine isn't doing what it should.

Please apply the following debugging patch (on top of the previous one) 
and let's see what it prints in the kernel log.

Alan Stern



Index: usb-4.x/drivers/usb/storage/protocol.c
===================================================================
--- usb-4.x.orig/drivers/usb/storage/protocol.c
+++ usb-4.x/drivers/usb/storage/protocol.c
@@ -188,9 +188,12 @@ void usb_stor_set_xfer_buf(unsigned char
 	unsigned int offset = 0;
 	struct scatterlist *sg = NULL;
 
+	printk(KERN_INFO "set_xfer_buf: src %u dest %u\n",
+			buflen, scsi_bufflen(srb));
 	buflen = min(buflen, scsi_bufflen(srb));
 	buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
 			TO_XFER_BUF);
+	printk(KERN_INFO "set_xfer_buf: actual %u\n", buflen);
 	if (buflen < scsi_bufflen(srb))
 		scsi_set_resid(srb, scsi_bufflen(srb) - buflen);
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux