From: GalaxySnail me@glxys.nl
[ Upstream commit 6eda9429501508196001845998bb8c73307d311a ]
add firmware information in the .modinfo section, so that userspace tools can find out firmware required by cs35l41/cs35l56 kernel module
Signed-off-by: GalaxySnail me@glxys.nl Reviewed-by: Richard Fitzgerald rf@opensource.cirrus.com Link: https://patch.msgid.link/20250624101716.2365302-2-me@glxys.nl Signed-off-by: Takashi Iwai tiwai@suse.de Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
Based on my analysis, I can now provide a determination on whether this commit should be backported:
**Backport Status: YES**
This commit should be backported to stable kernel trees for the following reasons:
1. **Fixes a real user-facing issue**: The commit adds MODULE_FIRMWARE declarations that are essential for userspace tools (like initramfs builders, dracut, mkinitcpio) to automatically detect and include required firmware files. Without these declarations, systems may fail to boot or have non-functional audio after kernel updates.
2. **Minimal and safe change**: The commit only adds four MODULE_FIRMWARE declarations: - For cs35l41: `cirrus/cs35l41-*.wmfw` and `cirrus/cs35l41-*.bin` - For cs35l56: `cirrus/cs35l54-*.wmfw`, `cirrus/cs35l54-*.bin`, `cirrus/cs35l56-*.wmfw`, and `cirrus/cs35l56-*.bin`
These are simple metadata additions that don't change any code logic or behavior.
3. **No risk of regression**: MODULE_FIRMWARE macros only add information to the module's .modinfo section. They don't affect runtime behavior, only help userspace tools identify firmware dependencies.
4. **Clear firmware loading requirement**: The code analysis shows these drivers do load firmware files with patterns matching the declared MODULE_FIRMWARE entries. In cs35l41_hda.c: ```c *filename = kasprintf(GFP_KERNEL, "cirrus/%s-%s-%s.%s", CS35L41_PART, dsp_name, cs35l41_hda_fw_ids[cs35l41->firmware_type], filetype); ``` Where CS35L41_PART is "cs35l41" and filetype can be "wmfw" or "bin".
5. **Follows established patterns**: Other HDA codec drivers (like patch_ca0132.c) already use MODULE_FIRMWARE declarations for their firmware files.
6. **Prevents boot failures**: Without proper firmware inclusion in initramfs, systems with these audio codecs may experience boot failures or missing audio functionality, especially when the root filesystem is encrypted or on a network device.
The commit is a straightforward bug fix that ensures proper firmware dependency tracking for cs35l41 and cs35l56 HDA audio codecs, making it an ideal candidate for stable backporting.
sound/pci/hda/cs35l41_hda.c | 2 ++ sound/pci/hda/cs35l56_hda.c | 4 ++++ 2 files changed, 6 insertions(+)
diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index d5bc81099d0d..17cdce91fdbf 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -2085,3 +2085,5 @@ MODULE_IMPORT_NS("SND_SOC_CS_AMP_LIB"); MODULE_AUTHOR("Lucas Tanure, Cirrus Logic Inc, tanureal@opensource.cirrus.com"); MODULE_LICENSE("GPL"); MODULE_IMPORT_NS("FW_CS_DSP"); +MODULE_FIRMWARE("cirrus/cs35l41-*.wmfw"); +MODULE_FIRMWARE("cirrus/cs35l41-*.bin"); diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c index 886c53184fec..f48077f5ca45 100644 --- a/sound/pci/hda/cs35l56_hda.c +++ b/sound/pci/hda/cs35l56_hda.c @@ -1176,3 +1176,7 @@ MODULE_IMPORT_NS("SND_SOC_CS_AMP_LIB"); MODULE_AUTHOR("Richard Fitzgerald rf@opensource.cirrus.com"); MODULE_AUTHOR("Simon Trimmer simont@opensource.cirrus.com"); MODULE_LICENSE("GPL"); +MODULE_FIRMWARE("cirrus/cs35l54-*.wmfw"); +MODULE_FIRMWARE("cirrus/cs35l54-*.bin"); +MODULE_FIRMWARE("cirrus/cs35l56-*.wmfw"); +MODULE_FIRMWARE("cirrus/cs35l56-*.bin");