All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
@ 2022-12-20 21:35 ` Ricardo Ribalda
  0 siblings, 0 replies; 8+ messages in thread
From: Ricardo Ribalda @ 2022-12-20 21:35 UTC (permalink / raw)
  To: Matthias Brugger, Roger Lu
  Cc: linux-arm-kernel, linux-mediatek, Ricardo Ribalda, linux-kernel

If the system does not come from reset (like when is booted via
kexec()), the peripheral might triger an IRQ before the data structures
are initialised.

Fixes:

[    0.227710] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000f08
[    0.227913] Call trace:
[    0.227918]  svs_isr+0x8c/0x538

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
To: Matthias Brugger <matthias.bgg@gmail.com>
To: Roger Lu <Roger.Lu@mediatek.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
Changes in v2:
- Enable the irq before svs_start, to avoid MT8192 not starting.
- Link to v1: https://lore.kernel.org/r/20221127-mtk-svs-v1-0-7a5819595838@chromium.org
---
 drivers/soc/mediatek/mtk-svs.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index 0469c9dfeb04..75b2f534aa9d 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -2385,14 +2385,6 @@ static int svs_probe(struct platform_device *pdev)
 		goto svs_probe_free_resource;
 	}
 
-	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
-					IRQF_ONESHOT, svsp->name, svsp);
-	if (ret) {
-		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
-			svsp_irq, ret);
-		goto svs_probe_free_resource;
-	}
-
 	svsp->main_clk = devm_clk_get(svsp->dev, "main");
 	if (IS_ERR(svsp->main_clk)) {
 		dev_err(svsp->dev, "failed to get clock: %ld\n",
@@ -2414,6 +2406,14 @@ static int svs_probe(struct platform_device *pdev)
 		goto svs_probe_clk_disable;
 	}
 
+	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
+					IRQF_ONESHOT, svsp->name, svsp);
+	if (ret) {
+		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
+			svsp_irq, ret);
+		goto svs_probe_iounmap;
+	}
+
 	ret = svs_start(svsp);
 	if (ret) {
 		dev_err(svsp->dev, "svs start fail: %d\n", ret);

---
base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
change-id: 20221127-mtk-svs-add137fbf187

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

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

* [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
@ 2022-12-20 21:35 ` Ricardo Ribalda
  0 siblings, 0 replies; 8+ messages in thread
From: Ricardo Ribalda @ 2022-12-20 21:35 UTC (permalink / raw)
  To: Matthias Brugger, Roger Lu
  Cc: linux-arm-kernel, linux-mediatek, Ricardo Ribalda, linux-kernel

If the system does not come from reset (like when is booted via
kexec()), the peripheral might triger an IRQ before the data structures
are initialised.

Fixes:

[    0.227710] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000f08
[    0.227913] Call trace:
[    0.227918]  svs_isr+0x8c/0x538

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
To: Matthias Brugger <matthias.bgg@gmail.com>
To: Roger Lu <Roger.Lu@mediatek.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
Changes in v2:
- Enable the irq before svs_start, to avoid MT8192 not starting.
- Link to v1: https://lore.kernel.org/r/20221127-mtk-svs-v1-0-7a5819595838@chromium.org
---
 drivers/soc/mediatek/mtk-svs.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index 0469c9dfeb04..75b2f534aa9d 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -2385,14 +2385,6 @@ static int svs_probe(struct platform_device *pdev)
 		goto svs_probe_free_resource;
 	}
 
