linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ben Schneider <ben@bens.haus>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Benjamin Schneider <bschnei@gmail.com>,
	Gregory Clement <gregory.clement@bootlin.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Linux Arm Kernel <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cpufreq: enable 1200Mhz clock speed for armada-37xx
Date: Mon, 3 Jun 2024 21:33:19 +0200 (CEST)	[thread overview]
Message-ID: <NzURcjd--3-9@bens.haus> (raw)
In-Reply-To: <f2284d6b-2e75-4896-9e10-caf2f72854a0@lunn.ch>

Jun 3, 2024, 05:46 by andrew@lunn.ch:

> The problem is, most systems don't have the new bootloader. And so if
> you enable 1.2GHz, they are going to be unstable.
>
Based on my testing, the A3720 was unstable using a bootloader built
with Marvell's source without regard to clock speed or frequency scaling.

That is, it didn't matter if 1.2Ghz was enabled or not, and it didn't matter
if cpufreq-dt was loaded or not, my devices were reliably crashing when
trying to use Marvell's source instead of Globalscale's for building the
bootloader. When I dug in to find the difference, this DDRPHY setting
was one of two that I found. I also found that setting it to the value in
Globalscale's repos restored stability to the devices.

I then tested 1.2Ghz bootloader speeds as well as frequency scaling and
found that they worked fine. I've been keeping track here:
https://github.com/bschnei/ebu-bootloader

> Rather than making this unconditional, i think it needs to be
> conditional on knowing the bootloader has been upgraded. Could you add
> code which looks in the DDRPHY and see if 0xC0001004 has the correct
> value. Only then enable the additional clock speed.
>
I think there are two potential issues with doing something like that. First,
that DDRPHY value has been flipped back and forth. The change I
submitted to Marvell just undoes this change from January 2021:
https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/commit/c3a8d3c7ff4bd460770b0cf601e57a6f70cb1871
Perhaps it would be OK if the older code is also stable, but I haven't
tested it.

Second, the value seems to be deliberately different for other memory
configurations (DDR3) which makes the conditional logic more complex
if it's meant to work for all A37XX variants, and I don't have other variants
to test.

Given the history of this setting getting flipped back and forth, and
having read through a few old threads on this subject, it's my theory
that some of the instability issues that were attributed to kernel frequency
scaling and/or 1.2Ghz as a speed were more likely attributable to bad
bootloaders all along. I've reached out to Armbian and Arch communities
to let them know in the hope of finding other users of these devices
that might be willing to test, but have not received any responses.

It's also worth noting that my devices came from the factory with the
bootloader clocked at 800Mhz. I'm pretty sure the OS cannot set a
speed above the bootloader clock speed. As a result, at least for the
ESPRESSObin Ultra, the only devices I would expect to break are those
where users have put in the work to build (or taken the risk of flashing)
a bootloader clocked at 1.2Ghz. When the kernel encounters one of
those devices it currently disables frequency scaling entirely (cpufreq-dt
will not load) leaving them to run at full speed constantly. If there are
users who can't/won't update their bootloader and for which frequency
scaling is unstable, it seems like it would make more sense and facilitate
further testing to use kernel config or userspace tools as the place to
disable scaling.

Thanks!

Ben

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-06-03 19:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03  1:26 [PATCH] cpufreq: enable 1200Mhz clock speed for armada-37xx Benjamin Schneider
2024-06-03  1:26 ` Benjamin Schneider
2024-06-03 12:46   ` Andrew Lunn
2024-06-03 19:33     ` Ben Schneider [this message]
2024-06-05 19:44   ` Pali Rohár
2024-06-05 23:44     ` Andrew Lunn
2024-07-11 16:59       ` Ben Schneider
2024-07-16  8:51         ` Gregory CLEMENT
2024-09-09 13:00           ` Ben Schneider
2024-10-13  3:01           ` Ben Schneider
  -- strict thread matches above, loose matches on Subject: below --
2024-11-25 21:14 bschnei
2024-12-12  7:07 ` Viresh Kumar
2024-12-15 21:23   ` Marek Behún
2025-01-12 22:49     ` Ben Schneider
2025-02-03 10:57     ` Viresh Kumar
2025-02-19  5:52 ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=NzURcjd--3-9@bens.haus \
    --to=ben@bens.haus \
    --cc=andrew@lunn.ch \
    --cc=bschnei@gmail.com \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).