[PATCH] qe_lib: Remove immrbar_virt_to_phys() function

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE7228d

11 messages, 3 authors, 2006-10-31 · open the first message on its own page

[PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Li Yang <hidden>
Date: 2006-10-25 11:04:30

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 <redacted>
Signed-off-by: Timur Tabi <redacted>

---
 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 */

Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Paul Mackerras <hidden>
Date: 2006-10-30 03:21:42

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.

RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Li Yang-r58472 <hidden>
Date: 2006-10-30 06:21:51

-----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
quoted
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

Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Kumar Gala <hidden>
Date: 2006-10-30 22:15:55

On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:
quoted
-----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:
quoted
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

RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Li Yang-r58472 <hidden>
Date: 2006-10-31 02:28:06

-----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
quoted
quoted
-----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:
quoted
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?
quoted
quoted
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

Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Kumar Gala <hidden>
Date: 2006-10-31 02:46:24

On Oct 30, 2006, at 8:28 PM, Li Yang-r58472 wrote:
quoted
-----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:
quoted
quoted
-----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:
quoted
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?
quoted
quoted
quoted
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

RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Li Yang-r58472 <hidden>
Date: 2006-10-31 02:55:26

quoted
quoted
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
quoted
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

Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Kumar Gala <hidden>
Date: 2006-10-31 05:05:51

On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
quoted
quoted
quoted
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
quoted
quoted
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

RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Li Yang-r58472 <hidden>
Date: 2006-10-31 05:24:29

-----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
quoted
quoted
quoted
quoted
I'm confused, if there are other users of immrbar_virt_to_phy()
how
quoted
quoted
quoted
quoted
can you get ride of it completely?
Other users will change to use iopa() instead.  There was some bug
to
quoted
quoted
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

Re: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Kumar Gala <hidden>
Date: 2006-10-31 05:30:14

On Oct 30, 2006, at 11:25 PM, Li Yang-r58472 wrote:
quoted
-----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:
quoted
quoted
quoted
quoted
I'm confused, if there are other users of immrbar_virt_to_phy()
how
quoted
quoted
quoted
quoted
quoted
can you get ride of it completely?
Other users will change to use iopa() instead.  There was some bug
to
quoted
quoted
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.
quoted
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

RE: [PATCH] qe_lib: Remove immrbar_virt_to_phys() function

From: Li Yang-r58472 <hidden>
Date: 2006-10-31 05:33:20

-----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
quoted
quoted
-----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:
quoted
quoted
quoted
quoted
I'm confused, if there are other users of immrbar_virt_to_phy()
how
quoted
quoted
quoted
quoted
quoted
can you get ride of it completely?
Other users will change to use iopa() instead.  There was some
bug
quoted
quoted
quoted
to
quoted
quoted
use iopa() with io_block_mapping area, but it is ok to use it
now.
quoted
quoted
quoted
quoted
Hmm, what are the other users doing?  I think we should avoid
using
quoted
quoted
quoted
quoted
iopa.
Get physical address from virtual address.  I have considered to
use
quoted
quoted
quoted
virt_to_phys(), but it is not consistent between ppc and powerpc
arch.
quoted
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
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help