qe_lib: Remove immrbar_virt_to_phys() function
PATCH 1/1 qe_lib: Remove immrbar_virt_to_phys() function
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.
---
arch/powerpc/sysdev/qe_lib/qe.c | 3 +-- include/asm-powerpc/immap_qe.h | 9 --------- 2 files changed, 1 insertions(+), 11 deletions(-)
arch/powerpc/sysdev/qe_lib/qe.c +0 -0
@@ -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));
include/asm-powerpc/immap_qe.h +0 -0
@@ -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 */
Quoted 5 lines · Li Yang
Remove private physical address mapping routine in
qe_lib. Users ofqe_libshould use generic functions likeiopa().
The change also addresses a bug found by Timur Tabi thatcmd_inputgot mapped inqe_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.
Quoted 14 lines
-----Original Message-----
From: Paul Mackerras [mailto:[email protected]]
Sent: Monday, October 30, 2006 11:22 AM
To: Li Yang-r58472
Cc: [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()function =20
Li Yang writes:
=20Quoted 5 lines
Remove private physical address mapping routine in
qe_lib. Users ofqe_libshould use generic functions likeiopa().
The change also addresses a bug found by Timur Tabi thatcmd_inputgot mapped inqe_issue_cmd(). It should be written to CECDR unmodified.
Quoted 5 lines
=20
Do you mean that the argument toqe_issue_cmdis a physical address? It seems to me that the bug fix you mention is the main thing the patch does, and the removal ofimmrvar_virt_to_physis 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
Quoted 20 lines · On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:
Quoted 15 lines
-----Original Message-----
From: Paul Mackerras [mailto:[email protected]]
Sent: Monday, October 30, 2006 11:22 AM
To: Li Yang-r58472
Cc: [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()functionQuoted 5 lines · Li Yang
Remove private physical address mapping routine in
qe_lib. Users ofqe_libshould use generic functions likeiopa().
The change also addresses a bug found by Timur Tabi thatcmd_inputgot mapped inqe_issue_cmd(). It should be written to CECDR unmodified.Quoted 4 lines
Do you mean that the argument to
qe_issue_cmdis a physical address? It seems to me that the bug fix you mention is the main thing the patch does, and the removal ofimmrvar_virt_to_physis a cleanup on the side that is made possible by the bugfix.
Quoted 6 lines
The argument
cmd_inputshould 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 theimmrbar_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
Quoted 26 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, October 31, 2006 6:16 AM
To: Li Yang-r58472
Cc: Paul Mackerras; [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()function =20
=20
On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:
=20Quoted 16 lines
Quoted 16 lines
-----Original Message-----
From: Paul Mackerras [mailto:[email protected]]
Sent: Monday, October 30, 2006 11:22 AM
To: Li Yang-r58472
Cc: [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()functionQuoted 5 lines · Li Yang
Remove private physical address mapping routine in
qe_lib. Users ofqe_libshould use generic functions likeiopa().
The change also addresses a bug found by Timur Tabi thatcmd_inputgot mapped inqe_issue_cmd(). It should be written to CECDR unmodified.Do you mean that the argument to
qe_issue_cmdis a physical
address?
Quoted 14 lines
Quoted 4 lines
Quoted 3 lines
It seems to me that the bug fix you mention is the main thing the patch does, and the removal of
immrvar_virt_to_physis a cleanup on the side that is made possible by the bugfix.Quoted 10 lines
The argument
cmd_inputshould 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 theimmrbar_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?
Quoted 3 lines
=20
I'm confused, if there are other users ofimmrbar_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
Quoted 42 lines · On Oct 30, 2006, at 8:28 PM, Li Yang-r58472 wrote:
Quoted 8 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, October 31, 2006 6:16 AM
To: Li Yang-r58472
Cc: Paul Mackerras; [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()functionQuoted 18 lines
Quoted 16 lines · On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:
Quoted 16 lines
-----Original Message-----
From: Paul Mackerras [mailto:[email protected]]
Sent: Monday, October 30, 2006 11:22 AM
To: Li Yang-r58472
Cc: [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()functionQuoted 5 lines · Li Yang
Remove private physical address mapping routine in
qe_lib. Users ofqe_libshould use generic functions likeiopa().
The change also addresses a bug found by Timur Tabi thatcmd_inputgot mapped inqe_issue_cmd(). It should be written to CECDR unmodified.Do you mean that the argument to
qe_issue_cmdis a physicaladdress?
Quoted 15 lines
Quoted 14 lines
Quoted 3 lines
It seems to me that the bug fix you mention is the main thing the patch does, and the removal of
immrvar_virt_to_physis a cleanup on the side that is made possible by the bugfix.The argument
cmd_inputshould 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 theimmrbar_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?
Quoted 5 lines
Quoted 2 lines
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 useiopa()withio_block_mappingarea, but it is ok to use it now.
Hmm, what are the other users doing? I think we should avoid using iopa.
- kumar
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
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 4 lines
Quoted 1 line
use
iopa()withio_block_mappingarea, 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
Quoted 4 lines · On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
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
Quoted 8 lines
to
Quoted 4 lines
Quoted 1 line
use
iopa()withio_block_mappingarea, 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
Quoted 11 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, October 31, 2006 1:06 PM
To: Li Yang-r58472
Cc: Paul Mackerras; [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()function =20
=20
On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
=20Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
I'm confused, if there are other users of
immrbar_virt_to_phy()
how
Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
can you get ride of it completely?
Other users will change to use
iopa()instead. There was some bugto
Quoted 4 lines
Quoted 1 line
use
iopa()withio_block_mappingarea, 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 2 lines
=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
Quoted 23 lines · On Oct 30, 2006, at 11:25 PM, Li Yang-r58472 wrote:
Quoted 11 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, October 31, 2006 1:06 PM
To: Li Yang-r58472
Cc: Paul Mackerras; [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()functionQuoted 1 line · On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
I'm confused, if there are other users of
immrbar_virt_to_phy()how
Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
can you get ride of it completely?
Other users will change to use
iopa()instead. There was some bugto
Quoted 4 lines
Quoted 1 line
use
iopa()withio_block_mappingarea, 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
Quoted 7 lines
arch.
Quoted 2 lines
Why does that matter, qe support only exists in powerpc.
Well, it does use
include/asm-ppc/io.hinstead ofinclude/asm-powerpc/io.hfor now. If the hack is removed, the driver will not work.
What uses asm-ppc/io.h instead of asm-powerpc/io.h?
- k
Quoted 25 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, October 31, 2006 1:30 PM
To: Li Yang-r58472
Cc: Paul Mackerras; [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()function =20
=20
On Oct 30, 2006, at 11:25 PM, Li Yang-r58472 wrote:
=20Quoted 15 lines
Quoted 11 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, October 31, 2006 1:06 PM
To: Li Yang-r58472
Cc: Paul Mackerras; [email protected]
Subject: Re: [PATCH]qe_lib: Removeimmrbar_virt_to_phys()functionQuoted 1 line · On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
I'm confused, if there are other users of
immrbar_virt_to_phy()how
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
can you get ride of it completely?
Other users will change to use
iopa()instead. There was some
bug
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
to
Quoted 1 line
Quoted 1 line
use
iopa()withio_block_mappingarea, but it is ok to use it
now.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Hmm, what are the other users doing? I think we should avoid
using
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
iopa.
Get physical address from virtual address. I have considered to
use
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
virt_to_phys(), but it is not consistent between ppc and powerpcarch.
Quoted 2 lines
Why does that matter, qe support only exists in powerpc.
Well, it does use
include/asm-ppc/io.hinstead ofinclude/asm-powerpc/io.hfor now. If the hack is removed, the
driver
Quoted 3 lines
Quoted 1 line
will not work.
=20
What usesasm-ppc/io.hinstead ofasm-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