From 3c22d7899730a4a7434bb17bd2d1ac6f162ec74e Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Tue, 23 Oct 2018 01:56:52 +0000 Subject: [PATCH] dpaa: Mark BMan and QMan as earlier driver modules The BMan softc must exist when dtsec devices are created, else a NULL pointer is dereferenced. QMan likely as well. Until now, we have relied on order within the fdt parsing to attach correctly, but this obviously is not foolproof. Mark these as BUS_PASS_SUPPORTDEV so they're probed and attached explicitly before dtsec devices. --- sys/dev/dpaa/bman_fdt.c | 3 ++- sys/dev/dpaa/qman_fdt.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/dpaa/bman_fdt.c b/sys/dev/dpaa/bman_fdt.c index 8656d0ef0fd..1e7bce6be43 100644 --- a/sys/dev/dpaa/bman_fdt.c +++ b/sys/dev/dpaa/bman_fdt.c @@ -68,7 +68,8 @@ static driver_t bman_driver = { }; static devclass_t bman_devclass; -DRIVER_MODULE(bman, simplebus, bman_driver, bman_devclass, 0, 0); +EARLY_DRIVER_MODULE(bman, simplebus, bman_driver, bman_devclass, 0, 0, + BUS_PASS_SUPPORTDEV); static int bman_fdt_probe(device_t dev) diff --git a/sys/dev/dpaa/qman_fdt.c b/sys/dev/dpaa/qman_fdt.c index 9eca3944b4d..bb40f724e7f 100644 --- a/sys/dev/dpaa/qman_fdt.c +++ b/sys/dev/dpaa/qman_fdt.c @@ -68,7 +68,8 @@ static driver_t qman_driver = { }; static devclass_t qman_devclass; -DRIVER_MODULE(qman, simplebus, qman_driver, qman_devclass, 0, 0); +EARLY_DRIVER_MODULE(qman, simplebus, qman_driver, qman_devclass, 0, 0, + BUS_PASS_SUPPORTDEV); static int qman_fdt_probe(device_t dev)