Date: Sat, 03 Nov 2001 00:56:10 +0900 From: Munehiro Matsuda <haro@h4.dion.ne.jp> To: t-ogawa@triaez.kaisei.org Cc: freebsd-current@FreeBSD.ORG, haro@h4.dion.ne.jp, imp@FreeBSD.ORG Subject: Re: Panic with PCCARD Message-ID: <20011103005610L.haro@h4.dion.ne.jp> In-Reply-To: <867kt9v774.wl.t-ogawa@triaez.kaisei.org> References: <20011102010512I.haro@h4.dion.ne.jp> <867kt9v774.wl.t-ogawa@triaez.kaisei.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello Ogawa-san, Thank you for your patch. That completely fixed my pccard problem. Now my pccard-modem gets attached as sio2, instead of sio3 like few days ago which seemed bogus, because my system don't have sio2! Regards, Haro From: OGAWA Takaya <t-ogawa@triaez.kaisei.org> Date: Fri, 02 Nov 2001 18:43:43 +0900 :: ::Same here. Stack trace is as below. :: ::This panic seems to be related to the recent change of ::devclass_alloc_unit() in subr_bus.c, which no longer ::automatically assigns a free unit number if specified unit ::number was already ocuppied. :: ::Currently pccardd(8) creates struct dev_desc with unit ::number 0 for pccard.conf entries without unit number, ::while devclass_add_unit() expects -1 for automatic ::unit number assignment. :: ::So fix for this problem would be: ::- Let pccardd(8) pass -1 as unit number for :: pccard.conf entries without unit number ::- Make sure devclass_add_child() didn't fail in :: sys/pccard/pccard.c in order to avoid panic. ::- Print warning regardless of bootverbose in :: devclass_alloc_unit() in sys/kern/subr_bus.c to :: inform user why device allocation failed. :: ::Patch includes above changes is attached. :: ::---------------------------------------- ::(kgdb) where ::#0 dumpsys () at /usr/src/sys/kern/kern_shutdown.c:492 ::#1 0xc0157a9b in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:335 ::#2 0xc0157ecd in panic (fmt=0xc022f99e "from debugger") :: at /usr/src/sys/kern/kern_shutdown.c:634 ::#3 0xc011f4d9 in db_panic (addr=-1072278331, have_addr=0, count=-1, :: modif=0xc8934974 "") at /usr/src/sys/ddb/db_command.c:443 ::#4 0xc011f477 in db_command (last_cmdp=0xc0257cec, cmd_table=0xc0257b2c, :: aux_cmd_tablep=0xc0252ae0, aux_cmd_tablep_end=0xc0252ae4) :: at /usr/src/sys/ddb/db_command.c:341 ::#5 0xc011f543 in db_command_loop () at /usr/src/sys/ddb/db_command.c:465 ::#6 0xc01217db in db_trap (type=12, code=0) at /usr/src/sys/ddb/db_trap.c:72 ::#7 0xc0212c4e in kdb_trap (type=12, code=0, regs=0xc8934ac0) :: at /usr/src/sys/i386/i386/db_interface.c:167 ::#8 0xc021f894 in trap_fatal (frame=0xc8934ac0, eva=60) :: at /usr/src/sys/i386/i386/trap.c:934 ::#9 0xc021f601 in trap_pfault (frame=0xc8934ac0, usermode=0, eva=60) :: at /usr/src/sys/i386/i386/trap.c:853 ::#10 0xc021f013 in trap (frame={tf_fs = -1071316968, tf_es = -1056767984, :: tf_ds = -1057947632, tf_edi = -1056341504, tf_esi = 0, :: tf_ebp = -929871104, tf_isp = -929871124, tf_ebx = -1056718336, :: tf_edx = 0, tf_ecx = 4, tf_eax = 0, tf_trapno = 12, tf_err = 2, :: tf_eip = -1072278331, tf_cs = 8, tf_eflags = 66118, tf_esp = -929871044, :: tf_ss = -1071852163}) at /usr/src/sys/i386/i386/trap.c:405 ::#11 0xc01654c5 in device_set_flags (dev=0x0, flags=0) :: at /usr/src/sys/kern/subr_bus.c:835 ::#12 0xc01cd57d in allocate_driver (slt=0xc0730400, desc=0xc1098200) :: at /usr/src/sys/pccard/pccard.c:245 ::#13 0xc01cdd5f in crdioctl (dev=0xc0276858, cmd=3232518150, :: data=0xc1098200 "sio", fflag=3, td=0xc8426104) :: at /usr/src/sys/pccard/pccard.c:603 ::#14 0xc01380b6 in spec_ioctl (ap=0xc8934ba4) :: at /usr/src/sys/fs/specfs/spec_vnops.c:320 ::#15 0xc0137d59 in spec_vnoperate (ap=0xc8934ba4) :: at /usr/src/sys/fs/specfs/spec_vnops.c:119 ::#16 0xc0197db7 in vn_ioctl (fp=0xc0fc9e40, com=3232518150, :: data=0xc1098200 "sio", td=0xc8426104) at vnode_if.h:357 ::#17 0xc0171838 in ioctl (td=0xc8426104, uap=0xc8934d20) :: at /usr/src/sys/sys/file.h:177 ::#18 0xc021fd40 in syscall (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, :: tf_edi = 0, tf_esi = 134689024, tf_ebp = -1077937408, :: tf_isp = -929870476, tf_ebx = 134689088, tf_edx = 8, tf_ecx = 9, :: tf_eax = 54, tf_trapno = 12, tf_err = 2, tf_eip = 134565072, tf_cs = 31, :: tf_eflags = 659, tf_esp = -1077937676, tf_ss = 47}) :: at /usr/src/sys/i386/i386/trap.c:1129 ::#19 0xc0213cbd in syscall_with_err_pushed () ::#20 0x8049345 in ?? () ::---Type <return> to continue, or q <return> to quit--- ::#21 0x8048dff in ?? () ::#22 0x8048abf in ?? () ::#23 0x8048135 in ?? () ::(kgdb) up 12 ::#12 0xc01cd57d in allocate_driver (slt=0xc0730400, desc=0xc1098200) :: at /usr/src/sys/pccard/pccard.c:245 ::245 device_set_flags(child, desc->flags); ::(kgdb) print *desc ::$1 = {name = "sio", '\000' <repeats 12 times>, unit = 0, mem = 0, memsize = 0, :: iobase = 744, iosize = 8, irqmask = 512, flags = 0, :: misc = '\000' <repeats 127 times>} ::(kgdb) quit ::---------------------------------------- :: ::--- usr.sbin/pccard/pccardd/file.c.orig Fri Nov 2 17:16:58 2001 ::+++ usr.sbin/pccard/pccardd/file.c Fri Nov 2 17:17:17 2001 ::@@ -573,6 +573,7 @@ :: drivers = drvp; :: drvp->name = newstr(name); :: drvp->kernel = newstr(name); ::+ drvp->unit = -1; :: p = drvp->kernel; :: while (*p++) :: if (*p >= '0' && *p <= '9') { ::--- sys/pccard/pccard.c.orig Fri Nov 2 17:17:52 2001 ::+++ sys/pccard/pccard.c Fri Nov 2 17:30:04 2001 ::@@ -242,6 +242,10 @@ :: bcopy(desc->misc, devi->misc, sizeof(desc->misc)); :: resource_list_init(&devi->resources); :: child = device_add_child(pccarddev, devi->name, desc->unit); ::+ if (child == NULL) { ::+ device_printf(pccarddev, "Failed to add a child.\n"); ::+ return (EIO); ::+ } :: device_set_flags(child, desc->flags); :: device_set_ivars(child, devi); :: if (bootverbose) { ::--- sys/kern/subr_bus.c.orig Fri Nov 2 17:30:21 2001 ::+++ sys/kern/subr_bus.c Fri Nov 2 17:30:40 2001 ::@@ -363,9 +363,8 @@ :: if (unit != -1) { :: if (unit >= 0 && unit < dc->maxunit && :: dc->devices[unit] != NULL) { ::- if (bootverbose) ::- printf("%s-: %s%d already exists, skipping it\n", ::- dc->name, dc->name, *unitp); ::+ printf("%s-: %s%d already exists, skipping it\n", ::+ dc->name, dc->name, *unitp); :: return (EEXIST); :: } :: } else { :: :: ::---------- ::OGAWA Takaya ::t-ogawa@triaez.kaisei.org =------------------------------------------------------------------------------ _ _ Munehiro (haro) Matsuda -|- /_\ |_|_| Business Incubation Dept., Kubota Corp. /|\ |_| |_|_| 1-3 Nihonbashi-Muromachi 3-Chome Chuo-ku Tokyo 103-8310, Japan Tel: +81-3-3245-3318 Fax: +81-3-3245-3315 Email: haro@kubota.co.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011103005610L.haro>