summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorAlexey Charkov <alchark@flipper.net>2026-09-02 17:07:52 +0400
committerSrinivas Kandagatla <srini@kernel.org>2026-09-14 23:13:03 +0100
commit798be42019957b28b4fb897d7f9f6cf6712247db (patch)
tree5e85eff8234251e09d7c1a70b7ff0702b5d9561a /tools/perf/scripts/python/stackcollapse.py
parentcee9395acd8043be0644b25c34bfa86623f2b935 (diff)
downloadlinux-next-798be42019957b28b4fb897d7f9f6cf6712247db.tar.gz
linux-next-798be42019957b28b4fb897d7f9f6cf6712247db.zip
nvmem: rockchip-otp: Serialize reads
The OTP controller is driven through a single set of registers holding a state machine which has to be stepped through for every word read, yet nothing keeps two readers out of each other's way. Concurrent reads interleave, and the outcome is either a reader bailing out: rockchip-otp 2a580000.otp: timeout during read setup or, worse, one of them silently taking delivery of the other's data. Reading two cells in parallel from userspace on RK3576 reproduces both within 150 iterations - 53 read errors and 9 corrupted results, the latter either losing their first word or, in one case, ending in the two bytes which belong to the other reader's cell - whereas the same reads issued sequentially never fail. Concurrency is not hypothetical here, as six thermal sensors source their trim values from the OTP and reach the driver straight from asynchronous driver probing. Guard the read path with a mutex. Reads are the only way into the hardware, as the driver registers no write callback, and they always run in process context, so a plain mutex spanning the whole clock-enable, read, clock-disable sequence is enough. Fixes: 755864feb729 ("nvmem: add Rockchip OTP driver") Cc: stable@vger.kernel.org Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Alexey Charkov <alchark@flipper.net> Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions