Index: sys/dev/sound/pci/hda/hdac.c =================================================================== --- sys/dev/sound/pci/hda/hdac.c (revision 196074) +++ sys/dev/sound/pci/hda/hdac.c (working copy) @@ -962,6 +962,7 @@ static int hdac_pcmchannel_setup(struct hdac_chan *); static void hdac_attach2(void *); +static void hdac_attach2_sub(void *); static uint32_t hdac_command_sendone_internal(struct hdac_softc *, uint32_t, int); @@ -4190,7 +4191,7 @@ sc->intrhook.ich_arg = (void *)sc; if (cold == 0 || config_intrhook_establish(&sc->intrhook) != 0) { sc->intrhook.ich_func = NULL; - hdac_attach2((void *)sc); + hdac_attach2_sub((void *)sc); } return (0); @@ -7418,6 +7419,15 @@ static void hdac_attach2(void *arg) { + + newbus_xlock(); + hdac_attach2_sub(arg); + newbus_xunlock(); +} + +static void +hdac_attach2_sub(void *arg) +{ struct hdac_codec *codec; struct hdac_softc *sc; struct hdac_audio_ctl *ctl; @@ -7435,7 +7445,6 @@ quirks_on, quirks_off); ); - newbus_xlock(); hdac_lock(sc); /* Remove ourselves from the config hooks */ @@ -7675,7 +7684,6 @@ SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, "pindump", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev), sysctl_hdac_pindump, "I", "Dump pin states/data"); - newbus_xunlock(); } /****************************************************************************