Re: usbmon problem

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

 



On Mon, 8 Mar 2010, Oliver Neukum wrote:

> Am Sonntag, 7. März 2010 21:45:50 schrieb Alan Stern:
> 
> > len and sg_page(sg) aren't particularly useful, as far as I can see.
> > 
> > sg and src need to be compared with the original values when the
> > scatterlist was created.  In invoke_transport() print out the values of
> > scsi_sglist(srb), srb->sense_buffer, &ses->sense_sgl, and
> > sg_virt(&ses->sense_sgl).  Do this after the call to
> > scsi_eh_prep_cmnd().
> Mar  8 19:06:10 vanamonde kernel: usb-storage: Issuing auto-REQUEST_SENSE                                                                                                                                          
> Mar  8 19:06:10 vanamonde kernel: usb_stor_invoke_transport - sglist ffff880135b37dc8 sense buffer ffff8801363db940 sense sgl ffff8801363db940 sg_virt ffffea00043dd7ea page link 0000000087654321 dmaaddr ffffea0 0043dd7ea                                                                                                                                                                                                          
> Mar  8 19:06:10 vanamonde kernel: usb-storage: Bulk Command S 0x43425355 T 0x118 L 18 F 128 Trg 0 LUN 0 CL 6                                                                                                       
> Mar  8 19:06:10 vanamonde kernel: usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes                                                                                                                           
> Mar  8 19:06:10 vanamonde kernel: mon_text_get_data: num_sgs == 0: src ffff880037807000                                                                                                                            

There are several problems here.  Are you sure your printk line really 
matches the right value with each label?

To begin with, scsi_sglist(srb) is defined as srb->sdb.table.sgl, and
in scsi_eh_prep_cmnd() that field is set to &ses->sense_sgl.  Hence the
sglist value and the sense sgl values above should be the same, but
they aren't.  Instead, &ses->sense_sgl is the same as
srb->sense_buffer!  I can't imagine how that would happen.

(Also, sg_virt(&ses->sense_sgl) should be the same as
srb->sense_buffer; the value is assigned when scsi_eh_prep_cmnd()
calls sg_init_one().  Instead its value looks random -- it's the same 
as the DMA address, with no relation to the actual buffer address.  Are 
you using some sort of iotlb?)

You might want to look at the assembly code generated by the compiler 
for scsi_eh_prep_cmnd(), just to see if this could be a compiler bug.  
It certainly looks very suspicious.

Alan Stern

--
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