Skip to contentSkip to conversation

USB and DMA on Alpha with 2.6.0-test7

DISCUSSION Måns Rullgård 4 participants 6 messages Oct 10, 2003

lore
Share & tools
lore
#0 lore raw

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]
#1 lore raw
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.

#2 lore raw
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() in usbnet.c is 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_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;

Is that all there is to it?

Signature · 2 lines
Måns Rullgård
[email protected]
#3 lore raw
In reply to Ivan Kokshaysky
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() 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;

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

#4 lore raw
Quoted 2 lines · Jamie Lokier

Isn't the device's dma_mask set equal to the controller's dma_mask automatically?

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.

#5 lore raw
Quoted 7 lines · Ivan Kokshaysky
Quoted 2 lines

Isn't the device's dma_mask set equal to the controller's dma_mask automatically?

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.

So, what should the patch look like? I'd like to use this thing.

Signature · 2 lines
Måns Rullgård
[email protected]