linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
@ 2006-10-25 11:05 Li Yang
  2006-10-30  3:21 ` Paul Mackerras
  0 siblings, 1 reply; 11+ messages in thread
From: Li Yang @ 2006-10-25 11:05 UTC (permalink / raw)
  To: linuxppc-dev

Remove private physical address mapping routine in qe_lib.  Users
of qe_lib should use generic functions like iopa().
The change also addresses a bug found by Timur Tabi that cmd_input
got mapped in qe_issue_cmd().  It should be written to CECDR
unmodified.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Timur Tabi <timur@freescale.com>

---
 arch/powerpc/sysdev/qe_lib/qe.c |    3 +--
 include/asm-powerpc/immap_qe.h  |    9 ---------
 2 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 2bae632..e422322 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -122,8 +122,7 @@ int qe_issue_cmd(u32 cmd, u32 device, u8
 				mcn_shift = QE_CR_MCN_NORMAL_SHIFT;
 		}
 
-		out_be32(&qe_immr->cp.cecdr,
-			 immrbar_virt_to_phys((void *)cmd_input));
+		out_be32(&qe_immr->cp.cecdr, cmd_input);
 		out_be32(&qe_immr->cp.cecr,
 			 (cmd | QE_CR_FLG | ((u32) device << dev_shift) | (u32)
 			  mcn_protocol << mcn_shift));
diff --git a/include/asm-powerpc/immap_qe.h b/include/asm-powerpc/immap_qe.h
index ce12f85..7cccd16 100644
--- a/include/asm-powerpc/immap_qe.h
+++ b/include/asm-powerpc/immap_qe.h
@@ -464,14 +464,5 @@ struct qe_immap {
 extern struct qe_immap *qe_immr;
 extern phys_addr_t get_qe_base(void);
 
-static inline unsigned long immrbar_virt_to_phys(volatile void * address)
-{
-	if ( ((u32)address >= (u32)qe_immr) &&
-			((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) )
-		return (unsigned long)(address - (u32)qe_immr +
-				(u32)get_qe_base());
-	return (unsigned long)virt_to_phys(address);
-}
-
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_IMMAP_QE_H */

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-25 11:05 [PATCH] qe_lib: Remove immrbar_virt_to_phys() function Li Yang
@ 2006-10-30  3:21 ` Paul Mackerras
  2006-10-30  6:22   ` Li Yang-r58472
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Mackerras @ 2006-10-30  3:21 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev

Li Yang writes:

> Remove private physical address mapping routine in qe_lib.  Users
> of qe_lib should use generic functions like iopa().
> The change also addresses a bug found by Timur Tabi that cmd_input
> got mapped in qe_issue_cmd().  It should be written to CECDR
> unmodified.

Do you mean that the argument to qe_issue_cmd is a physical address?
It seems to me that the bug fix you mention is the main thing the
patch does, and the removal of immrvar_virt_to_phys is a cleanup on
the side that is made possible by the bugfix.

Paul.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-30  3:21 ` Paul Mackerras
@ 2006-10-30  6:22   ` Li Yang-r58472
  2006-10-30 22:15     ` Kumar Gala
  0 siblings, 1 reply; 11+ messages in thread
From: Li Yang-r58472 @ 2006-10-30  6:22 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

> -----Original Message-----
> From: Paul Mackerras [mailto:paulus@samba.org]
> Sent: Monday, October 30, 2006 11:22 AM
> To: Li Yang-r58472
> Cc: linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>=20
> Li Yang writes:
>=20
> > Remove private physical address mapping routine in qe_lib.  Users
> > of qe_lib should use generic functions like iopa().
> > The change also addresses a bug found by Timur Tabi that cmd_input
> > got mapped in qe_issue_cmd().  It should be written to CECDR
> > unmodified.
>=20
> Do you mean that the argument to qe_issue_cmd is a physical address?
> It seems to me that the bug fix you mention is the main thing the
> patch does, and the removal of immrvar_virt_to_phys is a cleanup on
> the side that is made possible by the bugfix.

The argument cmd_input should be offset to the MURAM base.  The cleanup
is inspired by the bugfix but not result of the bugfix.  There are still
other users of the immrbar_virt_to_phy() which can be replaced.  The
bugfix can be covered by the work of removing all users of the routine.
Or the removal will be depending on the bugfix to complete its work.  Do
you suggest us to separate the patches?

