Re: Loading uart module fails

看板FB_current作者時間14年前 (2012/02/25 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/5 (看更多)
On Thursday, February 23, 2012 9:41:16 am Alexey Dokuchaev wrote: > On Thu, Feb 23, 2012 at 08:28:47AM -0500, John Baldwin wrote: > > Hmm, can you see what 'dev->nameunit' is? Maybe just do 'p *dev' actually > > and reply with that. > > (kgdb) p *dev > $1 = {ops = 0xc50de000, link = {tqe_next = 0xc5271380, tqe_prev = > 0xc5271184}, > devlink = {tqe_next = 0xc5271380, tqe_prev = 0xc527118c}, > parent = 0xc51fca80, children = {tqh_first = 0x0, tqh_last = 0xc5271318}, > driver = 0x0, devclass = 0xc5270a40, unit = 0, > nameunit = 0xc5006a00 "uart0", > desc = 0xc5511205 <Address 0xc5511205 out of bounds>, busy = 0, > state = DS_NOTPRESENT, devflags = 0, flags = 35, order = 30, > ivars = 0xc5270d00, softc = 0x0, sysctl_ctx = {tqh_first = 0x0, > tqh_last = 0x0}, sysctl_tree = 0x0} Try this for fixing the panic. New-bus was not clearing the description if a device's attach routine failed. Index: subr_bus.c =================================================================== --- subr_bus.c (revision 231983) +++ subr_bus.c (working copy) @@ -1129,7 +1129,6 @@ devclass_driver_deleted(devclass_t busclass, devcl dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); - (void)device_set_driver(dev, NULL); BUS_PROBE_NOMATCH(dev->parent, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; @@ -2097,7 +2097,7 @@ device_probe_child(device_t dev, device_t child) /* XXX What happens if we rebid and got no best? */ if (best) { /* - * If this device was atached, and we were asked to + * If this device was attached, and we were asked to * rescan, and it is a different driver, then we have * to detach the old driver and reattach this new one. * Note, we don't have to check for DF_REBID here @@ -2604,6 +2606,7 @@ device_set_driver(device_t dev, driver_t *driver) free(dev->softc, M_BUS_SC); dev->softc = NULL; } + device_set_desc(dev, NULL); kobj_delete((kobj_t) dev, NULL); dev->driver = driver; if (driver) { @@ -2789,7 +2792,6 @@ device_detach(device_t dev) dev->state = DS_NOTPRESENT; (void)device_set_driver(dev, NULL); - device_set_desc(dev, NULL); device_sysctl_fini(dev); return (0); -- John Baldwin _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1FHz1YKM (FB_current)
文章代碼(AID): #1FHz1YKM (FB_current)