i2c: clear the controller on every IRQ, not just armed buses A completed master write leaves bits set in I2CM14, and those bits hold the controller's shared interrupt line asserted. handle_slave_interrupt() is the only code that clears them, and it was reached only via try_next_slave_event() behind an `if bus.notif_enabled` guard. interrupt_ack() ran unconditionally, and it re-enables the NVIC line. So on a bus that never arms slave notification the hardware source was never cleared while the line was re-enabled, re-firing the interrupt forever. Service the controller on every IRQ and gate only the latch and client wake on notif_enabled. Buses that do arm notification are unaffected -- the call already ran for them.
diff --git a/services/i2c/server-runtime/src/lib.rs b/services/i2c/server-runtime/src/lib.rs index 202123d..a51e6c5 100644 --- a/services/i2c/server-runtime/src/lib.rs +++ b/services/i2c/server-runtime/src/lib.rs
@@ -121,8 +121,14 @@ let irq = w.user_data as u32; let acked = w.pending_signals & irq_signals; if let Some(bus) = buses.iter_mut().find(|b| b.irq == irq) { + // Service the controller even with no client listening: a master + // write leaves I2CM14 latched, holding the shared IRQ line + // asserted, and only the driver clears it. Skipping this makes + // the `interrupt_ack` below re-enable an interrupt that is still + // asserted, so it re-fires forever. + let event = bus.driver.try_next_slave_event(); if bus.notif_enabled { - match bus.driver.try_next_slave_event() { + match event { Ok(Some((kind, _))) => match kind { I2cIsrEvent::SlaveWrRecvd => { // Master finished writing — drain buffer into latch.