-	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
-					IRQF_ONESHOT, svsp->name, svsp);
-	if (ret) {
-		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
-			svsp_irq, ret);
-		goto svs_probe_free_resource;
-	}
-
 	svsp->main_clk = devm_clk_get(svsp->dev, "main");
 	if (IS_ERR(svsp->main_clk)) {
 		dev_err(svsp->dev, "failed to get clock: %ld\n",
@@ -2414,6 +2406,14 @@ static int svs_probe(struct platform_device *pdev)
 		goto svs_probe_clk_disable;
 	}
 
+	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
+					IRQF_ONESHOT, svsp->name, svsp);
+	if (ret) {
+		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
+			svsp_irq, ret);
+		goto svs_probe_iounmap;
+	}
+
 	ret = svs_start(svsp);
 	if (ret) {
 		dev_err(svsp->dev, "svs start fail: %d\n", ret);

---
base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
change-id: 20221127-mtk-svs-add137fbf187

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 related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
  2022-12-20 21:35 ` Ricardo Ribalda
@ 2022-12-21  8:56   ` Matthias Brugger
  -1 siblings, 0 replies; 8+ messages in thread
From: Matthias Brugger @ 2022-12-21  8:56 UTC (permalink / raw)
  To: Ricardo Ribalda, Roger Lu; +Cc: linux-arm-kernel, linux-mediatek, linux-kernel



On 20/12/2022 22:35, Ricardo Ribalda wrote:
> If the system does not come from reset (like when is booted via
> kexec()), the peripheral might triger an IRQ before the data structures
> are initialised.
> 
> Fixes:
> 
> [    0.227710] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000f08
> [    0.227913] Call trace:
> [    0.227918]  svs_isr+0x8c/0x538
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Thanks Ricardo. Roger I'll wait for a Tested-by tag from you to make sure this 
time everything is fine.

Regards,
Matthias

> ---
> To: Matthias Brugger <matthias.bgg@gmail.com>
> To: Roger Lu <Roger.Lu@mediatek.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-mediatek@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
> Changes in v2:
> - Enable the irq before svs_start, to avoid MT8192 not starting.
> - Link to v1: https://lore.kernel.org/r/20221127-mtk-svs-v1-0-7a5819595838@chromium.org
> ---
>   drivers/soc/mediatek/mtk-svs.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index 0469c9dfeb04..75b2f534aa9d 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -2385,14 +2385,6 @@ static int svs_probe(struct platform_device *pdev)
>   		goto svs_probe_free_resource;
>   	}
>   
> -	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
> -					IRQF_ONESHOT, svsp->name, svsp);
> -	if (ret) {
> -		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
> -			svsp_irq, ret);
> -		goto svs_probe_free_resource;
> -	}
> -
>   	svsp->main_clk = devm_clk_get(svsp->dev, "main");
>   	if (IS_ERR(svsp->main_clk)) {
>   		dev_err(svsp->dev, "failed to get clock: %ld\n",
> @@ -2414,6 +2406,14 @@ static int svs_probe(struct platform_device *pdev)
>   		goto svs_probe_clk_disable;
>   	}
>   
> +	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
> +					IRQF_ONESHOT, svsp->name, svsp);
> +	if (ret) {
> +		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
> +			svsp_irq, ret);
> +		goto svs_probe_iounmap;
> +	}
> +
>   	ret = svs_start(svsp);
>   	if (ret) {
>   		dev_err(svsp->dev, "svs start fail: %d\n", ret);
> 
> ---
> base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
> change-id: 20221127-mtk-svs-add137fbf187
> 
> Best regards,

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

* Re: [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
@ 2022-12-21  8:56   ` Matthias Brugger
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Brugger @ 2022-12-21  8:56 UTC (permalink / raw)
  To: Ricardo Ribalda, Roger Lu; +Cc: linux-arm-kernel, linux-mediatek, linux-kernel



On 20/12/2022 22:35, Ricardo Ribalda wrote:
> If the system does not come from reset (like when is booted via
> kexec()), the peripheral might triger an IRQ before the data structures
> are initialised.
> 
> Fixes:
> 
> [    0.227710] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000f08
> [    0.227913] Call trace:
> [    0.227918]  svs_isr+0x8c/0x538
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Thanks Ricardo. Roger I'll wait for a Tested-by tag from you to make sure this 
time everything is fine.

Regards,
Matthias

> ---
> To: Matthias Brugger <matthias.bgg@gmail.com>
> To: Roger Lu <Roger.Lu@mediatek.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-mediatek@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
> Changes in v2:
> - Enable the irq before svs_start, to avoid MT8192 not starting.
> - Link to v1: https://lore.kernel.org/r/20221127-mtk-svs-v1-0-7a5819595838@chromium.org
> ---
>   drivers/soc/mediatek/mtk-svs.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index 0469c9dfeb04..75b2f534aa9d 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -2385,14 +2385,6 @@ static int svs_probe(struct platform_device *pdev)
>   		goto svs_probe_free_resource;
>   	}
>   
> -	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
> -					IRQF_ONESHOT, svsp->name, svsp);
> -	if (ret) {
> -		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
> -			svsp_irq, ret);
> -		goto svs_probe_free_resource;
> -	}
> -
>   	svsp->main_clk = devm_clk_get(svsp->dev, "main");
>   	if (IS_ERR(svsp->main_clk)) {
>   		dev_err(svsp->dev, "failed to get clock: %ld\n",
> @@ -2414,6 +2406,14 @@ static int svs_probe(struct platform_device *pdev)
>   		goto svs_probe_clk_disable;
>   	}
>   
> +	ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
> +					IRQF_ONESHOT, svsp->name, svsp);
> +	if (ret) {
> +		dev_err(svsp->dev, "register irq(%d) failed: %d\n",
> +			svsp_irq, ret);
> +		goto svs_probe_iounmap;
> +	}
> +
>   	ret = svs_start(svsp);
>   	if (ret) {
>   		dev_err(svsp->dev, "svs start fail: %d\n", ret);
> 
> ---
> base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
> change-id: 20221127-mtk-svs-add137fbf187
> 
> Best regards,

_______________________________________________
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] 8+ messages in thread

* Re: [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
  2022-12-21  8:56   ` Matthias Brugger
@ 2023-01-25 19:11     ` Matthias Brugger
  -1 siblings, 0 replies; 8+ messages in thread
From: Matthias Brugger @ 2023-01-25 19:11 UTC (permalink / raw)
  To: Ricardo Ribalda, Roger Lu; +Cc: linux-arm-kernel, linux-mediatek, linux-kernel



On 21/12/2022 09:56, Matthias Brugger wrote:
> 
> 
> On 20/12/2022 22:35, Ricardo Ribalda wrote:
>> If the system does not come from reset (like when is booted via
>> kexec()), the peripheral might triger an IRQ before the data structures
>> are initialised.
>>
>> Fixes:
>>
>> [    0.227710] Unable to handle kernel NULL pointer dereference at virtual 
>> address 0000000000000f08
>> [    0.227913] Call trace:
>> [    0.227918]  svs_isr+0x8c/0x538
>>
>> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> 
> Thanks Ricardo. Roger I'll wait for a Tested-by tag from you to make sure this 
> time everything is fine.
> 

Given the chinese new year holidays I don't expect a Tested-by tag from Roger in 
time. So I just took this one without it.

Thanks!
Matthias

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

* Re: [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
@ 2023-01-25 19:11     ` Matthias Brugger
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Brugger @ 2023-01-25 19:11 UTC (permalink / raw)
  To: Ricardo Ribalda, Roger Lu; +Cc: linux-arm-kernel, linux-mediatek, linux-kernel



On 21/12/2022 09:56, Matthias Brugger wrote:
> 
> 
> On 20/12/2022 22:35, Ricardo Ribalda wrote:
>> If the system does not come from reset (like when is booted via
>> kexec()), the peripheral might triger an IRQ before the data structures
>> are initialised.
>>
>> Fixes:
>>
>> [    0.227710] Unable to handle kernel NULL pointer dereference at virtual 
>> address 0000000000000f08
>> [    0.227913] Call trace:
>> [    0.227918]  svs_isr+0x8c/0x538
>>
>> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> 
> Thanks Ricardo. Roger I'll wait for a Tested-by tag from you to make sure this 
> time everything is fine.
> 

Given the chinese new year holidays I don't expect a Tested-by tag from Roger in 
time. So I just took this one without it.

Thanks!
Matthias

_______________________________________________
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] 8+ messages in thread

* Re: [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
  2023-01-25 19:11     ` Matthias Brugger
@ 2023-01-30  8:47       ` Roger Lu (陸瑞傑)
  -1 siblings, 0 replies; 8+ messages in thread
From: Roger Lu (陸瑞傑) @ 2023-01-30  8:47 UTC (permalink / raw)
  To: matthias.bgg, ribalda; +Cc: linux-arm-kernel, linux-kernel, linux-mediatek

Hi Matthias Sir,

Excuse me for missing this thread. Add Tested-by tag.

On Wed, 2023-01-25 at 20:11 +0100, Matthias Brugger wrote:
> 
> On 21/12/2022 09:56, Matthias Brugger wrote:
> > 
> > 
> > On 20/12/2022 22:35, Ricardo Ribalda wrote:
> > > If the system does not come from reset (like when is booted via
> > > kexec()), the peripheral might triger an IRQ before the data structures
> > > are initialised.
> > > 
> > > Fixes:
> > > 
> > > [    0.227710] Unable to handle kernel NULL pointer dereference at
> > > virtual 
> > > address 0000000000000f08
> > > [    0.227913] Call trace:
> > > [    0.227918]  svs_isr+0x8c/0x538
> > > 
> > > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > 
> > Thanks Ricardo. Roger I'll wait for a Tested-by tag from you to make sure
> > this 
> > time everything is fine.
> > 
> 
> Given the chinese new year holidays I don't expect a Tested-by tag from Roger
> in 
> time. So I just took this one without it.

Tested-by: Roger Lu <roger.lu@mediatek.com>

> 
> Thanks!
> Matthias

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

* Re: [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later
@ 2023-01-30  8:47       ` Roger Lu (陸瑞傑)
  0 siblings, 0 replies; 8+ messages in thread
From: Roger Lu (陸瑞傑) @ 2023-01-30  8:47 UTC (permalink / raw)
  To: matthias.bgg, ribalda; +Cc: linux-arm-kernel, linux-kernel, linux-mediatek

Hi Matthias Sir,

Excuse me for missing this thread. Add Tested-by tag.

On Wed, 2023-01-25 at 20:11 +0100, Matthias Brugger wrote:
> 
> On 21/12/2022 09:56, Matthias Brugger wrote:
> > 
> > 
> > On 20/12/2022 22:35, Ricardo Ribalda wrote:
> > > If the system does not come from reset (like when is booted via
> > > kexec()), the peripheral might triger an IRQ before the data structures
> > > are initialised.
> > > 
> > > Fixes:
> > > 
> > > [    0.227710] Unable to handle kernel NULL pointer dereference at
> > > virtual 
> > > address 0000000000000f08
> > > [    0.227913] Call trace:
> > > [    0.227918]  svs_isr+0x8c/0x538
> > > 
> > > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > 
> > Thanks Ricardo. Roger I'll wait for a Tested-by tag from you to make sure
> > this 
> > time everything is fine.
> > 
> 
> Given the chinese new year holidays I don't expect a Tested-by tag from Roger
> in 
> time. So I just took this one without it.

Tested-by: Roger Lu <roger.lu@mediatek.com>

> 
> Thanks!
> Matthias
_______________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2023-01-30  9:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20 21:35 [PATCH v2] soc: mediatek: mtk-svs: Enable the IRQ later Ricardo Ribalda
2022-12-20 21:35 ` Ricardo Ribalda
2022-12-21  8:56 ` Matthias Brugger
2022-12-21  8:56   ` Matthias Brugger
2023-01-25 19:11   ` Matthias Brugger
2023-01-25 19:11     ` Matthias Brugger
2023-01-30  8:47     ` Roger Lu (陸瑞傑)
2023-01-30  8:47       ` Roger Lu (陸瑞傑)

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.