The following reply was made to PR kernel/6465; it has been noted by GNATS.
From: "James Boyle" <[email protected]> To: Miod Vallat <[email protected]> Cc: [email protected] Subject: Re: kernel/6465: panic: ifconfig tsec1 down during a special? case Date: Wed, 15 Sep 2010 16:38:09 -0400 (EDT) Ok, I rebuilt the kernel, and executed the test, but it was not successful. Also, I had to remove the last right-brace from the diff to get it to compile: cc -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-main -Wno-uninitialized -Wno-format -Wstack-larger-than-2047 -msoft-float -Wa,-many -fno-builtin-printf -fno-builtin-snprintf -fno-builtin-vsnprintf -fno-builtin-log -fno-builtin-log2 -fno-builtin-malloc -O2 -pipe -nostdinc -I. -I../../../.. -I../../../../arch -DDDB -DDIAGNOSTIC -DKTRACE -DACCOUNTING -DKMEMSTATS -DPTRACE -DPOOL_DEBUG -DCRYPTO -DSYSVMSG -DSYSVSEM -DSYSVSHM -DUVM_SWAP_ENCRYPT -DCOMPAT_43 -DLKM -DFFS -DFFS2 -DFFS_SOFTUPDATES -DUFS_DIRHASH -DQUOTA -DEXT2FS -DMFS -DNNPFS -DTCP_SACK -DTCP_ECN -DTCP_SIGNATURE -DNFSCLIENT -DNFSSERVER -DCD9660 -DUDF -DMSDOSFS -DFIFO -DINET -DALTQ -DINET6 -DIPSEC -DPPP_BSDCOMP -DPPP_DEFLATE -DMROUTING -DBOOT_CONFIG -DPCIVERBOSE -DUSBVERBOSE -DUSER_PCICONF -DAPERTURE -DMAXUSERS=32 -D_KERNEL -D__socppc__ -c ../../../../arch/socppc/dev/if_tsec.c ../../../../arch/socppc/dev/if_tsec.c:1234: error: expected identifier or '(' before '}' token *** Error code 1 Stop in /obsd/src/sys/arch/socppc/compile/GENERIC (line 92 of /usr/share/mk/sys.mk). I picked up the process with 'make depend && make'... I did not run make clean the second time, but I started out with a fresh source tree from CVS at the beginning. So, after building the new kernel, here's the log of what happened (incl. ps & trace): boot> booting wd0a:/bsd: 3275268-+438416-[82+147296+136744]=0x3d0284 Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2010 OpenBSD. All rights reserved. http://www.OpenBSD.org OpenBSD 4.8-current (GENERIC) #0: Wed Sep 15 12:47:16 EDT 2010 [email protected]:/obsd/src/sys/arch/socppc/compile/GENERIC real mem = 134217728 (128MB) avail mem = 124485632 (118MB) mainbus0 at root cpu0 at mainbus0: 8347 obio0 at mainbus0 "wdt" at obio0 offset 0x00200 not configured com0 at obio0 offset 0x04500 ivec 9: st16650, no working fifo com0: console socpcic0 at obio0 offset 0x08500 pci0 at socpcic0 bus 0 "Freescale MPC8343" rev 0x30 at pci0 dev 0 function 0 not configured vge0 at pci0 dev 11 function 0 "VIA VT612x" rev 0x11: ivec 21, address 00:0c:42:41:be:c3 ciphy0 at vge0 phy 1: CS8201 10/100/1000TX PHY, rev. 2 athn0 at pci0 dev 14 function 0 "Atheros AR9280" rev 0x01: ivec 18, address 00:0c:42:61:39:b3 athn0: AR9280 rev 2 (2T2R), ROM rev 21 ipic0 at obio0 offset 0x00700 "mdio" at obio0 offset 0x24520 not configured tsec0 at obio0 offset 0x25000 ivec 35: address 00:0c:42:41:be:c1 rgephy0 at tsec0 phy 0: RTL8169S/8110S PHY, rev. 2 tsec1 at obio0 offset 0x24000 ivec 32: address 00:0c:42:41:be:c2 rgephy1 at tsec1 phy 1: RTL8169S/8110S PHY, rev. 2 "gpio" at obio0 offset 0x00c08 not configured "beeper" at obio0 offset 0x00500 not configured "led" at obio0 not configured "fancon" at mainbus0 not configured "nand" at mainbus0 not configured "nnand" at mainbus0 not configured "flash" at mainbus0 not configured wdc0 at mainbus0 wd0 at wdc0 channel 0 drive 0: <ELITE PRO CF CARD 16GB> wd0: 1-sector PIO, LBA, 15279MB, 31293360 sectors wd0(wdc0:0:0): using BIOS timings wdc1 at mainbus0 wd1 at wdc1 channel 0 drive 0: <SanDisk SDCFB-128> wd1: 1-sector PIO, LBA, 122MB, 250880 sectors wd1(wdc1:0:0): using BIOS timings softraid0 at root root on wd0a swap on wd0b dump on wd0b WARNING: clock lost 14805 days, using FS time -- CHECK AND RESET THE DATE! Automatic boot in progress: starting file system checks. /dev/rwd0a: file system is clean; not checking /dev/rwd1a: file system is clean; not checking setting tty flags pf enabled net.inet.ip.forwarding: 0 -> 1 starting network add net 172.32.32.128/27: gateway 172.32.32.37 starting system logger starting named tsec_watchdog starting initial daemons: ntpd. savecore: no core dump checking quotas: done. building ps databases: kvm dev. clearing /tmp starting pre-securelevel daemons:. setting kernel security level: kern.securelevel: 0 -> 1 turning on accounting creating runtime link editor directory cache. preserving editor files. starting network daemons: sshd dhcpd sendmail inetd. starting local daemons: ddclient. standard daemons: cron. Wed Sep 15 12:54:06 EDT 2010 OpenBSD/socppc (sniezka.routefire.net) (console) login: root Password: Last login: Sun Sep 12 22:07:36 on console OpenBSD 4.8-current (GENERIC) #0: Wed Sep 15 12:47:16 EDT 2010 Welcome to OpenBSD: The proactively secure Unix-like operating system. Please use the sendbug(1) utility to report bugs in the system. Before reporting a bug, please try to reproduce it with the latest version of the code. With bug reports, please try to ensure that enough information to reproduce the problem is enclosed, and if a known fix for it exists, include that as well. You have new mail. [r...@sniezka root]# ifconfig tsec0 tsec0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:0c:42:41:be:c1 priority: 0 media: Ethernet autoselect (1000baseT full-duplex) status: active inet 172.32.32.62 netmask 0xffffffe0 broadcast 172.32.32.63 inet6 fe80::20c:42ff:fe41:bec1%tsec0 prefixlen 64 scopeid 0x3 [r...@sniezka root]# ifconfig -a lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33200 priority: 0 groups: lo inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6 vge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:0c:42:41:be:c3 priority: 0 groups: egress media: Ethernet autoselect (100baseTX full-duplex) status: active inet 192.168.1.254 netmask 0xffffff00 broadcast 192.168.1.255 inet6 fe80::20c:42ff:fe41:bec3%vge0 prefixlen 64 scopeid 0x1 athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:0c:42:61:39:b3 priority: 4 groups: wlan media: IEEE802.11 autoselect mode 11a hostap status: active ieee80211: nwid "new bogota" chan 36 bssid 00:0c:42:61:39:b3 wpapsk <key> wpaprotos wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip inet 172.32.32.222 netmask 0xffffffe0 broadcast 172.32.32.223 inet6 fe80::20c:42ff:fe61:39b3%athn0 prefixlen 64 scopeid 0x2 tsec0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:0c:42:41:be:c1 priority: 0 media: Ethernet autoselect (1000baseT full-duplex) status: active inet 172.32.32.62 netmask 0xffffffe0 broadcast 172.32.32.63 inet6 fe80::20c:42ff:fe41:bec1%tsec0 prefixlen 64 scopeid 0x3 tsec1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:0c:42:41:be:c2 priority: 0 media: Ethernet autoselect (none) status: no carrier inet 172.32.32.94 netmask 0xffffffe0 broadcast 172.32.32.95 inet6 fe80::20c:42ff:fe41:bec2%tsec1 prefixlen 64 scopeid 0x4 enc0: flags=0<> priority: 0 groups: enc status: active pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33200 priority: 0 groups: pflog [r...@sniezka root]# ifconfig tsec1 down panic: kernel diagnostic assertion "n != 100" failed: file "../../../../arch/socppc/dev/if_tsec.c", line 1218 Stopped at Debugger+0x10: lwz r0,20(r1) RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC! DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION! ddb> ps PID PPID PGRP UID S FLAGS WAIT COMMAND *24809 18584 24809 0 7 0x4000 ifconfig 2440 23844 2440 1000 2 0x4000 ssh 23844 9496 23844 1000 3 0x4080 pause ksh 27297 26402 27297 0 3 0x4080 ttyin ksh 26402 9496 26402 1000 3 0x4080 pause ksh 9496 1 9496 1000 3 0x80 kqread tmux 30574 32362 30574 1000 3 0x4080 kqread tmux 32362 208 32362 1000 3 0x4080 pause ksh 208 29740 29740 1000 3 0x180 select sshd 29740 13305 29740 0 3 0x4080 netio sshd 18584 1 18584 0 3 0x4080 pause ksh 16856 1 16856 0 3 0x80 select cron 296 1 15842 0 3 0x80 nanosleep perl 12571 31480 31480 0 3 0x40180 netcon2 sendmail 31480 1 31480 0 3 0x40180 select sendmail 5174 1 5174 0 3 0x180 select inetd 26438 1 26438 77 3 0x180 poll dhcpd 13305 1 13305 0 3 0x80 select sshd 9136 0 0 0 3 0x100200 acct acct 23376 31143 20110 83 3 0x180 poll ntpd 31143 20110 20110 83 3 0x180 poll ntpd 20110 1 20110 0 3 0x80 poll ntpd 28601 25946 25946 70 3 0x180 select named 25946 1 25946 0 3 0x180 netio named 18295 29275 29275 74 3 0x180 bpf pflogd 29275 1 29275 0 3 0x80 netio pflogd 31773 15869 15869 73 3 0x180 poll syslogd 15869 1 15869 0 3 0x88 netio syslogd 10 0 0 0 3 0x100200 aiodoned aiodoned 9 0 0 0 3 0x100200 syncer update 8 0 0 0 3 0x100200 cleaner cleaner 7 0 0 0 3 0x100200 reaper reaper 6 0 0 0 3 0x100200 pgdaemon pagedaemon 5 0 0 0 3 0x100200 bored crypto 4 0 0 0 3 0x100200 pftm pfpurge 3 0 0 0 3 0x100200 bored syswq 2 0 0 0 3 0x40100200 idle0 1 0 1 0 3 0x4080 wait init 0 -1 0 0 3 0x80200 scheduler swapper ddb> trace 000000fc: tlbdsmsize+0x14 fp e3691c60 nfp e3691c70 002b15ac: panic+0xc8 fp e3691c70 nfp e3691cd0 002b16a8: __assert+0x2c fp e3691cd0 nfp e3691ce0 0043c55c: tsec_stop_dma+0x114 fp e3691ce0 nfp e3691d00 0043cbc0: tsec_down+0x44 fp e3691d00 nfp e3691d20 0043d900: tsec_ioctl+0x1c4 fp e3691d20 nfp e3691d50 002f784c: ifioctl+0x900 fp e3691d50 nfp e3691e00 002b8a4c: soo_ioctl+0x218 fp e3691e00 nfp e3691e10 002b50ac: sys_ioctl+0x210 fp e3691e10 nfp e3691ed0 0042e1e0: trap+0x76c fp e3691ed0 nfp e3691f50 0020080c: ddblow+0x1ac fp e3691f50 nfp fffd9180 ddb> boot reboot rebooting Miod Vallat <[email protected]> wrote .. > Does the following diff help? > > Index: if_tsec.c > =================================================================== > RCS file: /cvs/src/sys/arch/socppc/dev/if_tsec.c,v > retrieving revision 1.28 > diff -u -p -r1.28 if_tsec.c > --- if_tsec.c 21 Dec 2009 19:58:57 -0000 1.28 > +++ if_tsec.c 14 Sep 2010 22:39:52 -0000 > @@ -271,6 +271,8 @@ struct tsec_softc { > int sc_rx_cons; > > struct timeout sc_tick; > + > + int sc_dma_stopped; > }; > > #define DEVNAME(_s) ((_s)->sc_dev.dv_xname) > @@ -1001,6 +1003,7 @@ tsec_up(struct tsec_softc *sc) > ecntrl = tsec_read(sc, TSEC_ECNTRL); > tsec_write(sc, TSEC_ECNTRL, ecntrl | TSEC_ECNTRL_R100M); > > + sc->sc_dma_stopped = 0; > dmactrl = tsec_read(sc, TSEC_DMACTRL); > dmactrl |= TSEC_DMACTRL_TDSEN; > dmactrl |= TSEC_DMACTRL_TBDSEN; > @@ -1201,28 +1204,33 @@ tsec_stop_dma(struct tsec_softc *sc) > uint32_t dmactrl, ievent; > int n; > > - /* Stop DMA. */ > - dmactrl = tsec_read(sc, TSEC_DMACTRL); > - dmactrl |= TSEC_DMACTRL_GTS; > - tsec_write(sc, TSEC_DMACTRL, dmactrl); > + if (sc->sc_dma_stopped == 0) { > + /* Stop DMA. */ > + dmactrl = tsec_read(sc, TSEC_DMACTRL); > + dmactrl |= TSEC_DMACTRL_GTS; > + tsec_write(sc, TSEC_DMACTRL, dmactrl); > + > + for (n = 0; n < 100; n++) { > + ievent = tsec_read(sc, TSEC_IEVENT); > + if (ievent & TSEC_IEVENT_GTSC) > + break; > + } > + KASSERT(n != 100); > > - for (n = 0; n < 100; n++) { > - ievent = tsec_read(sc, TSEC_IEVENT); > - if (ievent & TSEC_IEVENT_GTSC) > - break; > + dmactrl = tsec_read(sc, TSEC_DMACTRL); > + dmactrl |= TSEC_DMACTRL_GRS; > + tsec_write(sc, TSEC_DMACTRL, dmactrl); > + > + for (n = 0; n < 100; n++) { > + ievent = tsec_read(sc, TSEC_IEVENT); > + if (ievent & TSEC_IEVENT_GRSC) > + break; > + } > + KASSERT(n != 100); > } > - KASSERT(n != 100); > > - dmactrl = tsec_read(sc, TSEC_DMACTRL); > - dmactrl |= TSEC_DMACTRL_GRS; > - tsec_write(sc, TSEC_DMACTRL, dmactrl); > - > - for (n = 0; n < 100; n++) { > - ievent = tsec_read(sc, TSEC_IEVENT); > - if (ievent & TSEC_IEVENT_GRSC) > - break; > - } > - KASSERT(n != 100); > + sc->sc_dma_stopped = 1; > +} > } > > struct tsec_dmamem *
