linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
@ 2022-10-13 21:59 Marek Vasut
  2022-10-13 21:59 ` [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode Marek Vasut
  2022-10-17 10:23 ` [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Linus Walleij
  0 siblings, 2 replies; 13+ messages in thread
From: Marek Vasut @ 2022-10-13 21:59 UTC (permalink / raw)
  To: linux-gpio
  Cc: Marek Vasut, Linus Walleij, Marc Zyngier, Bartosz Golaszewski,
	Loic Poulain, NXP Linux Team, Peng Fan, Shawn Guo

The driver currently performs register read-modify-write without locking
in its irqchip part, this could lead to a race condition when configuring
interrupt mode setting. Add the missing bgpio spinlock lock/unlock around
the register read-modify-write.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
---
V3: New patch
V4: Include linux/spinlock.h
V5: Use raw_spinlock per 3c938cc5cebcb ("gpio: use raw spinlock for gpio chip shadowed data")
V6: No change
---
 drivers/gpio/gpio-mxc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index c871602fc5ba9..6cc98a5684ae1 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <linux/spinlock.h>
 #include <linux/syscore_ops.h>
 #include <linux/gpio/driver.h>
 #include <linux/of.h>
@@ -147,6 +148,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
 {
 	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
 	struct mxc_gpio_port *port = gc->private;
+	unsigned long flags;
 	u32 bit, val;
 	u32 gpio_idx = d->hwirq;
 	int edge;
@@ -185,6 +187,8 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
 		return -EINVAL;
 	}
 
+	raw_spin_lock_irqsave(&port->gc.bgpio_lock, flags);
+
 	if (GPIO_EDGE_SEL >= 0) {
 		val = readl(port->base + GPIO_EDGE_SEL);
 		if (edge == GPIO_INT_BOTH_EDGES)
@@ -204,15 +208,20 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
 
 	writel(1 << gpio_idx, port->base + GPIO_ISR);
 
+	raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags);
+
 	return 0;
 }
 
 static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
 {
 	void __iomem *reg = port->base;
+	unsigned long flags;
 	u32 bit, val;
 	int edge;
 
+	raw_spin_lock_irqsave(&port->gc.bgpio_lock, flags);
+
 	reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
 	bit = gpio & 0xf;
 	val = readl(reg);
@@ -230,6 +239,8 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
 		return;
 	}
 	writel(val | (edge << (bit << 1)), reg);
+
+	raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags);
 }
 
 /* handle 32 interrupts in one status register */
-- 
2.35.1


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

* [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2022-10-13 21:59 [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Marek Vasut
@ 2022-10-13 21:59 ` Marek Vasut
  2022-10-17 10:24   ` Linus Walleij
  2022-10-17 10:23 ` [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Linus Walleij
  1 sibling, 1 reply; 13+ messages in thread
From: Marek Vasut @ 2022-10-13 21:59 UTC (permalink / raw)
  To: linux-gpio
  Cc: Marek Vasut, Bartosz Golaszewski, Linus Walleij, Loic Poulain,
	Marc Zyngier, NXP Linux Team, Peng Fan, Shawn Guo

Always configure GPIO pins which are used as interrupt source as INPUTs.
In case the default pin configuration is OUTPUT, or the prior stage does
configure the pins as OUTPUT, then Linux will not reconfigure the pin as
INPUT and no interrupts are received.

Always configure the interrupt source GPIO pin as input to fix the above case.

Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
---
V2: Actually update and clear bits in GDIR register
V3: Rebase on top of new patch 1/2, expand CC list, add Fixes tag
V4: No change
V5: No change
V6: - Call gc->direction_input() to set direction, instead of GDIR register
      poking. The bgpio (gpio-mmio) may cache the content of direction
      register, so updating the HW GDIR register is not enough. Calling
      the gc->direction() assures the cache is updated.
    - Drop RBs since this is updated patch.
---
 drivers/gpio/gpio-mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 6cc98a5684ae1..dd91908c72f19 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -210,7 +210,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
 
 	raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags);
 
-	return 0;
+	return port->gc.direction_input(&port->gc, gpio_idx);
 }
 
 static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
-- 
2.35.1


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

* Re: [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
  2022-10-13 21:59 [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Marek Vasut
  2022-10-13 21:59 ` [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode Marek Vasut
@ 2022-10-17 10:23 ` Linus Walleij
  2022-10-18  8:33   ` Marek Vasut
  1 sibling, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2022-10-17 10:23 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-gpio, Marc Zyngier, Bartosz Golaszewski, Loic Poulain,
	NXP Linux Team, Peng Fan, Shawn Guo

On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:

> The driver currently performs register read-modify-write without locking
> in its irqchip part, this could lead to a race condition when configuring
> interrupt mode setting. Add the missing bgpio spinlock lock/unlock around
> the register read-modify-write.
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Reviewed-by: Marc Zyngier <maz@kernel.org>
> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
> Signed-off-by: Marek Vasut <marex@denx.de>

Unrelated, but Marek can you have a look at this MXC patch since
you're obviously working on the platform:
https://lore.kernel.org/linux-gpio/20221007152853.838136-1-shenwei.wang@nxp.com/

Yours,
Linus Walleij

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

* Re: [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2022-10-13 21:59 ` [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode Marek Vasut
@ 2022-10-17 10:24   ` Linus Walleij
  2022-12-16 21:51     ` Marek Vasut
  0 siblings, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2022-10-17 10:24 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-gpio, Bartosz Golaszewski, Loic Poulain, Marc Zyngier,
	NXP Linux Team, Peng Fan, Shawn Guo

On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:

> Always configure GPIO pins which are used as interrupt source as INPUTs.
> In case the default pin configuration is OUTPUT, or the prior stage does
> configure the pins as OUTPUT, then Linux will not reconfigure the pin as
> INPUT and no interrupts are received.
>
> Always configure the interrupt source GPIO pin as input to fix the above case.
>
> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
> Signed-off-by: Marek Vasut <marex@denx.de>

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

Yours,
Linus Walleij

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

* Re: [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
  2022-10-17 10:23 ` [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Linus Walleij
@ 2022-10-18  8:33   ` Marek Vasut
  2022-10-18  8:46     ` Linus Walleij
  0 siblings, 1 reply; 13+ messages in thread
From: Marek Vasut @ 2022-10-18  8:33 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-gpio, Marc Zyngier, Bartosz Golaszewski, Loic Poulain,
	NXP Linux Team, Peng Fan, Shawn Guo

On 10/17/22 12:23, Linus Walleij wrote:
> On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
> 
>> The driver currently performs register read-modify-write without locking
>> in its irqchip part, this could lead to a race condition when configuring
>> interrupt mode setting. Add the missing bgpio spinlock lock/unlock around
>> the register read-modify-write.
>>
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>> Reviewed-by: Marc Zyngier <maz@kernel.org>
>> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
>> Signed-off-by: Marek Vasut <marex@denx.de>
> 
> Unrelated, but Marek can you have a look at this MXC patch since
> you're obviously working on the platform:
> https://lore.kernel.org/linux-gpio/20221007152853.838136-1-shenwei.wang@nxp.com/

Errrr, that's i.MX8, which is completely different chip than the i.MX8M 
(except for the naming, which ... oh well). I work on the simpler i.MX8M.

But looking at the patch, don't we already have a DT property which lets 
one set GPIO as wake up source, without massive enumeration tables in 
each GPIO driver ? It seems to me that's what NXP is trying to 
implement, per GPIO wake up.

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

* Re: [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
  2022-10-18  8:33   ` Marek Vasut
@ 2022-10-18  8:46     ` Linus Walleij
  2022-10-18  9:04       ` Marek Vasut
  0 siblings, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2022-10-18  8:46 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-gpio, Marc Zyngier, Bartosz Golaszewski, Loic Poulain,
	NXP Linux Team, Peng Fan, Shawn Guo

On Tue, Oct 18, 2022 at 10:33 AM Marek Vasut <marex@denx.de> wrote:
> On 10/17/22 12:23, Linus Walleij wrote:
> > On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
> >
> >> The driver currently performs register read-modify-write without locking
> >> in its irqchip part, this could lead to a race condition when configuring
> >> interrupt mode setting. Add the missing bgpio spinlock lock/unlock around
> >> the register read-modify-write.
> >>
> >> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >> Reviewed-by: Marc Zyngier <maz@kernel.org>
> >> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >
> > Unrelated, but Marek can you have a look at this MXC patch since
> > you're obviously working on the platform:
> > https://lore.kernel.org/linux-gpio/20221007152853.838136-1-shenwei.wang@nxp.com/
>
> Errrr, that's i.MX8, which is completely different chip than the i.MX8M
> (except for the naming, which ... oh well). I work on the simpler i.MX8M.

Yeah, I think a part of the problem is that the MXC GPIO is not connected
to the back-end pin controller for i.MX so one rarely know which SoC
it is used on.

> But looking at the patch, don't we already have a DT property which lets
> one set GPIO as wake up source, without massive enumeration tables in
> each GPIO driver ? It seems to me that's what NXP is trying to
> implement, per GPIO wake up.

I had to bite the bullet and write a longer reply, hoping the i.MX
and MXC maintainers wake up:
https://lore.kernel.org/linux-gpio/CACRpkdaKncznz5qej6owA2OGMeqbrif9e_QO3CWN6+sGhEApDw@mail.gmail.com/T/#mac3a8d5399c486657c5e168107ed591694d4b155

Yours,
Linus Walleij

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

* Re: [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
  2022-10-18  8:46     ` Linus Walleij
@ 2022-10-18  9:04       ` Marek Vasut
  0 siblings, 0 replies; 13+ messages in thread
From: Marek Vasut @ 2022-10-18  9:04 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-gpio, Marc Zyngier, Bartosz Golaszewski, Loic Poulain,
	NXP Linux Team, Peng Fan, Shawn Guo, Anatolij Gustschin

On 10/18/22 10:46, Linus Walleij wrote:
> On Tue, Oct 18, 2022 at 10:33 AM Marek Vasut <marex@denx.de> wrote:
>> On 10/17/22 12:23, Linus Walleij wrote:
>>> On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
>>>
>>>> The driver currently performs register read-modify-write without locking
>>>> in its irqchip part, this could lead to a race condition when configuring
>>>> interrupt mode setting. Add the missing bgpio spinlock lock/unlock around
>>>> the register read-modify-write.
>>>>
>>>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>>>> Reviewed-by: Marc Zyngier <maz@kernel.org>
>>>> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>
>>> Unrelated, but Marek can you have a look at this MXC patch since
>>> you're obviously working on the platform:
>>> https://lore.kernel.org/linux-gpio/20221007152853.838136-1-shenwei.wang@nxp.com/
>>
>> Errrr, that's i.MX8, which is completely different chip than the i.MX8M
>> (except for the naming, which ... oh well). I work on the simpler i.MX8M.
> 
> Yeah, I think a part of the problem is that the MXC GPIO is not connected
> to the back-end pin controller for i.MX so one rarely know which SoC
> it is used on.

The MXC GPIO is traditionally completely separate from IOMUXC pinmux 
controller, the MX8 (the non-M and non-X) is just a bit odd and I have 
little experience with that one.

>> But looking at the patch, don't we already have a DT property which lets
>> one set GPIO as wake up source, without massive enumeration tables in
>> each GPIO driver ? It seems to me that's what NXP is trying to
>> implement, per GPIO wake up.
> 
> I had to bite the bullet and write a longer reply, hoping the i.MX
> and MXC maintainers wake up:
> https://lore.kernel.org/linux-gpio/CACRpkdaKncznz5qej6owA2OGMeqbrif9e_QO3CWN6+sGhEApDw@mail.gmail.com/T/#mac3a8d5399c486657c5e168107ed591694d4b155

I saw that one, thanks for CCing me, I actually dropped the request from 
you here yesterday by accident (sorry).

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

* Re: [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2022-10-17 10:24   ` Linus Walleij
@ 2022-12-16 21:51     ` Marek Vasut
  2022-12-18 23:21       ` Linus Walleij
  0 siblings, 1 reply; 13+ messages in thread
From: Marek Vasut @ 2022-12-16 21:51 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-gpio, Bartosz Golaszewski, Loic Poulain, Marc Zyngier,
	NXP Linux Team, Peng Fan, Shawn Guo

On 10/17/22 12:24, Linus Walleij wrote:
> On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
> 
>> Always configure GPIO pins which are used as interrupt source as INPUTs.
>> In case the default pin configuration is OUTPUT, or the prior stage does
>> configure the pins as OUTPUT, then Linux will not reconfigure the pin as
>> INPUT and no interrupts are received.
>>
>> Always configure the interrupt source GPIO pin as input to fix the above case.
>>
>> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
>> Signed-off-by: Marek Vasut <marex@denx.de>
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Can you please just pick these two patches up ?

Thank you

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

* Re: [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2022-12-16 21:51     ` Marek Vasut
@ 2022-12-18 23:21       ` Linus Walleij
  2022-12-19  0:29         ` Marek Vasut
  2023-01-10  8:16         ` Marek Vasut
  0 siblings, 2 replies; 13+ messages in thread
From: Linus Walleij @ 2022-12-18 23:21 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-gpio, Bartosz Golaszewski, Loic Poulain, Marc Zyngier,
	NXP Linux Team, Peng Fan, Shawn Guo

On Fri, Dec 16, 2022 at 10:51 PM Marek Vasut <marex@denx.de> wrote:
> On 10/17/22 12:24, Linus Walleij wrote:
> > On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
> >
> >> Always configure GPIO pins which are used as interrupt source as INPUTs.
> >> In case the default pin configuration is OUTPUT, or the prior stage does
> >> configure the pins as OUTPUT, then Linux will not reconfigure the pin as
> >> INPUT and no interrupts are received.
> >>
> >> Always configure the interrupt source GPIO pin as input to fix the above case.
> >>
> >> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Can you please just pick these two patches up ?

Bartosz is queueing GPIO patches, I'm sure he will get to
queue them soon enough.

Yours,
Linus Walleij

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

* Re: [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2022-12-18 23:21       ` Linus Walleij
@ 2022-12-19  0:29         ` Marek Vasut
  2023-01-10  8:16         ` Marek Vasut
  1 sibling, 0 replies; 13+ messages in thread
From: Marek Vasut @ 2022-12-19  0:29 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: linux-gpio, Loic Poulain, Marc Zyngier, NXP Linux Team, Peng Fan,
	Shawn Guo

On 12/19/22 00:21, Linus Walleij wrote:
> On Fri, Dec 16, 2022 at 10:51 PM Marek Vasut <marex@denx.de> wrote:
>> On 10/17/22 12:24, Linus Walleij wrote:
>>> On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
>>>
>>>> Always configure GPIO pins which are used as interrupt source as INPUTs.
>>>> In case the default pin configuration is OUTPUT, or the prior stage does
>>>> configure the pins as OUTPUT, then Linux will not reconfigure the pin as
>>>> INPUT and no interrupts are received.
>>>>
>>>> Always configure the interrupt source GPIO pin as input to fix the above case.
>>>>
>>>> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>
>>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> Can you please just pick these two patches up ?
> 
> Bartosz is queueing GPIO patches, I'm sure he will get to
> queue them soon enough.

Thanks

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

* Re: [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2022-12-18 23:21       ` Linus Walleij
  2022-12-19  0:29         ` Marek Vasut
@ 2023-01-10  8:16         ` Marek Vasut
  2023-01-16  8:31           ` Bartosz Golaszewski
  1 sibling, 1 reply; 13+ messages in thread
From: Marek Vasut @ 2023-01-10  8:16 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Bartosz Golaszewski
  Cc: linux-gpio, Bartosz Golaszewski, Loic Poulain, Marc Zyngier,
	NXP Linux Team, Peng Fan, Shawn Guo

On 12/19/22 00:21, Linus Walleij wrote:
> On Fri, Dec 16, 2022 at 10:51 PM Marek Vasut <marex@denx.de> wrote:
>> On 10/17/22 12:24, Linus Walleij wrote:
>>> On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
>>>
>>>> Always configure GPIO pins which are used as interrupt source as INPUTs.
>>>> In case the default pin configuration is OUTPUT, or the prior stage does
>>>> configure the pins as OUTPUT, then Linux will not reconfigure the pin as
>>>> INPUT and no interrupts are received.
>>>>
>>>> Always configure the interrupt source GPIO pin as input to fix the above case.
>>>>
>>>> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>
>>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> Can you please just pick these two patches up ?
> 
> Bartosz is queueing GPIO patches, I'm sure he will get to
> queue them soon enough.

Bartosz, any news ?

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

* Re: [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2023-01-10  8:16         ` Marek Vasut
@ 2023-01-16  8:31           ` Bartosz Golaszewski
  2023-01-16  9:51             ` Marek Vasut
  0 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-01-16  8:31 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Linus Walleij, Bartosz Golaszewski, linux-gpio, Loic Poulain,
	Marc Zyngier, NXP Linux Team, Peng Fan, Shawn Guo

On Tue, Jan 10, 2023 at 9:16 AM Marek Vasut <marex@denx.de> wrote:
>
> On 12/19/22 00:21, Linus Walleij wrote:
> > On Fri, Dec 16, 2022 at 10:51 PM Marek Vasut <marex@denx.de> wrote:
> >> On 10/17/22 12:24, Linus Walleij wrote:
> >>> On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
> >>>
> >>>> Always configure GPIO pins which are used as interrupt source as INPUTs.
> >>>> In case the default pin configuration is OUTPUT, or the prior stage does
> >>>> configure the pins as OUTPUT, then Linux will not reconfigure the pin as
> >>>> INPUT and no interrupts are received.
> >>>>
> >>>> Always configure the interrupt source GPIO pin as input to fix the above case.
> >>>>
> >>>> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
> >>>> Signed-off-by: Marek Vasut <marex@denx.de>
> >>>
> >>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >>
> >> Can you please just pick these two patches up ?
> >
> > Bartosz is queueing GPIO patches, I'm sure he will get to
> > queue them soon enough.
>
> Bartosz, any news ?

I don't know why this has escaped my attention for so long. I wanted
to apply it but it no longer applies on top of my for-next branch.
Could you rebase and resend? Sorry for the trouble Marek.

Bart

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

* Re: [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
  2023-01-16  8:31           ` Bartosz Golaszewski
@ 2023-01-16  9:51             ` Marek Vasut
  0 siblings, 0 replies; 13+ messages in thread
From: Marek Vasut @ 2023-01-16  9:51 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Bartosz Golaszewski, linux-gpio, Loic Poulain,
	Marc Zyngier, NXP Linux Team, Peng Fan, Shawn Guo

On 1/16/23 09:31, Bartosz Golaszewski wrote:
> On Tue, Jan 10, 2023 at 9:16 AM Marek Vasut <marex@denx.de> wrote:
>>
>> On 12/19/22 00:21, Linus Walleij wrote:
>>> On Fri, Dec 16, 2022 at 10:51 PM Marek Vasut <marex@denx.de> wrote:
>>>> On 10/17/22 12:24, Linus Walleij wrote:
>>>>> On Fri, Oct 14, 2022 at 12:00 AM Marek Vasut <marex@denx.de> wrote:
>>>>>
>>>>>> Always configure GPIO pins which are used as interrupt source as INPUTs.
>>>>>> In case the default pin configuration is OUTPUT, or the prior stage does
>>>>>> configure the pins as OUTPUT, then Linux will not reconfigure the pin as
>>>>>> INPUT and no interrupts are received.
>>>>>>
>>>>>> Always configure the interrupt source GPIO pin as input to fix the above case.
>>>>>>
>>>>>> Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
>>>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>>>
>>>>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>>>>
>>>> Can you please just pick these two patches up ?
>>>
>>> Bartosz is queueing GPIO patches, I'm sure he will get to
>>> queue them soon enough.
>>
>> Bartosz, any news ?
> 
> I don't know why this has escaped my attention for so long. I wanted
> to apply it but it no longer applies on top of my for-next branch.
> Could you rebase and resend? Sorry for the trouble Marek.

Done, V7 is out.

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

end of thread, other threads:[~2023-01-16  9:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13 21:59 [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Marek Vasut
2022-10-13 21:59 ` [PATCH v6 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode Marek Vasut
2022-10-17 10:24   ` Linus Walleij
2022-12-16 21:51     ` Marek Vasut
2022-12-18 23:21       ` Linus Walleij
2022-12-19  0:29         ` Marek Vasut
2023-01-10  8:16         ` Marek Vasut
2023-01-16  8:31           ` Bartosz Golaszewski
2023-01-16  9:51             ` Marek Vasut
2022-10-17 10:23 ` [PATCH v6 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Linus Walleij
2022-10-18  8:33   ` Marek Vasut
2022-10-18  8:46     ` Linus Walleij
2022-10-18  9:04       ` Marek Vasut

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