linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Don't shutdown mpc5200 serial port if it is a console
@ 2007-04-19 18:08 Grant Likely
  2007-04-19 18:43 ` Sylvain Munaut
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Likely @ 2007-04-19 18:08 UTC (permalink / raw)
  To: linuxppc-dev, linux-serial, Sylvain Munaut, Wolfgang Denk
  Cc: Grant Likely, Bartlomiej Sieka

If the serial port gets shut down, then console output stalls.  9 out
of 10 kernel hackers agree, this is a bad thing.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
---

This is a simple bug fix, but it's not a critical one.  It would be really
nice to get this merged for 2.6.21
 drivers/serial/mpc52xx_uart.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index f8c1761..35669f8 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -257,14 +257,16 @@ mpc52xx_uart_shutdown(struct uart_port *port)
 {
 	struct mpc52xx_psc __iomem *psc = PSC(port);
 
-	/* Shut down the port, interrupt and all */
-	out_8(&psc->command,MPC52xx_PSC_RST_RX);
-	out_8(&psc->command,MPC52xx_PSC_RST_TX);
+	/* We don't want to shut down a port that is used as a console */
+	if (!uart_console(port)) {
+		out_8(&psc->command,MPC52xx_PSC_RST_RX);
+		out_8(&psc->command,MPC52xx_PSC_RST_TX);
 
-	port->read_status_mask = 0;
-	out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
+		port->read_status_mask = 0;
+		out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
+	}
 
-	/* Release interrupt */
+	/* Release interrupt (OK for console port b/c console uses polling) */
 	free_irq(port->irq, port);
 }
 
-- 
1.5.1


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

* Re: [PATCH] Don't shutdown mpc5200 serial port if it is a console
  2007-04-19 18:08 [PATCH] Don't shutdown mpc5200 serial port if it is a console Grant Likely
@ 2007-04-19 18:43 ` Sylvain Munaut
  0 siblings, 0 replies; 2+ messages in thread
From: Sylvain Munaut @ 2007-04-19 18:43 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, linux-serial, Wolfgang Denk, Bartlomiej Sieka

The idea is OK,

but only TX should be left active and the interrupts should still be
disabled (imr set to 0), so we don't generate unhandled interrupts ...


        Sylvain


Grant Likely wrote:
> If the serial port gets shut down, then console output stalls.  9 out
> of 10 kernel hackers agree, this is a bad thing.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
> ---
>
> This is a simple bug fix, but it's not a critical one.  It would be really
> nice to get this merged for 2.6.21
>  drivers/serial/mpc52xx_uart.c |   14 ++++++++------
>  1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
> index f8c1761..35669f8 100644
> --- a/drivers/serial/mpc52xx_uart.c
> +++ b/drivers/serial/mpc52xx_uart.c
> @@ -257,14 +257,16 @@ mpc52xx_uart_shutdown(struct uart_port *port)
>  {
>  	struct mpc52xx_psc __iomem *psc = PSC(port);
>  
> -	/* Shut down the port, interrupt and all */
> -	out_8(&psc->command,MPC52xx_PSC_RST_RX);
> -	out_8(&psc->command,MPC52xx_PSC_RST_TX);
> +	/* We don't want to shut down a port that is used as a console */
> +	if (!uart_console(port)) {
> +		out_8(&psc->command,MPC52xx_PSC_RST_RX);
> +		out_8(&psc->command,MPC52xx_PSC_RST_TX);
>  
> -	port->read_status_mask = 0;
> -	out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
> +		port->read_status_mask = 0;
> +		out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
> +	}
>  
> -	/* Release interrupt */
> +	/* Release interrupt (OK for console port b/c console uses polling) */
>  	free_irq(port->irq, port);
>  }
>  
>   


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

end of thread, other threads:[~2007-04-19 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-19 18:08 [PATCH] Don't shutdown mpc5200 serial port if it is a console Grant Likely
2007-04-19 18:43 ` Sylvain Munaut

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