All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IP22: fix serial console hangs
@ 2006-07-09 13:51 Julien BLACHE
  2006-07-09 17:38 ` Kumba
  2006-07-09 17:58 ` Martin Michlmayr
  0 siblings, 2 replies; 7+ messages in thread
From: Julien BLACHE @ 2006-07-09 13:51 UTC (permalink / raw)
  To: linux-mips; +Cc: debian-mips

[-- Attachment #1: Type: text/plain, Size: 2011 bytes --]

Hi,

The patch below fixes serial console hangs as seen on IP22
machines. Typically, while booting, the machine hangs for ~1 minute
displaying "INIT: ", then the same thing happens again when init
enters in the designated runlevel and finally the getty process on
ttyS0 hangs indefinitely (though strace'ing it helps).

strace (-e raw=ioctl, otherwise the ioctl() translation is utterly
bogus) reveals that getty hangs on ioctl() 0x540f which happens to be
TCSETSW (I saw it hang on another console ioctl() but couldn't
reproduce that one).

A diff between ip22zilog and sunzilog revealed the following
differences:
 1. the channel A flag being set on up.port.flags instead of up.flags
 2. the channel A flag being set on what is marked as being channel B
 3. sunzilog has a call to uart_update_timeout(port, termios->c_cflag, baud);
    at the end of sunzilog_set_termios(), which ip22zilog lacks (on
    purpose ?)

The patch below addresses point 1 and fixes the serial console hangs
just fine. However point 2 should be investigated by someone familiar
with the IP22 Zilog; it's probably OK as is but even if it is, a
comment in ip22zilog.c is badly needed.

Point 3 is left as an exercise for whoever feels like digging into
ip22zilog :)

These are the main obvious differences between ip22zilog and
sunzilog. Newer versions of sunzilog (Linus's git tree as of today)
are more close to ip22zilog as the sbus_{write,read}b have been
changed into simple {write,read}b, which shrinks the diff by a fair
amount. Resyncing both drivers should be doable in a few hours time
now for someone familiar with the IP22 Zilog hardware.


Additional point: the IP22 thinks it's using the console on the
framebuffer when booting, when it's really using the serial console
(console=ttyS passed at boot, console=d, consoleOut=serial(0))


Please apply, along with the RTC typo fix from yesterday.

Thanks,

JB.

---
IP22: fix serial console hang due to a typo in ip22zilog.c

Signed-off-by: Julien BLACHE <jb@jblache.org>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix serial console hangs on IP22 --]
[-- Type: text/x-patch, Size: 538 bytes --]

--- source-mips-none/drivers/serial/ip22zilog.c	2006-06-18 03:49:35.000000000 +0200
+++ source/drivers/serial/ip22zilog.c	2006-07-09 14:25:11.847260358 +0200
@@ -1145,9 +1145,8 @@
 		up[(chip * 2) + 1].port.fifosize = 1;
 		up[(chip * 2) + 1].port.ops = &ip22zilog_pops;
 		up[(chip * 2) + 1].port.type = PORT_IP22ZILOG;
-		up[(chip * 2) + 1].port.flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
 		up[(chip * 2) + 1].port.line = (chip * 2) + 1;
-		up[(chip * 2) + 1].flags = 0;
+		up[(chip * 2) + 1].flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
 	}
 }
 

