* [PATCH] serial: samsung: disable irq before calling free_irq
@ 2012-02-11 3:12 ` Huisung Kang
0 siblings, 0 replies; 4+ messages in thread
From: Huisung Kang @ 2012-02-11 3:12 UTC (permalink / raw)
To: linux-arm-kernel, linux-samsung-soc; +Cc: gregkh, kgene.kim
From: Kisang Lee <kisang80.lee@samsung.com>
Pending UART irq may trigger spurious handling and may lead to
softlockup. This patch will fix following softlockup.
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
---
drivers/tty/serial/samsung.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c55e5fb..9067299 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -425,15 +425,19 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
struct s3c24xx_uart_port *ourport = to_ourport(port);
if (ourport->tx_claimed) {
- if (!s3c24xx_serial_has_interrupt_mask(port))
+ if (!s3c24xx_serial_has_interrupt_mask(port)) {
+ disable_irq(ourport->tx_irq);
free_irq(ourport->tx_irq, ourport);
+ }
tx_enabled(port) = 0;
ourport->tx_claimed = 0;
}
if (ourport->rx_claimed) {
- if (!s3c24xx_serial_has_interrupt_mask(port))
+ if (!s3c24xx_serial_has_interrupt_mask(port)) {
+ disable_irq(ourport->rx_irq);
free_irq(ourport->rx_irq, ourport);
+ }
ourport->rx_claimed = 0;
rx_enabled(port) = 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] serial: samsung: disable irq before calling free_irq
@ 2012-02-11 3:12 ` Huisung Kang
0 siblings, 0 replies; 4+ messages in thread
From: Huisung Kang @ 2012-02-11 3:12 UTC (permalink / raw)
To: linux-arm-kernel
From: Kisang Lee <kisang80.lee@samsung.com>
Pending UART irq may trigger spurious handling and may lead to
softlockup. This patch will fix following softlockup.
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
---
drivers/tty/serial/samsung.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c55e5fb..9067299 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -425,15 +425,19 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
struct s3c24xx_uart_port *ourport = to_ourport(port);
if (ourport->tx_claimed) {
- if (!s3c24xx_serial_has_interrupt_mask(port))
+ if (!s3c24xx_serial_has_interrupt_mask(port)) {
+ disable_irq(ourport->tx_irq);
free_irq(ourport->tx_irq, ourport);
+ }
tx_enabled(port) = 0;
ourport->tx_claimed = 0;
}
if (ourport->rx_claimed) {
- if (!s3c24xx_serial_has_interrupt_mask(port))
+ if (!s3c24xx_serial_has_interrupt_mask(port)) {
+ disable_irq(ourport->rx_irq);
free_irq(ourport->rx_irq, ourport);
+ }
ourport->rx_claimed = 0;
rx_enabled(port) = 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: samsung: disable irq before calling free_irq
2012-02-11 3:12 ` Huisung Kang
@ 2012-02-11 19:55 ` Russell King - ARM Linux
-1 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-02-11 19:55 UTC (permalink / raw)
To: Huisung Kang; +Cc: linux-arm-kernel, linux-samsung-soc, kgene.kim, gregkh
On Sat, Feb 11, 2012 at 12:12:33PM +0900, Huisung Kang wrote:
> From: Kisang Lee <kisang80.lee@samsung.com>
>
> Pending UART irq may trigger spurious handling and may lead to
> softlockup. This patch will fix following softlockup.
>
> Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
> Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
> ---
> drivers/tty/serial/samsung.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c55e5fb..9067299 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -425,15 +425,19 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
> struct s3c24xx_uart_port *ourport = to_ourport(port);
>
> if (ourport->tx_claimed) {
> - if (!s3c24xx_serial_has_interrupt_mask(port))
> + if (!s3c24xx_serial_has_interrupt_mask(port)) {
> + disable_irq(ourport->tx_irq);
> free_irq(ourport->tx_irq, ourport);
Either genirq is broken or something else is going on. Whatever, this is
not a valid bug fix.
Why? If you have a pending IRQ at free_irq() time, then you may also have
a pending IRQ before disable_irq() time. If the problem is that interrupt
causes a soft lockup, you're not really solving the issue.
Instead, if the problem is that free_irq() is removing the handler before
it masks the IRQ, then that's where the problem lies, but I doubt it -
the flow handlers are written such that if there isn't a handler in place,
they mask the interrupt themselves.
So, this needs much more explanation about the failure scenario.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] serial: samsung: disable irq before calling free_irq
@ 2012-02-11 19:55 ` Russell King - ARM Linux
0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-02-11 19:55 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Feb 11, 2012 at 12:12:33PM +0900, Huisung Kang wrote:
> From: Kisang Lee <kisang80.lee@samsung.com>
>
> Pending UART irq may trigger spurious handling and may lead to
> softlockup. This patch will fix following softlockup.
>
> Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
> Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
> ---
> drivers/tty/serial/samsung.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c55e5fb..9067299 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -425,15 +425,19 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
> struct s3c24xx_uart_port *ourport = to_ourport(port);
>
> if (ourport->tx_claimed) {
> - if (!s3c24xx_serial_has_interrupt_mask(port))
> + if (!s3c24xx_serial_has_interrupt_mask(port)) {
> + disable_irq(ourport->tx_irq);
> free_irq(ourport->tx_irq, ourport);
Either genirq is broken or something else is going on. Whatever, this is
not a valid bug fix.
Why? If you have a pending IRQ at free_irq() time, then you may also have
a pending IRQ before disable_irq() time. If the problem is that interrupt
causes a soft lockup, you're not really solving the issue.
Instead, if the problem is that free_irq() is removing the handler before
it masks the IRQ, then that's where the problem lies, but I doubt it -
the flow handlers are written such that if there isn't a handler in place,
they mask the interrupt themselves.
So, this needs much more explanation about the failure scenario.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-11 19:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-11 3:12 [PATCH] serial: samsung: disable irq before calling free_irq Huisung Kang
2012-02-11 3:12 ` Huisung Kang
2012-02-11 19:55 ` Russell King - ARM Linux
2012-02-11 19:55 ` Russell King - ARM Linux
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.