cpuidle regression ?
Hi Rafael,
the latest linux-next kernelci report indicates a kernel bug for the imx6 platform. I don't have this board so it is not possible to investigate it.
[ ... ]
[ 3.372501] Unable to handle kernel NULL pointer dereference at
virtual address 00000000
[ ... ]
[ 3.408898] PC is at _find_first_bit_le+0xc/0x2c [ 3.413785] LR is at cpuidle_driver_state_disabled+0x40/0xa0
Not sure if it is related to the latest changes or not.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rafael J. Wysocki
maintainerQuoted 15 lines · Daniel Lezcano
Hi Rafael,
the latest linux-next kernelci report indicates a kernel bug for the imx6 platform. I don't have this board so it is not possible to investigate it.
[ ... ]
[ 3.372501] Unable to handle kernel NULL pointer dereference atvirtual address 00000000
Quoted 7 lines
[ ... ]
[ 3.408898] PC is at _find_first_bit_le+0xc/0x2c [ 3.413785] LR is at cpuidle_driver_state_disabled+0x40/0xa0Not sure if it is related to the latest changes or not.
It does seem so, in which case the attached patch should address it.
Is there a way to test the patch alone or do I need to push it somewhere to be tested?
--- drivers/cpuidle/driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/cpuidle/driver.c +10 -0
@@ -403,6 +403,13 @@ void cpuidle_driver_state_disabled(strucmutex_lock (&cpuidle_lock); +spin_lock (&cpuidle_driver_lock); + +if (!drv->cpumask) { + drv->states[idx].flags |=CPUIDLE_FLAG_UNUSABLE ; + goto unlock; + } +for_each_cpu (cpu, drv->cpumask) {struct cpuidle_device *dev =per_cpu (cpuidle_devices, cpu);
@@ -415,5 +422,8 @@ void cpuidle_driver_state_disabled(struc dev->states_usage[idx].disable &= ~CPUIDLE_STATE_DISABLED_BY_DRIVER ; } +unlock: +spin_unlock (&cpuidle_driver_lock); +mutex_unlock (&cpuidle_lock); }
Quoted 23 lines · Rafael J. Wysocki
Quoted 21 lines · Daniel Lezcano
Hi Rafael,
the latest linux-next kernelci report indicates a kernel bug for the imx6 platform. I don't have this board so it is not possible to investigate it.
[ ... ]
[ 3.372501] Unable to handle kernel NULL pointer dereference atvirtual address 00000000
[ ... ]
[ 3.408898] PC is at _find_first_bit_le+0xc/0x2c [ 3.413785] LR is at cpuidle_driver_state_disabled+0x40/0xa0
Quoted 6 lines
Quoted 1 line
Not sure if it is related to the latest changes or not.
It does seem so, in which case the attached patch should address it.
Is there a way to test the patch alone or do I need to push it somewhere to be tested?
Is the bleeding-edge branch monitored by kernelci ?
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rafael J. Wysocki
maintainerQuoted 25 lines · Daniel Lezcano
Quoted 23 lines · Rafael J. Wysocki
Quoted 21 lines · Daniel Lezcano
Hi Rafael,
the latest linux-next kernelci report indicates a kernel bug for the imx6 platform. I don't have this board so it is not possible to investigate it.
[ ... ]
[ 3.372501] Unable to handle kernel NULL pointer dereference atvirtual address 00000000
[ ... ]
[ 3.408898] PC is at _find_first_bit_le+0xc/0x2c [ 3.413785] LR is at cpuidle_driver_state_disabled+0x40/0xa0
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Not sure if it is related to the latest changes or not.
It does seem so, in which case the attached patch should address it.
Is there a way to test the patch alone or do I need to push it somewhere to be tested?
Is the bleeding-edge branch monitored by kernelci ?
No, it is not right now, AFAICS.
Quoted 29 lines · Rafael J. Wysocki
Quoted 27 lines · Daniel Lezcano
Quoted 25 lines · Rafael J. Wysocki
Quoted 22 lines · Daniel Lezcano
Hi Rafael,
the latest linux-next kernelci report indicates a kernel bug for the imx6 platform. I don't have this board so it is not possible to investigate it.
[ ... ]
[ 3.372501] Unable to handle kernel NULL pointer dereference atvirtual address 00000000
[ ... ]
[ 3.408898] PC is at _find_first_bit_le+0xc/0x2c [ 3.413785] LR is at cpuidle_driver_state_disabled+0x40/0xa0Not sure if it is related to the latest changes or not.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
It does seem so, in which case the attached patch should address it.
Is there a way to test the patch alone or do I need to push it somewhere to be tested?
Is the bleeding-edge branch monitored by kernelci ?
No, it is not right now, AFAICS.
I have a imx7, I will try to reproduce the issue on it. Otherwise, I can test on the 'testing' thermal branch temporarily.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rafael J. Wysocki
maintainerQuoted 36 lines · Daniel Lezcano
Quoted 34 lines · Rafael J. Wysocki
Quoted 32 lines · Daniel Lezcano
Quoted 29 lines · Rafael J. Wysocki
Quoted 15 lines · Daniel Lezcano
Hi Rafael,
the latest linux-next kernelci report indicates a kernel bug for the imx6 platform. I don't have this board so it is not possible to investigate it.
[ ... ]
[ 3.372501] Unable to handle kernel NULL pointer dereference atvirtual address 00000000
Quoted 7 lines
[ ... ]
[ 3.408898] PC is at _find_first_bit_le+0xc/0x2c [ 3.413785] LR is at cpuidle_driver_state_disabled+0x40/0xa0Not sure if it is related to the latest changes or not.
It does seem so, in which case the attached patch should address it.
Is there a way to test the patch alone or do I need to push it somewhere to be tested?
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Is the bleeding-edge branch monitored by kernelci ?
No, it is not right now, AFAICS.
I have a imx7, I will try to reproduce the issue on it. Otherwise, I can test on the 'testing' thermal branch temporarily.
Thanks, that'll help!
Quoted 38 lines · Rafael J. Wysocki
Quoted 36 lines · Daniel Lezcano
Quoted 34 lines · Rafael J. Wysocki
Quoted 32 lines · Daniel Lezcano
Quoted 29 lines · Rafael J. Wysocki
Quoted 15 lines · Daniel Lezcano
Hi Rafael,
the latest linux-next kernelci report indicates a kernel bug for the imx6 platform. I don't have this board so it is not possible to investigate it.
[ ... ]
[ 3.372501] Unable to handle kernel NULL pointer dereference atvirtual address 00000000
Quoted 7 lines
[ ... ]
[ 3.408898] PC is at _find_first_bit_le+0xc/0x2c [ 3.413785] LR is at cpuidle_driver_state_disabled+0x40/0xa0Not sure if it is related to the latest changes or not.
It does seem so, in which case the attached patch should address it.
Is there a way to test the patch alone or do I need to push it somewhere to be tested?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Is the bleeding-edge branch monitored by kernelci ?
No, it is not right now, AFAICS.
I have a imx7, I will try to reproduce the issue on it. Otherwise, I can test on the 'testing' thermal branch temporarily.
Thanks, that'll help!
The imx7 kernel has an issue with cpuidle but not related to your changes, so I was unable to double check with a local board.
However, kernelci does no longer report a regression on the baseline with your patch applied on my 'testing' branch.
I can not guarantee the bug is fixed because I can't reproduce it locally and check the patch is effectively solving the issue.
In order to increase the confidence on the fix, I updated the branch without your patch, so in a few hours, we should see the if the regression appears or not.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On 09/12/2019 18:22, Daniel Lezcano wrote:
[ ... ]
Quoted 9 lines
However, kernelci does no longer report a regression on the baseline with your patch applied on my 'testing' branch.
I can not guarantee the bug is fixed because I can't reproduce it locally and check the patch is effectively solving the issue.
In order to increase the confidence on the fix, I updated the branch without your patch, so in a few hours, we should see the if the regression appears or not.
The regression came back without the patch.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rafael J. Wysocki
maintainerQuoted 8 lines · Daniel Lezcano
On 09/12/2019 18:22, Daniel Lezcano wrote:
[ ... ]
Quoted 3 lines
However, kernelci does no longer report a regression on the baseline with your patch applied on my 'testing' branch.
Quoted 8 lines
Quoted 6 lines
I can not guarantee the bug is fixed because I can't reproduce it locally and check the patch is effectively solving the issue.
In order to increase the confidence on the fix, I updated the branch without your patch, so in a few hours, we should see the if the regression appears or not.
The regression came back without the patch.
OK, thanks!
I'll post the patch properly then and queue it up as a regression fix.
PATCH 1/1 cpuidle: Fix cpuidle_driver_state_disabled()
In reply to Daniel LezcanoFrom: Rafael J. Wysocki <[email protected]>
It turns out that cpuidle_driver_state_disabled() can be called before registering the cpufreq driver on some platforms, which was not expected when it was introduced and which leads to a NULL pointer dereference when trying to walk the CPUs associated with the given cpuidle driver.
Fix the problem by making cpuidle_driver_state_disabled() check if the driver's mask of CPUs associated with it is present and to set CPUIDLE_FLAG_UNUSABLE for the given idle state in the driver's states list if that is not the case to cause __cpuidle_register_device() to set CPUIDLE_STATE_DISABLED_BY_DRIVER for that state for all cpuidle devices registered by it later.
--- drivers/cpuidle/driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/cpuidle/driver.c +10 -0
@@ -403,6 +403,13 @@ void cpuidle_driver_state_disabled(strucmutex_lock (&cpuidle_lock); +spin_lock (&cpuidle_driver_lock); + +if (!drv->cpumask) { + drv->states[idx].flags |=CPUIDLE_FLAG_UNUSABLE ; + goto unlock; + } +for_each_cpu (cpu, drv->cpumask) {struct cpuidle_device *dev =per_cpu (cpuidle_devices, cpu);
@@ -415,5 +422,8 @@ void cpuidle_driver_state_disabled(struc dev->states_usage[idx].disable &= ~CPUIDLE_STATE_DISABLED_BY_DRIVER ; } +unlock: +spin_unlock (&cpuidle_driver_lock); +mutex_unlock (&cpuidle_lock); }