Re: [BK PATCH] USB update for 2.6.3
From: Linus Torvalds
Date: Fri Feb 20 2004 - 15:43:45 EST
On Fri, 20 Feb 2004, Hollis Blanchard wrote:
>
> Well, I was picturing all those *_dma_supported() functions as being
> plugged into (new) fields in struct bus_type:
> struct bus_type {
> ...
> int (*dma_supported)(struct device *dev, u64 mask);
> }
Ok, that would work. It might even be a good idea (not just DMA-related)
to make sure that everything you can portably "do" with a device would
show up as device operations. Right now it's not very well specified, and
there's obviously a lot of confusion.
> If your *_dma_supported functions only take usb_dev, pci_dev, etc, then
> you end up with code like asm-generic/dma-mapping.h:
I agree, that is horrible. On the other hand, some architectures don't
need any indirection or any conditionals at all, since they know that they
only have one type of DMA.
Making the device operations explicit would be good, though, and would
match how we do things in general. It's a fairly big change at this point,
but if somebody is willing to put the effort into the cleanup, then I'm
all for it.
I'd still ask that people don't do DMA on non-host devices. I'd rather
have a USB "struct device" just return "DMA not supported", to make sure
that everybody asks the right chip.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/