- Leo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-30  6:22   ` Li Yang-r58472
@ 2006-10-30 22:15     ` Kumar Gala
  2006-10-31  2:28       ` Li Yang-r58472
  0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2006-10-30 22:15 UTC (permalink / raw)
  To: Li Yang-r58472; +Cc: linuxppc-dev, Paul Mackerras


On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:

>> -----Original Message-----
>> From: Paul Mackerras [mailto:paulus@samba.org]
>> Sent: Monday, October 30, 2006 11:22 AM
>> To: Li Yang-r58472
>> Cc: linuxppc-dev@ozlabs.org
>> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>>
>> Li Yang writes:
>>
>>> Remove private physical address mapping routine in qe_lib.  Users
>>> of qe_lib should use generic functions like iopa().
>>> The change also addresses a bug found by Timur Tabi that cmd_input
>>> got mapped in qe_issue_cmd().  It should be written to CECDR
>>> unmodified.
>>
>> Do you mean that the argument to qe_issue_cmd is a physical address?
>> It seems to me that the bug fix you mention is the main thing the
>> patch does, and the removal of immrvar_virt_to_phys is a cleanup on
>> the side that is made possible by the bugfix.
>
> The argument cmd_input should be offset to the MURAM base.  The  
> cleanup
> is inspired by the bugfix but not result of the bugfix.  There are  
> still
> other users of the immrbar_virt_to_phy() which can be replaced.  The
> bugfix can be covered by the work of removing all users of the  
> routine.
> Or the removal will be depending on the bugfix to complete its  
> work.  Do
> you suggest us to separate the patches?

I'm confused, if there are other users of immrbar_virt_to_phy() how  
can you get ride of it completely?

I would suggest just sending the bugfix so it can go in for 2.6.19  
and we can do the cleanup after that.

- kumar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-30 22:15     ` Kumar Gala
@ 2006-10-31  2:28       ` Li Yang-r58472
  2006-10-31  2:46         ` Kumar Gala
  0 siblings, 1 reply; 11+ messages in thread
From: Li Yang-r58472 @ 2006-10-31  2:28 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Tuesday, October 31, 2006 6:16 AM
> To: Li Yang-r58472
> Cc: Paul Mackerras; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>=20
>=20
> On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:
>=20
> >> -----Original Message-----
> >> From: Paul Mackerras [mailto:paulus@samba.org]
> >> Sent: Monday, October 30, 2006 11:22 AM
> >> To: Li Yang-r58472
> >> Cc: linuxppc-dev@ozlabs.org
> >> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
> >>
> >> Li Yang writes:
> >>
> >>> Remove private physical address mapping routine in qe_lib.  Users
> >>> of qe_lib should use generic functions like iopa().
> >>> The change also addresses a bug found by Timur Tabi that cmd_input
> >>> got mapped in qe_issue_cmd().  It should be written to CECDR
> >>> unmodified.
> >>
> >> Do you mean that the argument to qe_issue_cmd is a physical
address?
> >> It seems to me that the bug fix you mention is the main thing the
> >> patch does, and the removal of immrvar_virt_to_phys is a cleanup on
> >> the side that is made possible by the bugfix.
> >
> > The argument cmd_input should be offset to the MURAM base.  The
> > cleanup
> > is inspired by the bugfix but not result of the bugfix.  There are
> > still
> > other users of the immrbar_virt_to_phy() which can be replaced.  The
> > bugfix can be covered by the work of removing all users of the
> > routine.
> > Or the removal will be depending on the bugfix to complete its
> > work.  Do
> > you suggest us to separate the patches?
>=20
> I'm confused, if there are other users of immrbar_virt_to_phy() how
> can you get ride of it completely?

Other users will change to use iopa() instead.  There was some bug to
use iopa() with io_block_mapping area, but it is ok to use it now.

- Leo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-31  2:28       ` Li Yang-r58472
@ 2006-10-31  2:46         ` Kumar Gala
  2006-10-31  2:56           ` Li Yang-r58472
  0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2006-10-31  2:46 UTC (permalink / raw)
  To: Li Yang-r58472; +Cc: linuxppc-dev, Paul Mackerras


On Oct 30, 2006, at 8:28 PM, Li Yang-r58472 wrote:

>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Tuesday, October 31, 2006 6:16 AM
>> To: Li Yang-r58472
>> Cc: Paul Mackerras; linuxppc-dev@ozlabs.org
>> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>>
>>
>> On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:
>>
>>>> -----Original Message-----
>>>> From: Paul Mackerras [mailto:paulus@samba.org]
>>>> Sent: Monday, October 30, 2006 11:22 AM
>>>> To: Li Yang-r58472
>>>> Cc: linuxppc-dev@ozlabs.org
>>>> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>>>>
>>>> Li Yang writes:
>>>>
>>>>> Remove private physical address mapping routine in qe_lib.  Users
>>>>> of qe_lib should use generic functions like iopa().
>>>>> The change also addresses a bug found by Timur Tabi that cmd_input
>>>>> got mapped in qe_issue_cmd().  It should be written to CECDR
>>>>> unmodified.
>>>>
>>>> Do you mean that the argument to qe_issue_cmd is a physical
> address?
>>>> It seems to me that the bug fix you mention is the main thing the
>>>> patch does, and the removal of immrvar_virt_to_phys is a cleanup on
>>>> the side that is made possible by the bugfix.
>>>
>>> The argument cmd_input should be offset to the MURAM base.  The
>>> cleanup
>>> is inspired by the bugfix but not result of the bugfix.  There are
>>> still
>>> other users of the immrbar_virt_to_phy() which can be replaced.  The
>>> bugfix can be covered by the work of removing all users of the
>>> routine.
>>> Or the removal will be depending on the bugfix to complete its
>>> work.  Do
>>> you suggest us to separate the patches?
>>
>> I'm confused, if there are other users of immrbar_virt_to_phy() how
>> can you get ride of it completely?
>
> Other users will change to use iopa() instead.  There was some bug to
> use iopa() with io_block_mapping area, but it is ok to use it now.

Hmm, what are the other users doing?  I think we should avoid using  
iopa.

- kumar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-31  2:46         ` Kumar Gala
@ 2006-10-31  2:56           ` Li Yang-r58472
  2006-10-31  5:05             ` Kumar Gala
  0 siblings, 1 reply; 11+ messages in thread
From: Li Yang-r58472 @ 2006-10-31  2:56 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras

> >> I'm confused, if there are other users of immrbar_virt_to_phy() how
> >> can you get ride of it completely?
> >
> > Other users will change to use iopa() instead.  There was some bug
to
> > use iopa() with io_block_mapping area, but it is ok to use it now.
>=20
> Hmm, what are the other users doing?  I think we should avoid using
> iopa.

Get physical address from virtual address.  I have considered to use
virt_to_phys(), but it is not consistent between ppc and powerpc arch.

- Leo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-31  2:56           ` Li Yang-r58472
@ 2006-10-31  5:05             ` Kumar Gala
  2006-10-31  5:25               ` Li Yang-r58472
  0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2006-10-31  5:05 UTC (permalink / raw)
  To: Li Yang-r58472; +Cc: linuxppc-dev, Paul Mackerras


On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:

>>>> I'm confused, if there are other users of immrbar_virt_to_phy() how
>>>> can you get ride of it completely?
>>>
>>> Other users will change to use iopa() instead.  There was some bug
> to
>>> use iopa() with io_block_mapping area, but it is ok to use it now.
>>
>> Hmm, what are the other users doing?  I think we should avoid using
>> iopa.
>
> Get physical address from virtual address.  I have considered to use
> virt_to_phys(), but it is not consistent between ppc and powerpc arch.

Why does that matter, qe support only exists in powerpc.

- k

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-31  5:05             ` Kumar Gala
@ 2006-10-31  5:25               ` Li Yang-r58472
  2006-10-31  5:30                 ` Kumar Gala
  0 siblings, 1 reply; 11+ messages in thread
From: Li Yang-r58472 @ 2006-10-31  5:25 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Tuesday, October 31, 2006 1:06 PM
> To: Li Yang-r58472
> Cc: Paul Mackerras; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>=20
>=20
> On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
>=20
> >>>> I'm confused, if there are other users of immrbar_virt_to_phy()
how
> >>>> can you get ride of it completely?
> >>>
> >>> Other users will change to use iopa() instead.  There was some bug
> > to
> >>> use iopa() with io_block_mapping area, but it is ok to use it now.
> >>
> >> Hmm, what are the other users doing?  I think we should avoid using
> >> iopa.
> >
> > Get physical address from virtual address.  I have considered to use
> > virt_to_phys(), but it is not consistent between ppc and powerpc
arch.
>=20
> Why does that matter, qe support only exists in powerpc.

Well, it does use include/asm-ppc/io.h instead of
include/asm-powerpc/io.h for now.  If the hack is removed, the driver
will not work.

- Leo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-31  5:25               ` Li Yang-r58472
@ 2006-10-31  5:30                 ` Kumar Gala
  2006-10-31  5:34                   ` Li Yang-r58472
  0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2006-10-31  5:30 UTC (permalink / raw)
  To: Li Yang-r58472; +Cc: linuxppc-dev, Paul Mackerras


On Oct 30, 2006, at 11:25 PM, Li Yang-r58472 wrote:

>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Tuesday, October 31, 2006 1:06 PM
>> To: Li Yang-r58472
>> Cc: Paul Mackerras; linuxppc-dev@ozlabs.org
>> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>>
>>
>> On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
>>
>>>>>> I'm confused, if there are other users of immrbar_virt_to_phy()
> how
>>>>>> can you get ride of it completely?
>>>>>
>>>>> Other users will change to use iopa() instead.  There was some bug
>>> to
>>>>> use iopa() with io_block_mapping area, but it is ok to use it now.
>>>>
>>>> Hmm, what are the other users doing?  I think we should avoid using
>>>> iopa.
>>>
>>> Get physical address from virtual address.  I have considered to use
>>> virt_to_phys(), but it is not consistent between ppc and powerpc
> arch.
>>
>> Why does that matter, qe support only exists in powerpc.
>
> Well, it does use include/asm-ppc/io.h instead of
> include/asm-powerpc/io.h for now.  If the hack is removed, the driver
> will not work.

What uses asm-ppc/io.h instead of asm-powerpc/io.h?

- k

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
  2006-10-31  5:30                 ` Kumar Gala
@ 2006-10-31  5:34                   ` Li Yang-r58472
  0 siblings, 0 replies; 11+ messages in thread
From: Li Yang-r58472 @ 2006-10-31  5:34 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Tuesday, October 31, 2006 1:30 PM
> To: Li Yang-r58472
> Cc: Paul Mackerras; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
>=20
>=20
> On Oct 30, 2006, at 11:25 PM, Li Yang-r58472 wrote:
>=20
> >> -----Original Message-----
> >> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> >> Sent: Tuesday, October 31, 2006 1:06 PM
> >> To: Li Yang-r58472
> >> Cc: Paul Mackerras; linuxppc-dev@ozlabs.org
> >> Subject: Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function
> >>
> >>
> >> On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
> >>
> >>>>>> I'm confused, if there are other users of immrbar_virt_to_phy()
> > how
> >>>>>> can you get ride of it completely?
> >>>>>
> >>>>> Other users will change to use iopa() instead.  There was some
bug
> >>> to
> >>>>> use iopa() with io_block_mapping area, but it is ok to use it
now.
> >>>>
> >>>> Hmm, what are the other users doing?  I think we should avoid
using
> >>>> iopa.
> >>>
> >>> Get physical address from virtual address.  I have considered to
use
> >>> virt_to_phys(), but it is not consistent between ppc and powerpc
> > arch.
> >>
> >> Why does that matter, qe support only exists in powerpc.
> >
> > Well, it does use include/asm-ppc/io.h instead of
> > include/asm-powerpc/io.h for now.  If the hack is removed, the
driver
> > will not work.
>=20
> What uses asm-ppc/io.h instead of asm-powerpc/io.h?

You can look into the asm-powerpc/io.h.  We have hack like this

#ifndef CONFIG_PPC64
#include <asm-ppc/io.h>
#else
........
{whole bunch of defines}
.........
#endif

- Leo

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-10-31  5:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 11:05 [PATCH] qe_lib: Remove immrbar_virt_to_phys() function Li Yang
2006-10-30  3:21 ` Paul Mackerras
2006-10-30  6:22   ` Li Yang-r58472
2006-10-30 22:15     ` Kumar Gala
2006-10-31  2:28       ` Li Yang-r58472
2006-10-31  2:46         ` Kumar Gala
2006-10-31  2:56           ` Li Yang-r58472
2006-10-31  5:05             ` Kumar Gala
2006-10-31  5:25               ` Li Yang-r58472
2006-10-31  5:30                 ` Kumar Gala
2006-10-31  5:34                   ` Li Yang-r58472

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).