aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2023-09-27 12:23:58 +0000
committerMark Johnston <markj@FreeBSD.org>2023-09-27 12:28:27 +0000
commit015daf5221f7588b9258fe0242cee09bde39fe21 (patch)
treec7ad99435e20a51ba7b290c0d0c7cb6e922883b5
parent2b716e00cf3b59acbb5242f4b0695db84d2948af (diff)
downloadsrc-015daf5221f7588b9258fe0242cee09bde39fe21.tar.gz
src-015daf5221f7588b9258fe0242cee09bde39fe21.zip
hdac: Defer interrupt allocation in hdac_attach()
hdac_attach() registers an interrupt handler before allocating various driver resources which are accessed by the interrupt handler. On some platforms we observe what appear to be spurious interrupts upon a cold boot, resulting in panics. Partially work around the problem by deferring irq allocation until after other resources are allocated. I think this is not a complete solution, but is correct and sufficient to work around the problems reported in the PR. PR: 268393 Tested by: Alexander Sherikov <asherikov@yandex.com> Tested by: Oleh Hushchenkov <o.hushchenkov@gmail.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41883
-rw-r--r--sys/dev/sound/pci/hda/hdac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index 422f7f930ea5..2cf9239499af 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -1272,9 +1272,6 @@ hdac_attach(device_t dev)
result = hdac_mem_alloc(sc);
if (result != 0)
goto hdac_attach_fail;
- result = hdac_irq_alloc(sc);
- if (result != 0)
- goto hdac_attach_fail;
/* Get Capabilities */
result = hdac_get_capabilities(sc);
@@ -1347,6 +1344,10 @@ hdac_attach(device_t dev)
hdac_corb_init(sc);
hdac_rirb_init(sc);
+ result = hdac_irq_alloc(sc);
+ if (result != 0)
+ goto hdac_attach_fail;
+
/* Defer remaining of initialization until interrupts are enabled */
sc->intrhook.ich_func = hdac_attach2;
sc->intrhook.ich_arg = (void *)sc;