* [PATCH 1/2] gpio: omap: Add omap_gpio_disable/enable_irq calls
2024-10-10 18:48 [PATCH 0/2] Misc omap GPIO/UART fixes Judith Mendez
@ 2024-10-10 18:48 ` Judith Mendez
2024-10-10 18:48 ` [PATCH 2/2] serial: 8250: omap: Move pm_runtime_get_sync Judith Mendez
2024-10-11 16:58 ` [PATCH 0/2] Misc omap GPIO/UART fixes Judith Mendez
2 siblings, 0 replies; 5+ messages in thread
From: Judith Mendez @ 2024-10-10 18:48 UTC (permalink / raw)
To: Grygorii Strashko, Santosh Shilimkar, Kevin Hilman, Linus Walleij,
Bartosz Golaszewski
Cc: linux-omap, linux-gpio, linux-kernel, linux-serial, Judith Mendez,
Bin Liu
Add omap_gpio_disable_irq and omap_gpio_enable_irq
calls in gpio-omap.
Currently, kernel cannot disable gpio interrupts in
case of a irq storm, so add omap_gpio_disable_irq
so that interrupts can be disabled/enabled.
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
---
drivers/gpio/gpio-omap.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 76d5d87e9681..913e6ece1238 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -711,6 +711,31 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
raw_spin_unlock_irqrestore(&bank->lock, flags);
}
+static void omap_gpio_set_irq(struct irq_data *d, bool enable)
+{
+ struct gpio_bank *bank = omap_irq_data_get_bank(d);
+ unsigned int offset = d->hwirq;
+ unsigned long flags;
+
+ raw_spin_lock_irqsave(&bank->lock, flags);
+ omap_set_gpio_irqenable(bank, offset, enable);
+ raw_spin_unlock_irqrestore(&bank->lock, flags);
+}
+
+static void omap_gpio_disable_irq(struct irq_data *d)
+{
+ bool enable = 1;
+
+ omap_gpio_set_irq(d, !enable);
+}
+
+static void omap_gpio_enable_irq(struct irq_data *d)
+{
+ bool enable = 1;
+
+ omap_gpio_set_irq(d, enable);
+}
+
static void omap_gpio_irq_print_chip(struct irq_data *d, struct seq_file *p)
{
struct gpio_bank *bank = omap_irq_data_get_bank(d);
@@ -723,6 +748,8 @@ static const struct irq_chip omap_gpio_irq_chip = {
.irq_shutdown = omap_gpio_irq_shutdown,
.irq_mask = omap_gpio_mask_irq,
.irq_unmask = omap_gpio_unmask_irq,
+ .irq_disable = omap_gpio_disable_irq,
+ .irq_enable = omap_gpio_enable_irq,
.irq_set_type = omap_gpio_irq_type,
.irq_set_wake = omap_gpio_wake_enable,
.irq_bus_lock = omap_gpio_irq_bus_lock,
@@ -737,6 +764,8 @@ static const struct irq_chip omap_gpio_irq_chip_nowake = {
.irq_shutdown = omap_gpio_irq_shutdown,
.irq_mask = omap_gpio_mask_irq,
.irq_unmask = omap_gpio_unmask_irq,
+ .irq_disable = omap_gpio_disable_irq,
+ .irq_enable = omap_gpio_enable_irq,
.irq_set_type = omap_gpio_irq_type,
.irq_bus_lock = omap_gpio_irq_bus_lock,
.irq_bus_sync_unlock = gpio_irq_bus_sync_unlock,
--
2.46.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] serial: 8250: omap: Move pm_runtime_get_sync
2024-10-10 18:48 [PATCH 0/2] Misc omap GPIO/UART fixes Judith Mendez
2024-10-10 18:48 ` [PATCH 1/2] gpio: omap: Add omap_gpio_disable/enable_irq calls Judith Mendez
@ 2024-10-10 18:48 ` Judith Mendez
2024-10-11 4:46 ` Greg KH
2024-10-11 16:58 ` [PATCH 0/2] Misc omap GPIO/UART fixes Judith Mendez
2 siblings, 1 reply; 5+ messages in thread
From: Judith Mendez @ 2024-10-10 18:48 UTC (permalink / raw)
To: Grygorii Strashko, Santosh Shilimkar, Kevin Hilman, Linus Walleij,
Bartosz Golaszewski
Cc: linux-omap, linux-gpio, linux-kernel, linux-serial, Judith Mendez,
Bin Liu
Currently in omap_8250_shutdown, the dma->rx_running
flag is set to zero in omap_8250_rx_dma_flush. Next
pm_runtime_get_sync is called, which is a runtime
resume call stack which can re-set the flag. When the
call omap_8250_shutdown returns, the flag is expected
to be UN-SET, but this is not the case. This is causing
issues the next time UART is re-opened and omap_8250_rx_dma
is called. Fix by moving pm_runtime_get_sync before the
omap_8250_rx_dma_flush.
Fixes: 0e31c8d173ab ("tty: serial: 8250_omap: add custom DMA-RX callback")
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
---
drivers/tty/serial/8250/8250_omap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 88b58f44e4e9..0dd68bdbfbcf 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -776,12 +776,12 @@ static void omap_8250_shutdown(struct uart_port *port)
struct uart_8250_port *up = up_to_u8250p(port);
struct omap8250_priv *priv = port->private_data;
+ pm_runtime_get_sync(port->dev);
+
flush_work(&priv->qos_work);
if (up->dma)
omap_8250_rx_dma_flush(up);
- pm_runtime_get_sync(port->dev);
-
serial_out(up, UART_OMAP_WER, 0);
if (priv->habit & UART_HAS_EFR2)
serial_out(up, UART_OMAP_EFR2, 0x0);
--
2.46.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Misc omap GPIO/UART fixes
2024-10-10 18:48 [PATCH 0/2] Misc omap GPIO/UART fixes Judith Mendez
2024-10-10 18:48 ` [PATCH 1/2] gpio: omap: Add omap_gpio_disable/enable_irq calls Judith Mendez
2024-10-10 18:48 ` [PATCH 2/2] serial: 8250: omap: Move pm_runtime_get_sync Judith Mendez
@ 2024-10-11 16:58 ` Judith Mendez
2 siblings, 0 replies; 5+ messages in thread
From: Judith Mendez @ 2024-10-11 16:58 UTC (permalink / raw)
To: Santosh Shilimkar, Kevin Hilman, Linus Walleij,
Bartosz Golaszewski
Cc: linux-omap, linux-gpio, linux-kernel, linux-serial
Hi all,
On 10/10/24 1:48 PM, Judith Mendez wrote:
> This patch series carries some miscellaneous
> omap driver fixes for GPIO and UART drivers.
>
> For GPIO, add gpio_enable and gpio_disable calls
> to gpio-omap which fixes an issue where if there
> is an irq storm, serial console is unresponsive.
>
> For UART, move pm_runtime_get_sync since the
> current order of omap_8250_rx_dma_flush and
> pm_runtime_get_sync calls are set in a way that
> when omap_8250_shutdown returns, dma->rx_running
> is set and this causes issues next time the UART
> is re-opened.
Please ignore this patch series, I will be re-sending
this patch series with some CC list cleanups.
~ Judith
^ permalink raw reply [flat|nested] 5+ messages in thread