Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2023 16:55:41 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 5b6edfc577fb - stable/13 - bcm_dma: attach at an earlier bus pass
Message-ID:  <202303071655.327GtfdI022890@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=5b6edfc577fbb4e9703c112713c7fb472e144346

commit 5b6edfc577fbb4e9703c112713c7fb472e144346
Author:     Mark Millard <marklmi26-fbsd@yahoo.com>
AuthorDate: 2023-02-17 20:30:35 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2023-03-07 16:55:01 +0000

    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
    
    (cherry picked from commit 9873b171697033f9f19608d98bcd1c16cacb92af)
---
 sys/arm/broadcom/bcm2835/bcm2835_dma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c b/sys/arm/broadcom/bcm2835/bcm2835_dma.c
index cab8639bb607..af86647704f6 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c
@@ -766,5 +766,6 @@ static driver_t bcm_dma_driver = {
 
 static devclass_t bcm_dma_devclass;
 
-DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, bcm_dma_devclass, 0, 0);
+EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, bcm_dma_devclass, 0, 0,
+    BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE);
 MODULE_VERSION(bcm_dma, 1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202303071655.327GtfdI022890>