USB and DMA on Alpha with 2.6.0-test7
Yesterday, I compiled 2.6.0-test7 for one of my Alpha boxes. I have an AX8817X based USB ethernet adaptor connected to it (it's short on PCI slots), so I compiled the usbnet module. When I loaded usbnet, I got a BUG at include/asm-generic/dma-mapping.h:19. Apparently, DMA setup only works with PCI here. How should this be fixed? It worked with -test4, albeit slowly, for other reasons.
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 6 lines · Måns Rullgård
Yesterday, I compiled 2.6.0-test7 for one of my Alpha boxes. I have an AX8817X based USB ethernet adaptor connected to it (it's short on PCI slots), so I compiled the usbnet module. When I loaded usbnet, I got a BUG at
include/asm-generic/dma-mapping.h:19. Apparently, DMA setup only works with PCI here. How should this be fixed? It worked with -test4, albeit slowly, for other reasons.
Well, the usage of dma_supported() in usbnet.c is wrong even for i386. USB device doesn't do DMA, it's USB controller what does. The driver should check dma_mask of the parent device instead, something like this:
// possible with some EHCI controllers if (*udev->dev->parent->dma_mask == 0xffffffffffffffffULL) net->features |= NETIF_F_HIGHDMA;
Ivan.
Quoted 9 lines · Ivan Kokshaysky
Quoted 6 lines
Yesterday, I compiled 2.6.0-test7 for one of my Alpha boxes. I have an AX8817X based USB ethernet adaptor connected to it (it's short on PCI slots), so I compiled the usbnet module. When I loaded usbnet, I got a BUG at
include/asm-generic/dma-mapping.h:19. Apparently, DMA setup only works with PCI here. How should this be fixed? It worked with -test4, albeit slowly, for other reasons.Well, the usage of
dma_supported()inusbnet.cis wrong even for i386. USB device doesn't do DMA, it's USB controller what does. The driver should
That's what I thought.
Quoted 5 lines
check
dma_maskof the parent device instead, something like this:// possible with some EHCI controllers if (*udev->dev->parent->dma_mask == 0xffffffffffffffffULL) net->features |= NETIF_F_HIGHDMA;
Is that all there is to it?
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 8 lines · Ivan Kokshaysky
Quoted 6 lines · Måns Rullgård
Yesterday, I compiled 2.6.0-test7 for one of my Alpha boxes. I have an AX8817X based USB ethernet adaptor connected to it (it's short on PCI slots), so I compiled the usbnet module. When I loaded usbnet, I got a BUG at
include/asm-generic/dma-mapping.h:19. Apparently, DMA setup only works with PCI here. How should this be fixed? It worked with -test4, albeit slowly, for other reasons.
Quoted 7 lines
Well, the usage of
dma_supported()inusbnet.cis wrong even for i386. USB device doesn't do DMA, it's USB controller what does. The driver should checkdma_maskof the parent device instead, something like this:// possible with some EHCI controllers if (*udev->dev->parent->dma_mask == 0xffffffffffffffffULL) net->features |= NETIF_F_HIGHDMA;
Isn't the device's dma_mask set equal to the controller's dma_mask automatically?
What happens if it's on a hub, or a hub on a hub? Then the parent isn't the controller, is it?
-- Jamie
Quoted 2 lines · Jamie Lokier
Isn't the device's
dma_maskset equal to the controller'sdma_maskautomatically?
You are right, just check dma_mask of the device.
Anyway, as it is, usbnet driver won't work on i386 with more than 4G of RAM and 32-bit DMA USB controller.
Ivan.
Quoted 7 lines · Ivan Kokshaysky
Quoted 2 lines
Isn't the device's
dma_maskset equal to the controller'sdma_maskautomatically?You are right, just check
dma_maskof the device.Anyway, as it is, usbnet driver won't work on i386 with more than 4G of RAM and 32-bit DMA USB controller.
So, what should the patch look like? I'd like to use this thing.
Signature · 2 lines
Måns Rullgård [email protected]