RE: Linux USB gadget mass storage

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

 



On Thu, 1 Nov 2012, victor wrote:

> Alan,
> 
> The partial patch is here. In fact I am using file_storage.c in u-boot, the
> context and buf pointer are mismatch when the value is returned back from
> irq routine. The file-storage.c is not in u-boot release, so I post my
> question on linux usb. I am sorry if it is not the right place to post.
> 
> @@ -2151,19 +2160,16 @@
>                 struct bulk_cs_wrap     *csw = bh->buf;
> 
>                 /* Store and send the Bulk-only CSW */
> -               csw->Signature = cpu_to_le32(USB_BULK_CS_SIG);
> +               csw->Signature = cpu_to_le32(US_BULK_CS_SIGN);
>                 csw->Tag = fsg->tag;
>                 csw->Residue = cpu_to_le32(fsg->residue);
>                 csw->Status = status;
> 
> -               bh->inreq->length = USB_BULK_CS_WRAP_LEN;
> +               bh->inreq->length = US_BULK_CS_WRAP_LEN;
>                 bh->inreq->zero = 0;
> -	bh->inreq->buf = bh->buf;

That's not right.  Did you do the diff backwards?

Adding this line should not be necessary.  You are covering up a bug.  
It would be better to find the bug and fix it rather than sweeping it 
under the rug.

If the IRQ routine mangles the context value, it needs to be fixed.

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