[-- Attachment #3: Type: text/plain, Size: 290 bytes --]



-- 
 Julien BLACHE <jblache@debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

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

* Re: [PATCH] IP22: fix serial console hangs
  2006-07-09 13:51 [PATCH] IP22: fix serial console hangs Julien BLACHE
@ 2006-07-09 17:38 ` Kumba
  2006-07-09 18:37   ` Julien BLACHE
  2006-07-09 17:58 ` Martin Michlmayr
  1 sibling, 1 reply; 7+ messages in thread
From: Kumba @ 2006-07-09 17:38 UTC (permalink / raw)
  To: linux-mips; +Cc: Julien BLACHE

Julien BLACHE wrote:
> Hi,
> 
> The patch below fixes serial console hangs as seen on IP22
> machines. Typically, while booting, the machine hangs for ~1 minute
> displaying "INIT: ", then the same thing happens again when init
> enters in the designated runlevel and finally the getty process on
> ttyS0 hangs indefinitely (though strace'ing it helps).
> 

Out of curiosity, don't suppose you've seen the oops on IP22 that can sometimes 
be triggered by closing the serial client on another box?  Haven't investigated 
it too much, but I've seen the odd case on Indy and IP28 (which also uses the 
zilog driver) where shutting down my serial client or sometimes rebooting the 
system running the client oopses the driver.  I suspect some rogue data gets 
passed that zilog doesn't know how to handle properly.


--Kumba

-- 
Gentoo/MIPS Team Lead
Gentoo Foundation Board of Trustees

"Such is oft the course of deeds that move the wheels of the world: small hands 
do them because they must, while the eyes of the great are elsewhere."  --Elrond

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

* Re: [PATCH] IP22: fix serial console hangs
  2006-07-09 13:51 [PATCH] IP22: fix serial console hangs Julien BLACHE
  2006-07-09 17:38 ` Kumba
@ 2006-07-09 17:58 ` Martin Michlmayr
  2006-07-09 18:40   ` Julien BLACHE
  2006-07-09 18:40   ` Julien BLACHE
  1 sibling, 2 replies; 7+ messages in thread
From: Martin Michlmayr @ 2006-07-09 17:58 UTC (permalink / raw)
  To: Julien BLACHE; +Cc: linux-mips, debian-mips

* Julien BLACHE <jblache@debian.org> [2006-07-09 15:51]:
> The patch below fixes serial console hangs as seen on IP22
> machines. Typically, while booting, the machine hangs for ~1 minute

Thanks for tracking this down.  You've to send the patch to
rmk+serial@arm.linux.org.uk and linux-serial@vger.kernel.org
though.
-- 
Martin Michlmayr
http://www.cyrius.com/

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

* Re: [PATCH] IP22: fix serial console hangs
  2006-07-09 17:38 ` Kumba
@ 2006-07-09 18:37   ` Julien BLACHE
  0 siblings, 0 replies; 7+ messages in thread
From: Julien BLACHE @ 2006-07-09 18:37 UTC (permalink / raw)
  To: Kumba; +Cc: linux-mips

Kumba <kumba@gentoo.org> wrote:

Hi,

> Out of curiosity, don't suppose you've seen the oops on IP22 that can
> sometimes be triggered by closing the serial client on another box?

Haven't seen this one, no. I'm using a hardware console on the serial
line most of the time (though I still haven't found the proper
configuration and it's hardly usable for anything advanced making use
of terminal features).

> Haven't investigated it too much, but I've seen the odd case on Indy
> and IP28 (which also uses the zilog driver) where shutting down my
> serial client or sometimes rebooting the system running the client
> oopses the driver.  I suspect some rogue data gets passed that zilog
> doesn't know how to handle properly.

It looks a bit like the serial driver crash on reboot which Martin
Michlmayr fixed a couple of months back by backporting fixes from the
sunzilog driver. But I think this one made its way into the kernel, so
it must be something else.

JB.

-- 
 Julien BLACHE <jblache@debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

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

* Re: [PATCH] IP22: fix serial console hangs
  2006-07-09 17:58 ` Martin Michlmayr
@ 2006-07-09 18:40   ` Julien BLACHE
  2006-07-09 19:59     ` Russell King
  2006-07-09 18:40   ` Julien BLACHE
  1 sibling, 1 reply; 7+ messages in thread
From: Julien BLACHE @ 2006-07-09 18:40 UTC (permalink / raw)
  To: rmk+serial; +Cc: linux-serial, Martin Michlmayr

[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]

Martin Michlmayr <tbm@cyrius.com> wrote:

Hi,

>> The patch below fixes serial console hangs as seen on IP22
>> machines. Typically, while booting, the machine hangs for ~1 minute
>
> Thanks for tracking this down.  You've to send the patch to
> rmk+serial@arm.linux.org.uk and linux-serial@vger.kernel.org
> though.

Here it is for the serial hackers, then ;)



The patch below fixes serial console hangs as seen on IP22
machines. Typically, while booting, the machine hangs for ~1 minute
displaying "INIT: ", then the same thing happens again when init
enters in the designated runlevel and finally the getty process on
ttyS0 hangs indefinitely (though strace'ing it helps).

strace (-e raw=ioctl, otherwise the ioctl() translation is utterly
bogus) reveals that getty hangs on ioctl() 0x540f which happens to be
TCSETSW (I saw it hang on another console ioctl() but couldn't
reproduce that one).

A diff between ip22zilog and sunzilog revealed the following
differences:
 1. the channel A flag being set on up.port.flags instead of up.flags
 2. the channel A flag being set on what is marked as being channel B
 3. sunzilog has a call to uart_update_timeout(port, termios->c_cflag, baud);
    at the end of sunzilog_set_termios(), which ip22zilog lacks (on
    purpose ?)

The patch below addresses point 1 and fixes the serial console hangs
just fine. However point 2 should be investigated by someone familiar
with the IP22 Zilog; it's probably OK as is but even if it is, a
comment in ip22zilog.c is badly needed.

Point 3 is left as an exercise for whoever feels like digging into
ip22zilog :)

These are the main obvious differences between ip22zilog and
sunzilog. Newer versions of sunzilog (Linus's git tree as of today)
are more close to ip22zilog as the sbus_{write,read}b have been
changed into simple {write,read}b, which shrinks the diff by a fair
amount. Resyncing both drivers should be doable in a few hours time
now for someone familiar with the IP22 Zilog hardware.


Additional point: the IP22 thinks it's using the console on the
framebuffer when booting, when it's really using the serial console
(console=ttyS passed at boot, console=d, consoleOut=serial(0))


Please apply, along with the RTC typo fix from yesterday.

Thanks,

JB.

---
IP22: fix serial console hang due to a typo in ip22zilog.c

Signed-off-by: Julien BLACHE <jb@jblache.org>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix for IP22 serial console hangs --]
[-- Type: text/x-patch, Size: 538 bytes --]

--- source-mips-none/drivers/serial/ip22zilog.c	2006-06-18 03:49:35.000000000 +0200
+++ source/drivers/serial/ip22zilog.c	2006-07-09 14:25:11.847260358 +0200
@@ -1145,9 +1145,8 @@
 		up[(chip * 2) + 1].port.fifosize = 1;
 		up[(chip * 2) + 1].port.ops = &ip22zilog_pops;
 		up[(chip * 2) + 1].port.type = PORT_IP22ZILOG;
-		up[(chip * 2) + 1].port.flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
 		up[(chip * 2) + 1].port.line = (chip * 2) + 1;
-		up[(chip * 2) + 1].flags = 0;
+		up[(chip * 2) + 1].flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
 	}
 }
 

[-- Attachment #3: Type: text/plain, Size: 290 bytes --]



-- 
 Julien BLACHE <jblache@debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

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

* Re: [PATCH] IP22: fix serial console hangs
  2006-07-09 17:58 ` Martin Michlmayr
  2006-07-09 18:40   ` Julien BLACHE
@ 2006-07-09 18:40   ` Julien BLACHE
  1 sibling, 0 replies; 7+ messages in thread
From: Julien BLACHE @ 2006-07-09 18:40 UTC (permalink / raw)
  To: linux-mips; +Cc: debian-mips

Martin Michlmayr <tbm@cyrius.com> wrote:

> * Julien BLACHE <jblache@debian.org> [2006-07-09 15:51]:
>> The patch below fixes serial console hangs as seen on IP22
>> machines. Typically, while booting, the machine hangs for ~1 minute
>
> Thanks for tracking this down.  You've to send the patch to
> rmk+serial@arm.linux.org.uk and linux-serial@vger.kernel.org
> though.

Done.

JB.

-- 
 Julien BLACHE <jblache@debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

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

* Re: [PATCH] IP22: fix serial console hangs
  2006-07-09 18:40   ` Julien BLACHE
@ 2006-07-09 19:59     ` Russell King
  0 siblings, 0 replies; 7+ messages in thread
From: Russell King @ 2006-07-09 19:59 UTC (permalink / raw)
  To: Julien BLACHE; +Cc: linux-serial, Martin Michlmayr

On Sun, Jul 09, 2006 at 08:40:17PM +0200, Julien BLACHE wrote:
> The patch below fixes serial console hangs as seen on IP22
> machines. Typically, while booting, the machine hangs for ~1 minute
> displaying "INIT: ", then the same thing happens again when init
> enters in the designated runlevel and finally the getty process on
> ttyS0 hangs indefinitely (though strace'ing it helps).

Applied, thanks.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

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

end of thread, other threads:[~2006-07-09 19:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-09 13:51 [PATCH] IP22: fix serial console hangs Julien BLACHE
2006-07-09 17:38 ` Kumba
2006-07-09 18:37   ` Julien BLACHE
2006-07-09 17:58 ` Martin Michlmayr
2006-07-09 18:40   ` Julien BLACHE
2006-07-09 19:59     ` Russell King
2006-07-09 18:40   ` Julien BLACHE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.