Re: [PATCH] mfd: syscon: Set max_register_is_0 when syscon points to a single register
From: Mark Brown
Date: Wed Aug 28 2024 - 08:57:52 EST
On Wed, Aug 28, 2024 at 07:10:08AM -0500, Nishanth Menon wrote:
> Commit 0ec74ad3c157 ("regmap: rework ->max_register handling")
> introduced explicit handling in regmap framework for register maps
> that is exactly 1 register wide. As a result, a syscon pointing
> to a single register would cause regmap checks to skip checks
> (or in the case of regmap_get_max_register, return -EINVAL) as
> max_register_is_set will not be true.
In what sense is the behaviour changed for a map that doesn't specify a
maximum register?
> Fixes: 0ec74ad3c157 ("regmap: rework ->max_register handling")
In what sense is this a fix?
> + if (!syscon_config.max_register)
> + syscon_config.max_register_is_0 = true;
This will cause any syscon which does not explicitly specify a maximum
register to be converted to having only one register at number 0. That
really does not seem like a good idea - unless you've done an audit of
every single syscon to make sure they do explicitly specify a maximum
register, and confirmed that this can't be specified via DT, then it's
going to break things.
Attachment:
signature.asc
Description: PGP signature