Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140091155
D15760.id43609.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15760.id43609.diff
View Options
Index: sys/powerpc/powermac/smu.c
===================================================================
--- sys/powerpc/powermac/smu.c
+++ sys/powerpc/powermac/smu.c
@@ -278,22 +278,14 @@
sc->sc_cmd_phys = segs[0].ds_addr;
}
-static int
-smu_attach(device_t dev)
+static void
+smu_intrhook(void *xsc)
{
- struct smu_softc *sc;
+ struct smu_softc *sc = xsc;
phandle_t node, child;
uint8_t data[12];
- sc = device_get_softc(dev);
-
- mtx_init(&sc->sc_mtx, "smu", NULL, MTX_DEF);
- sc->sc_cur_cmd = NULL;
- sc->sc_doorbellirqid = -1;
-
- sc->sc_u3 = 0;
- if (OF_finddevice("/u3") != -1)
- sc->sc_u3 = 1;
+ KASSERT(smu_doorbell != NULL, "SMC Dooorbell missing");
/*
* Map the mailbox area. This should be determined from firmware,
@@ -405,6 +397,26 @@
return (bus_generic_attach(dev));
}
+static int
+smu_attach(device_t dev)
+{
+ struct smu_softc *sc;
+
+ sc = device_get_softc(dev);
+
+ mtx_init(&sc->sc_mtx, "smu", NULL, MTX_DEF);
+ sc->sc_cur_cmd = NULL;
+ sc->sc_doorbellirqid = -1;
+
+ sc->sc_u3 = 0;
+ if (OF_finddevice("/u3") != -1)
+ sc->sc_u3 = 1;
+
+ /* Defer everything else until we have interrupts and the doorbell device */
+ config_intrhook_oneshot(smc_intrhook, sc);
+ return (0);
+}
+
static const struct ofw_bus_devinfo *
smu_get_devinfo(device_t bus, device_t dev)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 2:56 AM (17 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27105750
Default Alt Text
D15760.id43609.diff (1 KB)
Attached To
Mode
D15760: Defer work until we have interrupts running. We use this to ensure that the doorbell device has attached. This has the nice side effect that we can do I/O to the i2c children if need be in the future.
Attached
Detach File
Event Timeline
Log In to Comment