Thread (7 messages) 7 messages, 2 authors, 2024-08-29

Re: [PATCH] mfd: syscon: Set max_register_is_0 when syscon points to a single register

From: Mark Brown <broonie@kernel.org>
Date: 2024-08-28 12:57:46
Also in: lkml

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.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help