To suppress only the specific spd5118 resume error lines (e.g., spd5118_resume [spd5118] returns -6 and failed to resume async: error -6) from appearing in dmesg output without silencing all spd5118-related messages, you can use kernel dynamic debugging (dyndbg) to filter these messages.
Here’s how to do it on Debian 13 (GNOME/HP laptop):
The messages are generated by the spd5118 kernel module. Confirm this by running:
lsmod | grep spd5118If it’s loaded, proceed.
Use dyndbg to disable only the resume-related debug messages for spd5118.
Run the following command as root:
echo 'module spd5118 +p; func spd5118_resume -p' | sudo tee /sys/kernel/debug/dynamic_debug/controlmodule spd5118 +p: Enables all debug messages for the spd5118 module (default state).func spd5118_resume -p: Disables debug messages only for the spd5118_resume function, which is responsible for the lines you want to suppress.Check if the messages are suppressed by running:
sudo dmesg -wTrigger the resume event (e.g., suspend/resume the laptop) and confirm the lines no longer appear.
To ensure this persists across reboots, add the command to a startup script (e.g., /etc/rc.local or a systemd service).
/etc/rc.local/etc/rc.local (create it if it doesn’t exist):sudo nano /etc/rc.localexit 0:echo 'module spd5118 +p; func spd5118_resume -p' > /sys/kernel/debug/dynamic_debug/controlsudo chmod +x /etc/rc.localsudo nano /etc/systemd/system/disable-spd5118-resume-messages.service[Unit]
Description=Disable spd5118 resume debug messages
After=sysinit.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo "module spd5118 +p; func spd5118_resume -p" > /sys/kernel/debug/dynamic_debug/control'
[Install]
WantedBy=multi-user.targetsudo systemctl enable disable-spd5118-resume-messages.service
sudo systemctl start disable-spd5118-resume-messages.servicedmesg Filtering (Temporary)If you only want to hide these messages when running dmesg (without suppressing them at the kernel level), use:
sudo dmesg | grep -v "spd5118_resume\|failed to resume async"This filters out the lines only for the current session.
dyndbg allows granular control over kernel debug messages.spd5118_resume debug messages only suppresses the resume-related errors while preserving other spd5118 messages (e.g., initialization, other functions).To re-enable all spd5118 debug messages:
echo 'module spd5118 +p' | sudo tee /sys/kernel/debug/dynamic_debug/controlVibe can make mistakes. Check answers. Learn more