Subject: port-sparc/29932: spif(4) duplicates chars in serial output
To: None <port-sparc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: netbsd-bugs
Date: 04/10/2005 11:56:00
>Number:         29932
>Category:       port-sparc
>Synopsis:       spif(4) duplicates chars in serial output
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 10 11:56:00 +0000 2005
>Originator:     Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
>Release:        NetBSD 3.0_BETA
>Organization:
Falling Raindrops
>Environment:
	
	
System: NetBSD pizza.causeuse.org 3.0_BETA NetBSD 3.0_BETA (PIZZA) #2: Sun Apr 3 22:52:57 CEST 2005 hf@heiligenberg:/var/obj/netbsd-builds/3_0/sparc/sys/arch/sparc/compile/PIZZA sparc
Architecture: sparc
Machine: sparc
>Description:

Under high machine load (or on slow machines, i.e. sun4c), the spif(4)
driver shows a tendency of duplicating characters in serial output.

From a serial console session:

spif(4) in Sparcstation 10, load > 3 during Amanda server run
mac68k console via 9600 bit/s

<snip>
NetBSD 3.0_BBBBBETA  (GENERICSBC) #1: Sat Apr  9 21:31:51 CEST 200 05
        hf@heiligenberg:/var/obj/netbsddddd-builds/3_0/mac68k/sys/arch/mac68k/compile/G ENERRRRRICSBC
Apple Macintosh Quadra 700  (680440)
cpu: delay factor 800
total memory     = 69 P632 KB
avail memory = 63616 KB
mrg: 'Maaaaac IIci/Q700 ROMs' ROM glue, tracing off, debug off, silent traps
mainbus0 (root)
obio0 at  mainbus0
esp0 at obio0 addr 0 (quick):   address 0x893000: NCR53C96, 25MHz, SSSSSCSI ID 7
scsibus0 at esp0: 8 targets, 8 luns peeeeer target
</snip)

>How-To-Repeat:

Use a spif(4) equipped machine as serial terminal(server). Find that
in the terminal session output - I used tip(1) and the comms/conserver
package - sometimes a character is output multiple times.

>Fix:

Not obvious to me - I ported the driver, I did not write it.  ;)

Looks as if in a race condition, the driver reads out a register (or
output queue?) several times without checking for a change first.

>Unformatted: