Re: [PATCH v2] usb/uas: make sure data urb is gone if we receive status before that

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

 



Hi Sebastian,

I applied your patch, but checkpatch warns about some indentation
issues:

sarah@xanatos:~/git/kernels/xhci$ git am -s ~/Maildir.fetchmail/.to-apply/
Applying: usb/uas: make sure data urb is gone if we receive status before that
WARNING: suspect code indent for conditional statements (16, 23)
#69: FILE: drivers/usb/storage/uas.c:220:
+		if (!(cmdinfo->state & COMPLETED_DATA_IN) &&
[...]
+		       if (devinfo->use_streams) {

WARNING: suspect code indent for conditional statements (23, 31)
#71: FILE: drivers/usb/storage/uas.c:222:
+		       if (devinfo->use_streams) {
+			       cmdinfo->state |= DATA_COMPLETES_CMD;

total: 0 errors, 2 warnings, 168 lines checked

Your patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
sarah@xanatos:~/git/kernels/xhci$

I'll send this patch as is off to Greg, but can you please use standard
indentation in the future?  I always run my applied patches through
checkpatch, and warnings stop my work flow.  I submitted a patch to
checkpatch to have a flag to ignore warnings, but the patch was, well,
ignored. :)

Sarah Sharp

On Wed, Jan 25, 2012 at 10:42:42AM -0800, Sarah Sharp wrote:
> 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
--
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