Subject: Re: Problems with "bus_dmamap_sync()" on sparc64
To: Hans Petter Selasky <hselasky@c2i.net>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 01/23/2007 20:01:12
On Tue, Jan 23, 2007 at 07:06:12PM +0100, Hans Petter Selasky wrote:
> Looks like the "_asi" field is set to the memory default value of zero:
> 
> psycho_attach():
> 
>         pp = sc->sc_psycho_this = malloc(sizeof *pp, M_DEVBUF,
>                                          M_NOWAIT | M_ZERO);
> 
> But pp->pp_sb.sb_sb._asi is not initialized anywhere, from what I can see. 

I asked, because I thought it would be unitialized - but I didn't expect it
to be undefined always ;-) Will fix this...

A good value would be 0x80 (ASI_PRIMARY), or 0x88 (ASI_PRIMARY_LITTLE).
The 0x00 value you found is implementation defined, and AFAICT not defined
by any of the supported CPUs user manuals - but I only did a very quick
check and may have overlooked it.

However, this is not likely to cause your problem. The physical PCI addresses
on this machines are non cachable, and as Eduardo keeps pointing out do
not need special treatment in this context.

You could easily test by adding a membar_memissue() before starting ehci (see
sys/arch/sparc64/include/ctlreg.h) - I hope this will not fix it though ;-)

Martin