On Thu, 11 Aug 2005, Juergen Schindele wrote:

> Am Mittwoch, 10. August 2005 16:48 schrieb Alan Stern:
> First thanks for your reply .
> 
> > The driver doesn't utilize this buffer as much as it could.  It should set
> > touchkit->irq->transfer_dma to touchkit->data_dma and
> > touchkit->irq->transfer_flags to URB_NO_TRANSFER_DMA_MAP.  However, even
> > without setting those things the transfer should still work okay.
> So i did the following :
> 
> touchkit->irq = usb_alloc_urb(0, GFP_KERNEL);
> 
> touchkit->data = usb_buffer_alloc(udev, TOUCHKIT_REPORT_DATA_SIZE,
>                                        SLAB_ATOMIC | URB_NO_TRANSFER_DMA_MAP,
>                                         &touchkit->irq->transfer_dma);
> 
> usb_fill_int_urb(touchkit->irq, touchkit->udev,
>                          usb_rcvintpipe(touchkit->udev, 0x81),
>                          touchkit->data, TOUCHKIT_REPORT_DATA_SIZE,
>                          touchkit_irq, touchkit, endpoint->bInterval);
> 
> But it still dont work like it should. :-(
> 
> > That's not a static array, because it's part of the dynamically-allocated
> > touchkit structure. 
> Ok you are right !
> 
> > I don't see how.  In both cases you told the driver where to put the data.
> > In one case the data ended up where you wanted, in the other case it
> > didn't.  It shouldn't matter how you got the data buffer in the first
> > place -- unless dma_alloc_coherent for some reason returned memory that
> > isn't accessible for DMA (which can't happen on x86).
> 
> Unfortunaterly i am not on ix86. So dma_alloc_coherent can fail !?

Ah, yes.  I didn't notice in the subject line you mentioned you're using
the PXA-270.  I don't know if dma_alloc_coherent can fail on PXA.  You
should test the address you get back to see if it is NULL.

You should also add this line to the driver:

        touchkit->irq->transfer_flags = URB_NO_TRANSFER_DMA_MAP;

right after usb_fill_int_urb().  Maybe then it will work correctly.

Alan Stern



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to