On Sun, 7 Mar 2010, Oliver Neukum wrote: > Hi, > > any ideas? > > Mar 7 18:51:00 vanamonde kernel: usb-storage: Issuing auto-REQUEST_SENSE > Mar 7 18:51:00 vanamonde kernel: usb-storage: Bulk Command S 0x43425355 T 0xff L 18 F 128 Trg 0 LUN 0 CL 6 > Mar 7 18:51:00 vanamonde kernel: usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > Mar 7 18:51:00 vanamonde kernel: mon_text_get_data: num_sgs == 0: src ffff880037c07000 > Mar 7 18:51:00 vanamonde kernel: usb-storage: Status code 0; transferred 31/31 > Mar 7 18:51:00 vanamonde kernel: usb-storage: -- transfer complete > Mar 7 18:51:00 vanamonde kernel: usb-storage: Bulk command transfer result=0 > Mar 7 18:51:00 vanamonde kernel: usb-storage: usb_stor_bulk_transfer_sglist: xfer 18 bytes, 1 entries > Mar 7 18:51:00 vanamonde kernel: mon_text_get_data: num_sgs == 1: src ffff8801351ed440, length 18, scatterlist at ffff880134051dc8, page ffffea000439ebd8 > > static inline char mon_text_get_data(struct mon_event_text *ep, struct urb *urb, > int len, char ev_type, struct mon_bus *mbus) > { > void *src; > > if (len <= 0) > return 'L'; > if (len >= DATA_MAX) > len = DATA_MAX; > > if (ep->is_in) { > if (ev_type != 'C') > return '<'; > } else { > if (ev_type != 'S') > return '>'; > } > > if (urb->num_sgs == 0) { > src = urb->transfer_buffer; > printk(KERN_ERR"%s: num_sgs == 0: src %p\n", __func__, src); > if (src == NULL) > return 'Z'; /* '0' would be not as pretty. */ > } else { > struct scatterlist *sg = urb->sg->sg; > > /* If IOMMU coalescing occurred, we cannot trust sg_page */ > if (urb->sg->nents != urb->num_sgs || > PageHighMem(sg_page(sg))) > return 'D'; > > /* For the text interface we copy only the first sg buffer */ > len = min_t(int, sg->length, len); > src = sg_virt(sg); > printk(KERN_ERR"%s: num_sgs == %d: src %p, length %d, scatterlist at %p, page %p\n", > __func__, urb->num_sgs, src, len, sg, sg_page(sg)); > } > > memcpy(ep->data, src, len); > return 0; > } 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(). 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