linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data
@ 2015-05-09 20:06 Lucas Stach
  2015-05-13  8:48 ` [tip:irq/urgent] irqchip: tegra: Set the proper base address in irq " tip-bot for Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lucas Stach @ 2015-05-09 20:06 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier
  Cc: Stephen Warren, Thierry Reding, Alexandre Courbot, linux-kernel,
	linux-tegra

The irq chip functions use the irq chipdata directly as the base register
address of the controller, so this should be passed in instead of a pointer
to the array address holding the base address.

This fixes Tegra20 CPUidle as now the un-/masking of IRQs at the LIC level
works again, but more importantly it fixes the resulting memory corruption.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
This is an important fix and should go into 4.1.
---
 drivers/irqchip/irq-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c
index 51c485d..f67bbd8 100644
--- a/drivers/irqchip/irq-tegra.c
+++ b/drivers/irqchip/irq-tegra.c
@@ -264,7 +264,7 @@ static int tegra_ictlr_domain_alloc(struct irq_domain *domain,
 
 		irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
 					      &tegra_ictlr_chip,
-					      &info->base[ictlr]);
+					      info->base[ictlr]);
 	}
 
 	parent_args = *args;
-- 
2.1.0


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

* [tip:irq/urgent] irqchip: tegra: Set the proper base address in irq chip data
  2015-05-09 20:06 [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data Lucas Stach
@ 2015-05-13  8:48 ` tip-bot for Lucas Stach
  2015-05-13  9:35 ` [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain " Thierry Reding
  2015-05-13 22:18 ` Stephen Warren
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Lucas Stach @ 2015-05-13  8:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: marc.zyngier, tglx, dev, gnurou, swarren, mingo, thierry.reding,
	hpa, jason, linux-kernel

Commit-ID:  9cf82e72ec449b4516843377ac7a20abe300c64f
Gitweb:     http://git.kernel.org/tip/9cf82e72ec449b4516843377ac7a20abe300c64f
Author:     Lucas Stach <dev@lynxeye.de>
AuthorDate: Sat, 9 May 2015 22:06:54 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 13 May 2015 10:46:07 +0200

irqchip: tegra: Set the proper base address in irq chip data

The irq chip functions use the irq chipdata directly as the base register
address of the controller, so this should be passed in instead of a pointer
to the array address holding the base address.

This fixes Tegra20 CPUidle as now the un-/masking of IRQs at the LIC level
works again, but more importantly it fixes the resulting memory corruption.

Fixes: de3ce0804916 ' irqchip: tegra: Add DT-based support for legacy interrupt controller'
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/1431202014-3136-1-git-send-email-dev@lynxeye.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/irqchip/irq-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c
index 51c485d..f67bbd8 100644
--- a/drivers/irqchip/irq-tegra.c
+++ b/drivers/irqchip/irq-tegra.c
@@ -264,7 +264,7 @@ static int tegra_ictlr_domain_alloc(struct irq_domain *domain,
 
 		irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
 					      &tegra_ictlr_chip,
-					      &info->base[ictlr]);
+					      info->base[ictlr]);
 	}
 
 	parent_args = *args;

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

* Re: [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data
  2015-05-09 20:06 [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data Lucas Stach
  2015-05-13  8:48 ` [tip:irq/urgent] irqchip: tegra: Set the proper base address in irq " tip-bot for Lucas Stach
@ 2015-05-13  9:35 ` Thierry Reding
  2015-05-13 22:18 ` Stephen Warren
  2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2015-05-13  9:35 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Thomas Gleixner, Jason Cooper, Marc Zyngier, Stephen Warren,
	Alexandre Courbot, linux-kernel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]

On Sat, May 09, 2015 at 10:06:54PM +0200, Lucas Stach wrote:
> The irq chip functions use the irq chipdata directly as the base register
> address of the controller, so this should be passed in instead of a pointer
> to the array address holding the base address.
> 
> This fixes Tegra20 CPUidle as now the un-/masking of IRQs at the LIC level
> works again, but more importantly it fixes the resulting memory corruption.
> 
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
> This is an important fix and should go into 4.1.
> ---
>  drivers/irqchip/irq-tegra.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This does indeed fix a boot regression on Tegra20. Unfortunately this is
not exposed on any platform that uses PCIe because PCIe needs to disable
the CPUidle LP2 state as a workaround for a hardware bug. However, I was
able to reproduce the regression on TrimSlice by disabling PCIe, hence
keeping CPUidle LP2 activated. I reproduced with v4.1-rc3 and applying
this patch on top restores functionality.

Thanks for tracking this down Lucas.

I just noticed that Thomas already applied this while I was testing it,
but here goes anyway:

Tested-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data
  2015-05-09 20:06 [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data Lucas Stach
  2015-05-13  8:48 ` [tip:irq/urgent] irqchip: tegra: Set the proper base address in irq " tip-bot for Lucas Stach
  2015-05-13  9:35 ` [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain " Thierry Reding
@ 2015-05-13 22:18 ` Stephen Warren
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2015-05-13 22:18 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Thomas Gleixner, Jason Cooper, Marc Zyngier, Thierry Reding,
	Alexandre Courbot, linux-kernel, linux-tegra

On 05/09/2015 02:06 PM, Lucas Stach wrote:
> The irq chip functions use the irq chipdata directly as the base register
> address of the controller, so this should be passed in instead of a pointer
> to the array address holding the base address.
>
> This fixes Tegra20 CPUidle as now the un-/masking of IRQs at the LIC level
> works again, but more importantly it fixes the resulting memory corruption.

Tested-by: Stephen Warren <swarren@nvidia.com>

Tested on NVIDIA Seaboard (which is affected by the bug in the default 
configuration/DT) with the patch applied on to of 4.1-rc3.

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

end of thread, other threads:[~2015-05-13 22:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 20:06 [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data Lucas Stach
2015-05-13  8:48 ` [tip:irq/urgent] irqchip: tegra: Set the proper base address in irq " tip-bot for Lucas Stach
2015-05-13  9:35 ` [PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain " Thierry Reding
2015-05-13 22:18 ` Stephen Warren

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