Skip to contentSkip to conversation

qe_lib: Remove immrbar_virt_to_phys() function

PATCH In review Li Yang 3 participants 11 messages Oct 25, 2006 – Oct 31, 2006 PowerPC

lore
Share & tools
lore

Li Yang

author
#0 lore raw

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
index 2bae632..e422322 100644
@@ -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
index ce12f85..7cccd16 100644
@@ -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 */

#1 lore raw
Quoted 5 lines · Li Yang

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.

#2 lore raw
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: Remove immrbar_virt_to_phys() function =20
Li Yang writes:
=20

Quoted 5 lines

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.

Quoted 5 lines

=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

#3 lore raw
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: Remove immrbar_virt_to_phys() function

Quoted 5 lines · Li Yang

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.

Quoted 4 lines

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.

Quoted 6 lines

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

#4 lore raw
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: Remove immrbar_virt_to_phys() function =20
=20
On Oct 30, 2006, at 12:22 AM, Li Yang-r58472 wrote:
=20

Quoted 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: Remove immrbar_virt_to_phys() function

Quoted 5 lines · Li Yang

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 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_phys is a cleanup on the side that is made possible by the bugfix.

Quoted 10 lines

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?

Quoted 3 lines

=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

#5 lore raw
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: Remove immrbar_virt_to_phys() function

Quoted 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: Remove immrbar_virt_to_phys() function

Quoted 5 lines · Li Yang

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 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_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?

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

#6 lore raw
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() 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

#7 lore raw
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() 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

#8 lore raw
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: Remove immrbar_virt_to_phys() function =20
=20
On Oct 30, 2006, at 8:56 PM, Li Yang-r58472 wrote:
=20

Quoted 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 bug

to

Quoted 4 lines
Quoted 1 line

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

#9 lore raw
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: Remove immrbar_virt_to_phys() function

Quoted 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 bug

to

Quoted 4 lines
Quoted 1 line

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

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

#10 lore raw
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: Remove immrbar_virt_to_phys() function =20
=20
On Oct 30, 2006, at 11:25 PM, Li Yang-r58472 wrote:
=20

Quoted 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: Remove immrbar_virt_to_phys() function

Quoted 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() with io_block_mapping area, 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 powerpc

arch.

Quoted 2 lines

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 3 lines
Quoted 1 line

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