-
Notifications
You must be signed in to change notification settings - Fork 140
soundwire: lower the trace level to warning when the alert is ignored #5619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: topic/sof-dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adjusts logging behavior for SoundWire Command Ignored responses by downgrading error messages to warnings. The Command Ignored response (-ENODATA) is a valid status that can occur when accessing unattached devices during unexpected interrupts, and treating it as an error unnecessarily alarms users.
Key Changes:
- Added conditional logging based on error type, using
dev_warn()for -ENODATA instead ofdev_err() - Applied this pattern to both direct register read failures and slave alert handling failures
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
drivers/soundwire/bus.c
Outdated
| "SDW_SCP_INT1 read failed:%d\n", ret); | ||
| if (ret == -ENODATA) | ||
| dev_warn(&slave->dev, | ||
| "SDW_SCP_INT1 read command was ignored:%d\n", ret); |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in warning message. Should be 'was ignored: %d' for consistency with the error message on line 1672.
| "SDW_SCP_INT1 read command was ignored:%d\n", ret); | |
| "SDW_SCP_INT1 read command was ignored: %d\n", ret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no space on line 1672, too.
drivers/soundwire/bus.c
Outdated
| "SDW_SCP_INT1 read failed:%d\n", ret); | ||
| if (ret == -ENODATA) | ||
| dev_warn(&slave->dev, | ||
| "SDW_SCP_INT1 read command was ignored:%d\n", ret); |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Including the error code (%d) in the warning message is redundant since -ENODATA is already confirmed by the condition. The error code adds no additional value for this specific case.
| "SDW_SCP_INT1 read command was ignored:%d\n", ret); | |
| "SDW_SCP_INT1 read command was ignored\n"); |
Command Ignored is a valid response of SoundWire. It could happen when an invalid interrupt occurs when the device is not attached. The driver will try to access the device and will get an Ignored response. It is harmless to ignore the unexpected interrupt. Lower the trace level to not scare users. Signed-off-by: Bard Liao <[email protected]>
Command Ignored is a valid response of SoundWire. It could happen when an invalid interrupt occurs when the device is not attached. The driver will try to access the device and will get an Ignored response. It is harmless to ignore the unexpected interrupt. Lower the trace level to not scare users.