From c836fffb66186d6c0355a977f69c8c2289bcc7b5 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Thu, 23 Jul 2026 06:34:35 +0900 Subject: [PATCH] ihdad: graceful failure on DSP/cAVS platforms (Phase 8.1) On cAVS/SOF platforms (e.g. LG Gram 8086:7728), STATESTS reads 0 because the codec sits behind the audio DSP; the legacy HDA codec-wake mechanism cannot reach it. enumerate() previously hardcoded codec 0 and would hang reading a non-existent codec via CORB/RIRB. Now, if no codecs respond after reset_controller(), log the DSP-platform diagnosis and fail honestly with ENODEV instead of hanging. A SOF/cAVS driver (Phase 8.2) is required for these platforms. --- drivers/audio/ihdad/src/hda/device.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/audio/ihdad/src/hda/device.rs b/drivers/audio/ihdad/src/hda/device.rs index 2f9f0b6ced..2e4cacb571 100755 --- a/drivers/audio/ihdad/src/hda/device.rs +++ b/drivers/audio/ihdad/src/hda/device.rs @@ -213,6 +213,18 @@ impl IntelHDA { module.init()?; module.info(); + + if module.codecs.is_empty() { + // DSP/cAVS platform: STATESTS=0 (codec behind DSP), enumerate() + // would hang on non-existent codec 0. Fail honestly. + log::error!( + "ihdad: no codecs responded on STATESTS — this is a DSP/cAVS \ + platform (codec behind the DSP). Legacy HDA cannot drive it; \ + a SOF/cAVS driver is required (Phase 8.2)." + ); + return Err(Error::new(ENODEV)); + } + module.enumerate()?; module.configure()?;