Subject: port-sparc/32052: tsleep() does not work on SMP sparc while shutting down
To: None <port-sparc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: netbsd-bugs
Date: 11/11/2005 22:30:00
>Number:         32052
>Category:       port-sparc
>Synopsis:       tsleep() does not work on SMP sparc while shutting down
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 11 22:30:00 +0000 2005
>Originator:     Hauke Fath
>Release:        NetBSD 3.0_BETA
>Organization:
Falling Raindrops
>Environment:
	
	
System: NetBSD pizza.causeuse.org 3.0_BETA NetBSD 3.0_BETA (PIZZA) #8: Sun Oct 30 16:49:34 CET 2005 hauke@pizza.causeuse.org:/usr/src/sys/arch/sparc/compile/PIZZA sparc
Architecture: sparc
Machine: sparc
>Description:

On a SPARCstation 10 equipped with two SM71 cpus I am running a
Netgear MA401 wlan card in a nell sbus-pcmcia bridge. With an SMP
enabled kernel and the MA401 inserted, the ss10 will hang in tsleep()
during shutdown.

[...]
unmounting /usr (/dev/sd1d)...
unmounting /var (/dev/sd0d)...
unmounting / (/dev/sd0a)... done
Before tsleep in 1131, file ../../../../dev/sbus/stp4020.c: ticks = 30
Stopped at      netbsd:cpu_Debugger+0x4:  or %o7, %g0, %g1
db{1}> ps
 PID           PPID     PGRP        UID S   FLAGS LWPS          COMMAND    WAIT
 1402             1      864        100 2  0x4102    1             halt stp4020
 558              0        0          0 2 0x20200    1            nfsio  nfsidl
 591              0        0          0 2 0x20200    1            nfsio  nfsidl
 569              0        0          0 2 0x20200    1            nfsio  nfsidl
 557              0        0          0 2 0x20200    1            nfsio  nfsidl
 306              0        0          0 2 0x20200    1       lfs_writer lfswrit
 7                0        0          0 2 0x20200    1         aiodoned aiodone
 6                0        0          0 2 0x20200    1          ioflush  syncer
 5                0        0          0 2 0x20200    1       pagedaemon pgdaemo
 4                0        0          0 2 0x20200    1         scsibus1  sccomp
 3                0        0          0 2 0x20200    1            nell0  pcicev
 2                0        0          0 2 0x20200    1         scsibus0  sccomp
 1                0        1          0 2  0x4000    1             init    wait
 0               -1        0          0 2 0x20200    1          swapper schedul
db{1}>

(Kernel configured with DEBUG and DIAGNOSTIC options.)

This does not happen with a kernel that lacks SMP support. In
addition, the frequent

stray interrupt ipl 0x7 pc=0xf0007e84 npc=0xf0007e88 psr=404000c7<S,PS> 

log entries only show up with SMP support.

A reboot has to be enforced by breaking into the kernel debugger and
issuing 'reboot' which usually works.

Replacing the netbsd-3 stp4020.c with the -current code did not help.

>How-To-Repeat:

Set up an SMP sparcstation with a nell(4) bridge and a prism card
(wi(4)) as wlan access point. Note that every time you shut it down,
it hangs.

>Fix:
	I don't have any.

>Unformatted: