linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: mvebu: fix coherency_late_init() for multiplatform
@ 2013-06-20  7:45 Thomas Petazzoni
  2013-06-20  7:48 ` Andrew Lunn
  2013-06-20 12:16 ` Jason Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2013-06-20  7:45 UTC (permalink / raw)
  To: linux-arm-kernel

As noticed by Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>, commit
865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in
coherency code') added a postcore_initcall() to register the bus
notifier that the mvebu code needs to apply correct DMA operations on
its platform devices breaks the multiplatform boot on other platforms,
because the bus notifier registration is unconditional.

This commit fixes that by registering the bus notifier only if we have
the mvebu coherency unit described in the Device Tree. The conditional
used is exactly the same in which the bus_register_notifier() call was
originally enclosed before 865e0527d2d7 ('arm: mvebu: avoid hardcoded
virtual address in coherency code').

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
---
This fix has been reported by Arnaud to fix the boot on his OMAP4
PandaBoard, and it continues to work well on Marvell Armada XP GP.

This commit is based on jcooper/mvebu/regmap.
---
 arch/arm/mach-mvebu/coherency.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 32fcf69..be11759 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -147,8 +147,9 @@ int __init coherency_init(void)
 
 static int __init coherency_late_init(void)
 {
-	bus_register_notifier(&platform_bus_type,
-			      &mvebu_hwcc_platform_nb);
+	if (of_find_matching_node(NULL, of_coherency_table))
+		bus_register_notifier(&platform_bus_type,
+				      &mvebu_hwcc_platform_nb);
 	return 0;
 }
 
-- 
1.8.1.2

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

* [PATCH] arm: mvebu: fix coherency_late_init() for multiplatform
  2013-06-20  7:45 [PATCH] arm: mvebu: fix coherency_late_init() for multiplatform Thomas Petazzoni
@ 2013-06-20  7:48 ` Andrew Lunn
  2013-06-20 12:16 ` Jason Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2013-06-20  7:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 20, 2013 at 09:45:26AM +0200, Thomas Petazzoni wrote:
> As noticed by Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>, commit
> 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in
> coherency code') added a postcore_initcall() to register the bus
> notifier that the mvebu code needs to apply correct DMA operations on
> its platform devices breaks the multiplatform boot on other platforms,
> because the bus notifier registration is unconditional.
> 
> This commit fixes that by registering the bus notifier only if we have
> the mvebu coherency unit described in the Device Tree. The conditional
> used is exactly the same in which the bus_register_notifier() call was
> originally enclosed before 865e0527d2d7 ('arm: mvebu: avoid hardcoded
> virtual address in coherency code').
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Reported-by: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
> ---
> This fix has been reported by Arnaud to fix the boot on his OMAP4
> PandaBoard, and it continues to work well on Marvell Armada XP GP.
> 
> This commit is based on jcooper/mvebu/regmap.
> ---
>  arch/arm/mach-mvebu/coherency.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
> index 32fcf69..be11759 100644
> --- a/arch/arm/mach-mvebu/coherency.c
> +++ b/arch/arm/mach-mvebu/coherency.c
> @@ -147,8 +147,9 @@ int __init coherency_init(void)
>  
>  static int __init coherency_late_init(void)
>  {
> -	bus_register_notifier(&platform_bus_type,
> -			      &mvebu_hwcc_platform_nb);
> +	if (of_find_matching_node(NULL, of_coherency_table))
> +		bus_register_notifier(&platform_bus_type,
> +				      &mvebu_hwcc_platform_nb);
>  	return 0;
>  }
>  
> -- 
> 1.8.1.2
> 

Acked-by: Andrew Lunn <andrew@lunn.ch>

	  Andrew

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

* [PATCH] arm: mvebu: fix coherency_late_init() for multiplatform
  2013-06-20  7:45 [PATCH] arm: mvebu: fix coherency_late_init() for multiplatform Thomas Petazzoni
  2013-06-20  7:48 ` Andrew Lunn
@ 2013-06-20 12:16 ` Jason Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Cooper @ 2013-06-20 12:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 20, 2013 at 09:45:26AM +0200, Thomas Petazzoni wrote:
> As noticed by Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>, commit
> 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in
> coherency code') added a postcore_initcall() to register the bus
> notifier that the mvebu code needs to apply correct DMA operations on
> its platform devices breaks the multiplatform boot on other platforms,
> because the bus notifier registration is unconditional.
> 
> This commit fixes that by registering the bus notifier only if we have
> the mvebu coherency unit described in the Device Tree. The conditional
> used is exactly the same in which the bus_register_notifier() call was
> originally enclosed before 865e0527d2d7 ('arm: mvebu: avoid hardcoded
> virtual address in coherency code').
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Reported-by: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
> ---
> This fix has been reported by Arnaud to fix the boot on his OMAP4
> PandaBoard, and it continues to work well on Marvell Armada XP GP.
> 
> This commit is based on jcooper/mvebu/regmap.
> ---
>  arch/arm/mach-mvebu/coherency.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied to mvebu/regmap

thx,

Jason.

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

end of thread, other threads:[~2013-06-20 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20  7:45 [PATCH] arm: mvebu: fix coherency_late_init() for multiplatform Thomas Petazzoni
2013-06-20  7:48 ` Andrew Lunn
2013-06-20 12:16 ` Jason Cooper

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