Repository navigation
Conversation
…D events" This reverts commit 87230e9.
This reverts commit 4d77b42.
… peripherals The cadence IP explicitly reports slave status changes with bits for each possible change. The function cdns_update_slave_status() attempts to translate this into the current status of each of the slaves. However when there are multiple peripherals on a bus any slave that did not have a status change when the work function ran would not have it's status updated - the array is initialised to a value that equates to UNATTACHED and this can cause spurious reports that slaves had dropped off the bus. In the case where a slave has no status change or has multiple status changes the value from the last PING command is used. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Ensure that if sdw_handle_slave_status() sees a peripheral has dropped off the bus it reports it to the client driver. If there are any devices reporting on address 0 it bails out after programming the device IDs. So it never reaches the second loop that calls sdw_update_slave_status(). If the missing device is one that is now showing as unenumerated it has been given a device ID so will report as attached next time sdw_handle_slave_status() runs. With the previous code the client driver would only see another ATTACHED notification because the UNATTACHED state was lost when sdw_handle_slave_status() bailed out after programming the device ID. This shows up most when the peripheral has to be reset after downloading updated firmware and there are multiple of these peripherals on the bus. They will all return to unenumerated state after the reset, and then there is a mix of unattached, attached and unenumerated PING states from the peripherals, as each is reset and they reboot. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Rearrange sdw_handle_slave_status() so that any peripherals on device #0 that are given a device ID are reported as unattached. The ensures that UNATTACH status is not lost. Handle unenumerated devices first and update the sdw_slave_status array to indicate IDs that must have become UNATTACHED. Look for UNATTACHED devices after this so we can pick up peripherals that were UNATTACHED in the original PING status and those that were still ATTACHED at the time of the PING but then reverted to unenumerated and were found by sdw_program_device_num(). As sdw_update_slave_status() is always processing a snapshot of a PING from some time in the past, it is possible that the status is changing while sdw_update_slave_status() is running. A peripheral could report attached in the PING, but detach and revert to device #0 and then be found in the loop in sdw_program_device_num(). Previously the code would not have updated slave->status to UNATTACHED because there was never a PING with that status. If the slave->status is not updated to UNATTACHED the next PING will report it as ATTACHED, but its slave->status is already ATTACHED so the re-attach will not be properly handled. This situations happens fairly frequently with multiple peripherals on a bus that are intentionally reset (for example after downloading firmware). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
plbossart
requested review from
RanderWang,
jack-cy-yu,
oder-chiou,
ryans-lee and
shumingfan
as code owners
August 26, 2022 09:15
Member
Author
|
yay build stuck... any idea what's going on @keqiaozhang @fredoh9 @greg-intel ? |
Member
Author
|
SOFCI TEST |
bardliao
approved these changes
Sep 13, 2022
RanderWang
approved these changes
Sep 14, 2022
RanderWang
left a comment
There was a problem hiding this comment.
Add to my favorite list although I can't 100% get it.
Member
Author
|
We don't want to merge this as is. the code has already changed upstream. I'll re-add it when the code is merged, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
revert Intel changes and apply the fixes from Cirrus Logic.
https://lore.kernel.org/alsa-devel/20220825122241.273090-1-rf@opensource.cirrus.com/T/#t