Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: usb and no bus_dma(9)



On Sun, Mar 13, 2011 at 07:26:02PM +0900, Izumi Tsutsui wrote:
> > > > Our usb driver demands bus_dma(9) without fail.  However, slhci(4)
> > > > doesn't use DMA.  Moreover, some ports is not supporting bus_dma(9)
> > > > now.
> > > Isn't it easy to provide a bus_dma implementation that does not realy
> > > do dma?
> > > That would be far preferable to crippling lots of other code with MD 
> > > hacks,
> > > IMHO.
> > 
> > I think that it is strange to implement bus_dma(9) for port that doesn't
> > use DMA.
> 
> For compromise, how about:
>  - use "#if NUHCI > 0 || NOHCI > 0 || NEHCI > 0" (or so) in *.c sources

That's not as bad as the original #ifdef mmeye stuff, but still, ew...
If your point is to avoid including some DMA code when usb is not included,
can that be done with config attributes instead?
i.e. in arch/mmeye/conf/files.mmeye do:

file common/bus_dma/bus_dmamem_common.c   usb

Perhaps you're focusing too much on the literal "dma" part of "bus_dma".
The man page for bus_dma_alloc says it 'Allocates memory that is "DMA safe"...'
but if the hardward doesn't do DMA, it seems reasonable to declare that 
any memory allocated with malloc() is "safe".
 
eric


Home | Main Index | Thread Index | Old Index