Re: [RFT][PATCH] generic device DMA implementation

From: David Brownell (david-b@pacbell.net)
Date: Sat Dec 28 2002 - 10:05:33 EST


Adam J. Richter wrote:
> At 2002-12-28 1:29:54 GMT, David Brownell wrote:
>
>>Isn't the goal to make sure that for every kind of "struct device *"
>>it should be possible to use those dma_*() calls, without BUGging
>>out.
>
> No.
>
>>If that's not true ... then why were they defined?
>
> So that other memory mapped busses such as ISA and sbus
> can use them.

That sounds like a "yes", not a "no" ... except for devices on busses
that don't have do memory mapped I/O. It's what I described: dma_*()
calls being used with struct device, without BUGging out.

> USB devices should do DMA operations with respect to their USB
> host adapters, typically a PCI device. For example, imagine a machine
> with two USB controllers on different bus instances.

USB already does that ... you write as if it didn't. It's done that
since pretty early in the 2.4 series, when conversions to the "new" PCI
DMA APIs replaced usage of virt_to_bus and bus_to_virt and USB became
usable on platforms that weren't very PC-like. Controllers that don't
use PCI also need Linux support, in embedded configs.

However, the device drivers can't do that using the not-yet-generic DMA
calls. It's handled by usbcore, or by the USB DMA calls. That works,
and will continue to do so ... but it does highlight how "generic" the
implementation of those APIs is (not very).

- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Dec 31 2002 - 22:00:12 EST