drivers/pinctrl/bcm/pinctrl-bcm63268.c | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+)
There is no guarantee that the bootloader will leave the pin configuration
in a known default state, so pinctrl needs to be explicitly set in some
cases. This patch adds a gpio function for drivers that need it, i.e.
gpio-leds.
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
---
drivers/pinctrl/bcm/pinctrl-bcm63268.c | 68 ++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm63268.c b/drivers/pinctrl/bcm/pinctrl-bcm63268.c
index 80c2fc55ffa2..5ad86b40f0b3 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm63268.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm63268.c
@@ -38,6 +38,7 @@ enum bcm63268_pinctrl_reg {
BCM63268_MODE,
BCM63268_CTRL,
BCM63268_BASEMODE,
+ BCM63268_NOREG,
};
struct bcm63268_function {
@@ -242,6 +243,61 @@ static struct pingroup bcm63268_groups[] = {
BCM_PIN_GROUP(vdsl_phy3_grp),
};
+static const char * const gpio_groups[] = {
+ "gpio0",
+ "gpio1",
+ "gpio2",
+ "gpio3",
+ "gpio4",
+ "gpio5",
+ "gpio6",
+ "gpio7",
+ "gpio8",
+ "gpio9",
+ "gpio10",
+ "gpio11",
+ "gpio12",
+ "gpio13",
+ "gpio14",
+ "gpio15",
+ "gpio16",
+ "gpio17",
+ "gpio18",
+ "gpio19",
+ "gpio20",
+ "gpio21",
+ "gpio22",
+ "gpio23",
+ "gpio24",
+ "gpio25",
+ "gpio26",
+ "gpio27",
+ "gpio28",
+ "gpio29",
+ "gpio30",
+ "gpio31",
+ "gpio32",
+ "gpio33",
+ "gpio34",
+ "gpio35",
+ "gpio36",
+ "gpio37",
+ "gpio38",
+ "gpio39",
+ "gpio40",
+ "gpio41",
+ "gpio42",
+ "gpio43",
+ "gpio44",
+ "gpio45",
+ "gpio46",
+ "gpio47",
+ "gpio48",
+ "gpio49",
+ "gpio50",
+ "gpio51",
+};
+
static const char * const led_groups[] = {
"gpio0",
"gpio1",
@@ -427,7 +483,16 @@ static const char * const vdsl_phy_override_3_groups[] = {
.mask = val, \
}
+#define BCM63268_NOMODE_FUN(n) \
+ { \
+ .name = #n, \
+ .groups = n##_groups, \
+ .num_groups = ARRAY_SIZE(n##_groups), \
+ .reg = BCM63268_NOREG, \
+ }
+
static const struct bcm63268_function bcm63268_funcs[] = {
+ BCM63268_NOMODE_FUN(gpio),
BCM63268_LED_FUN(led),
BCM63268_MODE_FUN(serial_led_clk),
BCM63268_MODE_FUN(serial_led_data),
@@ -562,6 +627,9 @@ static int bcm63268_pinctrl_set_mux(struct pinctrl_dev *pctldev,
mask = f->mask;
val = f->mask;
break;
+ case BCM63268_NOREG:
+ /*Do nothing, leave registers as default*/
+ break;
default:
WARN_ON(1);
return -EINVAL;
--
2.43.0
Hi Kyle,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linusw-pinctrl/devel]
[also build test WARNING on linusw-pinctrl/for-next linus/master v6.13-rc1 next-20241206]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kyle-Hendry/pinctrl-bcm63268-Add-gpio-function/20241208-063718
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link: https://lore.kernel.org/r/20241207223335.17535-1-kylehendrydev%40gmail.com
patch subject: [PATCH] pinctrl: bcm63268: Add gpio function
config: x86_64-buildonly-randconfig-005-20241208 (https://download.01.org/0day-ci/archive/20241208/202412081215.VyJuftPL-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412081215.VyJuftPL-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412081215.VyJuftPL-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/pinctrl/bcm/pinctrl-bcm63268.c:630:7: warning: variable 'reg' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
630 | case BCM63268_NOREG:
| ^~~~~~~~~~~~~~
drivers/pinctrl/bcm/pinctrl-bcm63268.c:638:31: note: uninitialized use occurs here
638 | regmap_update_bits(pc->regs, reg, mask, val);
| ^~~
drivers/pinctrl/bcm/pinctrl-bcm63268.c:603:18: note: initialize the variable 'reg' to silence this warning
603 | unsigned int reg;
| ^
| = 0
>> drivers/pinctrl/bcm/pinctrl-bcm63268.c:630:7: warning: variable 'mask' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
630 | case BCM63268_NOREG:
| ^~~~~~~~~~~~~~
drivers/pinctrl/bcm/pinctrl-bcm63268.c:638:36: note: uninitialized use occurs here
638 | regmap_update_bits(pc->regs, reg, mask, val);
| ^~~~
drivers/pinctrl/bcm/pinctrl-bcm63268.c:604:24: note: initialize the variable 'mask' to silence this warning
604 | unsigned int val, mask;
| ^
| = 0
>> drivers/pinctrl/bcm/pinctrl-bcm63268.c:630:7: warning: variable 'val' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
630 | case BCM63268_NOREG:
| ^~~~~~~~~~~~~~
drivers/pinctrl/bcm/pinctrl-bcm63268.c:638:42: note: uninitialized use occurs here
638 | regmap_update_bits(pc->regs, reg, mask, val);
| ^~~
drivers/pinctrl/bcm/pinctrl-bcm63268.c:604:18: note: initialize the variable 'val' to silence this warning
604 | unsigned int val, mask;
| ^
| = 0
3 warnings generated.
vim +/reg +630 drivers/pinctrl/bcm/pinctrl-bcm63268.c
595
596 static int bcm63268_pinctrl_set_mux(struct pinctrl_dev *pctldev,
597 unsigned selector, unsigned group)
598 {
599 struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
600 const struct pingroup *pg = &bcm63268_groups[group];
601 const struct bcm63268_function *f = &bcm63268_funcs[selector];
602 unsigned i;
603 unsigned int reg;
604 unsigned int val, mask;
605
606 for (i = 0; i < pg->npins; i++)
607 bcm63268_set_gpio(pc, pg->pins[i]);
608
609 switch (f->reg) {
610 case BCM63268_LEDCTRL:
611 reg = BCM63268_LED_REG;
612 mask = BIT(pg->pins[0]);
613 val = BIT(pg->pins[0]);
614 break;
615 case BCM63268_MODE:
616 reg = BCM63268_MODE_REG;
617 mask = BIT(pg->pins[0]);
618 val = BIT(pg->pins[0]);
619 break;
620 case BCM63268_CTRL:
621 reg = BCM63268_CTRL_REG;
622 mask = BIT(pg->pins[0]);
623 val = 0;
624 break;
625 case BCM63268_BASEMODE:
626 reg = BCM63268_BASEMODE_REG;
627 mask = f->mask;
628 val = f->mask;
629 break;
> 630 case BCM63268_NOREG:
631 /*Do nothing, leave registers as default*/
632 break;
633 default:
634 WARN_ON(1);
635 return -EINVAL;
636 }
637
638 regmap_update_bits(pc->regs, reg, mask, val);
639
640 return 0;
641 }
642
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
From: Kyle Hendry <kylehendrydev@gmail.com>
There is no guarantee that the bootloader will leave the pin configuration
in a known default state, so pinctrl needs to be explicitly set in some
cases. This patch adds a gpio function for drivers that need it, i.e.
gpio-leds.
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
drivers/pinctrl/bcm/pinctrl-bcm63268.c | 71 +++++++++++++++++++++++++-
1 file changed, 70 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm63268.c b/drivers/pinctrl/bcm/pinctrl-bcm63268.c
index 80c2fc55ffa2..a98f57e64d1e 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm63268.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm63268.c
@@ -34,6 +34,7 @@
#define BCM63268_BASEMODE_VDSL_PHY_3 BIT(9) /* GPIOs 26/27 */
enum bcm63268_pinctrl_reg {
+ BCM63268_NONE,
BCM63268_LEDCTRL,
BCM63268_MODE,
BCM63268_CTRL,
@@ -242,6 +243,61 @@ static struct pingroup bcm63268_groups[] = {
BCM_PIN_GROUP(vdsl_phy3_grp),
};
+static const char * const gpio_groups[] = {
+ "gpio0",
+ "gpio1",
+ "gpio2",
+ "gpio3",
+ "gpio4",
+ "gpio5",
+ "gpio6",
+ "gpio7",
+ "gpio8",
+ "gpio9",
+ "gpio10",
+ "gpio11",
+ "gpio12",
+ "gpio13",
+ "gpio14",
+ "gpio15",
+ "gpio16",
+ "gpio17",
+ "gpio18",
+ "gpio19",
+ "gpio20",
+ "gpio21",
+ "gpio22",
+ "gpio23",
+ "gpio24",
+ "gpio25",
+ "gpio26",
+ "gpio27",
+ "gpio28",
+ "gpio29",
+ "gpio30",
+ "gpio31",
+ "gpio32",
+ "gpio33",
+ "gpio34",
+ "gpio35",
+ "gpio36",
+ "gpio37",
+ "gpio38",
+ "gpio39",
+ "gpio40",
+ "gpio41",
+ "gpio42",
+ "gpio43",
+ "gpio44",
+ "gpio45",
+ "gpio46",
+ "gpio47",
+ "gpio48",
+ "gpio49",
+ "gpio50",
+ "gpio51",
+};
+
static const char * const led_groups[] = {
"gpio0",
"gpio1",
@@ -394,6 +450,14 @@ static const char * const vdsl_phy_override_3_groups[] = {
"vdsl_phy_override_3_grp",
};
+#define BCM63268_GPIO_FUN(n) \
+ { \
+ .name = #n, \
+ .groups = n##_groups, \
+ .num_groups = ARRAY_SIZE(n##_groups), \
+ .reg = BCM63268_NONE, \
+ }
+
#define BCM63268_LED_FUN(n) \
{ \
.name = #n, \
@@ -428,6 +492,7 @@ static const char * const vdsl_phy_override_3_groups[] = {
}
static const struct bcm63268_function bcm63268_funcs[] = {
+ BCM63268_GPIO_FUN(gpio),
BCM63268_LED_FUN(led),
BCM63268_MODE_FUN(serial_led_clk),
BCM63268_MODE_FUN(serial_led_data),
@@ -542,6 +607,9 @@ static int bcm63268_pinctrl_set_mux(struct pinctrl_dev *pctldev,
bcm63268_set_gpio(pc, pg->pins[i]);
switch (f->reg) {
+ case BCM63268_NONE:
+ reg = 0;
+ break;
case BCM63268_LEDCTRL:
reg = BCM63268_LED_REG;
mask = BIT(pg->pins[0]);
@@ -567,7 +635,8 @@ static int bcm63268_pinctrl_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
}
- regmap_update_bits(pc->regs, reg, mask, val);
+ if (reg)
+ regmap_update_bits(pc->regs, reg, mask, val);
return 0;
}
--
2.39.5
Hi, On Tue, Dec 24, 2024 at 11:41 AM Álvaro Fernández Rojas <noltari@gmail.com> wrote: > > From: Kyle Hendry <kylehendrydev@gmail.com> > > There is no guarantee that the bootloader will leave the pin configuration > in a known default state, so pinctrl needs to be explicitly set in some > cases. This patch adds a gpio function for drivers that need it, i.e. > gpio-leds. > > Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> > Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> bcm63268-pinctrl implements pinmux_ops::gpio_request_enable(), which should automatically set any requested GPIO pin to the GPIO function, so explicitly requesting the gpio function for a pin should not be needed. Is this not enough? Best Regards, Jonas
On 2024-12-30 08:42, Jonas Gorski wrote: > Hi, > > On Tue, Dec 24, 2024 at 11:41 AM Álvaro Fernández Rojas > <noltari@gmail.com> wrote: >> From: Kyle Hendry <kylehendrydev@gmail.com> >> >> There is no guarantee that the bootloader will leave the pin configuration >> in a known default state, so pinctrl needs to be explicitly set in some >> cases. This patch adds a gpio function for drivers that need it, i.e. >> gpio-leds. >> >> Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> >> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> > > bcm63268-pinctrl implements pinmux_ops::gpio_request_enable(), which > should automatically set any requested GPIO pin to the GPIO function, > so explicitly requesting the gpio function for a pin should not be > needed. Is this not enough? > > Best Regards, > Jonas > > I assumed that as well, but nothing I tried worked with gpio-leds. gpiochip_generic_request() does call gpio_request_enable(), but gpio-leds uses devm_fwnode_gpiod_get() which looks like a different code path. The only place it seems to be configuring the gpio is in create_gpio_led() where it needs a pinctl node in the device tree. That's just my reading of the code, though. I haven't set up a ftrace to verify it. Best Regards, Kyle
El vie, 3 ene 2025 a las 4:04, Kyle Hendry (<kylehendrydev@gmail.com>) escribió: > > On 2024-12-30 08:42, Jonas Gorski wrote: > > Hi, > > > > On Tue, Dec 24, 2024 at 11:41 AM Álvaro Fernández Rojas > > <noltari@gmail.com> wrote: > >> From: Kyle Hendry <kylehendrydev@gmail.com> > >> > >> There is no guarantee that the bootloader will leave the pin configuration > >> in a known default state, so pinctrl needs to be explicitly set in some > >> cases. This patch adds a gpio function for drivers that need it, i.e. > >> gpio-leds. > >> > >> Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> > >> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> > > > > bcm63268-pinctrl implements pinmux_ops::gpio_request_enable(), which > > should automatically set any requested GPIO pin to the GPIO function, > > so explicitly requesting the gpio function for a pin should not be > > needed. Is this not enough? > > > > Best Regards, > > Jonas > > > > > I assumed that as well, but nothing I tried worked with gpio-leds. > gpiochip_generic_request() does call gpio_request_enable(), but gpio-leds > uses devm_fwnode_gpiod_get() which looks like a different code path. The > only place it seems to be configuring the gpio is in create_gpio_led() > where it needs a pinctl node in the device tree. That's just my reading > of the code, though. I haven't set up a ftrace to verify it. > > Best Regards, > Kyle As Kyle pointed out it's not enough and gpio_request_enable() doesn't get called from gpio-leds. I will try to investigate this and report back. Best regards, Álvaro.
El sáb, 4 ene 2025 a las 16:44, Álvaro Fernández Rojas (<noltari@gmail.com>) escribió: > > El vie, 3 ene 2025 a las 4:04, Kyle Hendry (<kylehendrydev@gmail.com>) escribió: > > > > On 2024-12-30 08:42, Jonas Gorski wrote: > > > Hi, > > > > > > On Tue, Dec 24, 2024 at 11:41 AM Álvaro Fernández Rojas > > > <noltari@gmail.com> wrote: > > >> From: Kyle Hendry <kylehendrydev@gmail.com> > > >> > > >> There is no guarantee that the bootloader will leave the pin configuration > > >> in a known default state, so pinctrl needs to be explicitly set in some > > >> cases. This patch adds a gpio function for drivers that need it, i.e. > > >> gpio-leds. > > >> > > >> Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> > > >> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> > > > > > > bcm63268-pinctrl implements pinmux_ops::gpio_request_enable(), which > > > should automatically set any requested GPIO pin to the GPIO function, > > > so explicitly requesting the gpio function for a pin should not be > > > needed. Is this not enough? > > > > > > Best Regards, > > > Jonas > > > > > > > > I assumed that as well, but nothing I tried worked with gpio-leds. > > gpiochip_generic_request() does call gpio_request_enable(), but gpio-leds > > uses devm_fwnode_gpiod_get() which looks like a different code path. The > > only place it seems to be configuring the gpio is in create_gpio_led() > > where it needs a pinctl node in the device tree. That's just my reading > > of the code, though. I haven't set up a ftrace to verify it. > > > > Best Regards, > > Kyle > > As Kyle pointed out it's not enough and gpio_request_enable() doesn't > get called from gpio-leds. > I will try to investigate this and report back. > > Best regards, > Álvaro. I've performed some tests and so far I haven't been able to get bcm63268_gpio_request_enable() called. Even exporting a gpio from userspace doesn't trigger that function, which seems strange because in that case we won't have a "gpio" function on the pinctrl for that gpio, even with this patch... Best regards, Álvaro.
On Sat, Jan 4, 2025 at 6:02 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote: > > El sáb, 4 ene 2025 a las 16:44, Álvaro Fernández Rojas > (<noltari@gmail.com>) escribió: > > > > El vie, 3 ene 2025 a las 4:04, Kyle Hendry (<kylehendrydev@gmail.com>) escribió: > > > > > > On 2024-12-30 08:42, Jonas Gorski wrote: > > > > Hi, > > > > > > > > On Tue, Dec 24, 2024 at 11:41 AM Álvaro Fernández Rojas > > > > <noltari@gmail.com> wrote: > > > >> From: Kyle Hendry <kylehendrydev@gmail.com> > > > >> > > > >> There is no guarantee that the bootloader will leave the pin configuration > > > >> in a known default state, so pinctrl needs to be explicitly set in some > > > >> cases. This patch adds a gpio function for drivers that need it, i.e. > > > >> gpio-leds. > > > >> > > > >> Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> > > > >> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> > > > > > > > > bcm63268-pinctrl implements pinmux_ops::gpio_request_enable(), which > > > > should automatically set any requested GPIO pin to the GPIO function, > > > > so explicitly requesting the gpio function for a pin should not be > > > > needed. Is this not enough? > > > > > > > > Best Regards, > > > > Jonas > > > > > > > > > > > I assumed that as well, but nothing I tried worked with gpio-leds. > > > gpiochip_generic_request() does call gpio_request_enable(), but gpio-leds > > > uses devm_fwnode_gpiod_get() which looks like a different code path. The > > > only place it seems to be configuring the gpio is in create_gpio_led() > > > where it needs a pinctl node in the device tree. That's just my reading > > > of the code, though. I haven't set up a ftrace to verify it. > > > > > > Best Regards, > > > Kyle > > > > As Kyle pointed out it's not enough and gpio_request_enable() doesn't > > get called from gpio-leds. > > I will try to investigate this and report back. > > > > Best regards, > > Álvaro. > > I've performed some tests and so far I haven't been able to get > bcm63268_gpio_request_enable() called. > > Even exporting a gpio from userspace doesn't trigger that function, > which seems strange because in that case we won't have a "gpio" > function on the pinctrl for that gpio, even with this patch... On a first glance it looks like that regmap-gpio does not populate gpio_chip::request and gpio_chip:free, so the gpio subsystem is not aware that it needs to request anything. Not sure if just using gpiolib_generic_request() / gpiolib_generic_free() is fine. Currently on vacation, so no hardware to test anything at hand ;-) Best Regards, Jonas
El sáb, 4 ene 2025 a las 20:32, Jonas Gorski (<jonas.gorski@gmail.com>) escribió: > > On Sat, Jan 4, 2025 at 6:02 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote: > > > > El sáb, 4 ene 2025 a las 16:44, Álvaro Fernández Rojas > > (<noltari@gmail.com>) escribió: > > > > > > El vie, 3 ene 2025 a las 4:04, Kyle Hendry (<kylehendrydev@gmail.com>) escribió: > > > > > > > > On 2024-12-30 08:42, Jonas Gorski wrote: > > > > > Hi, > > > > > > > > > > On Tue, Dec 24, 2024 at 11:41 AM Álvaro Fernández Rojas > > > > > <noltari@gmail.com> wrote: > > > > >> From: Kyle Hendry <kylehendrydev@gmail.com> > > > > >> > > > > >> There is no guarantee that the bootloader will leave the pin configuration > > > > >> in a known default state, so pinctrl needs to be explicitly set in some > > > > >> cases. This patch adds a gpio function for drivers that need it, i.e. > > > > >> gpio-leds. > > > > >> > > > > >> Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> > > > > >> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> > > > > > > > > > > bcm63268-pinctrl implements pinmux_ops::gpio_request_enable(), which > > > > > should automatically set any requested GPIO pin to the GPIO function, > > > > > so explicitly requesting the gpio function for a pin should not be > > > > > needed. Is this not enough? > > > > > > > > > > Best Regards, > > > > > Jonas > > > > > > > > > > > > > > I assumed that as well, but nothing I tried worked with gpio-leds. > > > > gpiochip_generic_request() does call gpio_request_enable(), but gpio-leds > > > > uses devm_fwnode_gpiod_get() which looks like a different code path. The > > > > only place it seems to be configuring the gpio is in create_gpio_led() > > > > where it needs a pinctl node in the device tree. That's just my reading > > > > of the code, though. I haven't set up a ftrace to verify it. > > > > > > > > Best Regards, > > > > Kyle > > > > > > As Kyle pointed out it's not enough and gpio_request_enable() doesn't > > > get called from gpio-leds. > > > I will try to investigate this and report back. > > > > > > Best regards, > > > Álvaro. > > > > I've performed some tests and so far I haven't been able to get > > bcm63268_gpio_request_enable() called. > > > > Even exporting a gpio from userspace doesn't trigger that function, > > which seems strange because in that case we won't have a "gpio" > > function on the pinctrl for that gpio, even with this patch... > > On a first glance it looks like that regmap-gpio does not populate > gpio_chip::request and gpio_chip:free, so the gpio subsystem is not > aware that it needs to request anything. Not sure if just using > gpiolib_generic_request() / gpiolib_generic_free() is fine. Currently > on vacation, so no hardware to test anything at hand ;-) > > Best Regards, > Jonas You're totally right, after adding request() and free() functions to gpio-regmap it's now working without this patch because bcm63268_gpio_request_enable() is now properly called: 1. gpio-keys-polled [ 4.052132] gpio_button_hotplug: loading out-of-tree module taints kernel. [ 4.060657] bcm63268-pinctrl 100000d0.pinctrl: request pin 34 (gpio34) for 100000d0.pinctrl:546 [ 4.069704] bcm63268_gpio_request_enable: range=99a2e0ae offset=34 [ 4.076158] bcm63268-pinctrl 100000d0.pinctrl: request pin 35 (gpio35) for 100000d0.pinctrl:547 [ 4.085135] bcm63268_gpio_request_enable: range=99a2e0ae offset=35 2. gpio-leds [ 4.480190] bcm63268-pinctrl 100000d0.pinctrl: request pin 0 (gpio0) for 100000d0.pinctrl:512 [ 4.489078] bcm63268_gpio_request_enable: range=99a2e0ae offset=0 [ 4.495747] bcm63268-pinctrl 100000d0.pinctrl: request pin 1 (gpio1) for 100000d0.pinctrl:513 [ 4.504600] bcm63268_gpio_request_enable: range=99a2e0ae offset=1 3. userspace gpio export root@OpenWrt:~# cat /sys/kernel/debug/gpio gpiochip0: GPIOs 512-563, parent: platform/100000d0.pinctrl, 100000d0.pinctrl: gpio-512 ( |red:mobile ) out lo gpio-513 ( |green:mobile ) out lo gpio-546 ( |wps ) in hi ACTIVE LOW gpio-547 ( |reset ) in hi ACTIVE LOW root@OpenWrt:~# echo 545 > /sys/class/gpio/export [ 33.437477] bcm63268-pinctrl 100000d0.pinctrl: request pin 33 (gpio33) for 100000d0.pinctrl:545 [ 33.446503] bcm63268_gpio_request_enable: range=99a2e0ae offset=33 root@OpenWrt:~# cat /sys/kernel/debug/gpio gpiochip0: GPIOs 512-563, parent: platform/100000d0.pinctrl, 100000d0.pinctrl: gpio-512 ( |red:mobile ) out lo gpio-513 ( |green:mobile ) out lo gpio-545 ( |sysfs ) in hi gpio-546 ( |wps ) in hi ACTIVE LOW gpio-547 ( |reset ) in hi ACTIVE LOW OpenWrt test source code: https://github.com/Noltari/openwrt/commits/bmips-gpio-tests https://github.com/Noltari/openwrt/commit/d3bc7610c8fe8f713a3e47ed8368b6aa220ae763 Linux test source code: https://github.com/Noltari/linux/commits/gpio-regmap-pinctrl-request-free https://github.com/Noltari/linux/commit/2d0ebb8cad8084e932f40f3f69d4e931b2316aa4 @Linus I assume that adding those functions may cause issues to other drivers and maybe we need to add some logic to add them dynamically based on a new gpio_regmap_config parameter? Best regards, Álvaro.
On Tue, Dec 24, 2024 at 11:36 AM Álvaro Fernández Rojas <noltari@gmail.com> wrote: > From: Kyle Hendry <kylehendrydev@gmail.com> > > There is no guarantee that the bootloader will leave the pin configuration > in a known default state, so pinctrl needs to be explicitly set in some > cases. This patch adds a gpio function for drivers that need it, i.e. > gpio-leds. > > Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> > Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> This looks right to me, but can we get some review from some of the Broadcom people? (Hm it's MIPS so I guess that means Florian.) Yours, Linus Walleij
El vie, 27 dic 2024 a las 17:17, Linus Walleij (<linus.walleij@linaro.org>) escribió: > > On Tue, Dec 24, 2024 at 11:36 AM Álvaro Fernández Rojas > <noltari@gmail.com> wrote: > > > From: Kyle Hendry <kylehendrydev@gmail.com> > > > > There is no guarantee that the bootloader will leave the pin configuration > > in a known default state, so pinctrl needs to be explicitly set in some > > cases. This patch adds a gpio function for drivers that need it, i.e. > > gpio-leds. > > > > Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> > > Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> > > This looks right to me, but can we get some review from some > of the Broadcom people? (Hm it's MIPS so I guess that means > Florian.) > > Yours, > Linus Walleij Thanks Linus :) BTW, I think that other bcm63xx pinctrl drivers need that fix too (or at least bcm6362). Can anyone confirm it? Best regards, Álvaro.
© 2016 - 2025 Red Hat, Inc.