[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <715873f9acb975aa8a6a21fda372b00dcc5c137a.camel@mediatek.com>
Date: Wed, 1 Feb 2023 13:43:09 +0000
From: Roger Lu (陸瑞傑) <Roger.Lu@...iatek.com>
To: "eballetbo@...il.com" <eballetbo@...il.com>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"khilman@...nel.org" <khilman@...nel.org>,
"drinkcat@...gle.com" <drinkcat@...gle.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
"ribalda@...omium.org" <ribalda@...omium.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@...iatek.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Jia-wei Chang (張佳偉)
<Jia-wei.Chang@...iatek.com>,
Fan Chen (陳凡) <fan.chen@...iatek.com>
Subject: Re: [PATCH v4 03/14] soc: mediatek: mtk-svs: enable the IRQ later
Hi Matthias Sir,
On Tue, 2023-01-31 at 13:59 +0100, Matthias Brugger wrote:
>
> On 11/01/2023 08:45, Roger Lu wrote:
> > From: Ricardo Ribalda <ribalda@...omium.org>
> >
> > If the system does not come from reset (like when is booted via
> > kexec(), the peripheral might trigger an IRQ before the data structures
> > are initialized.
> >
> > Fixes:
> >
> > [ 0.227710] Unable to handle kernel NULL pointer dereference at virtual
> > address 0000000000000f08
> > [ 0.227913] Call trace:
> > [ 0.227918] svs_isr+0x8c/0x538
> >
>
> This patch is different from
> https://lore.kernel.org/r/20221127-mtk-svs-v2-0-145b07663ea8@chromium.org
>
> If you think the patch from Ricardo is wrong, then you should have mentioned
> that in the review.
My bad. Ricardo's patch is correct. Moving platform_get_irq() brings no
functional change and is for helping the svs probe readability as my preference.
>
> Regards,
> Matthias
>
> > Fixes: 681a02e95000 ("soc: mediatek: SVS: introduce MTK SVS engine")
> > Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
> > Signed-off-by: Roger Lu <roger.lu@...iatek.com>
> > ---
> > drivers/soc/mediatek/mtk-svs.c | 28 ++++++++++++++--------------
> > 1 file changed, 14 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> > index a803b92afc3d..64d4d03ab71c 100644
> > --- a/drivers/soc/mediatek/mtk-svs.c
> > +++ b/drivers/soc/mediatek/mtk-svs.c
> > @@ -2403,20 +2403,6 @@ static int svs_probe(struct platform_device *pdev)
> > goto svs_probe_free_resource;
> > }
> >
> > - svsp_irq = platform_get_irq(pdev, 0);
> > - if (svsp_irq < 0) {
> > - ret = svsp_irq;
> > - 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",
> > @@ -2438,6 +2424,20 @@ static int svs_probe(struct platform_device *pdev)
> > goto svs_probe_clk_disable;
> > }
> >
> > + svsp_irq = platform_get_irq(pdev, 0);
> > + if (svsp_irq < 0) {
> > + ret = svsp_irq;
> > + goto svs_probe_iounmap;
> > + }
> > +
> > + 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);
Powered by blists - more mailing lists