2022-06-14 22:13:17

by Naresh Kamboju

[permalink] [raw]
Subject: [next] arm64: db410c: WARNING: CPU: 0 PID: 1 at drivers/opp/core.c:2265 dev_pm_opp_clear_config+0x174/0x17c

Following kernel crash reported while booting arm64 db410c board with
Linux next-20220614 [1] kfence enabled on this kernel.

Reported-by: Linux Kernel Functional Testing <[email protected]>

Boot log:
---------
[ 0.850420] WARNING: CPU: 0 PID: 1 at drivers/opp/core.c:2265
dev_pm_opp_clear_config+0x174/0x17c
[ 0.850447] Modules linked in:
[ 0.850459] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
5.19.0-rc1-next-20220610 #1
[ 0.850470] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[ 0.850477] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 0.850489] pc : dev_pm_opp_clear_config+0x174/0x17c
[ 0.850501] lr : dt_cpufreq_probe+0x1e4/0x4a0
[ 0.850513] sp : ffff80000802bb00
[ 0.850518] x29: ffff80000802bb00 x28: ffff80000ada1c30 x27: 0000000000000000
[ 0.850538] x26: 00000000fffffdfb x25: ffff00000311f410 x24: ffff00000389ec90
[ 0.850557] x23: ffff80000a9eea98 x22: ffff80000a9eed00 x21: ffff80000ada1b68
[ 0.850576] x20: ffff00000389ec80 x19: ffff00003fc41308 x18: ffffffffffffffff
[ 0.850595] x17: ffff800009f21700 x16: ffff8000080955c0 x15: ffff0000031c2a1c
[ 0.850614] x14: 0000000000000001 x13: 0a6b636f6c632064 x12: 6e69662074276e64
[ 0.850632] x11: 0000000000000040 x10: 0000000000000020 x9 : ffff800009006964
[ 0.850650] x8 : 0000000000000020 x7 : ffffffffffffffff x6 : 0000000000000000
[ 0.850668] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
[ 0.850686] x2 : 0000000000000004 x1 : 0000000000000000 x0 : 0000000000000000
[ 0.850704] Call trace:
[ 0.850708] dev_pm_opp_clear_config+0x174/0x17c
[ 0.850722] platform_probe+0x74/0xf0
[ 0.850735] really_probe+0x19c/0x3f0
[ 0.850745] __driver_probe_device+0x11c/0x190
[ 0.850755] driver_probe_device+0x44/0xf4
[ 0.850765] __driver_attach+0xd8/0x200
[ 0.850775] bus_for_each_dev+0x7c/0xe0
[ 0.850790] driver_attach+0x30/0x40
[ 0.850799] bus_add_driver+0x154/0x240
[ 0.850813] driver_register+0x84/0x140
[ 0.850824] __platform_driver_register+0x34/0x40
[ 0.850835] dt_cpufreq_platdrv_init+0x28/0x34
[ 0.850848] do_one_initcall+0x50/0x2b0
[ 0.850861] kernel_init_freeable+0x24c/0x2d4
[ 0.850871] kernel_init+0x30/0x140
[ 0.850884] ret_from_fork+0x10/0x20
[ 0.850897] ---[ end trace 0000000000000000 ]---


metadata:
git_ref: master
git_repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next
git_sha: 35d872b9ea5b3ad784d7479ea728dcb688df2db7
git_describe: next-20220614
kernel_version: 5.19.0-rc2
kernel-config: https://builds.tuxbuild.com/2AYbNeAYdcbtKeaEoYNvOAwsMQf/config
build-url: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next/-/pipelines/563047963
artifact-location: https://builds.tuxbuild.com/2AYbNeAYdcbtKeaEoYNvOAwsMQf
System.map: https://builds.tuxbuild.com/2AYbNeAYdcbtKeaEoYNvOAwsMQf/System.map
vmlinux: https://builds.tuxbuild.com/2AYbNeAYdcbtKeaEoYNvOAwsMQf/vmlinux.xz
toolchain: gcc-11


