Re: IP22 doesn't shutdown properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Russell King <rmk@xxxxxxxxxxxxxxxx> [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/


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux