linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: linuxppc-dev@ozlabs.org, linux-serial@vger.kernel.org,
	Sylvain Munaut <tnt@246tnt.com>, Wolfgang Denk <wd@denx.de>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Bartlomiej Sieka <tur@semihalf.com>
Subject: [PATCH] Don't shutdown mpc5200 serial port if it is a console
Date: Thu, 19 Apr 2007 12:08:33 -0600	[thread overview]
Message-ID: <11770061133776-git-send-email-grant.likely@secretlab.ca> (raw)

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


             reply	other threads:[~2007-04-19 18:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-19 18:08 Grant Likely [this message]
2007-04-19 18:43 ` [PATCH] Don't shutdown mpc5200 serial port if it is a console Sylvain Munaut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11770061133776-git-send-email-grant.likely@secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=linux-serial@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=tnt@246tnt.com \
    --cc=tur@semihalf.com \
    --cc=wd@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).