Re: [PATCH 2/6] cpufreq: sun50i: Move nvmem cell reading into a helper

From: Alexander Sverdlin

Date: Tue Nov 17 2026 - 17:34:59 EST


Hi Rajan,

thank you for the series!

On Wed, 2026-11-04 at 22:40 -0600, Rajan Yadav via B4 Relay wrote:
> From: Rajan Yadav <rajanyadav0307@xxxxxxxxx>
>
> The A133 speed grade needs several efuse cells, but the cell reading
> is open coded in sun50i_cpufreq_get_efuse() for a single cell. Move it
> into sun50i_cpufreq_read_cell(), which takes the cell name, so the next
> patch can read the A133 cells by name.
>
> No functional change: the existing users read the first cell, as
> before, with the same length check, byte order and error message. The
> raw bytes are now held in a __le32, the type le32_to_cpu() expects,
> which also removes the sparse warning "cast to restricted __le32" that
> the kernel test robot reported.
>
> Claude Code (Anthropic) drafted this refactor and its message; I
> reviewed and tested it.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202603021703.aBD0w99y-lkp@xxxxxxxxx/
> Signed-off-by: Rajan Yadav <rajanyadav0307@xxxxxxxxx>

I've tested the series on A133 "marking 0x1400, bin 4, revision 6: speed grade 9":

Vendor build had scaling_max_freq == 1512000.
Upstream before the patch scaling_max_freq == 1464000.
With your series scaling_max_freq == 1512000.

I also tried to set 1008000 and 1512000 and `mhz` tool
reports cpu_MHz=1005.475 and cpu_MHz=1509.625 respectively.

Reviewed-by: Alexander Sverdlin <alex@xxxxxxxxxxxx>
Tested-by: Alexander Sverdlin <alex@xxxxxxxxxxxx>

> ---
>  drivers/cpufreq/sun50i-cpufreq-nvmem.c | 55 ++++++++++++++++++++--------------
>  1 file changed, 33 insertions(+), 22 deletions(-)