linux-mips
[Top] [All Lists]

Re: IP22 doesn't shutdown properly

To: Russell King <rmk@arm.linux.org.uk>
Subject: Re: IP22 doesn't shutdown properly
From: Martin Michlmayr <tbm@cyrius.com>
Date: Mon, 27 Feb 2006 10:54:33 +0000
Cc: linux-mips@linux-mips.org, jblache@debian.org
In-reply-to: <20060224083141.GA32080@flint.arm.linux.org.uk>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20060217225824.GE20785@deprecation.cyrius.com> <20060223221350.GA5239@deprecation.cyrius.com> <20060223224346.GA7536@flint.arm.linux.org.uk> <20060224003947.GJ9704@deprecation.cyrius.com> <20060224083141.GA32080@flint.arm.linux.org.uk>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.11
* Russell King <rmk@arm.linux.org.uk> [2006-02-24 08:31]:
> Not quite - I didn't say "do absolutely nothing" - I did explicitly say
...
> At a guess, for the console port, you want to disable the receiver, leave
> the transmitter enabled, and disable all interrupts originating from the
> port.

I tried to implement this suggestion but it still fails.  Note that
I'm a complete kernel newbie so maybe I just did something wrong.  In
any case, the other fix I just sent (taken from sunzilog) works.

For the record, what I initially tried (but which doesn't work) was:

diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index 419dd3c..2bda770 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -747,20 +747,23 @@ static void ip22zilog_shutdown(struct ua
        struct zilog_channel *channel;
        unsigned long flags;
 
-       if (ZS_IS_CONS(up))
-               return;
-
        spin_lock_irqsave(&port->lock, flags);
 
        channel = ZILOG_CHANNEL_FROM_PORT(port);
 
-       /* Disable receiver and transmitter.  */
+       /* Disable receiver. */
        up->curregs[R3] &= ~RxENAB;
-       up->curregs[R5] &= ~TxENAB;
-
-       /* Disable all interrupts and BRK assertion.  */
+       /* Disable all interrupts. */
        up->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
-       up->curregs[R5] &= ~SND_BRK;
+       /* For the console port, we want to disable the receiver, leave
+        * the transmitter enabled, and disable all interrupts originating
+        * from the port. */
+       if (!ZS_IS_CONS(up)) {
+               /* Disable transmitter. */
+               up->curregs[R5] &= ~TxENAB;
+               /* Disable BRK assertion. */
+               up->curregs[R5] &= ~SND_BRK;
+       }
        ip22zilog_maybe_update_regs(up, channel);
 
        spin_unlock_irqrestore(&port->lock, flags);
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 5cc4d4c..63cdf9d 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -834,20 +834,23 @@ static void sunzilog_shutdown(struct uar
        struct zilog_channel __iomem *channel;
        unsigned long flags;
 
-       if (ZS_IS_CONS(up))
-               return;
-
        spin_lock_irqsave(&port->lock, flags);
 
        channel = ZILOG_CHANNEL_FROM_PORT(port);
 
-       /* Disable receiver and transmitter.  */
+       /* Disable receiver. */
        up->curregs[R3] &= ~RxENAB;
-       up->curregs[R5] &= ~TxENAB;
-
-       /* Disable all interrupts and BRK assertion.  */
+       /* Disable all interrupts. */
        up->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
-       up->curregs[R5] &= ~SND_BRK;
+       /* For the console port, we want to disable the receiver, leave
+        * the transmitter enabled, and disable all interrupts originating
+        * from the port. */
+       if (!ZS_IS_CONS(up)) {
+               /* Disable transmitter. */
+               up->curregs[R5] &= ~TxENAB;
+               /* Disable BRK assertion. */
+               up->curregs[R5] &= ~SND_BRK;
+       }
        sunzilog_maybe_update_regs(up, channel);
 
        spin_unlock_irqrestore(&port->lock, flags);

-- 
Martin Michlmayr
http://www.cyrius.com/

<Prev in Thread] Current Thread [Next in Thread>