Re: [PATCH v2] interconnect: qcom: bcm-voter: Clear the ALC vote left by the bootloader

From: Michael Auer

Date: Mon Nov 23 2026 - 16:02:21 EST


Hi Konrad,

> I was hoping you would test my suggestion before sending it out..

I did run it: the numbers in the commit message are from your code on
the OnePlus 6. What I only saw after the review is that just the
active-only write had an effect.

> My agent suggests that changing this to use rpmh_write_batch() as
> these aren't cached and should achieve the desired outcome, please
> explore that

For sleep and wake, rpmh_write_batch() also only queues the request,
on ctrlr->batch_cache, until rpmh_flush(). It skips the sleep == wake
check, but qcom_icc_bcm_voter_commit() calls rpmh_invalidate() on
every commit, and that frees the whole batch_cache.

I tried it on the OnePlus 6, with all three ALC votes sent through
rpmh_write_batch() and a debug print in rpmh.c: both ALC batches were
queued at probe and freed by rpmh_invalidate() 2 ms later, at the
first icc commit. They never reached rpmh_flush(), and after suspend
the vote was still the active-only (12, 0), as with v2. So ALC would
have to be added to the wake and sleep batches of every commit.

Also, a (0, 0) wake vote that reaches the hardware would turn ALC off
after the first resume.

rpmh_invalidate() does not touch the rpmh_write() cache, so I tested a
smaller change: active-only (12, 0) and sleep (0, 0) with rpmh_write(),
and no wake write. The active write also sets the cached wake value,
so the sleep and wake values differ and rpmh_flush() programs both.

On the OnePlus 6 the rpmh cache now has ALC at sleep (0, 0) and wake
(12, 0), and rpmh_flush() no longer skips it. The APPS DRV vote reads
(12, 0) after boot and again after 16 suspends. In a 25 minute suspend
test the SoC was in CX collapse for 86 % of the suspended time, the
same as with v2.

If that is what you meant, I will send it as v3.

Thanks,
Michael