linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors
@ 2025-10-20  8:51 William Breathitt Gray
  2025-10-20  8:51 ` [PATCH v2 1/3] gpio: 104-idio-16: Define maximum valid register address offset William Breathitt Gray
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: William Breathitt Gray @ 2025-10-20  8:51 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko
  Cc: Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, William Breathitt Gray,
	Mark Cave-Ayland, stable

The migration of IDIO-16 GPIO drivers to the regmap API resulted in some
regressions to the gpio-104-idio-16, gpio-pci-idio-16, and gpio-idio-16
modules. Specifically, the 104-idio-16 and pci-idio-16 GPIO drivers
utilize regmap caching and thus must set max_register for their
regmap_config, while gpio-idio-16 requires fixed_direction_output to
represent the fixed direction of the IDIO-16 GPIO lines. Fixes for these
regressions are provided by this series.

Link: https://lore.kernel.org/r/cover.1680618405.git.william.gray@linaro.org
Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
---
Changes in v2:
- Pick up Reviewed-by tags
- Replace Link tags with Closes tags for fixes addressing bug reports
- Link to v1: https://lore.kernel.org/r/20251017-fix-gpio-idio-16-regmap-v1-0-a7c71080f740@kernel.org

---
William Breathitt Gray (3):
      gpio: 104-idio-16: Define maximum valid register address offset
      gpio: pci-idio-16: Define maximum valid register address offset
      gpio: idio-16: Define fixed direction of the GPIO lines

 drivers/gpio/gpio-104-idio-16.c | 1 +
 drivers/gpio/gpio-idio-16.c     | 5 +++++
 drivers/gpio/gpio-pci-idio-16.c | 1 +
 3 files changed, 7 insertions(+)
---
base-commit: eba11116f39533d2e38cc5898014f2c95f32d23a
change-id: 20251017-fix-gpio-idio-16-regmap-1282cdc56a19

Best regards,
-- 
William Breathitt Gray <wbg@kernel.org>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 1/3] gpio: 104-idio-16: Define maximum valid register address offset
  2025-10-20  8:51 [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors William Breathitt Gray
@ 2025-10-20  8:51 ` William Breathitt Gray
  2025-10-20  8:51 ` [PATCH v2 2/3] gpio: pci-idio-16: " William Breathitt Gray
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: William Breathitt Gray @ 2025-10-20  8:51 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko
  Cc: Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, William Breathitt Gray,
	Mark Cave-Ayland, stable

Attempting to load the 104-idio-16 module fails during regmap
initialization with a return error -EINVAL. This is a result of the
regmap cache failing initialization. Set the idio_16_regmap_config
max_register member to fix this failure.

Fixes: 2c210c9a34a3 ("gpio: 104-idio-16: Migrate to the regmap API")
Reported-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
Suggested-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Cc: stable@vger.kernel.org
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
---
 drivers/gpio/gpio-104-idio-16.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-104-idio-16.c b/drivers/gpio/gpio-104-idio-16.c
index ffe7e1cb6b238856b9d13b2a278fe6c44b9cc8d3..fe5c10cd5c327ace1b715e9a27590211dce06fb0 100644
--- a/drivers/gpio/gpio-104-idio-16.c
+++ b/drivers/gpio/gpio-104-idio-16.c
@@ -59,6 +59,7 @@ static const struct regmap_config idio_16_regmap_config = {
 	.reg_stride = 1,
 	.val_bits = 8,
 	.io_port = true,
+	.max_register = 0x5,
 	.wr_table = &idio_16_wr_table,
 	.rd_table = &idio_16_rd_table,
 	.volatile_table = &idio_16_rd_table,

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/3] gpio: pci-idio-16: Define maximum valid register address offset
  2025-10-20  8:51 [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors William Breathitt Gray
  2025-10-20  8:51 ` [PATCH v2 1/3] gpio: 104-idio-16: Define maximum valid register address offset William Breathitt Gray
