Comments (12)
While investigating the issue I found a code path that could lead to a null pointer dereference or similar in _add_opp_table_indexed
. Maybe that's why we are having that kernel oops.
struct opp_table *_add_opp_table_indexed(struct device *dev, int index,
bool getclk)
{
...
if (opp_table) {
if (!_add_opp_dev(dev, opp_table)) {
dev_pm_opp_put_opp_table(opp_table);
opp_table = ERR_PTR(-ENOMEM); <----
}
mutex_lock(&opp_table_lock);
} else {
opp_table = _allocate_opp_table(dev, index);
mutex_lock(&opp_table_lock);
if (!IS_ERR(opp_table))
list_add(&opp_table->node, &opp_tables);
}
opp_tables_busy = false;
unlock:
mutex_unlock(&opp_table_lock);
return _update_opp_table_clk(dev, opp_table, getclk); <---- (this functions tries to access a struct field of opp_table without checking if the pointer is invalid)
}
from linux.
Nevermind, i didn't see the IS_ERR() in _update_opp_table_clk
from linux.
Now i got something
/mnt/linux # cat trace.txt | CROSS_COMPILE=aarch64-alpine-linux-musl- ./scripts/decode_stacktrace.sh .output/vmlinux ./
[ 1.618458] Call trace:
[ 1.618461] _of_add_table_indexed (/mnt/linux/.output/../drivers/opp/of.c:373 /mnt/linux/.output/../drivers/opp/of.c:1053 /mnt/linux/.output/../drivers/opp/of.c:1148)
[ 1.618472] dev_pm_opp_of_add_table_indexed (/mnt/linux/.output/../drivers/opp/of.c:1235)
[ 1.618481] of_genpd_add_provider_onecell (/mnt/linux/.output/../drivers/base/power/domain.c:2380)
Here's the issue:
Lines 369 to 375 in b265c06
The size of the array that's being indexed and required_opp_count don't match because when initializing the opp_table if there's no required_tables it doesn't set the value of required_opp_count.
Here's the code (put_np is at the end of the function):
Lines 172 to 183 in b265c06
from linux.
Lol I found what the error was...
linux/arch/arm64/boot/dts/qcom/msm8953.dtsi
Lines 360 to 362 in b265c06
Compatible has to be operating-points-v2
. No wonder it was reading a null opp table...
I just tested it and its working...
from linux.
Can you test changing the compatible and see if that's it?
from linux.
According to docs, standalone operating-points-v2-kryo-cpu
compatible is a legit use case (and also used on msm8996 & qcs404, but operating-points-v2-qcom-cpu
isn't documented anywhere. Removing the latter doesn't change anything though.
Are you sure that the cpufreq driver probes correctly when you set compatible to operating-points-v2
?
from linux.
Okay right, it's failing with -ENOENT. But at least now it doesn't crash...
[ 1.296503] qcom-cpufreq-nvmem: probe of qcom-cpufreq-nvmem failed with error -2
Maybe something's missing in the DT?
from linux.
Yes, also commenting the nvmem-cells = <&cpu_speed_bin>;
in dt makes probe fail and boot succeed.
I guess the bug lies in either b052d04 (which looks quite hacky tbh and looks like it might cause stuff like this) or 664d2ef and presumably doing things that shouldn't be done.
from linux.
Temporarily worked around with b265c06, I believe
from linux.
Fixed in 6.0.10 branch, the compatible for the spmi regulator that cpr uses was wrong so it didn't probe
from linux.
Can you test it in both sdm625 and 632?
from linux.
Is this still relevant?
from linux.
Related Issues (20)
- Patches for linux-next () HOT 18
- PMI632 vibrator HOT 3
- Cannot wake up panel_xiaomi_nt35532 on mido HOT 3
- Initial support for qpnp-qg fuel gauge on Fairphone3 HOT 4
- Question about config HOT 1
- xiaomi-vince Synaptics touchscreen not working HOT 6
- msm8953 6.5.2 kernel gpu cannot be used in mobian system! System graphics card display software rendering can't use gpu. HOT 6
- xiaomi ysl wifi connect 4WAY_HANDSHAKE_TIMEOUT HOT 9
- Xiaomi Mi A2 Lite (xiaomi-daisy) slow GPU HOT 4
- gcc_venus0_core0_vcodec0_clk status stuck at 'off'
- Slow charging speed HOT 4
- USB Type-C support with PMI632 HOT 1
- RedMi Note 4X (Mido) after changing the screen cannot be displayed
- RedMi Note 4X (Mido) after changing the screen cannot be displayed HOT 11
- xiaomi-vince: power management issues (supend transitions, i2c/smbus, synaptic rmi4) HOT 2
- xiaomi-vince: static noise when idle and popping noise when starting/stopping audio (q6asm_dai) HOT 5
- Can I boot without lk2nd? HOT 2
- Snapdragon 625 gpu can't be used normally in other desktop environments. HOT 2
- Mainline/linx
- Using mainline config to compile and report errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linux.