Repository navigation
Conversation
d020254 to
0b46b0d
Compare
|
Thanks, this is a real leak and a sensible design. Three things:
Once the 9a run is in, I'll boot it on the 7 Pro. |
4f58d4a to
e30c106
Compare
|
Points 2 and 3 are in, pushed as one amended commit (still a draft until the sign-off, which is the owner's and is queued for him).
Builds for arm64 with W=1 (compile-tested on the 9a's tree), checkpatch clean apart from the sign-off. The 9a run against a timing-out channel is still owed. |
e30c106 to
183ae76
Compare
|
Thanks, the rx_lock re-check reads right, and the new evidence paragraph is accurate. One thing left on the branch: it still has the original unsigned commit underneath the signed one, and kernel PRs land commit by commit. Please squash them into a single commit with the sign-off. Once the 9a run against a stalled channel is in, I'll boot it on my 7 Pro. |
|
Squashed into one signed commit and rebased onto today's omamobile. checkpatch --strict and the W=1 arm64 build of exynos-acpm.o are clean. The 9a run against a stalled channel is still to come. Today's palmtop console (without this patch) shows a stall on the DVFS channel: |
183ae76 to
413fa4a
Compare
|
Thank you, @W4HO-ham, for the squash and the rebase. All three points from my review are in, and the squashed patch is line for line what I read on the 31st. I went through the timeout path once more. About the 9a run. Today's DVFS stall, with the bitmap filling one bit per timeout and then "RX front can not keep up with TX front", looks like firmware that has stopped answering. On such a channel the patch changes nothing you can see, because the pool still fills, as the message says. The run shows the fix only if the firmware answers late at least once: a One small thing: this file's history, here and upstream, uses the prefix Once the 9a run is in, I'll boot it on my 7 Pro (DVFS, thermal and PMIC reads, smoke test) before merging. |
A request claims one of the channel's 63 sequence slots in acpm_prepare_xfer() and gives it back in acpm_dequeue_by_polling(), on the path where the answer arrives. The timeout path prints and returns -ETIME with the slot still claimed, and nothing ever releases it, so every timeout costs the channel one slot for good. After 63 of them the channel answers every request with -EBUSY and "ACPM sequence number pool exhausted", and only a reboot brings it back. This is reachable: on a Pixel 9a whose thermal channel stopped answering, the console shows repeated "Timeout! ch:9 s:46 bitmap:600000000000" and "s:47" with the same bitmap. Those two bits are the two requests that timed out together (tx_lock is released before the wait, so two can be outstanding), not a leaked slot; what the log shows is the rate: thermal polls about once a second, so against a stalled firmware the pool is gone in about a minute. The same code serves the PMIC and DVFS channels. The slot cannot simply be released on timeout: the firmware may still answer, and the answer carries that sequence number, so a slot handed to the next request would deliver the old answer as the new request's. Mark the slot abandoned instead, and let acpm_get_rx() release it when the late answer arrives, dropping that answer. Take that decision under rx_lock after one more look at completed: another thread draining the queue may have saved this answer just before the deadline, and abandoning the slot after that would leak it, since no further answer will come; the request has then succeeded, late, and is treated as such. A firmware that never answers at all still exhausts the pool, which is then an honest report of a dead channel rather than the result of bookkeeping. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
413fa4a to
dcfa3ff
Compare
|
Retitled to |
|
Thanks, @W4HO-ham, for the retitle. It now matches the file's history, and |
Draft because it is untested on hardware: the palmtop is hung awaiting a forced restart, so I could not run a single ACPM timeout against it. The bug itself is in the code, not inferred from a log.
The leak. A request claims one of the channel's 63 sequence slots in
acpm_prepare_xfer()and gives it back inacpm_dequeue_by_polling(), on the path where the answer arrives. The timeout path prints and returns-ETIMEwith the slot still claimed, and nothing else releases it. After 63 timeouts the channel answers everything with-EBUSYand "ACPM sequence number pool exhausted", until a reboot.The evidence, stated correctly. It comes from a Pixel 9a console of 2026-10-30 18:31, a boot that ended in a watchdog reset during a GNSS session, not from the UFS resume failure earlier that day (an earlier version of this description said the latter, which was my mistake; the UFS console has no ACPM timeout in it at all). In that boot, 10 s after an AoC DSP fault and its ALSA command timeouts, the thermal channel stopped answering:
Two slots are held at once in that bitmap while allocations are serialised under
tx_lock, so one had already leaked when the second timeout printed. Thermal polls about once a second, so a firmware that has stopped answering burns the pool in about a minute, and the same code serves the PMIC and DVFS channels. I am not claiming the leak caused that reset; it is a defect found while reading those paths, and it is worth fixing on its own.Why not simply clear the bit on timeout. The firmware may still answer, and its answer carries that sequence number. A slot handed to the next request would then take the old answer as the new request's reply. So the slot is marked abandoned and
acpm_get_rx()releases it when the late answer arrives, dropping the answer. A firmware that never answers at all still exhausts the pool, which is then an honest report of a dead channel.Builds with
W=1for arm64, no new warnings;checkpatch --strictclean. What it needs before leaving draft: a run on hardware where a channel times out, showing the bitmap returning to zero afterwards and no "pool exhausted".