Index | Thread | Search

From:
Vitaliy Makkoveev <mvs@openbsd.org>
Subject:
Re: Initial Raspberry Pi CPU frequency driver (apm -A)
To:
Ron Manosuthi <rman401@proton.me>
Cc:
"tech@openbsd.org" <tech@openbsd.org>
Date:
Sat, 24 Jan 2026 11:40:47 +0300

Download raw body.

Thread
On Wed, Jan 21, 2026 at 10:22:13PM +0000, Ron Manosuthi wrote:
> Hi Vitaliy,
> 
> Diff at the end. Only changed manpage, so you can ignore it Jan :)
> Thanks for the feedback so far.
> 
> Questions:
> 
> 1. For the manpage, do I have to handle the RCS ID myself?
> This question also extends to code in general.

This should be "/*     $OpenBSD$       */" macro.

> 2. How are new features requiring a lot of changes handled around here?
> I looked through a couple commits and they follow this format:
> 
> - asks "ok?"
> - waits
> - commits them upon "ok name@"
> 
> but they're mostly core devs with write access to the repo, and the
> commits are small.
>

'OK' from someone means this person assumes the proposed  diff is
correct. However, if someone is not agree with proposed diff it will not
be pushed even it was already OK'ed.

> Anyway, fixed all manpage lints except for
> 
> mandoc: share/man/man4/man4.arm64/rpicpu.4: STYLE: RCS id missing: (OpenBSD)
> 
> It looks like drivers don't really have man9,
> so removed reference to bcmclock_set_frequency(9).
> 
> > Also. Does the `sc_post_lock' really required to be rwlock? Mutex seems
> > to be more reasonable here.
> 
> bcmmbox_post(9) calls bcmmbox_read(9) which sleeps when !cold.
> Can't hold a mutex while sleeping, no?
> 

Thanks, I see. I expected bcmmbox*() have ho sleep points within. And
may be they should not. 

> 
> > I see the temperature is much higher with your diff. Even while my RPI
> > does nothing and hw.perfpolicy is set to 'auto' I see the lowest
> > temperature is about 49 degrees. Without your diff this idling RPI is
> > around 42 degrees. I don't think this is an expected behavior.
> 
> I see minimal temperature difference with/without the patch.
> It took Pi 4B a while for temperature to stabilize from unused-for-days start.
> I saw up to a 7C difference.
> 
> Methodology: Let it rest for at least 10 minutes after boot.
> 22C room, no sunlight. 5 samples each.
> 
> while true; do sysctl hw.sensors.bcmtmon0.temp0; sleep 60; done
>

I do the same, but with 1 or 10 seconds interval. And I see it is much
hotter. I hadn't used thermal imager, but check with my fingers exposes
the same. Jan's answer to my question about temperature shows the
measurements very close to my own. So I guess he has the same behavior.
To me the behavior with your diff is very close to setting 'arm_freq'
and 'over_voltage' in config.txt.

Look. Your diff only introduces CPU frequency switching between 600 and
1500 MHz. We don't have smooth scaling, so only min and max values. This
mean while I have 'hw.perfpolicy=high' with 'hw.cpuspeed=1500' the
behavior should be the same as it is without your diff. I should have no
performance impact, I should have ho temperature impact. But I have.
This means even we are running at 1500 MHz the 'voltage' setting is too
high, and/or in fact we an not at 1500 MHz. So, I think the frequency
setting is not enough, you need to control voltage too.

Your diff add significant performance impact and I like the direction.
However it makes RPI4 hotter up to 70 deg with the default settings.
This is unacceptable because users must rework their cooling scheme.