Hi All,

I want to ask what the correct USB behavior should be for a gadget attempting to perform a zero byte transfer (note transfer, not transaction) on a bulk-in endpoint should be:

  Background:
* Basically I've got a hacked up kernel; hardware is TI omap dm3730 (an overo gumstix board). * I use gadget fs (for which I've done major work to fix both gadgetfs and musb).
    * I connect the overo board to a windows/linux/osx pc via its OTG port.

I discovered that by writing a zero length packet to a bulk in endpoint I can cause a kernel panic in musb - basically I think it is trying to setup a DMA transaction with a "valid" pointer of zero bytes and blowing up. I encountered this by writing a crappy user-land program (by accident). Now I don't believe I should be able to panic the kernel from my stupid user program; so I could easily short-cut this so that gadgetfs disallows zero byte writes. I could also pursue this lower so that musb does not allow 0 length transactions - however, my question is more basic than that:

Are zero length transfers from a device to the PC on a bulk endpoint sensible?

I can see a case where a zero length transfer would cause a read thread in the host to be interrupted.

Does musb/gadgetfs need to correctly support zero byte transfers, or is this a non-sensible suggestion?

Cheers,

        -Brett
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to