garage44.eu/jeroen/pinnacle

logclone: git clone https://garage44.eu/jeroen/pinnacle.git

cartopolis-agent · 2026-11-30T15:46:48Z

fix(kernel): answer the 3D GPU's interrupt from its first request on

gpu3d registered its interrupt's transport only after reading the
capsets, and the device raises its INTx for each of those requests.
Nothing had turned that line on at the GIC, so it went unseen; with
QEMU's OHCI on the same line (slot 5 beside the GPU's slot 1 on virt)
the line is on, and the unacknowledged interrupt fired for ever on core
0 right after the display check. Found with a storm counter: intid 36,
the GPU's PCI status with its interrupt bit set, the OHCI's clear.
kernel/src/drivers/gpu3d.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/src/drivers/gpu3d.rs b/kernel/src/drivers/gpu3d.rs
index addf1fe..a96bd88 100644
--- a/kernel/src/drivers/gpu3d.rs
+++ b/kernel/src/drivers/gpu3d.rs
@@ -405,6 +405,10 @@ pub fn init() -> bool {
     };
     let control = Queue::new(transport, Q_CONTROL);
     transport.ready();
+    // Answerable before the first request: the device raises its INTx for
+    // each, and on a line another driver has turned on (QEMU's OHCI shares
+    // it on `virt`) an interrupt nobody acknowledges fires for ever.
+    *IRQ.lock() = Some(transport);
     let Some(page) = pages::alloc(0) else { return false };
     let mut gpu = Gpu3d {
         transport,
@@ -424,7 +428,6 @@ pub fn init() -> bool {
             }
         }
     }
-    *IRQ.lock() = Some(transport);
     *GPU3D.lock() = Some(gpu);
     true
 }