@ 2025-10-20  8:51 ` William Breathitt Gray
  2025-10-20  8:51 ` [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines William Breathitt Gray
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: William Breathitt Gray @ 2025-10-20  8:51 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko
  Cc: Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, William Breathitt Gray,
	Mark Cave-Ayland, stable

Attempting to load the pci-idio-16 module fails during regmap
initialization with a return error -EINVAL. This is a result of the
regmap cache failing initialization. Set the idio_16_regmap_config
max_register member to fix this failure.

Fixes: 73d8f3efc5c2 ("gpio: pci-idio-16: Migrate to the regmap API")
Reported-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
Suggested-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Cc: stable@vger.kernel.org
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
---
 drivers/gpio/gpio-pci-idio-16.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c
index 476cea1b5ed774d18511aaf71d8ca2d71bcc9ff0..9d28ca8e1d6fac4bdc105b850583607b5e5a87ea 100644
--- a/drivers/gpio/gpio-pci-idio-16.c
+++ b/drivers/gpio/gpio-pci-idio-16.c
@@ -41,6 +41,7 @@ static const struct regmap_config idio_16_regmap_config = {
 	.reg_stride = 1,
 	.val_bits = 8,
 	.io_port = true,
+	.max_register = 0x7,
 	.wr_table = &idio_16_wr_table,
 	.rd_table = &idio_16_rd_table,
 	.volatile_table = &idio_16_rd_table,

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines
  2025-10-20  8:51 [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors William Breathitt Gray
  2025-10-20  8:51 ` [PATCH v2 1/3] gpio: 104-idio-16: Define maximum valid register address offset William Breathitt Gray
  2025-10-20  8:51 ` [PATCH v2 2/3] gpio: pci-idio-16: " William Breathitt Gray
@ 2025-10-20  8:51 ` William Breathitt Gray
  2025-10-21 13:21   ` Bartosz Golaszewski
  2025-10-21  7:15 ` [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors Linus Walleij
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: William Breathitt Gray @ 2025-10-20  8:51 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko
  Cc: Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, William Breathitt Gray,
	Mark Cave-Ayland, stable

The direction of the IDIO-16 GPIO lines is fixed with the first 16 lines
as output and the remaining 16 lines as input. Set the gpio_config
fixed_direction_output member to represent the fixed direction of the
GPIO lines.

Fixes: db02247827ef ("gpio: idio-16: Migrate to the regmap API")
Reported-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
Suggested-by: Michael Walle <mwalle@kernel.org>
Cc: stable@vger.kernel.org # ae495810cffe: gpio: regmap: add the .fixed_direction_output configuration parameter
Cc: stable@vger.kernel.org
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
---
 drivers/gpio/gpio-idio-16.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpio/gpio-idio-16.c b/drivers/gpio/gpio-idio-16.c
index 0103be977c66bb8d165c1c92123368be6832d120..4fbae6f6a49727df40f2793b42ca207d78ec272b 100644
--- a/drivers/gpio/gpio-idio-16.c
+++ b/drivers/gpio/gpio-idio-16.c
@@ -6,6 +6,7 @@
 
 #define DEFAULT_SYMBOL_NAMESPACE "GPIO_IDIO_16"
 
+#include <linux/bitmap.h>
 #include <linux/bits.h>
 #include <linux/device.h>
 #include <linux/err.h>
@@ -107,6 +108,7 @@ int devm_idio_16_regmap_register(struct device *const dev,
 	struct idio_16_data *data;
 	struct regmap_irq_chip *chip;
 	struct regmap_irq_chip_data *chip_data;
+	DECLARE_BITMAP(fixed_direction_output, IDIO_16_NGPIO);
 
 	if (!config->parent)
 		return -EINVAL;
@@ -164,6 +166,9 @@ int devm_idio_16_regmap_register(struct device *const dev,
 	gpio_config.irq_domain = regmap_irq_get_domain(chip_data);
 	gpio_config.reg_mask_xlate = idio_16_reg_mask_xlate;
 
+	bitmap_from_u64(fixed_direction_output, GENMASK_U64(15, 0));
+	gpio_config.fixed_direction_output = fixed_direction_output;
+
 	return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &gpio_config));
 }
 EXPORT_SYMBOL_GPL(devm_idio_16_regmap_register);

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors
  2025-10-20  8:51 [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors William Breathitt Gray
                   ` (2 preceding siblings ...)
  2025-10-20  8:51 ` [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines William Breathitt Gray
@ 2025-10-21  7:15 ` Linus Walleij
  2025-10-21  9:50 ` Bartosz Golaszewski
  2025-10-22  6:54 ` (subset) " Bartosz Golaszewski
  5 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2025-10-21  7:15 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Bartosz Golaszewski, Andy Shevchenko, Bartosz Golaszewski,
	Michael Walle, Ioana Ciornei, Mark Brown, linux-gpio,
	linux-kernel, Mark Cave-Ayland, stable

On Mon, Oct 20, 2025 at 10:52 AM William Breathitt Gray <wbg@kernel.org> wrote:

> The migration of IDIO-16 GPIO drivers to the regmap API resulted in some
> regressions to the gpio-104-idio-16, gpio-pci-idio-16, and gpio-idio-16
> modules. Specifically, the 104-idio-16 and pci-idio-16 GPIO drivers
> utilize regmap caching and thus must set max_register for their
> regmap_config, while gpio-idio-16 requires fixed_direction_output to
> represent the fixed direction of the IDIO-16 GPIO lines. Fixes for these
> regressions are provided by this series.
>
> Link: https://lore.kernel.org/r/cover.1680618405.git.william.gray@linaro.org
> Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
> Signed-off-by: William Breathitt Gray <wbg@kernel.org>

The series:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors
  2025-10-20  8:51 [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors William Breathitt Gray
                   ` (3 preceding siblings ...)
  2025-10-21  7:15 ` [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors Linus Walleij
@ 2025-10-21  9:50 ` Bartosz Golaszewski
  2025-10-22  6:54 ` (subset) " Bartosz Golaszewski
  5 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-10-21  9:50 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	William Breathitt Gray
  Cc: Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, Mark Cave-Ayland, stable

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Mon, 20 Oct 2025 17:51:43 +0900, William Breathitt Gray wrote:
> The migration of IDIO-16 GPIO drivers to the regmap API resulted in some
> regressions to the gpio-104-idio-16, gpio-pci-idio-16, and gpio-idio-16
> modules. Specifically, the 104-idio-16 and pci-idio-16 GPIO drivers
> utilize regmap caching and thus must set max_register for their
> regmap_config, while gpio-idio-16 requires fixed_direction_output to
> represent the fixed direction of the IDIO-16 GPIO lines. Fixes for these
> regressions are provided by this series.
> 
> [...]

Queued for fixes, thanks!

[1/3] gpio: 104-idio-16: Define maximum valid register address offset
      https://git.kernel.org/brgl/linux/c/c4d35e635f3a65aec291a6045cae8c99cede5bba
[2/3] gpio: pci-idio-16: Define maximum valid register address offset
      https://git.kernel.org/brgl/linux/c/d37623132a6347b4ab9e2179eb3f2fa77863c364
[3/3] gpio: idio-16: Define fixed direction of the GPIO lines
      https://git.kernel.org/brgl/linux/c/0d3f95740ced3acb6171cdec8c5bef336b0cabdb

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines
  2025-10-20  8:51 ` [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines William Breathitt Gray
@ 2025-10-21 13:21   ` Bartosz Golaszewski
  2025-10-21 14:41     ` Andy Shevchenko
  2025-10-22  2:18     ` William Breathitt Gray
  0 siblings, 2 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-10-21 13:21 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, Mark Cave-Ayland, stable

On Mon, 20 Oct 2025 10:51:46 +0200, William Breathitt Gray
<wbg@kernel.org> said:
> The direction of the IDIO-16 GPIO lines is fixed with the first 16 lines
> as output and the remaining 16 lines as input. Set the gpio_config
> fixed_direction_output member to represent the fixed direction of the
> GPIO lines.
>
> Fixes: db02247827ef ("gpio: idio-16: Migrate to the regmap API")
> Reported-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
> Suggested-by: Michael Walle <mwalle@kernel.org>
> Cc: stable@vger.kernel.org # ae495810cffe: gpio: regmap: add the .fixed_direction_output configuration parameter
> Cc: stable@vger.kernel.org
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: William Breathitt Gray <wbg@kernel.org>
> ---
>  drivers/gpio/gpio-idio-16.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpio/gpio-idio-16.c b/drivers/gpio/gpio-idio-16.c
> index 0103be977c66bb8d165c1c92123368be6832d120..4fbae6f6a49727df40f2793b42ca207d78ec272b 100644
> --- a/drivers/gpio/gpio-idio-16.c
> +++ b/drivers/gpio/gpio-idio-16.c
> @@ -6,6 +6,7 @@
>
>  #define DEFAULT_SYMBOL_NAMESPACE "GPIO_IDIO_16"
>
> +#include <linux/bitmap.h>
>  #include <linux/bits.h>
>  #include <linux/device.h>
>  #include <linux/err.h>
> @@ -107,6 +108,7 @@ int devm_idio_16_regmap_register(struct device *const dev,
>  	struct idio_16_data *data;
>  	struct regmap_irq_chip *chip;
>  	struct regmap_irq_chip_data *chip_data;
> +	DECLARE_BITMAP(fixed_direction_output, IDIO_16_NGPIO);
>
>  	if (!config->parent)
>  		return -EINVAL;
> @@ -164,6 +166,9 @@ int devm_idio_16_regmap_register(struct device *const dev,
>  	gpio_config.irq_domain = regmap_irq_get_domain(chip_data);
>  	gpio_config.reg_mask_xlate = idio_16_reg_mask_xlate;
>
> +	bitmap_from_u64(fixed_direction_output, GENMASK_U64(15, 0));
> +	gpio_config.fixed_direction_output = fixed_direction_output;
> +
>  	return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &gpio_config));
>  }
>  EXPORT_SYMBOL_GPL(devm_idio_16_regmap_register);
>
> --
> 2.51.0
>
>

Turns out, this requires commit ae495810cffe ("gpio: regmap: add the
.fixed_direction_output configuration parameter") so I cannot queue it for
v6.18. What do you want me to do? Send the first two ones upstream and apply
this for v6.19?

Bartosz

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines
  2025-10-21 13:21   ` Bartosz Golaszewski
@ 2025-10-21 14:41     ` Andy Shevchenko
  2025-10-21 14:49       ` Bartosz Golaszewski
  2025-10-22  2:18     ` William Breathitt Gray
  1 sibling, 1 reply; 13+ messages in thread
From: Andy Shevchenko @ 2025-10-21 14:41 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: William Breathitt Gray, Linus Walleij, Bartosz Golaszewski,
	Michael Walle, Ioana Ciornei, Mark Brown, linux-gpio,
	linux-kernel, Mark Cave-Ayland, stable

On Tue, Oct 21, 2025 at 09:21:38AM -0400, Bartosz Golaszewski wrote:
> On Mon, 20 Oct 2025 10:51:46 +0200, William Breathitt Gray
> <wbg@kernel.org> said:

...

> > Cc: stable@vger.kernel.org # ae495810cffe: gpio: regmap: add the .fixed_direction_output configuration parameter

> Turns out, this requires commit ae495810cffe ("gpio: regmap: add the
> .fixed_direction_output configuration parameter") so I cannot queue it for
> v6.18. What do you want me to do? Send the first two ones upstream and apply
> this for v6.19?

Why can't this be pulled from some IB/IT as part of the fix?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines
  2025-10-21 14:41     ` Andy Shevchenko
@ 2025-10-21 14:49       ` Bartosz Golaszewski
  2025-10-21 15:04         ` Andy Shevchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-10-21 14:49 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: William Breathitt Gray, Linus Walleij, Bartosz Golaszewski,
	Michael Walle, Ioana Ciornei, Mark Brown, linux-gpio,
	linux-kernel, Mark Cave-Ayland, stable

On Tue, Oct 21, 2025 at 4:41 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Tue, Oct 21, 2025 at 09:21:38AM -0400, Bartosz Golaszewski wrote:
> > On Mon, 20 Oct 2025 10:51:46 +0200, William Breathitt Gray
> > <wbg@kernel.org> said:
>
> ...
>
> > > Cc: stable@vger.kernel.org # ae495810cffe: gpio: regmap: add the .fixed_direction_output configuration parameter
>
> > Turns out, this requires commit ae495810cffe ("gpio: regmap: add the
> > .fixed_direction_output configuration parameter") so I cannot queue it for
> > v6.18. What do you want me to do? Send the first two ones upstream and apply
> > this for v6.19?
>
> Why can't this be pulled from some IB/IT as part of the fix?
>

These kinds of things should be signalled before applying the patches
that should go to an immutable branch. I would now have to rebase the
my for-next branch. Also: the commit in question brings in a new
feature, not a fix.

Bartosz

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines
  2025-10-21 14:49       ` Bartosz Golaszewski
@ 2025-10-21 15:04         ` Andy Shevchenko
  0 siblings, 0 replies; 13+ messages in thread
From: Andy Shevchenko @ 2025-10-21 15:04 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: William Breathitt Gray, Linus Walleij, Bartosz Golaszewski,
	Michael Walle, Ioana Ciornei, Mark Brown, linux-gpio,
	linux-kernel, Mark Cave-Ayland, stable

On Tue, Oct 21, 2025 at 04:49:05PM +0200, Bartosz Golaszewski wrote:
> On Tue, Oct 21, 2025 at 4:41 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Tue, Oct 21, 2025 at 09:21:38AM -0400, Bartosz Golaszewski wrote:
> > > On Mon, 20 Oct 2025 10:51:46 +0200, William Breathitt Gray
> > > <wbg@kernel.org> said:

...

> > > > Cc: stable@vger.kernel.org # ae495810cffe: gpio: regmap: add the .fixed_direction_output configuration parameter
> >
> > > Turns out, this requires commit ae495810cffe ("gpio: regmap: add the
> > > .fixed_direction_output configuration parameter") so I cannot queue it for
> > > v6.18. What do you want me to do? Send the first two ones upstream and apply
> > > this for v6.19?
> >
> > Why can't this be pulled from some IB/IT as part of the fix?
> 
> These kinds of things should be signalled before applying the patches
> that should go to an immutable branch. I would now have to rebase the
> my for-next branch.

No objections on this one, this is unfortunate.

> Also: the commit in question brings in a new feature, not a fix.

I can argue that this is part of the fix.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines
  2025-10-21 13:21   ` Bartosz Golaszewski
  2025-10-21 14:41     ` Andy Shevchenko
@ 2025-10-22  2:18     ` William Breathitt Gray
  2025-10-22  6:50       ` Bartosz Golaszewski
  1 sibling, 1 reply; 13+ messages in thread
From: William Breathitt Gray @ 2025-10-22  2:18 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: William Breathitt Gray, Linus Walleij, Andy Shevchenko,
	Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, Mark Cave-Ayland, stable

On Tue, Oct 21, 2025 at 09:21:38AM -0400, Bartosz Golaszewski wrote:
> On Mon, 20 Oct 2025 10:51:46 +0200, William Breathitt Gray
> <wbg@kernel.org> said:
> > The direction of the IDIO-16 GPIO lines is fixed with the first 16 lines
> > as output and the remaining 16 lines as input. Set the gpio_config
> > fixed_direction_output member to represent the fixed direction of the
> > GPIO lines.
> >
> > Fixes: db02247827ef ("gpio: idio-16: Migrate to the regmap API")
> > Reported-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> > Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
> > Suggested-by: Michael Walle <mwalle@kernel.org>
> > Cc: stable@vger.kernel.org # ae495810cffe: gpio: regmap: add the .fixed_direction_output configuration parameter
> > Cc: stable@vger.kernel.org
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: William Breathitt Gray <wbg@kernel.org>
> > ---
> >  drivers/gpio/gpio-idio-16.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpio/gpio-idio-16.c b/drivers/gpio/gpio-idio-16.c
> > index 0103be977c66bb8d165c1c92123368be6832d120..4fbae6f6a49727df40f2793b42ca207d78ec272b 100644
> > --- a/drivers/gpio/gpio-idio-16.c
> > +++ b/drivers/gpio/gpio-idio-16.c
> > @@ -6,6 +6,7 @@
> >
> >  #define DEFAULT_SYMBOL_NAMESPACE "GPIO_IDIO_16"
> >
> > +#include <linux/bitmap.h>
> >  #include <linux/bits.h>
> >  #include <linux/device.h>
> >  #include <linux/err.h>
> > @@ -107,6 +108,7 @@ int devm_idio_16_regmap_register(struct device *const dev,
> >  	struct idio_16_data *data;
> >  	struct regmap_irq_chip *chip;
> >  	struct regmap_irq_chip_data *chip_data;
> > +	DECLARE_BITMAP(fixed_direction_output, IDIO_16_NGPIO);
> >
> >  	if (!config->parent)
> >  		return -EINVAL;
> > @@ -164,6 +166,9 @@ int devm_idio_16_regmap_register(struct device *const dev,
> >  	gpio_config.irq_domain = regmap_irq_get_domain(chip_data);
> >  	gpio_config.reg_mask_xlate = idio_16_reg_mask_xlate;
> >
> > +	bitmap_from_u64(fixed_direction_output, GENMASK_U64(15, 0));
> > +	gpio_config.fixed_direction_output = fixed_direction_output;
> > +
> >  	return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &gpio_config));
> >  }
> >  EXPORT_SYMBOL_GPL(devm_idio_16_regmap_register);
> >
> > --
> > 2.51.0
> >
> >
> 
> Turns out, this requires commit ae495810cffe ("gpio: regmap: add the
> .fixed_direction_output configuration parameter") so I cannot queue it for
> v6.18. What do you want me to do? Send the first two ones upstream and apply
> this for v6.19?
> 
> Bartosz

Sorry for the confusion this caused. It looks like `b4 prep --edit-deps`
will add explict dependencies, so I'll use that from now on to hopefully
prevent this kind of problem in the future.

So we'll need this fix in v6.18 as well because the IDIO-16 drivers are
completely broken right now. In theory we could revert the entire GPIO
regmap migration series [^1], but that would be a far more invasive
solution prone to further regressions. Instead, picking the commit
ae495810cffe dependency with the remaining patches is the cleanest
solution to this regression.

William Breathitt Gray

[^1] https://lore.kernel.org/r/cover.1680618405.git.william.gray@linaro.org

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines
  2025-10-22  2:18     ` William Breathitt Gray
@ 2025-10-22  6:50       ` Bartosz Golaszewski
  0 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-10-22  6:50 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Linus Walleij, Andy Shevchenko, Bartosz Golaszewski,
	Michael Walle, Ioana Ciornei, Mark Brown, linux-gpio,
	linux-kernel, Mark Cave-Ayland, stable

On Wed, Oct 22, 2025 at 4:19 AM William Breathitt Gray <wbg@kernel.org> wrote:
> >
> > Turns out, this requires commit ae495810cffe ("gpio: regmap: add the
> > .fixed_direction_output configuration parameter") so I cannot queue it for
> > v6.18. What do you want me to do? Send the first two ones upstream and apply
> > this for v6.19?
> >
> > Bartosz
>
> Sorry for the confusion this caused. It looks like `b4 prep --edit-deps`
> will add explict dependencies, so I'll use that from now on to hopefully
> prevent this kind of problem in the future.
>
> So we'll need this fix in v6.18 as well because the IDIO-16 drivers are
> completely broken right now. In theory we could revert the entire GPIO
> regmap migration series [^1], but that would be a far more invasive
> solution prone to further regressions. Instead, picking the commit
> ae495810cffe dependency with the remaining patches is the cleanest
> solution to this regression.
>
> William Breathitt Gray
>
> [^1] https://lore.kernel.org/r/cover.1680618405.git.william.gray@linaro.org

Eh... Ok I will pick ae495810cffe into fixes, send it upstream with
this series and then pull v6.18-rc3 back into gpio/for-next and
resolve the conflict.

Bartosz

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: (subset) [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors
  2025-10-20  8:51 [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors William Breathitt Gray
                   ` (4 preceding siblings ...)
  2025-10-21  9:50 ` Bartosz Golaszewski
@ 2025-10-22  6:54 ` Bartosz Golaszewski
  5 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-10-22  6:54 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	William Breathitt Gray
  Cc: Bartosz Golaszewski, Michael Walle, Ioana Ciornei, Mark Brown,
	linux-gpio, linux-kernel, Mark Cave-Ayland, stable

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Mon, 20 Oct 2025 17:51:43 +0900, William Breathitt Gray wrote:
> The migration of IDIO-16 GPIO drivers to the regmap API resulted in some
> regressions to the gpio-104-idio-16, gpio-pci-idio-16, and gpio-idio-16
> modules. Specifically, the 104-idio-16 and pci-idio-16 GPIO drivers
> utilize regmap caching and thus must set max_register for their
> regmap_config, while gpio-idio-16 requires fixed_direction_output to
> represent the fixed direction of the IDIO-16 GPIO lines. Fixes for these
> regressions are provided by this series.
> 
> [...]

Applied, thanks!

[3/3] gpio: idio-16: Define fixed direction of the GPIO lines
      https://git.kernel.org/brgl/linux/c/2ba5772e530f73eb847fb96ce6c4017894869552

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-10-22  6:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20  8:51 [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors William Breathitt Gray
2025-10-20  8:51 ` [PATCH v2 1/3] gpio: 104-idio-16: Define maximum valid register address offset William Breathitt Gray
2025-10-20  8:51 ` [PATCH v2 2/3] gpio: pci-idio-16: " William Breathitt Gray
2025-10-20  8:51 ` [PATCH v2 3/3] gpio: idio-16: Define fixed direction of the GPIO lines William Breathitt Gray
2025-10-21 13:21   ` Bartosz Golaszewski
2025-10-21 14:41     ` Andy Shevchenko
2025-10-21 14:49       ` Bartosz Golaszewski
2025-10-21 15:04         ` Andy Shevchenko
2025-10-22  2:18     ` William Breathitt Gray
2025-10-22  6:50       ` Bartosz Golaszewski
2025-10-21  7:15 ` [PATCH v2 0/3] gpio: idio-16: Fix regmap initialization errors Linus Walleij
2025-10-21  9:50 ` Bartosz Golaszewski
2025-10-22  6:54 ` (subset) " Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).