linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 2/2] msm: io: Change the default static iomappings to be shared
@ 2012-08-10 21:18 Rohit Vaswani
  2012-08-28 20:41 ` Olof Johansson
  0 siblings, 1 reply; 5+ messages in thread
From: Rohit Vaswani @ 2012-08-10 21:18 UTC (permalink / raw)
  To: davidb; +Cc: Rohit Vaswani, linux-arm-kernel, linux-kernel, linux-arm-msm

With 3.4 kernel the static iomappings can be shared with the ioremap
mappings. If ioremap is called with an address for which a static
mapping already exists, then that mapping should be used instead
of creating a new one.
However, the MT_DEVICE_NONSHARED flag prevents this. Hence, get rid
of this flag. Some targets (7X00) that require the static iomappings
to be NONSHARED use the MSM_DEVICE_TYPE and MSM_CHIP_DEVICE_TYPE macros.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
---
 arch/arm/mach-msm/io.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index 2409c0b..5fc2e48 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -33,23 +33,32 @@
 		.virtual = (unsigned long) MSM_##name##_BASE, \
 		.pfn = __phys_to_pfn(chip##_##name##_PHYS), \
 		.length = chip##_##name##_SIZE, \
-		.type = MT_DEVICE_NONSHARED, \
+		.type = MT_DEVICE, \
+	 }
+
+#define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) {			      \
+		.virtual = (unsigned long) MSM_##name##_BASE, \
+		.pfn = __phys_to_pfn(chip##_##name##_PHYS), \
+		.length = chip##_##name##_SIZE, \
+		.type = mem_type, \
 	 }
 
 #define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
+#define MSM_DEVICE_TYPE(name, mem_type) \
+		MSM_CHIP_DEVICE_TYPE(name, MSM, mem_type)
 
 #if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \
 	|| defined(CONFIG_ARCH_MSM7X25)
 static struct map_desc msm_io_desc[] __initdata = {
-	MSM_DEVICE(VIC),
-	MSM_CHIP_DEVICE(CSR, MSM7X00),
-	MSM_DEVICE(DMOV),
-	MSM_CHIP_DEVICE(GPIO1, MSM7X00),
-	MSM_CHIP_DEVICE(GPIO2, MSM7X00),
-	MSM_DEVICE(CLK_CTL),
+	MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(CLK_CTL, MSM7X00, MT_DEVICE_NONSHARED),
 #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
 	defined(CONFIG_DEBUG_MSM_UART3)
-	MSM_DEVICE(DEBUG_UART),
+	MSM_DEVICE_TYPE(DEBUG_UART, MT_DEVICE_NONSHARED),
 #endif
 	{
 		.virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
-- 
Sent by an employee of the Qualcomm Innovation Center,Inc
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.


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

* Re: [PATCH RESEND 2/2] msm: io: Change the default static iomappings to be shared
  2012-08-10 21:18 [PATCH RESEND 2/2] msm: io: Change the default static iomappings to be shared Rohit Vaswani
@ 2012-08-28 20:41 ` Olof Johansson
  2012-09-06 17:16   ` [PATCHv2 " Rohit Vaswani
  0 siblings, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2012-08-28 20:41 UTC (permalink / raw)
  To: Rohit Vaswani; +Cc: davidb, linux-arm-kernel, linux-kernel, linux-arm-msm

Hi,

On Fri, Aug 10, 2012 at 2:18 PM, Rohit Vaswani <rvaswani@codeaurora.org> wrote:
> With 3.4 kernel the static iomappings can be shared with the ioremap
> mappings. If ioremap is called with an address for which a static
> mapping already exists, then that mapping should be used instead
> of creating a new one.
> However, the MT_DEVICE_NONSHARED flag prevents this. Hence, get rid
> of this flag. Some targets (7X00) that require the static iomappings
> to be NONSHARED use the MSM_DEVICE_TYPE and MSM_CHIP_DEVICE_TYPE macros.
>
> Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
> ---
>  arch/arm/mach-msm/io.c |   25 +++++++++++++++++--------
>  1 files changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
> index 2409c0b..5fc2e48 100644
> --- a/arch/arm/mach-msm/io.c
> +++ b/arch/arm/mach-msm/io.c
> @@ -33,23 +33,32 @@
>                 .virtual = (unsigned long) MSM_##name##_BASE, \
>                 .pfn = __phys_to_pfn(chip##_##name##_PHYS), \
>                 .length = chip##_##name##_SIZE, \
> -               .type = MT_DEVICE_NONSHARED, \
> +               .type = MT_DEVICE, \
> +        }
> +
> +#define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) {                         \
> +               .virtual = (unsigned long) MSM_##name##_BASE, \
> +               .pfn = __phys_to_pfn(chip##_##name##_PHYS), \
> +               .length = chip##_##name##_SIZE, \
> +               .type = mem_type, \
>          }

The above is partially hidden by lack of context in the diff, but now
you have two defines that do nearly the same thing. It's better to
move to a

#define MSM_CHIP_DEVICE(name, chip)  MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE)

for the exising one, instead of duplicating the open coded macros.


-Olof

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

* [PATCHv2 2/2] msm: io: Change the default static iomappings to be shared
  2012-08-28 20:41 ` Olof Johansson
@ 2012-09-06 17:16   ` Rohit Vaswani
  2012-09-07  3:17     ` Stephen Boyd
  0 siblings, 1 reply; 5+ messages in thread
From: Rohit Vaswani @ 2012-09-06 17:16 UTC (permalink / raw)
  To: Olof Johansson, David Brown, Bryan Huntsman, Daniel Walker
  Cc: Rohit Vaswani, linux-arm-kernel, linux-kernel, linux-arm-msm

With 3.4 kernel the static iomappings can be shared with the ioremap
mappings. If ioremap is called with an address for which a static
mapping already exists, then that mapping should be used instead
of creating a new one.
However, the MT_DEVICE_NONSHARED flag prevents this. Hence, get rid
of this flag. Some targets (7X00) that require the static iomappings
to be NONSHARED use the MSM_DEVICE_TYPE and MSM_CHIP_DEVICE_TYPE macros.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
---
 arch/arm/mach-msm/io.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index 2409c0b..5190136 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -29,27 +29,31 @@
 
 #include <mach/board.h>
 
-#define MSM_CHIP_DEVICE(name, chip) {			      \
+#define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) {			      \
 		.virtual = (unsigned long) MSM_##name##_BASE, \
 		.pfn = __phys_to_pfn(chip##_##name##_PHYS), \
 		.length = chip##_##name##_SIZE, \
-		.type = MT_DEVICE_NONSHARED, \
+		.type = mem_type, \
 	 }
 
+#define MSM_DEVICE_TYPE(name, mem_type) \
+		MSM_CHIP_DEVICE_TYPE(name, MSM, mem_type)
+#define MSM_CHIP_DEVICE(name, chip) \
+		MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE)
 #define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
 
 #if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \
 	|| defined(CONFIG_ARCH_MSM7X25)
 static struct map_desc msm_io_desc[] __initdata = {
-	MSM_DEVICE(VIC),
-	MSM_CHIP_DEVICE(CSR, MSM7X00),
-	MSM_DEVICE(DMOV),
-	MSM_CHIP_DEVICE(GPIO1, MSM7X00),
-	MSM_CHIP_DEVICE(GPIO2, MSM7X00),
-	MSM_DEVICE(CLK_CTL),
+	MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(CLK_CTL, MSM7X00, MT_DEVICE_NONSHARED),
 #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
 	defined(CONFIG_DEBUG_MSM_UART3)
-	MSM_DEVICE(DEBUG_UART),
+	MSM_DEVICE_TYPE(DEBUG_UART, MT_DEVICE_NONSHARED),
 #endif
 	{
 		.virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


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

* Re: [PATCHv2 2/2] msm: io: Change the default static iomappings to be shared
  2012-09-06 17:16   ` [PATCHv2 " Rohit Vaswani
@ 2012-09-07  3:17     ` Stephen Boyd
  2012-09-07 20:05       ` [PATCHv3 " Rohit Vaswani
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2012-09-07  3:17 UTC (permalink / raw)
  To: Rohit Vaswani
  Cc: Olof Johansson, David Brown, Bryan Huntsman, Daniel Walker,
	linux-arm-kernel, linux-kernel, linux-arm-msm

On 09/06/12 10:16, Rohit Vaswani wrote:
>  static struct map_desc msm_io_desc[] __initdata = {
> -	MSM_DEVICE(VIC),
> -	MSM_CHIP_DEVICE(CSR, MSM7X00),
> -	MSM_DEVICE(DMOV),
> -	MSM_CHIP_DEVICE(GPIO1, MSM7X00),
> -	MSM_CHIP_DEVICE(GPIO2, MSM7X00),
> -	MSM_DEVICE(CLK_CTL),
> +	MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED),
> +	MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED),
> +	MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
> +	MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
> +	MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
> +	MSM_CHIP_DEVICE_TYPE(CLK_CTL, MSM7X00, MT_DEVICE_NONSHARED),

This one is supposed to be MSM_DEVICE_TYPE.

Please squash this in:

diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index 35d6926..d908a37 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -52,7 +52,7 @@ static struct map_desc msm_io_desc[] __initdata = {
        MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
        MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
        MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
-       MSM_CHIP_DEVICE_TYPE(CLK_CTL, MSM7X00, MT_DEVICE_NONSHARED),
+       MSM_DEVICE_TYPE(CLK_CTL, MT_DEVICE_NONSHARED),
 #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
        defined(CONFIG_DEBUG_MSM_UART3)
        MSM_DEVICE_TYPE(DEBUG_UART, MT_DEVICE_NONSHARED),

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


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

* [PATCHv3 2/2] msm: io: Change the default static iomappings to be shared
  2012-09-07  3:17     ` Stephen Boyd
@ 2012-09-07 20:05       ` Rohit Vaswani
  0 siblings, 0 replies; 5+ messages in thread
From: Rohit Vaswani @ 2012-09-07 20:05 UTC (permalink / raw)
  To: Stephen Boyd, David Brown, Bryan Huntsman, Daniel Walker
  Cc: Rohit Vaswani, linux-arm-kernel, linux-kernel, linux-arm-msm

With 3.4 kernel the static iomappings can be shared with the ioremap
mappings. If ioremap is called with an address for which a static
mapping already exists, then that mapping should be used instead
of creating a new one.
However, the MT_DEVICE_NONSHARED flag prevents this. Hence, get rid
of this flag. Some targets (7X00) that require the static iomappings
to be NONSHARED use the MSM_DEVICE_TYPE and MSM_CHIP_DEVICE_TYPE macros.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
---
 arch/arm/mach-msm/io.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index 2409c0b..af43f6a 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -29,27 +29,31 @@
 
 #include <mach/board.h>
 
-#define MSM_CHIP_DEVICE(name, chip) {			      \
+#define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) {			      \
 		.virtual = (unsigned long) MSM_##name##_BASE, \
 		.pfn = __phys_to_pfn(chip##_##name##_PHYS), \
 		.length = chip##_##name##_SIZE, \
-		.type = MT_DEVICE_NONSHARED, \
+		.type = mem_type, \
 	 }
 
+#define MSM_DEVICE_TYPE(name, mem_type) \
+		MSM_CHIP_DEVICE_TYPE(name, MSM, mem_type)
+#define MSM_CHIP_DEVICE(name, chip) \
+		MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE)
 #define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
 
 #if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \
 	|| defined(CONFIG_ARCH_MSM7X25)
 static struct map_desc msm_io_desc[] __initdata = {
-	MSM_DEVICE(VIC),
-	MSM_CHIP_DEVICE(CSR, MSM7X00),
-	MSM_DEVICE(DMOV),
-	MSM_CHIP_DEVICE(GPIO1, MSM7X00),
-	MSM_CHIP_DEVICE(GPIO2, MSM7X00),
-	MSM_DEVICE(CLK_CTL),
+	MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
+	MSM_DEVICE_TYPE(CLK_CTL, MT_DEVICE_NONSHARED),
 #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
 	defined(CONFIG_DEBUG_MSM_UART3)
-	MSM_DEVICE(DEBUG_UART),
+	MSM_DEVICE_TYPE(DEBUG_UART, MT_DEVICE_NONSHARED),
 #endif
 	{
 		.virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


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

end of thread, other threads:[~2012-09-07 20:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10 21:18 [PATCH RESEND 2/2] msm: io: Change the default static iomappings to be shared Rohit Vaswani
2012-08-28 20:41 ` Olof Johansson
2012-09-06 17:16   ` [PATCHv2 " Rohit Vaswani
2012-09-07  3:17     ` Stephen Boyd
2012-09-07 20:05       ` [PATCHv3 " Rohit Vaswani

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