[1]
https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20220614/testrun/10154254/suite/log-parser-boot/test/check-kernel-bug-5169280/details/


--
Linaro LKFT
https://lkft.linaro.org


2022-06-15 05:33:44

by Viresh Kumar

[permalink] [raw]
Subject: Re: [next] arm64: db410c: WARNING: CPU: 0 PID: 1 at drivers/opp/core.c:2265 dev_pm_opp_clear_config+0x174/0x17c

On 15-06-22, 02:49, Naresh Kamboju wrote:
> Following kernel crash reported while booting arm64 db410c board with
> Linux next-20220614 [1] kfence enabled on this kernel.
>
> Reported-by: Linux Kernel Functional Testing <[email protected]>
>
> Boot log:
> ---------
> [ 0.850420] WARNING: CPU: 0 PID: 1 at drivers/opp/core.c:2265

A print like this normally comes when we hit a WARN or something.

Here is the line 2265 from above tag

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/opp/core.c?h=next-20220614#n2265

which doesn't have any such WARNs there. I wonder where exactly we hit the WARN
here and why it isn't showing up properly.

> dev_pm_opp_clear_config+0x174/0x17c
> [ 0.850447] Modules linked in:
> [ 0.850459] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
> 5.19.0-rc1-next-20220610 #1
> [ 0.850470] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
> [ 0.850477] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [ 0.850489] pc : dev_pm_opp_clear_config+0x174/0x17c
> [ 0.850501] lr : dt_cpufreq_probe+0x1e4/0x4a0
> [ 0.850513] sp : ffff80000802bb00
> [ 0.850518] x29: ffff80000802bb00 x28: ffff80000ada1c30 x27: 0000000000000000
> [ 0.850538] x26: 00000000fffffdfb x25: ffff00000311f410 x24: ffff00000389ec90
> [ 0.850557] x23: ffff80000a9eea98 x22: ffff80000a9eed00 x21: ffff80000ada1b68
> [ 0.850576] x20: ffff00000389ec80 x19: ffff00003fc41308 x18: ffffffffffffffff
> [ 0.850595] x17: ffff800009f21700 x16: ffff8000080955c0 x15: ffff0000031c2a1c
> [ 0.850614] x14: 0000000000000001 x13: 0a6b636f6c632064 x12: 6e69662074276e64
> [ 0.850632] x11: 0000000000000040 x10: 0000000000000020 x9 : ffff800009006964
> [ 0.850650] x8 : 0000000000000020 x7 : ffffffffffffffff x6 : 0000000000000000
> [ 0.850668] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
> [ 0.850686] x2 : 0000000000000004 x1 : 0000000000000000 x0 : 0000000000000000
> [ 0.850704] Call trace:
> [ 0.850708] dev_pm_opp_clear_config+0x174/0x17c
> [ 0.850722] platform_probe+0x74/0xf0

