Re: [PATCH] usb: musb: host: Unmap the buffer for PIO data transfers

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

 



On Sun, Aug 22, 2010 at 12:05 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Sat, 21 Aug 2010, Maulik Mankad wrote:
>
>> > I can't tell if it would be correct here, but have you considered just
>> > calling unmap_urb_for_dma() instead?  (You'd have to make that routine
>> > non-static and EXPORT it first.)
>> >
>>
>> Yes I did exactly that as a first step. It worked.
>>
>> Then found that only dma_unmap_page() is necessary since the
>> map_urb_for_dma() function
>> does a page mapping using dma_map_page() at least for Storage and HID use cases.
>>
>> I tested this with Storage and HID classes.
>>
>> What I may be missing is some class driver which might be using dma_map_sg() or
>> other such routine to map the DMA buffers. Is there such a possibility?
>
> All the mappings are done in map_urb_for_dma, except in the case where
> the buffer was set up for a coherent mapping.  If you always call
> unmap_urb_for_dma then you won't have to worry about strange drivers or
> exceptional cases.  Besides, it means adding less new code than your
> patch contains.
>

Yes thats true.

Calling unmap_urb_for_dma() will handle all cases and would be most effective.

So is it okay to make it non-static and export it?

Will such a patch be acceptable (since it is in core/hcd.c)?

Thanks,
Maulik
--
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