All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] pinctrl:mtk: Fix kexec() initialization
@ 2022-11-21 23:38 ` Ricardo Ribalda
  0 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda @ 2022-11-21 23:38 UTC (permalink / raw)
  To: Linus Walleij, Matthias Brugger, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google),
	Ricardo Ribalda

When we use kexec to reboot a system, the hardware keeps its
old state.

This can be problematic for interrupt controllers.

Lets initialise the controller with a know state.

To: Sean Wang <sean.wang@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-mediatek@lists.infradead.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ross Zwisler <zwisler@kernel.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

---
Ricardo Ribalda (1):
      pinctrl: meditatek: Startup with the IRQs disabled

 drivers/pinctrl/mediatek/mtk-eint.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
base-commit: eb7081409f94a9a8608593d0fb63a1aa3d6f95d8
change-id: 20221122-mtk-pinctrl-a82d0240c848

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>

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

* [PATCH v1 0/1] pinctrl:mtk: Fix kexec() initialization
@ 2022-11-21 23:38 ` Ricardo Ribalda
  0 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda @ 2022-11-21 23:38 UTC (permalink / raw)
  To: Linus Walleij, Matthias Brugger, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google),
	Ricardo Ribalda

When we use kexec to reboot a system, the hardware keeps its
old state.

This can be problematic for interrupt controllers.

Lets initialise the controller with a know state.

To: Sean Wang <sean.wang@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-mediatek@lists.infradead.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ross Zwisler <zwisler@kernel.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

---
Ricardo Ribalda (1):
      pinctrl: meditatek: Startup with the IRQs disabled

 drivers/pinctrl/mediatek/mtk-eint.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
base-commit: eb7081409f94a9a8608593d0fb63a1aa3d6f95d8
change-id: 20221122-mtk-pinctrl-a82d0240c848

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
  2022-11-21 23:38 ` Ricardo Ribalda
@ 2022-11-21 23:38   ` Ricardo Ribalda
  -1 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda @ 2022-11-21 23:38 UTC (permalink / raw)
  To: Linus Walleij, Matthias Brugger, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google),
	Ricardo Ribalda

If the system is restarted via kexec(), the peripherals do not start
with a known state.

If the previous system had enabled an IRQs we will receive unexected
IRQs that can lock the system.

[   28.109251] watchdog: BUG: soft lockup - CPU#0 stuck for 26s!
[swapper/0:0]
[   28.109263] Modules linked in:
[   28.109273] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
5.15.79-14458-g4b9edf7b1ac6 #1 9f2e76613148af94acccd64c609a552fb4b4354b
[   28.109284] Hardware name: Google Elm (DT)
[   28.109290] pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS
		BTYPE=--)