Nevertheless, I see one place from where such a WARN can be hit, which can be
fixed with:

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 58eae9de4b91..c3d4058d33fc 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -2437,7 +2437,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_set_config);
*/
void dev_pm_opp_clear_config(struct opp_table *opp_table)
{
- if (WARN_ON(!opp_table))
+ if (!opp_table)
return;

_opp_detach_genpd(opp_table);

Not sure it fixes the issue you reported here though.

Can you run the tests for my branch once, it has the updated fix as well.

git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/linux-next

--
viresh

2022-06-15 19:41:31

by Naresh Kamboju

[permalink] [raw]
Subject: Re: [next] arm64: db410c: WARNING: CPU: 0 PID: 1 at drivers/opp/core.c:2265 dev_pm_opp_clear_config+0x174/0x17c

Hi Viresh,

On Wed, 15 Jun 2022 at 10:55, Viresh Kumar <[email protected]> wrote:
>
> On 15-06-22, 02:49, Naresh Kamboju wrote:
> > Following kernel crash reported while booting arm64 db410c board with
> > Linux next-20220614 [1] kfence enabled on this kernel.
> >
> > Reported-by: Linux Kernel Functional Testing <[email protected]>
> >
> > Boot log:
> > ---------
> > [ 0.850420] WARNING: CPU: 0 PID: 1 at drivers/opp/core.c:2265
>
> A print like this normally comes when we hit a WARN or something.
>
> Here is the line 2265 from above tag
>
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/opp/core.c?h=next-20220614#n2265
>
> which doesn't have any such WARNs there. I wonder where exactly we hit the WARN
> here and why it isn't showing up properly.
>
> > dev_pm_opp_clear_config+0x174/0x17c
> > [ 0.850447] Modules linked in:
> > [ 0.850459] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
> > 5.19.0-rc1-next-20220610 #1
> > [ 0.850470] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
> > [ 0.850477] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > [ 0.850489] pc : dev_pm_opp_clear_config+0x174/0x17c
> > [ 0.850501] lr : dt_cpufreq_probe+0x1e4/0x4a0
> > [ 0.850513] sp : ffff80000802bb00
> > [ 0.850518] x29: ffff80000802bb00 x28: ffff80000ada1c30 x27: 0000000000000000
> > [ 0.850538] x26: 00000000fffffdfb x25: ffff00000311f410 x24: ffff00000389ec90
> > [ 0.850557] x23: ffff80000a9eea98 x22: ffff80000a9eed00 x21: ffff80000ada1b68
> > [ 0.850576] x20: ffff00000389ec80 x19: ffff00003fc41308 x18: ffffffffffffffff
> > [ 0.850595] x17: ffff800009f21700 x16: ffff8000080955c0 x15: ffff0000031c2a1c
> > [ 0.850614] x14: 0000000000000001 x13: 0a6b636f6c632064 x12: 6e69662074276e64
> > [ 0.850632] x11: 0000000000000040 x10: 0000000000000020 x9 : ffff800009006964
> > [ 0.850650] x8 : 0000000000000020 x7 : ffffffffffffffff x6 : 0000000000000000
> > [ 0.850668] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
> > [ 0.850686] x2 : 0000000000000004 x1 : 0000000000000000 x0 : 0000000000000000
> > [ 0.850704] Call trace:
> > [ 0.850708] dev_pm_opp_clear_config+0x174/0x17c
> > [ 0.850722] platform_probe+0x74/0xf0
>
> Nevertheless, I see one place from where such a WARN can be hit, which can be
> fixed with:
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 58eae9de4b91..c3d4058d33fc 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -2437,7 +2437,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_set_config);
> */
> void dev_pm_opp_clear_config(struct opp_table *opp_table)
> {
> - if (WARN_ON(!opp_table))
> + if (!opp_table)
> return;
>
> _opp_detach_genpd(opp_table);
>
> Not sure it fixes the issue you reported here though.
>
> Can you run the tests for my branch once, it has the updated fix as well.

As per your suggestion, I have tested [1] this tree and branch and it worked.
The reported kernel warning has been fixed.
Thank you.

Tested-by: Linux Kernel Functional Testing <[email protected]>

>
> git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/linux-next
>
> --
> viresh

[1] https://lkft.validation.linaro.org/scheduler/job/5179605

--
Linaro LKFT
https://lkft.linaro.org

2022-06-16 06:09:30

by Viresh Kumar

[permalink] [raw]
Subject: Re: [next] arm64: db410c: WARNING: CPU: 0 PID: 1 at drivers/opp/core.c:2265 dev_pm_opp_clear_config+0x174/0x17c

On 16-06-22, 00:56, Naresh Kamboju wrote:
> As per your suggestion, I have tested [1] this tree and branch and it worked.
> The reported kernel warning has been fixed.
> Thank you.
>
> Tested-by: Linux Kernel Functional Testing <[email protected]>

Thanks Naresh.

--
viresh