While boot testing arm x15 devices the Kernel warning noticed with linux next
tag 20200825.
BAD: next-20200825
GOOD: next-20200824
metadata:
git branch: master
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git commit: 3a00d3dfd4b68b208ecd5405e676d06c8ad6bb63
git describe: next-20200825
make_kernelversion: 5.9.0-rc2
kernel-config:
https://builds.tuxbuild.com/LDTu4GFMmvkJspza5LJIjQ/kernel.config
We are working on git bisect and boot testing on x15 and get back to you.
warning log:
-----------------
[ 13.330201] sdhci-pltfm: SDHCI platform and OF driver helper
[ 13.352903] omap_gpio 4805d000.gpio: Could not set line 27 debounce
to 200000 microseconds (-22)
[ 13.361767] sdhci-omap 4809c000.mmc: Got CD GPIO
[ 13.366885] sdhci-omap 4809c000.mmc: supply vqmmc not found, using
dummy regulator
[ 13.374716] ------------[ cut here ]------------
[ 13.379414] WARNING: CPU: 0 PID: 21 at drivers/opp/core.c:678
dev_pm_opp_set_rate+0x4cc/0x5d4
[ 13.387999] Modules linked in:
[ 13.391089] CPU: 0 PID: 21 Comm: kworker/0:1 Not tainted
5.9.0-rc2-next-20200825 #1
[ 13.398779] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 13.404908] Workqueue: events dbs_work_handler
[ 13.409378] Backtrace:
[ 13.411852] [<c040e860>] (dump_backtrace) from [<c040ebd4>]
(show_stack+0x20/0x24)
[ 13.419460] r7:c20cca94 r6:00000000 r5:60000013 r4:c20cca94
[ 13.425153] [<c040ebb4>] (show_stack) from [<c0941338>]
(dump_stack+0xec/0x118)
[ 13.432505] [<c094124c>] (dump_stack) from [<c0451530>] (__warn+0xe8/0x100)
[ 13.439501] r10:e8b50600 r9:00000009 r8:c105f6f4 r7:000002a6
r6:c105f6f4 r5:00000009
[ 13.447369] r4:00000000 r3:c2004f30
[ 13.450968] [<c0451448>] (__warn) from [<c04518fc>]
(warn_slowpath_fmt+0x74/0xc4)
[ 13.458485] r7:000002a6 r6:c1b42034 r5:00000000 r4:e9b50000
[ 13.464174] [<c045188c>] (warn_slowpath_fmt) from [<c105f6f4>]
(dev_pm_opp_set_rate+0x4cc/0x5d4)
[ 13.472999] r9:e8b50280 r8:e9b50000 r7:ffffffea r6:3b9aca00
r5:59682f00 r4:e8902c00
[ 13.480783] [<c105f228>] (dev_pm_opp_set_rate) from [<c106aa8c>]
(set_target+0x3c/0x64)
[ 13.488824] r10:00000002 r9:00000000 r8:c22b508c r7:c2227048
r6:0016e360 r5:00000000
[ 13.496688] r4:e8903000
[ 13.499243] [<c106aa50>] (set_target) from [<c1064ca0>]
(__cpufreq_driver_target+0x2d0/0x628)
[ 13.507808] r7:c2227048 r6:e9b50000 r5:00000000 r4:e8903000
[ 13.513499] [<c10649d0>] (__cpufreq_driver_target) from
[<c1069040>] (od_dbs_update+0x14c/0x170)
[ 13.522327] r10:c2204070 r9:e8b50880 r8:e8b50800 r7:e8b51440
r6:e8b50880 r5:e8b50800
[ 13.530192] r4:e8903000
[ 13.532741] [<c1068ef4>] (od_dbs_update) from [<c1069d5c>]
(dbs_work_handler+0x3c/0x68)
[ 13.540783] r9:00000000 r8:c21d902c r7:e8903000 r6:e8b50804
r5:00000000 r4:e8b50838
[ 13.548572] [<c1069d20>] (dbs_work_handler) from [<c046f204>]
(process_one_work+0x200/0x560)
[ 13.557051] r9:00000000 r8:00000000 r7:efc2c600 r6:efc29300
r5:e9b24500 r4:e8b50838
[ 13.564833] [<c046f004>] (process_one_work) from [<c046f5b0>]
(worker_thread+0x4c/0x57c)
[ 13.572963] r10:efc29300 r9:00000008 r8:c2003d00 r7:efc29318
r6:e9b24514 r5:efc29300
[ 13.580828] r4:e9b24500
[ 13.583381] [<c046f564>] (worker_thread) from [<c04773e0>]
(kthread+0x144/0x170)
[ 13.590812] r10:e9979e7c r9:e9b24500 r8:c046f564 r7:e9b50000
r6:00000000 r5:e9b25b80
[ 13.598675] r4:e99c0140
[ 13.601228] [<c047729c>] (kthread) from [<c040024c>]
(ret_from_fork+0x14/0x28)
[ 13.608484] Exception stack(0xe9b51fb0 to 0xe9b51ff8)
[ 13.613559] 1fa0: 00000000
00000000 00000000 00000000
[ 13.621777] 1fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[ 13.629994] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 13.636642] r10:00000000 r9:00000000 r8:00000000 r7:00000000
r6:00000000 r5:c047729c
[ 13.644506] r4:e9b25b80
[ 13.647118] ---[ end trace 4ddd29ac9505935c ]---
[ 13.651768] cpu cpu0: multiple regulators are not supported
[ #
13.655036] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[ 13.657394] cpufreq: __target_index: Failed to change cpu frequency: -22
[ 13.670803] ------------[ cut here ]------------
[ 13.675501] WARNING: CPU: 0 PID: 21 at drivers/opp/core.c:678
dev_pm_opp_set_rate+0x4cc/0x5d4
[ 13.684068] Modules linked in:
[ 13.687178] CPU: 0 PID: 21 Comm: kworker/0:1 Tainted: G W
5.9.0-rc2-next-20200825 #1
[ 13.696267] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 13.702394] Workqueue: events dbs_work_handler
[ 13.706861] Backtrace:
[ 13.709334] [<c040e860>] (dump_backtrace) from [<c040ebd4>]
(show_stack+0x20/0x24)
[ 13.716942] r7:c20cca94 r6:00000000 r5:60000013 r4:c20cca94
[ 13.722633] [<c040ebb4>] (show_stack) from [<c0941338>]
(dump_stack+0xec/0x118)
[ 13.729983] [<c094124c>] (dump_stack) from [<c0451530>] (__warn+0xe8/0x100)
[ 13.736978] r10:e8b50600 r9:00000009 r8:c105f6f4 r7:000002a6
r6:c105f6f4 r5:00000009
[ 13.744844] r4:00000000 r3:c2004f30
[ 13.748442] [<c0451448>] (__warn) from [<c04518fc>]
(warn_slowpath_fmt+0x74/0xc4)
[ 13.755960] r7:000002a6 r6:c1b42034 r5:00000000 r4:e9b50000
[ 13.761649] [<c045188c>] (warn_slowpath_fmt) from [<c105f6f4>]
(dev_pm_opp_set_rate+0x4cc/0x5d4)
[ 13.770479] r9:e8b50280 r8:e9b50000 r7:ffffffea r6:3b9aca00
r5:59682f00 r4:e8902c00
[ 13.778263] [<c105f228>] (dev_pm_opp_set_rate) from [<c106aa8c>]
(set_target+0x3c/0x64)
[ 13.786304] r10:00000002 r9:00000000 r8:c22b508c r7:c2227048
r6:0016e360 r5:00000000
[ 13.794168] r4:e8903000
[ 13.796717] [<c106aa50>] (set_target) from [<c1064ca0>]
(__cpufreq_driver_target+0x2d0/0x628)
[ 13.805281] r7:c2227048 r6:e9b50000 r5:00000000 r4:e8903000
[ 13.810971] [<c10649d0>] (__cpufreq_driver_target) from
[<c1069040>] (od_dbs_update+0x14c/0x170)
[ 13.819797] r10:c2204070 r9:e8b50880 r8:e8b50800 r7:e8b51440
r6:e8b50880 r5:e8b50800
[ 13.827662] r4:e8903000
[ 13.830213] [<c1068ef4>] (od_dbs_update) from [<c1069d5c>]
(dbs_work_handler+0x3c/0x68)
[ 13.838256] r9:00000000 r8:c21d902c r7:e8903000 r6:e8b50804
r5:00000000 r4:e8b50838
[ 13.846042] [<c1069d20>] (dbs_work_handler) from [<c046f204>]
(process_one_work+0x200/0x560)
[ 13.854518] r9:00000000 r8:00000000 r7:efc2c600 r6:efc29300
r5:e9b24500 r4:e8b50838
[ 13.862301] [<c046f004>] (process_one_work) from [<c046f5b0>]
(worker_thread+0x4c/0x57c)
[ 13.870431] r10:efc29300 r9:00000008 r8:c2003d00 r7:efc29318
r6:e9b24514 r5:efc29300
[ 13.878295] r4:e9b24500
[ 13.880846] [<c046f564>] (worker_thread) from [<c04773e0>]
(kthread+0x144/0x170)
[ 13.888278] r10:e9979e7c r9:e9b24500 r8:c046f564 r7:e9b50000
r6:00000000 r5:e9b25b80
[ 13.896144] r4:e99c0140
[ 13.898694] [<c047729c>] (kthread) from [<c040024c>]
(ret_from_fork+0x14/0x28)
[ 13.905948] Exception stack(0xe9b51fb0 to 0xe9b51ff8)
[ 13.911024] 1fa0: 00000000
00000000 00000000 00000000
[ 13.919241] 1fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[ 13.927457] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 13.934104] r10:00000000 r9:00000000 r8:00000000 r7:00000000
r6:00000000 r5:c047729c
[ 13.941967] r4:e9b25b80
[ 13.944558] ---[ end trace 4ddd29ac9505935d ]---
[ 13.949228] cpu cpu0: multiple regulators are not supported
[ 13.954832] cpufreq: __target_index: Failed to change cpu frequency: -22
#
[ 13.961638] ------------[ cut here ]------------
[ 13.961941] sdhci-omap 4809c000.mmc: no pinctrl state for ddr_3_3v mode
[ 13.966303] WARNING: CPU: 0 PID: 21 at drivers/opp/core.c:678
dev_pm_opp_set_rate+0x4cc/0x5d4
[ 13.966311] Modules linked in:
[ 13.984620] CPU: 0 PID: 21 Comm: kworker/0:1 Tainted: G W
5.9.0-rc2-next-20200825 #1
[ 13.993706] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 13.999833] Workqueue: events dbs_work_handler
[ 14.004301] Backtrace:
[ 14.006772] [<c040e860>] (dump_backtrace) from [<c040ebd4>]
(show_stack+0x20/0x24)
[ 14.014379] r7:c20cca94 r6:00000000 r5:60000013 r4:c20cca94
[ 14.020071] [<c040ebb4>] (show_stack) from [<c0941338>]
(dump_stack+0xec/0x118)
[ 14.027418] [<c094124c>] (dump_stack) from [<c0451530>] (__warn+0xe8/0x100)
[ 14.034416] r10:e8b50600 r9:00000009 r8:c105f6f4 r7:000002a6
r6:c105f6f4 r5:00000009
[ 14.042282] r4:00000000 r3:c2004f30
[ 14.045878] [<c0451448>] (__warn) from [<c04518fc>]
(warn_slowpath_fmt+0x74/0xc4)
[ 14.053394] r7:000002a6 r6:c1b42034 r5:00000000 r4:e9b50000
[ 14.059082] [<c045188c>] (warn_slowpath_fmt) from [<c105f6f4>]
(dev_pm_opp_set_rate+0x4cc/0x5d4)
[ 14.067912] r9:e8b50280 r8:e9b50000 r7:ffffffea r6:3b9aca00
r5:59682f00 r4:e8902c00
[ 14.075695] [<c105f228>] (dev_pm_opp_set_rate) from [<c106aa8c>]
(set_target+0x3c/0x64)
[ 14.083736] r10:00000002 r9:00000000 r8:c22b508c r7:c2227048
r6:0016e360 r5:00000000
[ 14.091600] r4:e8903000
[ 14.094150] [<c106aa50>] (set_target) from [<c1064ca0>]
(__cpufreq_driver_target+0x2d0/0x628)
[ 14.102715] r7:c2227048 r6:e9b50000 r5:00000000 r4:e8903000
[ 14.108403] [<c10649d0>] (__cpufreq_driver_target) from
[<c1069040>] (od_dbs_update+0x14c/0x170)
[ 14.117229] r10:c2204070 r9:e8b50880 r8:e8b50800 r7:e8b51440
r6:e8b50880 r5:e8b50800
[ 14.125094] r4:e8903000
[ 14.127646] [<c1068ef4>] (od_dbs_update) from [<c1069d5c>]
(dbs_work_handler+0x3c/0x68)
[ 14.135690] r9:00000000 r8:c21d902c r7:e8903000 r6:e8b50804
r5:00000000 r4:e8b50838
[ 14.143476] [<c1069d20>] (dbs_work_handler) from [<c046f204>]
(process_one_work+0x200/0x560)
[ 14.151954] r9:00000000 r8:00000000 r7:efc2c600 r6:efc29300
r5:e9b24500 r4:e8b50838
[ 14.159737] [<c046f004>] (process_one_work) from [<c046f5b0>]
(worker_thread+0x4c/0x57c)
[ 14.167867] r10:efc29300 r9:00000008 r8:c2003d00 r7:efc29318
r6:e9b24514 r5:efc29300
[ 14.175732] r4:e9b24500
[ 14.178282] [<c046f564>] (worker_thread) from [<c04773e0>]
(kthread+0x144/0x170)
[ 14.185715] r10:e9979e7c r9:e9b24500 r8:c046f564 r7:e9b50000
r6:00000000 r5:e9b25b80
[ 14.193578] r4:e99c0140
[ 14.196127] [<c047729c>] (kthread) from [<c040024c>]
(ret_from_fork+0x14/0x28)
[ 14.203381] Exception stack(0xe9b51fb0 to 0xe9b51ff8)
[ 14.208458] 1fa0: 00000000
00000000 00000000 00000000
[ 14.216674] 1fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[ 14.224889] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 14.231536] r10:00000000 r9:00000000 r8:00000000 r7:00000000
r6:00000000 r5:c047729c
[ 14.239400] r4:e9b25b80
[ 14.242012] ---[ end trace 4ddd29ac9505935e ]---
[ 14.246695] cpu cpu0: multiple regulators are not supported
[ 14.252301] cpufreq: __target_index: Failed to change cpu frequency: -22
[ 14.259160] ------------[ cut here ]------------
[ 14.263821] WARNIN#
G: CPU: 0 PID: 21 at drivers/opp/core.c:678 dev_pm_opp_set_rate+0x4cc/0x5d4
[ 14.272406] Modules linked in:
[ 14.275542] CPU: 0 PID: 21 Comm: kworker/0:1 Tainted: G W
5.9.0-rc2-next-20200825 #1
[ 14.284629] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 14.290756] Workqueue: events dbs_work_handler
[ 14.295223] Backtrace:
Full log,
https://pastebin.com/HwTf2VMA
--
Linaro LKFT
https://lkft.linaro.org
On 27-08-20, 15:04, Naresh Kamboju wrote:
> While boot testing arm x15 devices the Kernel warning noticed with linux next
> tag 20200825.
>
> BAD: next-20200825
> GOOD: next-20200824
>
> metadata:
> git branch: master
> git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git commit: 3a00d3dfd4b68b208ecd5405e676d06c8ad6bb63
> git describe: next-20200825
> make_kernelversion: 5.9.0-rc2
> kernel-config:
> https://builds.tuxbuild.com/LDTu4GFMmvkJspza5LJIjQ/kernel.config
>
> We are working on git bisect and boot testing on x15 and get back to you.
Was this working earlier ? But considering that multiple things
related to OPP broke recently, it may be a OPP core bug as well. Not
sure though.
Can you give me delta between both the next branches for drivers/opp/
path ? I didn't get these tags after fetching linux-next.
--
viresh
On Thu, 27 Aug 2020 at 15:16, Viresh Kumar <[email protected]> wrote:
>
> On 27-08-20, 15:04, Naresh Kamboju wrote:
> > While boot testing arm x15 devices the Kernel warning noticed with linux next
> > tag 20200825.
> >
> > BAD: next-20200825
> > GOOD: next-20200824
> >
> > metadata:
> > git branch: master
> > git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> > git commit: 3a00d3dfd4b68b208ecd5405e676d06c8ad6bb63
> > git describe: next-20200825
> > make_kernelversion: 5.9.0-rc2
> > kernel-config:
> > https://builds.tuxbuild.com/LDTu4GFMmvkJspza5LJIjQ/kernel.config
> >
> > We are working on git bisect and boot testing on x15 and get back to you.
>
> Was this working earlier ? But considering that multiple things
> related to OPP broke recently, it may be a OPP core bug as well. Not
> sure though.
>
> Can you give me delta between both the next branches for drivers/opp/
> path ? I didn't get these tags after fetching linux-next.
git log --oneline next-20200824..next-20200825 -- drivers/opp/
b0531b897c9a opp: Set required OPPs in reverse order when scaling down
b11044e5204e opp: Reduce code duplication in _set_required_opps()
c67ba698f5fe opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
8aaf6264fc7f opp: Remove _dev_pm_opp_find_and_remove_table() wrapper
f3364e17d571 opp: Split out _opp_set_rate_zero()
10b217365b94 opp: Reuse the enabled flag in !target_freq path
72f80ce4ef9b opp: Rename regulator_enabled and use it as status of all resources
- Naresh
Hi Viresh,
On Thu, 27 Aug 2020 15:16:51 +0530 Viresh Kumar <[email protected]> wrote:
>
> On 27-08-20, 15:04, Naresh Kamboju wrote:
> > While boot testing arm x15 devices the Kernel warning noticed with linux next
> > tag 20200825.
> >
> > BAD: next-20200825
> > GOOD: next-20200824
> >
> > metadata:
> > git branch: master
> > git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> > git commit: 3a00d3dfd4b68b208ecd5405e676d06c8ad6bb63
> > git describe: next-20200825
> > make_kernelversion: 5.9.0-rc2
> > kernel-config:
> > https://builds.tuxbuild.com/LDTu4GFMmvkJspza5LJIjQ/kernel.config
> >
> > We are working on git bisect and boot testing on x15 and get back to you.
>
> Was this working earlier ? But considering that multiple things
> related to OPP broke recently, it may be a OPP core bug as well. Not
> sure though.
>
> Can you give me delta between both the next branches for drivers/opp/
> path ? I didn't get these tags after fetching linux-next.
Yeah, you need to explicitly fetch the tags as only the latest tag is
part of the branches in the tree.
$ git diff next-20200824..next-20200825 drivers/opp
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 6978b9218c6e..8b3c3986f589 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -779,29 +779,39 @@ static int _set_opp_custom(const struct opp_table *opp_table,
return opp_table->set_opp(data);
}
+static int _set_required_opp(struct device *dev, struct device *pd_dev,
+ struct dev_pm_opp *opp, int i)
+{
+ unsigned int pstate = likely(opp) ? opp->required_opps[i]->pstate : 0;
+ int ret;
+
+ if (!pd_dev)
+ return 0;
+
+ ret = dev_pm_genpd_set_performance_state(pd_dev, pstate);
+ if (ret) {
+ dev_err(dev, "Failed to set performance rate of %s: %d (%d)\n",
+ dev_name(pd_dev), pstate, ret);
+ }
+
+ return ret;
+}
+
/* This is only called for PM domain for now */
static int _set_required_opps(struct device *dev,
struct opp_table *opp_table,
- struct dev_pm_opp *opp)
+ struct dev_pm_opp *opp, bool up)
{
struct opp_table **required_opp_tables = opp_table->required_opp_tables;
struct device **genpd_virt_devs = opp_table->genpd_virt_devs;
- unsigned int pstate;
int i, ret = 0;
if (!required_opp_tables)
return 0;
/* Single genpd case */
- if (!genpd_virt_devs) {
- pstate = likely(opp) ? opp->required_opps[0]->pstate : 0;
- ret = dev_pm_genpd_set_performance_state(dev, pstate);
- if (ret) {
- dev_err(dev, "Failed to set performance state of %s: %d (%d)\n",
- dev_name(dev), pstate, ret);
- }
- return ret;
- }
+ if (!genpd_virt_devs)
+ return _set_required_opp(dev, dev, opp, 0);
/* Multiple genpd case */
@@ -811,19 +821,21 @@ static int _set_required_opps(struct device *dev,
*/
mutex_lock(&opp_table->genpd_virt_dev_lock);
- for (i = 0; i < opp_table->required_opp_count; i++) {
- pstate = likely(opp) ? opp->required_opps[i]->pstate : 0;
-
- if (!genpd_virt_devs[i])
- continue;
-
- ret = dev_pm_genpd_set_performance_state(genpd_virt_devs[i], pstate);
- if (ret) {
- dev_err(dev, "Failed to set performance rate of %s: %d (%d)\n",
- dev_name(genpd_virt_devs[i]), pstate, ret);
- break;
+ /* Scaling up? Set required OPPs in normal order, else reverse */
+ if (up) {
+ for (i = 0; i < opp_table->required_opp_count; i++) {
+ ret = _set_required_opp(dev, genpd_virt_devs[i], opp, i);
+ if (ret)
+ break;
+ }
+ } else {
+ for (i = opp_table->required_opp_count - 1; i >= 0; i--) {
+ ret = _set_required_opp(dev, genpd_virt_devs[i], opp, i);
+ if (ret)
+ break;
}
}
+
mutex_unlock(&opp_table->genpd_virt_dev_lock);
return ret;
@@ -882,7 +894,7 @@ static int _opp_set_rate_zero(struct device *dev, struct opp_table *opp_table)
if (opp_table->regulators)
regulator_disable(opp_table->regulators[0]);
- ret = _set_required_opps(dev, opp_table, NULL);
+ ret = _set_required_opps(dev, opp_table, NULL, false);
opp_table->enabled = false;
return ret;
@@ -973,7 +985,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
/* Scaling up? Configure required OPPs before frequency */
if (freq >= old_freq) {
- ret = _set_required_opps(dev, opp_table, opp);
+ ret = _set_required_opps(dev, opp_table, opp, true);
if (ret)
goto put_opp;
}
@@ -993,7 +1005,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
/* Scaling down? Configure required OPPs after frequency */
if (!ret && freq < old_freq) {
- ret = _set_required_opps(dev, opp_table, opp);
+ ret = _set_required_opps(dev, opp_table, opp, false);
if (ret)
dev_err(dev, "Failed to set required opps: %d\n", ret);
}
@@ -1068,7 +1080,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
*/
opp_table = kzalloc(sizeof(*opp_table), GFP_KERNEL);
if (!opp_table)
- return NULL;
+ return ERR_PTR(-ENOMEM);
mutex_init(&opp_table->lock);
mutex_init(&opp_table->genpd_virt_dev_lock);
@@ -1079,8 +1091,8 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
opp_dev = _add_opp_dev(dev, opp_table);
if (!opp_dev) {
- kfree(opp_table);
- return NULL;
+ ret = -ENOMEM;
+ goto err;
}
_of_init_opp_table(opp_table, dev, index);
@@ -1089,16 +1101,21 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
opp_table->clk = clk_get(dev, NULL);
if (IS_ERR(opp_table->clk)) {
ret = PTR_ERR(opp_table->clk);
- if (ret != -EPROBE_DEFER)
- dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__,
- ret);
+ if (ret == -EPROBE_DEFER)
+ goto err;
+
+ dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret);
}
/* Find interconnect path(s) for the device */
ret = dev_pm_opp_of_find_icc_paths(dev, opp_table);
- if (ret)
+ if (ret) {
+ if (ret == -EPROBE_DEFER)
+ goto err;
+
dev_warn(dev, "%s: Error finding interconnect paths: %d\n",
__func__, ret);
+ }
BLOCKING_INIT_NOTIFIER_HEAD(&opp_table->head);
INIT_LIST_HEAD(&opp_table->opp_list);
@@ -1107,6 +1124,10 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
/* Secure the device table modification */
list_add(&opp_table->node, &opp_tables);
return opp_table;
+
+err:
+ kfree(opp_table);
+ return ERR_PTR(ret);
}
void _get_opp_table_kref(struct opp_table *opp_table)
@@ -1129,7 +1150,7 @@ static struct opp_table *_opp_get_opp_table(struct device *dev, int index)
if (opp_table) {
if (!_add_opp_dev_unlocked(dev, opp_table)) {
dev_pm_opp_put_opp_table(opp_table);
- opp_table = NULL;
+ opp_table = ERR_PTR(-ENOMEM);
}
goto unlock;
}
@@ -1573,8 +1594,8 @@ struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev,
struct opp_table *opp_table;
opp_table = dev_pm_opp_get_opp_table(dev);
- if (!opp_table)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(opp_table))
+ return opp_table;
/* Make sure there are no concurrent readers while updating opp_table */
WARN_ON(!list_empty(&opp_table->opp_list));
@@ -1632,8 +1653,8 @@ struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name)
struct opp_table *opp_table;
opp_table = dev_pm_opp_get_opp_table(dev);
- if (!opp_table)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(opp_table))
+ return opp_table;
/* Make sure there are no concurrent readers while updating opp_table */
WARN_ON(!list_empty(&opp_table->opp_list));
@@ -1725,8 +1746,8 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
int ret, i;
opp_table = dev_pm_opp_get_opp_table(dev);
- if (!opp_table)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(opp_table))
+ return opp_table;
/* This should be called before OPPs are initialized */
if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@@ -1833,8 +1854,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name)
int ret;
opp_table = dev_pm_opp_get_opp_table(dev);
- if (!opp_table)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(opp_table))
+ return opp_table;
/* This should be called before OPPs are initialized */
if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@@ -1901,8 +1922,8 @@ struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev,
return ERR_PTR(-EINVAL);
opp_table = dev_pm_opp_get_opp_table(dev);
- if (!opp_table)
- return ERR_PTR(-ENOMEM);
+ if (!IS_ERR(opp_table))
+ return opp_table;
/* This should be called before OPPs are initialized */
if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@@ -1982,8 +2003,8 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
const char **name = names;
opp_table = dev_pm_opp_get_opp_table(dev);
- if (!opp_table)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(opp_table))
+ return opp_table;
/*
* If the genpd's OPP table isn't already initialized, parsing of the
@@ -2153,8 +2174,8 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
int ret;
opp_table = dev_pm_opp_get_opp_table(dev);
- if (!opp_table)
- return -ENOMEM;
+ if (IS_ERR(opp_table))
+ return PTR_ERR(opp_table);
/* Fix regulator count for dynamic OPPs */
opp_table->regulator_count = 1;
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 7d9d4455a59e..e39ddcc779af 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -947,8 +947,8 @@ int dev_pm_opp_of_add_table(struct device *dev)
int ret;
opp_table = dev_pm_opp_get_opp_table_indexed(dev, 0);
- if (!opp_table)
- return -ENOMEM;
+ if (IS_ERR(opp_table))
+ return PTR_ERR(opp_table);
/*
* OPPs have two version of bindings now. Also try the old (v1)
@@ -1002,8 +1002,8 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
}
opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);
- if (!opp_table)
- return -ENOMEM;
+ if (IS_ERR(opp_table))
+ return PTR_ERR(opp_table);
ret = _of_add_opp_table_v2(dev, opp_table);
if (ret)
--
Cheers,
Stephen Rothwell
On 27-08-20, 21:18, Stephen Rothwell wrote:
> Hi Viresh,
>
> On Thu, 27 Aug 2020 15:16:51 +0530 Viresh Kumar <[email protected]> wrote:
> >
> > On 27-08-20, 15:04, Naresh Kamboju wrote:
> > > While boot testing arm x15 devices the Kernel warning noticed with linux next
> > > tag 20200825.
> > >
> > > BAD: next-20200825
> > > GOOD: next-20200824
> > >
> > > metadata:
> > > git branch: master
> > > git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> > > git commit: 3a00d3dfd4b68b208ecd5405e676d06c8ad6bb63
> > > git describe: next-20200825
> > > make_kernelversion: 5.9.0-rc2
> > > kernel-config:
> > > https://builds.tuxbuild.com/LDTu4GFMmvkJspza5LJIjQ/kernel.config
> > >
> > > We are working on git bisect and boot testing on x15 and get back to you.
> >
> > Was this working earlier ? But considering that multiple things
> > related to OPP broke recently, it may be a OPP core bug as well. Not
> > sure though.
> >
> > Can you give me delta between both the next branches for drivers/opp/
> > path ? I didn't get these tags after fetching linux-next.
>
> Yeah, you need to explicitly fetch the tags as only the latest tag is
> part of the branches in the tree.
Ah, I see. Thanks.
--
viresh
On Fri, 28 Aug 2020 at 10:21, Viresh Kumar <[email protected]> wrote:
>
> On 27-08-20, 21:18, Stephen Rothwell wrote:
> > Hi Viresh,
> >
> > On Thu, 27 Aug 2020 15:16:51 +0530 Viresh Kumar <[email protected]> wrote:
> > >
> > > On 27-08-20, 15:04, Naresh Kamboju wrote:
> > > > While boot testing arm x15 devices the Kernel warning noticed with linux next
> > > > tag 20200825.
> > > >
> > > > BAD: next-20200825
> > > > GOOD: next-20200824
> > > >
> > > > We are working on git bisect and boot testing on x15 and get back to you.
Viresh,
I have applied the v2 patch series on top of linux next-20200824.
and tested again the reported kernel warning is fixed [1]
[1] https://lkft.validation.linaro.org/scheduler/job/1717615#L1881
On 28-08-20, 15:42, Naresh Kamboju wrote:
> Viresh,
> I have applied the v2 patch series on top of linux next-20200824.
> and tested again the reported kernel warning is fixed [1]
>
> [1] https://lkft.validation.linaro.org/scheduler/job/1717615#L1881
Hi Naresh,
You meant this one ?
[PATCH V2 4/8] mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table()
Great, thanks a lot for testing these.
--
viresh
On Mon, 31 Aug 2020 at 10:11, Viresh Kumar <[email protected]> wrote:
>
> On 28-08-20, 15:42, Naresh Kamboju wrote:
> > Viresh,
> > I have applied the v2 patch series on top of linux next-20200824.
> > and tested again the reported kernel warning is fixed [1]
> >
> > [1] https://lkft.validation.linaro.org/scheduler/job/1717615#L1881
>
> Hi Naresh,
>
> You meant this one ?
>
> [PATCH V2 4/8] mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table()
I have not tested individual patches instead applied all v2 of 8 patches
and tested.
This is from my tree.
$ git log --oneline | head -8
574dafbe5e8a qcom-geni-se: remove has_opp_table
6680f35d0cca tty: serial: qcom_geni_serial: Unconditionally call
dev_pm_opp_of_remove_table()
2a3929d0d5e0 spi: spi-qcom-qspi: Unconditionally call
dev_pm_opp_of_remove_table()
617b65175370 spi: spi-geni-qcom: Unconditionally call
dev_pm_opp_of_remove_table()
e736706a4914 mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table()
afdd91145686 drm/msm: Unconditionally call dev_pm_opp_of_remove_table()
b85668862d92 drm/lima: Unconditionally call dev_pm_opp_of_remove_table()
3ac057e88c7c cpufreq: imx6q: Unconditionally call dev_pm_opp_of_remove_table()
>
> Great, thanks a lot for testing these.
Anytime testing :)
>
> --
> viresh
- Naresh
On 31-08-20, 11:30, Naresh Kamboju wrote:
> On Mon, 31 Aug 2020 at 10:11, Viresh Kumar <[email protected]> wrote:
> >
> > On 28-08-20, 15:42, Naresh Kamboju wrote:
> > > Viresh,
> > > I have applied the v2 patch series on top of linux next-20200824.
> > > and tested again the reported kernel warning is fixed [1]
> > >
> > > [1] https://lkft.validation.linaro.org/scheduler/job/1717615#L1881
> >
> > Hi Naresh,
> >
> > You meant this one ?
> >
> > [PATCH V2 4/8] mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table()
>
> I have not tested individual patches instead applied all v2 of 8 patches
> and tested.
Ah okay, Thanks. That's the same.
To be honest, I wasn't targeting fixing this bug with that version,
but it went well after all :)
--
viresh
On Mon, 31 Aug 2020 at 11:32, Viresh Kumar <[email protected]> wrote:
>
> On 31-08-20, 11:30, Naresh Kamboju wrote:
> > On Mon, 31 Aug 2020 at 10:11, Viresh Kumar <[email protected]> wrote:
> > >
> > > On 28-08-20, 15:42, Naresh Kamboju wrote:
> > > > Viresh,
> > > > I have applied the v2 patch series on top of linux next-20200824.
> > > > and tested again the reported kernel warning is fixed [1]
> > > >
> > > > [1] https://lkft.validation.linaro.org/scheduler/job/1717615#L1881
> > >
> > > Hi Naresh,
> > >
> > > You meant this one ?
> > >
> > > [PATCH V2 4/8] mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table()
> >
> > I have not tested individual patches instead applied all v2 of 8 patches
> > and tested.
>
> Ah okay, Thanks. That's the same.
>
> To be honest, I wasn't targeting fixing this bug with that version,
> but it went well after all :)
The arm x15 boot failed on Linus 's mainline version 5.9.0.
I have listed the latest commits on drivers/opp/ .
metadata:
git branch: master
git repo: https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline
git commit: 3e4fb4346c781068610d03c12b16c0cfb0fd24a3
git describe: v5.9-4105-g3e4fb4346c78
make_kernelversion: 5.9.0
kernel-config:
https://builds.tuxbuild.com/2BB2g61t29VaadVLXEl4cQ/kernel.config
------------[ cut here ]------------
[ 13.530971] sdhci-omap 4809c000.mmc: Got CD GPIO
[ 13.535647] WARNING: CPU: 0 PID: 137 at drivers/opp/core.c:678
dev_pm_opp_set_rate+0x4cc/0x5d4
[ 13.540752] sdhci-omap 4809c000.mmc: supply vqmmc not found, using
dummy regulator
[ 13.548931] Modules linked in:
[ 13.559638] CPU: 0 PID: 137 Comm: kworker/0:2 Not tainted 5.9.0 #1
[ 13.565848] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 13.571982] Workqueue: events dbs_work_handler
[ 13.576453] Backtrace:
[ 13.578924] [<c11e8338>] (dump_backtrace) from [<c11e86e4>]
(show_stack+0x20/0x24)
[ 13.583819] mmc1: SDHCI controller on 480b4000.mmc [480b4000.mmc] using ADMA
[ 13.586532] r7:c1df7f60 r6:60000013 r5:00000000 r4:c1df7f60
[ 13.599290] [<c11e86c4>] (show_stack) from [<c11ee004>]
(dump_stack+0xe4/0x104)
[ 13.606640] [<c11edf20>] (dump_stack) from [<c034f384>] (__warn+0xe0/0x104)
[ 13.613638] r10:ed33b880 r9:00000009 r8:c0f3f4f4 r7:000002a6
r6:c0f3f4f4 r5:00000009
[ 13.621502] r4:c1a3546c r3:00000000
[ 13.625097] [<c034f2a4>] (__warn) from [<c11e9950>]
(warn_slowpath_fmt+0x74/0xc4)
[ 13.632616] r7:000002a6 r6:c1a3546c r5:00000000 r4:ee6c2000
[ 13.638305] [<c11e98e0>] (warn_slowpath_fmt) from [<c0f3f4f4>]
(dev_pm_opp_set_rate+0x4cc/0x5d4)
[ 13.647132] r9:ed33b500 r8:ee6c2000 r7:ffffffea r6:3b9aca00
r5:59682f00 r4:ed328600
[ 13.654916] [<c0f3f028>] (dev_pm_opp_set_rate) from [<c0f4ac98>]
(set_target+0x38/0x3c)
[ 13.662958] r10:00000002 r9:00000000 r8:c1fc11d4 r7:c1f550c0
r6:ee6c2000 r5:00000000
[ 13.670821] r4:ed328a00
[ 13.673370] [<c0f4ac60>] (set_target) from [<c0f45c54>]
(__cpufreq_driver_target+0x214/0x658)
[ 13.681938] [<c0f45a40>] (__cpufreq_driver_target) from
[<c0f49208>] (od_dbs_update+0x14c/0x170)
[ 13.690764] r10:c1f2f1c0 r9:ed33bb00 r8:ed33ba80 r7:ed33f740
r6:ed33bb00 r5:ed33ba80
[ 13.698631] r4:ed328a00
[ 13.701181] [<c0f490bc>] (od_dbs_update) from [<c0f49f6c>]
(dbs_work_handler+0x3c/0x68)
[ 13.709224] r9:00000000 r8:c1f03ee8 r7:ed328a00 r6:ed33ba84
r5:00000000 r4:ed33bab8
[ 13.717012] [<c0f49f30>] (dbs_work_handler) from [<c036d7e8>]
(process_one_work+0x200/0x568)
[ 13.725489] r9:00000000 r8:00000000 r7:eeb32600 r6:eeb2f300
r5:ee69fd00 r4:ed33bab8
[ 13.733274] [<c036d5e8>] (process_one_work) from [<c036db9c>]
(worker_thread+0x4c/0x57c)
[ 13.741405] r10:eeb2f300 r9:00000008 r8:c1d03d00 r7:eeb2f318
r6:ee69fd14 r5:eeb2f300
[ 13.749267] r4:ee69fd00
[ 13.751819] [<c036db50>] (worker_thread) from [<c0375550>]
(kthread+0x144/0x170)
[ 13.759252] r10:ee17be7c r9:ee69fd00 r8:c036db50 r7:ee6c2000
r6:00000000 r5:ee6ab1c0
[ 13.767116] r4:ee1c55c0
[ 13.769667] [<c037540c>] (kthread) from [<c0300174>]
(ret_from_fork+0x14/0x20)
[ 13.776922] Exception stack(0xee6c3fb0 to 0xee6c3ff8)
[ 13.781997] 3fa0: 00000000
00000000 00000000 00000000
[ 13.790216] 3fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[ 13.798433] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 13.805079] r10:00000000 r9:00000000 r8:00000000 r7:00000000
r6:00000000 r5:c037540c
[ 13.812945] r4:ee6ab1c0
[ 13.815566] ---[ end trace 3876693f0f796f8e ]---
[ 13.820213] cpu cpu0: multiple regulators are not supported
[ 13.825836] cpufreq: __target_index: Failed to change cpu frequency: -22
<>
[ 15.409753] ---[ end trace 3876693f0f796f94 ]---
[ 15.414449] cpu cpu0: multiple regulators are not supported
[ 15.414469] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[ 15.420054] cpufreq: __target_index: Failed to change cpu frequ#
$ git log --oneline drivers/opp/
757e282188f0 Merge branch 'opp/linux-next' of
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
a5663c9b1e31 opp: Allow opp-level to be set to 0
cb60e9602cce opp: Prevent memory leak in dev_pm_opp_attach_genpd()
0ff25c99042a opp: Allow opp-supported-hw to contain multiple versions
2c59138c22f1 opp: Set required OPPs in reverse order when scaling down
60cdeae0d627 opp: Reduce code duplication in _set_required_opps()
475ac8ead803 opp: Drop unnecessary check from dev_pm_opp_attach_genpd()
3a5578784d1e Merge branch 'opp/defer-probe' into HEAD
90d46d71cce2 opp: Handle multiple calls for same OPP table in
_of_add_opp_table_v1()
763700f5e0fc Merge branch 'opp/fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
922ff0759a16 opp: Don't drop reference for an OPP table that was never parsed
dd461cd9183f opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
8aaf6264fc7f opp: Remove _dev_pm_opp_find_and_remove_table() wrapper
f3364e17d571 opp: Split out _opp_set_rate_zero()
10b217365b94 opp: Reuse the enabled flag in !target_freq path
72f80ce4ef9b opp: Rename regulator_enabled and use it as status of all resources
a4501bac0e55 opp: Enable resources again if they were disabled earlier
d4ec88d20558 opp: Put opp table in dev_pm_opp_set_rate() if _set_opp_bw() fails
8979ef70850e opp: Put opp table in dev_pm_opp_set_rate() for empty tables
link,
https://pastebin.com/9kDPEFLU
https://qa-reports.linaro.org/lkft/linux-mainline-master-sanity/build/v5.9-4105-g3e4fb4346c78/testrun/3308561/suite/linux-log-parser/tests/
- Naresh
+Dave,
On 15-10-20, 15:26, Naresh Kamboju wrote:
> The arm x15 boot failed on Linus 's mainline version 5.9.0.
Don't mention the version as this doesn't give the right information.
You tested it over 5.9 + 5.10-rc1 material.
> I have listed the latest commits on drivers/opp/ .
>
> metadata:
> git branch: master
> git repo: https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline
> git commit: 3e4fb4346c781068610d03c12b16c0cfb0fd24a3
> git describe: v5.9-4105-g3e4fb4346c78
> make_kernelversion: 5.9.0
> kernel-config:
> https://builds.tuxbuild.com/2BB2g61t29VaadVLXEl4cQ/kernel.config
>
>
> ------------[ cut here ]------------
> [ 13.530971] sdhci-omap 4809c000.mmc: Got CD GPIO
> [ 13.535647] WARNING: CPU: 0 PID: 137 at drivers/opp/core.c:678
> dev_pm_opp_set_rate+0x4cc/0x5d4
Looks like the stuff from drivers/opp/ti-opp-supply.c supply didn't
work as expected.
One of the major changes came with these patches:
dc279ac6e5b4 cpufreq: dt: Refactor initialization to handle probe deferral properly
dd461cd9183f opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
And that's where I think it may have gone wrong.
Dave: Will you (or someone else from TI) can have a look at it as well
?
--
viresh
On 16-10-20, 11:15, Viresh Kumar wrote:
> +Dave,
>
> On 15-10-20, 15:26, Naresh Kamboju wrote:
> > The arm x15 boot failed on Linus 's mainline version 5.9.0.
>
> Don't mention the version as this doesn't give the right information.
> You tested it over 5.9 + 5.10-rc1 material.
>
> > I have listed the latest commits on drivers/opp/ .
> >
> > metadata:
> > git branch: master
> > git repo: https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline
> > git commit: 3e4fb4346c781068610d03c12b16c0cfb0fd24a3
> > git describe: v5.9-4105-g3e4fb4346c78
> > make_kernelversion: 5.9.0
> > kernel-config:
> > https://builds.tuxbuild.com/2BB2g61t29VaadVLXEl4cQ/kernel.config
> >
> >
> > ------------[ cut here ]------------
> > [ 13.530971] sdhci-omap 4809c000.mmc: Got CD GPIO
> > [ 13.535647] WARNING: CPU: 0 PID: 137 at drivers/opp/core.c:678
> > dev_pm_opp_set_rate+0x4cc/0x5d4
>
> Looks like the stuff from drivers/opp/ti-opp-supply.c supply didn't
> work as expected.
>
> One of the major changes came with these patches:
>
> dc279ac6e5b4 cpufreq: dt: Refactor initialization to handle probe deferral properly
> dd461cd9183f opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
>
> And that's where I think it may have gone wrong.
>
> Dave: Will you (or someone else from TI) can have a look at it as well
> ?
http://lore.kernel.org/lkml/be911bcddc1dbf4a152513cb3d83f8eed7d2574c.1603189831.git.viresh.kumar@linaro.org
I think this will fix it now.
--
viresh