[   28.109298] pc : __do_softirq+0xa0/0x388
[   28.109309] lr : __do_softirq+0x70/0x388
[   28.109316] sp : ffffffc008003ee0
[   28.109321] x29: ffffffc008003f00 x28: 000000000000000a x27:
0000000000000080
[   28.109334] x26: 0000000000000001 x25: ffffffefa7b350c0 x24:
ffffffefa7b47480
[   28.109346] x23: ffffffefa7b3d000 x22: 0000000000000000 x21:
ffffffefa7b0fa40
[   28.109358] x20: ffffffefa7b005b0 x19: ffffffefa7b47480 x18:
0000000000065b6b
[   28.109370] x17: ffffffefa749c8b0 x16: 000000000000018c x15:
00000000000001b8
[   28.109382] x14: 00000000000d3b6b x13: 0000000000000006 x12:
0000000000057e91
[   28.109394] x11: 0000000000000000 x10: 0000000000000000 x9 :
ffffffefa7b47480
[   28.109406] x8 : 00000000000000e0 x7 : 000000000f424000 x6 :
0000000000000000
[   28.109418] x5 : ffffffefa7dfaca0 x4 : ffffffefa7dfadf0 x3 :
000000000000000f
[   28.109429] x2 : 0000000000000000 x1 : 0000000000000100 x0 :
0000000001ac65c5
[   28.109441] Call trace:
[   28.109447]  __do_softirq+0xa0/0x388
[   28.109454]  irq_exit+0xc0/0xe0
[   28.109464]  handle_domain_irq+0x68/0x90
[   28.109473]  gic_handle_irq+0xac/0xf0
[   28.109480]  call_on_irq_stack+0x28/0x50
[   28.109488]  do_interrupt_handler+0x44/0x58
[   28.109496]  el1_interrupt+0x30/0x58
[   28.109506]  el1h_64_irq_handler+0x18/0x24
[   28.109512]  el1h_64_irq+0x7c/0x80
[   28.109519]  arch_local_irq_enable+0xc/0x18
[   28.109529]  default_idle_call+0x40/0x140
[   28.109539]  do_idle+0x108/0x290
[   28.109547]  cpu_startup_entry+0x2c/0x30
[   28.109554]  rest_init+0xe8/0xf8
[   28.109562]  arch_call_rest_init+0x18/0x24
[   28.109571]  start_kernel+0x338/0x42c
[   28.109578]  __primary_switched+0xbc/0xc4
[   28.109588] Kernel panic - not syncing: softlockup: hung tasks

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
index 65d312967619..27f0a54e12bf 100644
--- a/drivers/pinctrl/mediatek/mtk-eint.c
+++ b/drivers/pinctrl/mediatek/mtk-eint.c
@@ -303,12 +303,15 @@ static struct irq_chip mtk_eint_irq_chip = {
 
 static unsigned int mtk_eint_hw_init(struct mtk_eint *eint)
 {
-	void __iomem *reg = eint->base + eint->regs->dom_en;
+	void __iomem *dom_en = eint->base + eint->regs->dom_en;
+	void __iomem *mask_set = eint->base + eint->regs->mask_set;
 	unsigned int i;
 
 	for (i = 0; i < eint->hw->ap_num; i += 32) {
-		writel(0xffffffff, reg);
-		reg += 4;
+		writel(0xffffffff, dom_en);
+		writel(0xffffffff, mask_set);
+		dom_en += 4;
+		mask_set += 4;
 	}
 
 	return 0;

-- 
b4 0.11.0-dev-d93f8

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

* [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
@ 2022-11-21 23:38   ` Ricardo Ribalda
  0 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda @ 2022-11-21 23:38 UTC (permalink / raw)
  To: Linus Walleij, Matthias Brugger, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google),
	Ricardo Ribalda

If the system is restarted via kexec(), the peripherals do not start
with a known state.

If the previous system had enabled an IRQs we will receive unexected
IRQs that can lock the system.

[   28.109251] watchdog: BUG: soft lockup - CPU#0 stuck for 26s!
[swapper/0:0]
[   28.109263] Modules linked in:
[   28.109273] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
5.15.79-14458-g4b9edf7b1ac6 #1 9f2e76613148af94acccd64c609a552fb4b4354b
[   28.109284] Hardware name: Google Elm (DT)
[   28.109290] pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS
		BTYPE=--)
[   28.109298] pc : __do_softirq+0xa0/0x388
[   28.109309] lr : __do_softirq+0x70/0x388
[   28.109316] sp : ffffffc008003ee0
[   28.109321] x29: ffffffc008003f00 x28: 000000000000000a x27:
0000000000000080
[   28.109334] x26: 0000000000000001 x25: ffffffefa7b350c0 x24:
ffffffefa7b47480
[   28.109346] x23: ffffffefa7b3d000 x22: 0000000000000000 x21:
ffffffefa7b0fa40
[   28.109358] x20: ffffffefa7b005b0 x19: ffffffefa7b47480 x18:
0000000000065b6b
[   28.109370] x17: ffffffefa749c8b0 x16: 000000000000018c x15:
00000000000001b8
[   28.109382] x14: 00000000000d3b6b x13: 0000000000000006 x12:
0000000000057e91
[   28.109394] x11: 0000000000000000 x10: 0000000000000000 x9 :
ffffffefa7b47480
[   28.109406] x8 : 00000000000000e0 x7 : 000000000f424000 x6 :
0000000000000000
[   28.109418] x5 : ffffffefa7dfaca0 x4 : ffffffefa7dfadf0 x3 :
000000000000000f
[   28.109429] x2 : 0000000000000000 x1 : 0000000000000100 x0 :
0000000001ac65c5
[   28.109441] Call trace:
[   28.109447]  __do_softirq+0xa0/0x388
[   28.109454]  irq_exit+0xc0/0xe0
[   28.109464]  handle_domain_irq+0x68/0x90
[   28.109473]  gic_handle_irq+0xac/0xf0
[   28.109480]  call_on_irq_stack+0x28/0x50
[   28.109488]  do_interrupt_handler+0x44/0x58
[   28.109496]  el1_interrupt+0x30/0x58
[   28.109506]  el1h_64_irq_handler+0x18/0x24
[   28.109512]  el1h_64_irq+0x7c/0x80
[   28.109519]  arch_local_irq_enable+0xc/0x18
[   28.109529]  default_idle_call+0x40/0x140
[   28.109539]  do_idle+0x108/0x290
[   28.109547]  cpu_startup_entry+0x2c/0x30
[   28.109554]  rest_init+0xe8/0xf8
[   28.109562]  arch_call_rest_init+0x18/0x24
[   28.109571]  start_kernel+0x338/0x42c
[   28.109578]  __primary_switched+0xbc/0xc4
[   28.109588] Kernel panic - not syncing: softlockup: hung tasks

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
index 65d312967619..27f0a54e12bf 100644
--- a/drivers/pinctrl/mediatek/mtk-eint.c
+++ b/drivers/pinctrl/mediatek/mtk-eint.c
@@ -303,12 +303,15 @@ static struct irq_chip mtk_eint_irq_chip = {
 
 static unsigned int mtk_eint_hw_init(struct mtk_eint *eint)
 {
-	void __iomem *reg = eint->base + eint->regs->dom_en;
+	void __iomem *dom_en = eint->base + eint->regs->dom_en;
+	void __iomem *mask_set = eint->base + eint->regs->mask_set;
 	unsigned int i;
 
 	for (i = 0; i < eint->hw->ap_num; i += 32) {
-		writel(0xffffffff, reg);
-		reg += 4;
+		writel(0xffffffff, dom_en);
+		writel(0xffffffff, mask_set);
+		dom_en += 4;
+		mask_set += 4;
 	}
 
 	return 0;

-- 
b4 0.11.0-dev-d93f8

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
  2022-11-21 23:38   ` Ricardo Ribalda
@ 2022-11-22  8:34     ` Linus Walleij
  -1 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2022-11-22  8:34 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Matthias Brugger, Sean Wang, Steven Rostedt, Ross Zwisler,
	linux-kernel, linux-gpio, linux-arm-kernel, linux-mediatek,
	Sergey Senozhatsky, Joel Fernandes (Google)

On Tue, Nov 22, 2022 at 12:39 AM Ricardo Ribalda <ribalda@chromium.org> wrote:

> If the system is restarted via kexec(), the peripherals do not start
> with a known state.
>
> If the previous system had enabled an IRQs we will receive unexected
> IRQs that can lock the system.
(...)

This is obviously the right thing to do, so I just applied this
patch for fixes. Any ACKs and reviewed-by can be added
while this is tested in linux-next.

Yours,
Linus Walleij

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

* Re: [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
@ 2022-11-22  8:34     ` Linus Walleij
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2022-11-22  8:34 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Matthias Brugger, Sean Wang, Steven Rostedt, Ross Zwisler,
	linux-kernel, linux-gpio, linux-arm-kernel, linux-mediatek,
	Sergey Senozhatsky, Joel Fernandes (Google)

On Tue, Nov 22, 2022 at 12:39 AM Ricardo Ribalda <ribalda@chromium.org> wrote:

> If the system is restarted via kexec(), the peripherals do not start
> with a known state.
>
> If the previous system had enabled an IRQs we will receive unexected
> IRQs that can lock the system.
(...)

This is obviously the right thing to do, so I just applied this
patch for fixes. Any ACKs and reviewed-by can be added
while this is tested in linux-next.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
  2022-11-21 23:38   ` Ricardo Ribalda
@ 2022-11-22  9:23     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-11-22  9:23 UTC (permalink / raw)
  To: Ricardo Ribalda, Linus Walleij, Matthias Brugger, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google)

Il 22/11/22 00:38, Ricardo Ribalda ha scritto:
> If the system is restarted via kexec(), the peripherals do not start
> with a known state.
> 
> If the previous system had enabled an IRQs we will receive unexected
> IRQs that can lock the system.
> 
> [   28.109251] watchdog: BUG: soft lockup - CPU#0 stuck for 26s!
> [swapper/0:0]
> [   28.109263] Modules linked in:
> [   28.109273] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
> 5.15.79-14458-g4b9edf7b1ac6 #1 9f2e76613148af94acccd64c609a552fb4b4354b
> [   28.109284] Hardware name: Google Elm (DT)
> [   28.109290] pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS
> 		BTYPE=--)
> [   28.109298] pc : __do_softirq+0xa0/0x388
> [   28.109309] lr : __do_softirq+0x70/0x388
> [   28.109316] sp : ffffffc008003ee0
> [   28.109321] x29: ffffffc008003f00 x28: 000000000000000a x27:
> 0000000000000080
> [   28.109334] x26: 0000000000000001 x25: ffffffefa7b350c0 x24:
> ffffffefa7b47480
> [   28.109346] x23: ffffffefa7b3d000 x22: 0000000000000000 x21:
> ffffffefa7b0fa40
> [   28.109358] x20: ffffffefa7b005b0 x19: ffffffefa7b47480 x18:
> 0000000000065b6b
> [   28.109370] x17: ffffffefa749c8b0 x16: 000000000000018c x15:
> 00000000000001b8
> [   28.109382] x14: 00000000000d3b6b x13: 0000000000000006 x12:
> 0000000000057e91
> [   28.109394] x11: 0000000000000000 x10: 0000000000000000 x9 :
> ffffffefa7b47480
> [   28.109406] x8 : 00000000000000e0 x7 : 000000000f424000 x6 :
> 0000000000000000
> [   28.109418] x5 : ffffffefa7dfaca0 x4 : ffffffefa7dfadf0 x3 :
> 000000000000000f
> [   28.109429] x2 : 0000000000000000 x1 : 0000000000000100 x0 :
> 0000000001ac65c5
> [   28.109441] Call trace:
> [   28.109447]  __do_softirq+0xa0/0x388
> [   28.109454]  irq_exit+0xc0/0xe0
> [   28.109464]  handle_domain_irq+0x68/0x90
> [   28.109473]  gic_handle_irq+0xac/0xf0
> [   28.109480]  call_on_irq_stack+0x28/0x50
> [   28.109488]  do_interrupt_handler+0x44/0x58
> [   28.109496]  el1_interrupt+0x30/0x58
> [   28.109506]  el1h_64_irq_handler+0x18/0x24
> [   28.109512]  el1h_64_irq+0x7c/0x80
> [   28.109519]  arch_local_irq_enable+0xc/0x18
> [   28.109529]  default_idle_call+0x40/0x140
> [   28.109539]  do_idle+0x108/0x290
> [   28.109547]  cpu_startup_entry+0x2c/0x30
> [   28.109554]  rest_init+0xe8/0xf8
> [   28.109562]  arch_call_rest_init+0x18/0x24
> [   28.109571]  start_kernel+0x338/0x42c
> [   28.109578]  __primary_switched+0xbc/0xc4
> [   28.109588] Kernel panic - not syncing: softlockup: hung tasks
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



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

* Re: [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
@ 2022-11-22  9:23     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-11-22  9:23 UTC (permalink / raw)
  To: Ricardo Ribalda, Linus Walleij, Matthias Brugger, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google)

Il 22/11/22 00:38, Ricardo Ribalda ha scritto:
> If the system is restarted via kexec(), the peripherals do not start
> with a known state.
> 
> If the previous system had enabled an IRQs we will receive unexected
> IRQs that can lock the system.
> 
> [   28.109251] watchdog: BUG: soft lockup - CPU#0 stuck for 26s!
> [swapper/0:0]
> [   28.109263] Modules linked in:
> [   28.109273] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
> 5.15.79-14458-g4b9edf7b1ac6 #1 9f2e76613148af94acccd64c609a552fb4b4354b
> [   28.109284] Hardware name: Google Elm (DT)
> [   28.109290] pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS
> 		BTYPE=--)
> [   28.109298] pc : __do_softirq+0xa0/0x388
> [   28.109309] lr : __do_softirq+0x70/0x388
> [   28.109316] sp : ffffffc008003ee0
> [   28.109321] x29: ffffffc008003f00 x28: 000000000000000a x27:
> 0000000000000080
> [   28.109334] x26: 0000000000000001 x25: ffffffefa7b350c0 x24:
> ffffffefa7b47480
> [   28.109346] x23: ffffffefa7b3d000 x22: 0000000000000000 x21:
> ffffffefa7b0fa40
> [   28.109358] x20: ffffffefa7b005b0 x19: ffffffefa7b47480 x18:
> 0000000000065b6b
> [   28.109370] x17: ffffffefa749c8b0 x16: 000000000000018c x15:
> 00000000000001b8
> [   28.109382] x14: 00000000000d3b6b x13: 0000000000000006 x12:
> 0000000000057e91
> [   28.109394] x11: 0000000000000000 x10: 0000000000000000 x9 :
> ffffffefa7b47480
> [   28.109406] x8 : 00000000000000e0 x7 : 000000000f424000 x6 :
> 0000000000000000
> [   28.109418] x5 : ffffffefa7dfaca0 x4 : ffffffefa7dfadf0 x3 :
> 000000000000000f
> [   28.109429] x2 : 0000000000000000 x1 : 0000000000000100 x0 :
> 0000000001ac65c5
> [   28.109441] Call trace:
> [   28.109447]  __do_softirq+0xa0/0x388
> [   28.109454]  irq_exit+0xc0/0xe0
> [   28.109464]  handle_domain_irq+0x68/0x90
> [   28.109473]  gic_handle_irq+0xac/0xf0
> [   28.109480]  call_on_irq_stack+0x28/0x50
> [   28.109488]  do_interrupt_handler+0x44/0x58
> [   28.109496]  el1_interrupt+0x30/0x58
> [   28.109506]  el1h_64_irq_handler+0x18/0x24
> [   28.109512]  el1h_64_irq+0x7c/0x80
> [   28.109519]  arch_local_irq_enable+0xc/0x18
> [   28.109529]  default_idle_call+0x40/0x140
> [   28.109539]  do_idle+0x108/0x290
> [   28.109547]  cpu_startup_entry+0x2c/0x30
> [   28.109554]  rest_init+0xe8/0xf8
> [   28.109562]  arch_call_rest_init+0x18/0x24
> [   28.109571]  start_kernel+0x338/0x42c
> [   28.109578]  __primary_switched+0xbc/0xc4
> [   28.109588] Kernel panic - not syncing: softlockup: hung tasks
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
  2022-11-21 23:38   ` Ricardo Ribalda
@ 2022-11-22  9:48     ` Matthias Brugger
  -1 siblings, 0 replies; 10+ messages in thread
From: Matthias Brugger @ 2022-11-22  9:48 UTC (permalink / raw)
  To: Ricardo Ribalda, Linus Walleij, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google)



On 22/11/2022 00:38, Ricardo Ribalda wrote:
> If the system is restarted via kexec(), the peripherals do not start
> with a known state.
> 
> If the previous system had enabled an IRQs we will receive unexected
> IRQs that can lock the system.
> 
> [   28.109251] watchdog: BUG: soft lockup - CPU#0 stuck for 26s!
> [swapper/0:0]
> [   28.109263] Modules linked in:
> [   28.109273] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
> 5.15.79-14458-g4b9edf7b1ac6 #1 9f2e76613148af94acccd64c609a552fb4b4354b
> [   28.109284] Hardware name: Google Elm (DT)
> [   28.109290] pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS
> 		BTYPE=--)
> [   28.109298] pc : __do_softirq+0xa0/0x388
> [   28.109309] lr : __do_softirq+0x70/0x388
> [   28.109316] sp : ffffffc008003ee0
> [   28.109321] x29: ffffffc008003f00 x28: 000000000000000a x27:
> 0000000000000080
> [   28.109334] x26: 0000000000000001 x25: ffffffefa7b350c0 x24:
> ffffffefa7b47480
> [   28.109346] x23: ffffffefa7b3d000 x22: 0000000000000000 x21:
> ffffffefa7b0fa40
> [   28.109358] x20: ffffffefa7b005b0 x19: ffffffefa7b47480 x18:
> 0000000000065b6b
> [   28.109370] x17: ffffffefa749c8b0 x16: 000000000000018c x15:
> 00000000000001b8
> [   28.109382] x14: 00000000000d3b6b x13: 0000000000000006 x12:
> 0000000000057e91
> [   28.109394] x11: 0000000000000000 x10: 0000000000000000 x9 :
> ffffffefa7b47480
> [   28.109406] x8 : 00000000000000e0 x7 : 000000000f424000 x6 :
> 0000000000000000
> [   28.109418] x5 : ffffffefa7dfaca0 x4 : ffffffefa7dfadf0 x3 :
> 000000000000000f
> [   28.109429] x2 : 0000000000000000 x1 : 0000000000000100 x0 :
> 0000000001ac65c5
> [   28.109441] Call trace:
> [   28.109447]  __do_softirq+0xa0/0x388
> [   28.109454]  irq_exit+0xc0/0xe0
> [   28.109464]  handle_domain_irq+0x68/0x90
> [   28.109473]  gic_handle_irq+0xac/0xf0
> [   28.109480]  call_on_irq_stack+0x28/0x50
> [   28.109488]  do_interrupt_handler+0x44/0x58
> [   28.109496]  el1_interrupt+0x30/0x58
> [   28.109506]  el1h_64_irq_handler+0x18/0x24
> [   28.109512]  el1h_64_irq+0x7c/0x80
> [   28.109519]  arch_local_irq_enable+0xc/0x18
> [   28.109529]  default_idle_call+0x40/0x140
> [   28.109539]  do_idle+0x108/0x290
> [   28.109547]  cpu_startup_entry+0x2c/0x30
> [   28.109554]  rest_init+0xe8/0xf8
> [   28.109562]  arch_call_rest_init+0x18/0x24
> [   28.109571]  start_kernel+0x338/0x42c
> [   28.109578]  __primary_switched+0xbc/0xc4
> [   28.109588] Kernel panic - not syncing: softlockup: hung tasks
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> 
> diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
> index 65d312967619..27f0a54e12bf 100644
> --- a/drivers/pinctrl/mediatek/mtk-eint.c
> +++ b/drivers/pinctrl/mediatek/mtk-eint.c
> @@ -303,12 +303,15 @@ static struct irq_chip mtk_eint_irq_chip = {
>   
>   static unsigned int mtk_eint_hw_init(struct mtk_eint *eint)
>   {
> -	void __iomem *reg = eint->base + eint->regs->dom_en;
> +	void __iomem *dom_en = eint->base + eint->regs->dom_en;
> +	void __iomem *mask_set = eint->base + eint->regs->mask_set;
>   	unsigned int i;
>   
>   	for (i = 0; i < eint->hw->ap_num; i += 32) {
> -		writel(0xffffffff, reg);
> -		reg += 4;
> +		writel(0xffffffff, dom_en);
> +		writel(0xffffffff, mask_set);
> +		dom_en += 4;
> +		mask_set += 4;
>   	}
>   
>   	return 0;
> 

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

* Re: [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled
@ 2022-11-22  9:48     ` Matthias Brugger
  0 siblings, 0 replies; 10+ messages in thread
From: Matthias Brugger @ 2022-11-22  9:48 UTC (permalink / raw)
  To: Ricardo Ribalda, Linus Walleij, Sean Wang
  Cc: Steven Rostedt, Ross Zwisler, linux-kernel, linux-gpio,
	linux-arm-kernel, linux-mediatek, Sergey Senozhatsky,
	Joel Fernandes (Google)



On 22/11/2022 00:38, Ricardo Ribalda wrote:
> If the system is restarted via kexec(), the peripherals do not start
> with a known state.
> 
> If the previous system had enabled an IRQs we will receive unexected
> IRQs that can lock the system.
> 
> [   28.109251] watchdog: BUG: soft lockup - CPU#0 stuck for 26s!
> [swapper/0:0]
> [   28.109263] Modules linked in:
> [   28.109273] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
> 5.15.79-14458-g4b9edf7b1ac6 #1 9f2e76613148af94acccd64c609a552fb4b4354b
> [   28.109284] Hardware name: Google Elm (DT)
> [   28.109290] pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS
> 		BTYPE=--)
> [   28.109298] pc : __do_softirq+0xa0/0x388
> [   28.109309] lr : __do_softirq+0x70/0x388
> [   28.109316] sp : ffffffc008003ee0
> [   28.109321] x29: ffffffc008003f00 x28: 000000000000000a x27:
> 0000000000000080
> [   28.109334] x26: 0000000000000001 x25: ffffffefa7b350c0 x24:
> ffffffefa7b47480
> [   28.109346] x23: ffffffefa7b3d000 x22: 0000000000000000 x21:
> ffffffefa7b0fa40
> [   28.109358] x20: ffffffefa7b005b0 x19: ffffffefa7b47480 x18:
> 0000000000065b6b
> [   28.109370] x17: ffffffefa749c8b0 x16: 000000000000018c x15:
> 00000000000001b8
> [   28.109382] x14: 00000000000d3b6b x13: 0000000000000006 x12:
> 0000000000057e91
> [   28.109394] x11: 0000000000000000 x10: 0000000000000000 x9 :
> ffffffefa7b47480
> [   28.109406] x8 : 00000000000000e0 x7 : 000000000f424000 x6 :
> 0000000000000000
> [   28.109418] x5 : ffffffefa7dfaca0 x4 : ffffffefa7dfadf0 x3 :
> 000000000000000f
> [   28.109429] x2 : 0000000000000000 x1 : 0000000000000100 x0 :
> 0000000001ac65c5
> [   28.109441] Call trace:
> [   28.109447]  __do_softirq+0xa0/0x388
> [   28.109454]  irq_exit+0xc0/0xe0
> [   28.109464]  handle_domain_irq+0x68/0x90
> [   28.109473]  gic_handle_irq+0xac/0xf0
> [   28.109480]  call_on_irq_stack+0x28/0x50
> [   28.109488]  do_interrupt_handler+0x44/0x58
> [   28.109496]  el1_interrupt+0x30/0x58
> [   28.109506]  el1h_64_irq_handler+0x18/0x24
> [   28.109512]  el1h_64_irq+0x7c/0x80
> [   28.109519]  arch_local_irq_enable+0xc/0x18
> [   28.109529]  default_idle_call+0x40/0x140
> [   28.109539]  do_idle+0x108/0x290
> [   28.109547]  cpu_startup_entry+0x2c/0x30
> [   28.109554]  rest_init+0xe8/0xf8
> [   28.109562]  arch_call_rest_init+0x18/0x24
> [   28.109571]  start_kernel+0x338/0x42c
> [   28.109578]  __primary_switched+0xbc/0xc4
> [   28.109588] Kernel panic - not syncing: softlockup: hung tasks
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> 
> diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
> index 65d312967619..27f0a54e12bf 100644
> --- a/drivers/pinctrl/mediatek/mtk-eint.c
> +++ b/drivers/pinctrl/mediatek/mtk-eint.c
> @@ -303,12 +303,15 @@ static struct irq_chip mtk_eint_irq_chip = {
>   
>   static unsigned int mtk_eint_hw_init(struct mtk_eint *eint)
>   {
> -	void __iomem *reg = eint->base + eint->regs->dom_en;
> +	void __iomem *dom_en = eint->base + eint->regs->dom_en;
> +	void __iomem *mask_set = eint->base + eint->regs->mask_set;
>   	unsigned int i;
>   
>   	for (i = 0; i < eint->hw->ap_num; i += 32) {
> -		writel(0xffffffff, reg);
> -		reg += 4;
> +		writel(0xffffffff, dom_en);
> +		writel(0xffffffff, mask_set);
> +		dom_en += 4;
> +		mask_set += 4;
>   	}
>   
>   	return 0;
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-11-22  9:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 23:38 [PATCH v1 0/1] pinctrl:mtk: Fix kexec() initialization Ricardo Ribalda
2022-11-21 23:38 ` Ricardo Ribalda
2022-11-21 23:38 ` [PATCH v1 1/1] pinctrl: meditatek: Startup with the IRQs disabled Ricardo Ribalda
2022-11-21 23:38   ` Ricardo Ribalda
2022-11-22  8:34   ` Linus Walleij
2022-11-22  8:34     ` Linus Walleij
2022-11-22  9:23   ` AngeloGioacchino Del Regno
2022-11-22  9:23     ` AngeloGioacchino Del Regno
2022-11-22  9:48   ` Matthias Brugger
2022-11-22  9:48     ` Matthias Brugger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.