ChangeSet 1.1474.81.20, 2004/01/16 16:20:49-08:00, stern@rowland.harvard.edu [PATCH] USB Storage: Old patches (as129 and as141) There's a couple of old patches floating around still that you might want to apply. I have reproduced them below. as129 handles the situation where a command error causes us to do a device reset, but the SCSI layer times out and aborts the command during the reset delay. It clears a flag that otherwise will prevent us from sending the clear-halt messages following the reset. as141 is the DMA buffer alignment patch. You asked me to remind you about it eventually. There shouldn't be any harm at all in applying it without waiting for the corresponding SCSI part of the patch to be applied. Without that other part, this will essentially do nothing. Alan Stern drivers/usb/storage/scsiglue.c | 10 ++++++++++ drivers/usb/storage/transport.c | 3 +++ 2 files changed, 13 insertions(+) diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c --- a/drivers/usb/storage/scsiglue.c Tue Jan 20 17:35:49 2004 +++ b/drivers/usb/storage/scsiglue.c Tue Jan 20 17:35:49 2004 @@ -65,6 +65,16 @@ static int slave_configure (struct scsi_device *sdev) { + /* Scatter-gather buffers (all but the last) must have a length + * divisible by the bulk maxpacket size. Otherwise a data packet + * would end up being short, causing a premature end to the data + * transfer. Since high-speed bulk pipes have a maxpacket size + * of 512, we'll use that as the scsi device queue's DMA alignment + * mask. Guaranteeing proper alignment of the first buffer will + * have the desired effect because, except at the beginning and + * the end, scatter-gather buffers follow page boundaries. */ + blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); + /* this is to satisify the compiler, tho I don't think the * return code is ever checked anywhere. */ return 0; diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c --- a/drivers/usb/storage/transport.c Tue Jan 20 17:35:49 2004 +++ b/drivers/usb/storage/transport.c Tue Jan 20 17:35:49 2004 @@ -1089,6 +1089,9 @@ return FAILED; } + /* permit the clear-halt transfers to take place */ + clear_bit(US_FLIDX_ABORTING, &us->flags); + US_DEBUGP("Soft reset: clearing bulk-in endpoint halt\n"); result = usb_stor_clear_halt(us, us->recv_bulk_pipe);