mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
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
This commit is contained in:
parent
2b716e00cf
commit
015daf5221
|
@ -1270,9 +1270,6 @@ hdac_attach(device_t dev)
|
|||
|
||||
/* Allocate resources */
|
||||
result = hdac_mem_alloc(sc);
|
||||
if (result != 0)
|
||||
goto hdac_attach_fail;
|
||||
result = hdac_irq_alloc(sc);
|
||||
if (result != 0)
|
||||
goto hdac_attach_fail;
|
||||
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue