Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-09 Thread Dan Malek
On Feb 8, 2007, at 8:35 AM, Timur Tabi wrote: That's what the original code did, kinda. It called virt_to_phys() if it is main memory, and it called immrbar_virt_to_phys() if it is MURAM. immrbar_virt_to_phys() did pointer math to extract the physical address. You've got to be kidding.

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-09 Thread Timur Tabi
Dan Malek wrote: On Feb 8, 2007, at 8:35 AM, Timur Tabi wrote: That's what the original code did, kinda. It called virt_to_phys() if it is main memory, and it called immrbar_virt_to_phys() if it is MURAM. immrbar_virt_to_phys() did pointer math to extract the physical address. You've got

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-09 Thread Timur Tabi
Li Yang-r58472 wrote: No, we don't know if the BD ring is in MURAM or main memory as it is configurable. iopa() is best choice to handle both case, IMHO. The above code would only be used if the BD is in MURAM. The "if bd_mem_part == MEM_PART_MURAM" would stay. If the BD ring can be in ma

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-08 Thread Timur Tabi
Kumar Gala wrote: Right, so when do you know if you'll be using MURAM or normal memory? Why not just keep around a token that is the physical address at the point you make the decision of MURAM vs normal memory. That's what the original code did, kinda. It called virt_to_phys() if it is ma

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala
: Change private immrbar_virt_to_phys to generic iopa On Feb 8, 2007, at 1:06 AM, Li Yang-r58472 wrote: MURAM is a mmio region so it don't share the characteristic of main memory that phy_addr = virt_addr - PAGE_OFFSET. While they can both be mapped through page table using iopa().

RE: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> -Original Message- > From: Kumar Gala [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 08, 2007 3:16 PM > To: Li Yang-r58472 > Cc: Tabi Timur-B04825; netdev@vger.kernel.org; [EMAIL PROTECTED] > Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala
On Feb 8, 2007, at 1:06 AM, Li Yang-r58472 wrote: MURAM is a mmio region so it don't share the characteristic of main memory that phy_addr = virt_addr - PAGE_OFFSET. While they can both be mapped through page table using iopa(). Right, so when do you know if you'll be using MURAM or normal m

RE: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> > If its been mapped with ioremap() you know the physical address > >>> already > > so why do you need iopa(). > > That's what the original function immrbar_virt_to_phys() does. > > We're > >>> trying to > get rid of it, because we thought is redundant with iopa(). > >

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala
] Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa Kumar Gala wrote: If its been mapped with ioremap() you know the physical address already so why do you need iopa(). That's what the original function immrbar_virt_to_phys() does. We're tryi

RE: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> -Original Message- > From: Kumar Gala [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 08, 2007 1:58 PM > To: Li Yang-r58472 > Cc: Tabi Timur-B04825; netdev@vger.kernel.org; [EMAIL PROTECTED] > Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala
On Feb 7, 2007, at 11:52 PM, Li Yang-r58472 wrote: -Original Message- From: Timur Tabi [mailto:[EMAIL PROTECTED] Sent: Thursday, February 08, 2007 1:03 AM To: Kumar Gala Cc: Li Yang-r58472; netdev@vger.kernel.org; [EMAIL PROTECTED] Subject: Re: [PATCH 1/4] ucc_geth: Change private

RE: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> -Original Message- > From: Timur Tabi [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 08, 2007 1:03 AM > To: Kumar Gala > Cc: Li Yang-r58472; netdev@vger.kernel.org; [EMAIL PROTECTED] > Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Timur Tabi
Kumar Gala wrote: If its been mapped with ioremap() you know the physical address already so why do you need iopa(). That's what the original function immrbar_virt_to_phys() does. We're trying to get rid of it, because we thought is redundant with iopa(). static inline unsigned long immr

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala
On Feb 7, 2007, at 10:43 AM, Timur Tabi wrote: Kumar Gala wrote: On Feb 6, 2007, at 5:31 AM, Li Yang wrote: Get rid of private immrbar_virt_to_phys() routine and use generic iopa(). Nack. iopa() isn't that generic, shouldn't we really be using the dma mapping API here? I'm having a hard t

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala
On Feb 7, 2007, at 3:34 AM, Li Yang-r58472 wrote: On Feb 6, 2007, at 5:31 AM, Li Yang wrote: Get rid of private immrbar_virt_to_phys() routine and use generic iopa(). Nack. iopa() isn't that generic, shouldn't we really be using the dma mapping API here? Do you mean the dma_map_single()?

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Timur Tabi
Kumar Gala wrote: On Feb 6, 2007, at 5:31 AM, Li Yang wrote: Get rid of private immrbar_virt_to_phys() routine and use generic iopa(). Nack. iopa() isn't that generic, shouldn't we really be using the dma mapping API here? I'm having a hard time understanding what's wrong with iopa(). Is

RE: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> On Feb 6, 2007, at 5:31 AM, Li Yang wrote: > > > Get rid of private immrbar_virt_to_phys() routine and > > use generic iopa(). > > Nack. iopa() isn't that generic, shouldn't we really be using the dma > mapping API here? Do you mean the dma_map_single()? dma_map_single can map memory space co

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-06 Thread Jeff Garzik
Li Yang wrote: Get rid of private immrbar_virt_to_phys() routine and use generic iopa(). Signed-off-by: Li Yang <[EMAIL PROTECTED]> --- drivers/net/ucc_geth.c | 29 ++--- 1 files changed, 6 insertions(+), 23 deletions(-) I'll await resend pending resolution of comments

Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-06 Thread Kumar Gala
On Feb 6, 2007, at 5:31 AM, Li Yang wrote: Get rid of private immrbar_virt_to_phys() routine and use generic iopa(). Nack. iopa() isn't that generic, shouldn't we really be using the dma mapping API here? - k Signed-off-by: Li Yang <[EMAIL PROTECTED]> --- drivers/net/ucc_geth.c | 29