* [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown
@ 2015-03-13 11:38 Javier Martinez Canillas
2015-03-20 12:19 ` Javier Martinez Canillas
2015-03-20 13:34 ` Sylwester Nawrocki
0 siblings, 2 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2015-03-13 11:38 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jiri Slaby, Robert Baldyga, Sylwester Nawrocki, Olof Johansson,
Doug Anderson, linux-samsung-soc, linux-serial, linux-kernel,
Javier Martinez Canillas
Exynos serial ports operate either in a DMA-based or interrupt-based
modes. In DMA-based mode, the UART generates a transfer data request
and a Transmission (Tx) interrupt in interrupt-based mode.
The Tx IRQ is only unmasked in interrupt-based mode and it was done
in s3c24xx_serial_start_tx(). Commit ba019a3e2ad5 ("serial: samsung:
remove redundant interrupt enabling") removed the IRQ enable on that
function since it is enabled when the mode is set in enable_tx_pio().
The problem is that enable_tx_pio() is only called if the port mode
has not been set before but the mode was not cleared on .shutdown().
So if the UART was shutdown and then started up again, the mode set
will remain and the Tx IRQ won't be unmasked.
This caused a hang on at least Exynos5250, Exynos5420 and Exynos5800
when the system is rebooted or powered off.
Fixes: ba019a3e2ad5 ("serial: samsung: remove redundant interrupt enabling")
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
I noticed this issue on an Exynos5250 Snow, Exynos5420 Peach Pit and Exynos
5800 Peach Pi Chromebooks. This patch fixes the issue on all of them.
The offending commit landed in v4.0-rc1 so this fix is -rc material.
drivers/tty/serial/samsung.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index af821a908720..cf08876922f1 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -963,6 +963,7 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
free_irq(ourport->tx_irq, ourport);
tx_enabled(port) = 0;
ourport->tx_claimed = 0;
+ ourport->tx_mode = 0;
}
if (ourport->rx_claimed) {
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown
2015-03-13 11:38 [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown Javier Martinez Canillas
@ 2015-03-20 12:19 ` Javier Martinez Canillas
2015-03-26 21:57 ` Greg Kroah-Hartman
2015-03-20 13:34 ` Sylwester Nawrocki
1 sibling, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2015-03-20 12:19 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jiri Slaby, Robert Baldyga, Sylwester Nawrocki, Olof Johansson,
Doug Anderson, linux-samsung-soc, linux-serial, linux-kernel
Hello,
On 03/13/2015 12:38 PM, Javier Martinez Canillas wrote:
> Exynos serial ports operate either in a DMA-based or interrupt-based
> modes. In DMA-based mode, the UART generates a transfer data request
> and a Transmission (Tx) interrupt in interrupt-based mode.
>
> The Tx IRQ is only unmasked in interrupt-based mode and it was done
> in s3c24xx_serial_start_tx(). Commit ba019a3e2ad5 ("serial: samsung:
> remove redundant interrupt enabling") removed the IRQ enable on that
> function since it is enabled when the mode is set in enable_tx_pio().
>
> The problem is that enable_tx_pio() is only called if the port mode
> has not been set before but the mode was not cleared on .shutdown().
>
> So if the UART was shutdown and then started up again, the mode set
> will remain and the Tx IRQ won't be unmasked.
>
> This caused a hang on at least Exynos5250, Exynos5420 and Exynos5800
> when the system is rebooted or powered off.
>
> Fixes: ba019a3e2ad5 ("serial: samsung: remove redundant interrupt enabling")
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
>
> I noticed this issue on an Exynos5250 Snow, Exynos5420 Peach Pit and Exynos
> 5800 Peach Pi Chromebooks. This patch fixes the issue on all of them.
>
> The offending commit landed in v4.0-rc1 so this fix is -rc material.
>
> drivers/tty/serial/samsung.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index af821a908720..cf08876922f1 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -963,6 +963,7 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
> free_irq(ourport->tx_irq, ourport);
> tx_enabled(port) = 0;
> ourport->tx_claimed = 0;
> + ourport->tx_mode = 0;
> }
>
> if (ourport->rx_claimed) {
>
Any comments about this patch? 3.14-rc5 will most likely be released this weekend
so we are running out of time to fix this issue before 3.14 is released.
Best regards,
Javier
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown
2015-03-20 12:19 ` Javier Martinez Canillas
@ 2015-03-26 21:57 ` Greg Kroah-Hartman
2015-03-26 22:19 ` Javier Martinez Canillas
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2015-03-26 21:57 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: Jiri Slaby, Robert Baldyga, Sylwester Nawrocki, Olof Johansson,
Doug Anderson, linux-samsung-soc, linux-serial, linux-kernel
On Fri, Mar 20, 2015 at 01:19:44PM +0100, Javier Martinez Canillas wrote:
> Hello,
>
> On 03/13/2015 12:38 PM, Javier Martinez Canillas wrote:
> > Exynos serial ports operate either in a DMA-based or interrupt-based
> > modes. In DMA-based mode, the UART generates a transfer data request
> > and a Transmission (Tx) interrupt in interrupt-based mode.
> >
> > The Tx IRQ is only unmasked in interrupt-based mode and it was done
> > in s3c24xx_serial_start_tx(). Commit ba019a3e2ad5 ("serial: samsung:
> > remove redundant interrupt enabling") removed the IRQ enable on that
> > function since it is enabled when the mode is set in enable_tx_pio().
> >
> > The problem is that enable_tx_pio() is only called if the port mode
> > has not been set before but the mode was not cleared on .shutdown().
> >
> > So if the UART was shutdown and then started up again, the mode set
> > will remain and the Tx IRQ won't be unmasked.
> >
> > This caused a hang on at least Exynos5250, Exynos5420 and Exynos5800
> > when the system is rebooted or powered off.
> >
> > Fixes: ba019a3e2ad5 ("serial: samsung: remove redundant interrupt enabling")
> > Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> > ---
> >
> > I noticed this issue on an Exynos5250 Snow, Exynos5420 Peach Pit and Exynos
> > 5800 Peach Pi Chromebooks. This patch fixes the issue on all of them.
> >
> > The offending commit landed in v4.0-rc1 so this fix is -rc material.
> >
> > drivers/tty/serial/samsung.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> > index af821a908720..cf08876922f1 100644
> > --- a/drivers/tty/serial/samsung.c
> > +++ b/drivers/tty/serial/samsung.c
> > @@ -963,6 +963,7 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
> > free_irq(ourport->tx_irq, ourport);
> > tx_enabled(port) = 0;
> > ourport->tx_claimed = 0;
> > + ourport->tx_mode = 0;
> > }
> >
> > if (ourport->rx_claimed) {
> >
>
> Any comments about this patch? 3.14-rc5 will most likely be released this weekend
> so we are running out of time to fix this issue before 3.14 is released.
3.14 was released months ago...
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown
2015-03-26 21:57 ` Greg Kroah-Hartman
@ 2015-03-26 22:19 ` Javier Martinez Canillas
0 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2015-03-26 22:19 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jiri Slaby, Robert Baldyga, Sylwester Nawrocki, Olof Johansson,
Doug Anderson, linux-samsung-soc, linux-serial, linux-kernel
On 03/26/2015 10:57 PM, Greg Kroah-Hartman wrote:
> On Fri, Mar 20, 2015 at 01:19:44PM +0100, Javier Martinez Canillas wrote:
>> > The offending commit landed in v4.0-rc1 so this fix is -rc material.
>> >
>> > drivers/tty/serial/samsung.c | 1 +
>> > 1 file changed, 1 insertion(+)
>> >
>> > diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>> > index af821a908720..cf08876922f1 100644
>> > --- a/drivers/tty/serial/samsung.c
>> > +++ b/drivers/tty/serial/samsung.c
>> > @@ -963,6 +963,7 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
>> > free_irq(ourport->tx_irq, ourport);
>> > tx_enabled(port) = 0;
>> > ourport->tx_claimed = 0;
>> > + ourport->tx_mode = 0;
>> > }
>> >
>> > if (ourport->rx_claimed) {
>> >
>>
>> Any comments about this patch? 3.14-rc5 will most likely be released this weekend
>> so we are running out of time to fix this issue before 3.14 is released.
>
> 3.14 was released months ago...
>
err... I don't know what I was thinking when I wrote this, I obviously
meant 4.0. It seems the 3.1 prefix stuck in my head :)
Best regards,
Javier
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown
2015-03-13 11:38 [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown Javier Martinez Canillas
2015-03-20 12:19 ` Javier Martinez Canillas
@ 2015-03-20 13:34 ` Sylwester Nawrocki
1 sibling, 0 replies; 5+ messages in thread
From: Sylwester Nawrocki @ 2015-03-20 13:34 UTC (permalink / raw)
To: Javier Martinez Canillas, Robert Baldyga
Cc: Greg Kroah-Hartman, Jiri Slaby, Olof Johansson, Doug Anderson,
linux-samsung-soc, linux-serial, linux-kernel
On 13/03/15 12:38, Javier Martinez Canillas wrote:
> Exynos serial ports operate either in a DMA-based or interrupt-based
> modes. In DMA-based mode, the UART generates a transfer data request
> and a Transmission (Tx) interrupt in interrupt-based mode.
>
> The Tx IRQ is only unmasked in interrupt-based mode and it was done
> in s3c24xx_serial_start_tx(). Commit ba019a3e2ad5 ("serial: samsung:
> remove redundant interrupt enabling") removed the IRQ enable on that
> function since it is enabled when the mode is set in enable_tx_pio().
>
> The problem is that enable_tx_pio() is only called if the port mode
> has not been set before but the mode was not cleared on .shutdown().
>
> So if the UART was shutdown and then started up again, the mode set
> will remain and the Tx IRQ won't be unmasked.
>
> This caused a hang on at least Exynos5250, Exynos5420 and Exynos5800
> when the system is rebooted or powered off.
>
> Fixes: ba019a3e2ad5 ("serial: samsung: remove redundant interrupt enabling")
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
>
> I noticed this issue on an Exynos5250 Snow, Exynos5420 Peach Pit and Exynos
> 5800 Peach Pi Chromebooks. This patch fixes the issue on all of them.
>
> The offending commit landed in v4.0-rc1 so this fix is -rc material.
>
> drivers/tty/serial/samsung.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index af821a908720..cf08876922f1 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -963,6 +963,7 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
> free_irq(ourport->tx_irq, ourport);
> tx_enabled(port) = 0;
> ourport->tx_claimed = 0;
> + ourport->tx_mode = 0;
> }
The patch looks good to me, Robert could you comment on that?
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
--
Thanks,
Sylwester
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-26 22:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-13 11:38 [PATCH 1/1] serial: samsung: Clear operation mode on UART shutdown Javier Martinez Canillas
2015-03-20 12:19 ` Javier Martinez Canillas
2015-03-26 21:57 ` Greg Kroah-Hartman
2015-03-26 22:19 ` Javier Martinez Canillas
2015-03-20 13:34 ` Sylwester Nawrocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox