bcm_dma: attach at an earlier bus pass

The sdhci_bcm driver attach routine relies on bcm_dma already being
attached, in order to allocate a DMA channel. However, both drivers
attached at the default pass so this is not guaranteed. Newer RPI
firmware exposes this assumption, and the result is a NULL-dereference
in bcm_dma_allocate().

To fix this, use BUS_PASS_SUPPORTDEV for bcm_dma.

PR:		268835
Reviewed by:	mhorne
MFC after:	1 week
This commit is contained in:
Mark Millard 2023-02-17 16:30:35 -04:00 committed by Mitchell Horne
parent 4036fcb805
commit 9873b17169

View File

@ -764,5 +764,6 @@ static driver_t bcm_dma_driver = {
sizeof(struct bcm_dma_softc),
};
DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0);
EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0,
BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE);
MODULE_VERSION(bcm_dma, 1);