Re: [PATCH] usb: musb: cppi41: fix not transmitting zero length packet issue

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

 



Daniel,


On Tue, Aug 12, 2014 at 12:15 PM, Daniel Mack <zonque@xxxxxxxxx> wrote:
> On 08/12/2014 07:05 PM, Bin Liu wrote:
>>> Don't you need to check for (urb->transfer_flags & URB_ZERO_PACKET)
>>> somewhere here? I'd not expect an extra 0-byte packet at the end of a
>>> transfer unless this flag is set.
>>
>> mode is set to 1 when (urb->transfer_flags & URB_ZERO_PACKET), in
>> musb_tx_dma_program in musb_host.c.
>
> Hmm, yes, but only for (!CONFIG_USB_INVENTRA_DMA &&
> !CONFIG_USB_UX500_DMA). Otherwise, mode will be 1 'if (length >
> pkt_size)', so on those platforms, the driver will now send terminating
> ZLPs whenever a transfer spans across multiple packets. Or am I missing
> anything?

633  #if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_UX500_DMA)
...
658  #else
659         if (!is_cppi_enabled() && !tusb_dma_omap())
660                  return false;
...
668         mode = (urb->transfer_flags & URB_ZERO_PACKET) ? 1 : 0;
669  #endif

So mode is only set to 1 for CPPI DMA when URB_ZERO_PACKET is set,
then musb_cppi41 driver will transmit the ZLP.

For other DMA engine (INVERNTRA or UX500), its driver should have its
own channel_program() callback, cppi41 driver should not be called.

Regards,
-Bin.

>
> You might need to pass a pointer to the urb or its transfer_flags down
> to channel_program().
>
>
> Thanks,
> Daniel
--
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