stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree
@ 2021-03-11 18:12 gregkh
  2021-03-12 11:59 ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: gregkh @ 2021-03-11 18:12 UTC (permalink / raw)
  To: andriy.shevchenko, linus.walleij, mika.westerberg; +Cc: stable


The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 62d5247d239d4b48762192a251c647d7c997616a Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Thu, 25 Feb 2021 18:33:18 +0200
Subject: [PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk

On some systems the ACPI tables has wrong pin number and instead of
having a relative one it provides an absolute one in the global GPIO
number space.

Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk to cope with such cases.

Fixes: ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
Depends-on: 0ea683931adb ("gpio: dwapb: Convert driver to using the GPIO-lib-based IRQ-chip")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 86efa2d9bf7f..0fa0127d50ec 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -677,6 +677,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
 	if (!lookup->desc) {
 		const struct acpi_resource_gpio *agpio = &ares->data.gpio;
 		bool gpioint = agpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT;
+		struct gpio_desc *desc;
 		u16 pin_index;
 
 		if (lookup->info.quirks & ACPI_GPIO_QUIRK_ONLY_GPIOIO && gpioint)
@@ -689,8 +690,12 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
 		if (pin_index >= agpio->pin_table_length)
 			return 1;
 
-		lookup->desc = acpi_get_gpiod(agpio->resource_source.string_ptr,
+		if (lookup->info.quirks & ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER)
+			desc = gpio_to_desc(agpio->pin_table[pin_index]);
+		else
+			desc = acpi_get_gpiod(agpio->resource_source.string_ptr,
 					      agpio->pin_table[pin_index]);
+		lookup->desc = desc;
 		lookup->info.pin_config = agpio->pin_config;
 		lookup->info.debounce = agpio->debounce_timeout;
 		lookup->info.gpioint = gpioint;
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index ef49307611d2..c73b25bc9213 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -674,6 +674,8 @@ struct acpi_gpio_mapping {
  * get GpioIo type explicitly, this quirk may be used.
  */
 #define ACPI_GPIO_QUIRK_ONLY_GPIOIO		BIT(1)
+/* Use given pin as an absolute GPIO number in the system */
+#define ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER		BIT(2)
 
 	unsigned int quirks;
 };


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

* Re: FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree
  2021-03-11 18:12 FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree gregkh
@ 2021-03-12 11:59 ` Andy Shevchenko
  2021-03-12 12:10   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2021-03-12 11:59 UTC (permalink / raw)
  To: gregkh; +Cc: linus.walleij, mika.westerberg, stable

On Thu, Mar 11, 2021 at 07:12:55PM +0100, gregkh@linuxfoundation.org wrote:
> 
> The patch below does not apply to the 5.4-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.

No need for v5.4.

Please, also drop
gpio-pca953x-set-irq-type-when-handle-intel-galileo-gen-2.patch
gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch

from 5.4-stable queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree
  2021-03-12 11:59 ` Andy Shevchenko
@ 2021-03-12 12:10   ` Greg KH
  2021-03-12 12:24     ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2021-03-12 12:10 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linus.walleij, mika.westerberg, stable

On Fri, Mar 12, 2021 at 01:59:27PM +0200, Andy Shevchenko wrote:
> On Thu, Mar 11, 2021 at 07:12:55PM +0100, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 5.4-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> 
> No need for v5.4.
> 
> Please, also drop
> gpio-pca953x-set-irq-type-when-handle-intel-galileo-gen-2.patch
> gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
> 
> from 5.4-stable queue, thanks!

Why?  If you look at the first commit above, it says:
Fixes: ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")

which is in the 5.4.52 kernel release.  So why shouldn't it go there?

Same goes for the
gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
patch.

Is your marking of the "Fixes:" tags incorrect somehow?

confused,

greg k-h

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

* Re: FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree
  2021-03-12 12:10   ` Greg KH
@ 2021-03-12 12:24     ` Andy Shevchenko
  2021-03-12 12:33       ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2021-03-12 12:24 UTC (permalink / raw)
  To: Greg KH; +Cc: linus.walleij, mika.westerberg, stable

On Fri, Mar 12, 2021 at 01:10:09PM +0100, Greg KH wrote:
> On Fri, Mar 12, 2021 at 01:59:27PM +0200, Andy Shevchenko wrote:
> > On Thu, Mar 11, 2021 at 07:12:55PM +0100, gregkh@linuxfoundation.org wrote:
> > > 
> > > The patch below does not apply to the 5.4-stable tree.
> > > If someone wants it applied there, or to any other stable or longterm
> > > tree, then please email the backport, including the original git commit
> > > id to <stable@vger.kernel.org>.
> > 
> > No need for v5.4.
> > 
> > Please, also drop
> > gpio-pca953x-set-irq-type-when-handle-intel-galileo-gen-2.patch
> > gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
> > 
> > from 5.4-stable queue, thanks!
> 
> Why?  If you look at the first commit above, it says:
> Fixes: ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
> 
> which is in the 5.4.52 kernel release.  So why shouldn't it go there?
> 
> Same goes for the
> gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
> patch.
> 
> Is your marking of the "Fixes:" tags incorrect somehow?
> 
> confused,

It has also Depends-on which points out that the regression only visible when
that commit is in the tree.

If you want to see them in v5.4, I can backport the series.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree
  2021-03-12 12:24     ` Andy Shevchenko
@ 2021-03-12 12:33       ` Andy Shevchenko
  2021-03-12 13:24         ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2021-03-12 12:33 UTC (permalink / raw)
  To: Greg KH; +Cc: linus.walleij, mika.westerberg, stable

On Fri, Mar 12, 2021 at 02:24:13PM +0200, Andy Shevchenko wrote:
> On Fri, Mar 12, 2021 at 01:10:09PM +0100, Greg KH wrote:
> > On Fri, Mar 12, 2021 at 01:59:27PM +0200, Andy Shevchenko wrote:
> > > On Thu, Mar 11, 2021 at 07:12:55PM +0100, gregkh@linuxfoundation.org wrote:
> > > > 
> > > > The patch below does not apply to the 5.4-stable tree.
> > > > If someone wants it applied there, or to any other stable or longterm
> > > > tree, then please email the backport, including the original git commit
> > > > id to <stable@vger.kernel.org>.
> > > 
> > > No need for v5.4.
> > > 
> > > Please, also drop
> > > gpio-pca953x-set-irq-type-when-handle-intel-galileo-gen-2.patch
> > > gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
> > > 
> > > from 5.4-stable queue, thanks!
> > 
> > Why?  If you look at the first commit above, it says:
> > Fixes: ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
> > 
> > which is in the 5.4.52 kernel release.  So why shouldn't it go there?
> > 
> > Same goes for the
> > gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
> > patch.
> > 
> > Is your marking of the "Fixes:" tags incorrect somehow?
> > 
> > confused,
> 
> It has also Depends-on which points out that the regression only visible when
> that commit is in the tree.
> 
> If you want to see them in v5.4, I can backport the series.

Since the other two in your queue, you may try to use this one, which I have
sent for v5.10.y, but it seems good enough for v5.4.

https://lore.kernel.org/stable/20210312121542.67389-1-andriy.shevchenko@linux.intel.com/T/#u

Thanks!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree
  2021-03-12 12:33       ` Andy Shevchenko
@ 2021-03-12 13:24         ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2021-03-12 13:24 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linus.walleij, mika.westerberg, stable

On Fri, Mar 12, 2021 at 02:33:57PM +0200, Andy Shevchenko wrote:
> On Fri, Mar 12, 2021 at 02:24:13PM +0200, Andy Shevchenko wrote:
> > On Fri, Mar 12, 2021 at 01:10:09PM +0100, Greg KH wrote:
> > > On Fri, Mar 12, 2021 at 01:59:27PM +0200, Andy Shevchenko wrote:
> > > > On Thu, Mar 11, 2021 at 07:12:55PM +0100, gregkh@linuxfoundation.org wrote:
> > > > > 
> > > > > The patch below does not apply to the 5.4-stable tree.
> > > > > If someone wants it applied there, or to any other stable or longterm
> > > > > tree, then please email the backport, including the original git commit
> > > > > id to <stable@vger.kernel.org>.
> > > > 
> > > > No need for v5.4.
> > > > 
> > > > Please, also drop
> > > > gpio-pca953x-set-irq-type-when-handle-intel-galileo-gen-2.patch
> > > > gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
> > > > 
> > > > from 5.4-stable queue, thanks!
> > > 
> > > Why?  If you look at the first commit above, it says:
> > > Fixes: ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
> > > 
> > > which is in the 5.4.52 kernel release.  So why shouldn't it go there?
> > > 
> > > Same goes for the
> > > gpiolib-acpi-allow-to-find-gpioint-resource-by-name-and-index.patch
> > > patch.
> > > 
> > > Is your marking of the "Fixes:" tags incorrect somehow?
> > > 
> > > confused,
> > 
> > It has also Depends-on which points out that the regression only visible when
> > that commit is in the tree.
> > 
> > If you want to see them in v5.4, I can backport the series.
> 
> Since the other two in your queue, you may try to use this one, which I have
> sent for v5.10.y, but it seems good enough for v5.4.
> 
> https://lore.kernel.org/stable/20210312121542.67389-1-andriy.shevchenko@linux.intel.com/T/#u

Ok, this looks to not make sense for 5.4.y, so I've dropped all of the
gpiolib patches from there, and fixed up the 5.10.y ones, so we should
be all good now.

thanks,

greg k-h

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

end of thread, other threads:[~2021-03-12 13:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 18:12 FAILED: patch "[PATCH] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk" failed to apply to 5.4-stable tree gregkh
2021-03-12 11:59 ` Andy Shevchenko
2021-03-12 12:10   ` Greg KH
2021-03-12 12:24     ` Andy Shevchenko
2021-03-12 12:33       ` Andy Shevchenko
2021-03-12 13:24         ` Greg KH

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).