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 Tue, Mar 15, 2011 at 12:15:47AM +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,
> 
> The point is "usb* at slhci?" is usb but it doesn't use DMA,
> unlike uhci/ohci/ehci.
> 
> > 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
> 
> What does it solve??
> 
> > 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".
> 
> That's what Kiyohara's patch does, isn't it?
> I'm suggesting to use #ifdef N?HCI instead of #ifdef mmeye.

what about a config attribute "usb_dma" that could be used in place
of the #ifdef N?HCI ? [uoe]hci would define it, while slhci would not.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index