Date: Mon, 06 Mar 2006 18:10:22 -0700 From: Scott Long <scottl@samsco.org> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-scsi@freebsd.org, Andrey Beresovsky <and@rsu.ru> Subject: Re: Boot hangs on ips0: resetting adapter, this may take up to 5 minutes Message-ID: <440CDD7E.3060208@samsco.org> In-Reply-To: <200603061243.04708.jhb@freebsd.org> References: <20060215102749.D58480@brain.cc.rsu.ru> <20060304224419.N1270@wolf.os.rsu.ru> <1141653998.1502.23.camel@brain.cc.rsu.ru> <200603061243.04708.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin wrote: > On Monday 06 March 2006 09:06, Oleg Sharoiko wrote: > >>On Sat, 2006-03-04 at 23:07 +0300, Oleg Sharoiko wrote: >> >> >>>ips0: <Adaptec ServeRAID Adapter> mem >>>0xd0300000-0xd0300fff,0xd4000000-0xd7ffffff irq 11 at device 1.0 on pci3 >>>ips0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xd0300000 >>>ips0: irq allocation failed >>>panic: Assertion mtx_unowned(m) failed at >>>/usr/src-HEAD-20060228-223000UTC/sys/kern/kern_mutex.c:885 >>>cpuid = 0 >>>KDB: enter: panic >>>[thread pid 0 tid 0 ] >>>Stopped at kdb_enter+0x31: leave >>>db> >> >>There seems to be a small bug in the ips driver. I doesn't relate to the >>hang at all, but as I suppose it needs to be fixed anyway. >> >>ips_pci_attach() from dev/ips/ips_pci.c does "goto error;" to make a >>cleanup when something goes wrong. There we have >> >>error: >> ips_pci_free(sc); >> return (ENXIO); >> >>ips_pci_free() always calls >> >>mtx_destroy(&sc->queue_mtx); >>sema_destroy(&sc->cmd_sema); >> >>but ips_pci_attach may jump to error: event before queue_mtx gets >>initialized. Unfortunately I'm not sure how to fix this in the most >>proper way. I suppose it would be nice to check in ips_pci_free() if the >>mutex is initialized or not, but I don't know how to implement this >>check. Another possible solution is to move initializition before first >>"goto error"; So I'm leaving this for the one who knows better. > > > Actually, you can just init the mutex and sema earlier so they are always > setup. That's what several other drivers do. mtx_init() is fairly > cheap in the non-WITNESS case. > Yeah, but he pointed out that there are other problems with the attach failure code, so I was going to take care of everything together. Scott
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?440CDD7E.3060208>