lkml.org 
[lkml]   [2010]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: USB mass storage and ARM cache coherency
    Date
    Am Mittwoch, 17. Februar 2010 09:55:08 schrieb Shilimkar, Santosh:
    > > Your original patch however kills ehci, ohci and uhci on some architectures.
    >
    > How about below approach? Controller driver can set
    > "uses_pio_for_control" if it can't do dma for control transfer.
    >
    > diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
    > index 80995ef..e3eae02 100644
    > --- a/drivers/usb/core/hcd.c
    > +++ b/drivers/usb/core/hcd.c
    > @@ -1276,7 +1276,7 @@ static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
    >
    > if (usb_endpoint_xfer_control(&urb->ep->desc)
    > && !(urb->transfer_flags & URB_NO_SETUP_DMA_MAP)) {
    > - if (hcd->self.uses_dma) {
    > + if (hcd->self.uses_dma && !hcd->self.uses_pio_for_control) {

    It is not elegant to describe exceptions. It would be better, if you split up
    the flag into two flags, called uses_dma_for_ordinary_transfers and
    uses_dma_for control_transfers. Doing so also makes sure you look at
    all hcd drivers ;-)

    And the tests become straightforward. And please add a detailed comment
    to explain why this differentiation is needed on ARM.

    Regards
    Oliver


    \
     
     \ /
      Last update: 2010-02-17 10:13    [W:0.023 / U:32.172 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site