On Wed, Jan 25, 2012 at 11:48:40AM +0100, Sebastian Andrzej Siewior wrote: > Just run into the following: > - new disk arrived in the system > - udev couldn't wait to get its hands on to to run ata_id /dev/sda > - this sent the cdb 0xa1 to the device. > - my UAS-gadget recevied the cdb and had no idea what to do with it. It > decided to send a status URB back with sense set to invalid opcode. > - the host side received it status and completed the scsi command. > - the host sent another scsi with 4kib data buffer > - Now I was confused why the data transfer is only 512 bytes instead of > 4kib since the host is always allocating the complete transfer in one > go. > - Finally the system crashed while walking through the sg list. > > This patch adds three new flags in order to distinguish between DATA > URB completed and outstanding. If we receive status before data, we > cancel data and let data complete the command. > This solves the problem for IN and OUT transfers but does not work for > BIDI. > > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> > --- > v1..v2: > - make work on the non-stream case again > - plumb memory leaks on the non-stream case Ok, this looks much better. I'll queue it up and send it to Greg along with the other UAS patches if no one objects by tomorrow. Sarah Sharp -- 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