On Mon, Dec 04, 2006 at 05:45:58PM -0500, Vivek Goyal wrote:
> On Mon, Dec 04, 2006 at 10:42:47PM +0100, Andi Kleen wrote:
> > > > But arch independent code can not call __pa_symbol() as this definition
> > > > is local to i386 and x86_64 arches. So is it acceptable to change
> > > > symantics of __pa()?
> > 
> > __pa is by definition architecture dependent. Why should
> > architecture independent code want to call it?
> >
> 
> That's true, but a quick grep in drivers/ dir gave me lots of results. I am
> pasting few of them. Looks like __pa() is already being used at many a places
> in arch independent code

Most of them should be using the DMA API 

> 
> An stupid question, as __pa() is arch dependent call, how does one
> determine the physical addr associated with a kernel text sysmbol or phy
> addr associated with a kernel linearly mapped region in in arch independent
> code?

You don't. Only architecture code is supposed to know anything
about that.

> 
>  
> ./base/cpu.c:   addr = __pa(per_cpu_ptr(crash_notes, cpunum));

Broken

> ./char/mbcs.c:                      __pa(soft->gscr_addr) >> PAGE_SHIFT,

IA64 only, probably should be using DMA API anyways.

> ./char/mem.c:     && addr >= __pa(high_memory);
> ./char/mem.c:   return addr >= __pa(high_memory);
> ./char/mem.c:   if (addr + count > __pa(high_memory))

Inside ifdef

> ./char/mmtimer.c:       mmtimer_addr = __pa(RTC_COUNTER_ADDR);

Should be using DMA API

> ./char/mspec.c:                 nid = 
> nasid_to_cnodeid(get_node_number(__pa(addr)));
> ./char/mspec.c:                         phys = __pa(scratch_page[nid]);

IA64 only, probably should be using DMA APi

> ./char/watchdog/wdrtas.c:                          WDRTAS_SP_SPI, (void 
> *)__pa(&value), 4);
> ./char/watchdog/wdrtas.c:                                  (void 
> *)__pa(wdrtas_logbuffer),
> ./char/watchdog/wdrtas.c:                          (void *)__pa(&temperature),

Should be using DMA API

> ./infiniband/hw/amso1100/c2.c:                  (void *) __pa((unsigned long) 
> rxp_hdr));

Similar.


> ./media/video/cpia2/cpia2_core.c:       ret = __pa(kva);

Similar.

> ./net/fec.c:    bdp->cbd_bufaddr = __pa(skb->data);
> ./net/fec.c:            bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]);
> ./net/fec.c:                    bdp->cbd_bufaddr = __pa(mem_addr);
> ./net/fec.c:    fecp->fec_r_des_start = __pa((uint)(fep->rx_bd_base));
> ./net/fec.c:    fecp->fec_x_des_start = __pa((uint)(fep->tx_bd_base));
> ./net/fec.c:    fecp->fec_r_des_start = __pa((uint)(fep->rx_bd_base));
> ./net/fec.c:    fecp->fec_x_des_start = __pa((uint)(fep->tx_bd_base));

Should be using DMA API

-Andi
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to