[PATCH 2/7] pinctrl: bcm281xx: Fix incorrect regmap max_registers value

Artur Weber posted 7 patches 1 year ago
There is a newer version of this series
[PATCH 2/7] pinctrl: bcm281xx: Fix incorrect regmap max_registers value
Posted by Artur Weber 1 year ago
The max_registers value does not take into consideration the stride;
currently, it's set to the number of the last pin, but this does not
accurately represent the final register.

Fix this by multiplying the current value by 4.

Fixes: 54b1aa5a5b16 ("ARM: pinctrl: Add Broadcom Capri pinctrl driver")
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
 drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c
index 73dbf29c002f39cde71352c1bf806872dd218b62..cf6efa9c0364a1ad65885c982e7634f26d19c944 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c
@@ -974,7 +974,7 @@ static const struct regmap_config bcm281xx_pinctrl_regmap_config = {
 	.reg_bits = 32,
 	.reg_stride = 4,
 	.val_bits = 32,
-	.max_register = BCM281XX_PIN_VC_CAM3_SDA,
+	.max_register = BCM281XX_PIN_VC_CAM3_SDA * 4,
 };
 
 static int bcm281xx_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)

-- 
2.48.1
Re: [PATCH 2/7] pinctrl: bcm281xx: Fix incorrect regmap max_registers value
Posted by Linus Walleij 11 months, 4 weeks ago
On Fri, Feb 7, 2025 at 9:02 PM Artur Weber <aweber.kernel@gmail.com> wrote:

> The max_registers value does not take into consideration the stride;
> currently, it's set to the number of the last pin, but this does not
> accurately represent the final register.
>
> Fix this by multiplying the current value by 4.
>
> Fixes: 54b1aa5a5b16 ("ARM: pinctrl: Add Broadcom Capri pinctrl driver")
> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>

This looks like it could be causing regressions so I pulled this patch out
and applied it for fixes.

Yours,
Linus Walleij
Re: [PATCH 2/7] pinctrl: bcm281xx: Fix incorrect regmap max_registers value
Posted by Artur Weber 11 months, 4 weeks ago
On 14.02.2025 10:03, Linus Walleij wrote:
> On Fri, Feb 7, 2025 at 9:02 PM Artur Weber <aweber.kernel@gmail.com> wrote:
> 
>> The max_registers value does not take into consideration the stride;
>> currently, it's set to the number of the last pin, but this does not
>> accurately represent the final register.
>>
>> Fix this by multiplying the current value by 4.
>>
>> Fixes: 54b1aa5a5b16 ("ARM: pinctrl: Add Broadcom Capri pinctrl driver")
>> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
> 
> This looks like it could be causing regressions so I pulled this patch out
> and applied it for fixes.

Thanks. I assume this means this patch can be dropped from the next version
of this patchset now? If so, which branch contains the patch so that I can
rebase the next version of this patchset on it? I've checked the "fixes",
"devel" and "for-next" branches of linux-pinctrl.git[1] but did not see it
in any of them.

Best regards
Artur

[1] https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=fixes