Repository navigation
Conversation
…peripherals Use a common deadline so that we will still wait at most x seconds when there are more than 1 ghost peripherals. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change to share a single timeout budget across SoundWire peripheral detection.
No open issues 🎉
What changed in this PR
Updates SOF Intel SoundWire peripheral detection to share one timeout budget, preventing multiple missing peripherals from each triggering a full wait.
Changes:
- Establishes a common deadline before checking peripherals.
- Uses the remaining timeout budget for each enumeration wait.
- Simplifies presence checks and removes the skip-wait label.
| File | Description |
|---|---|
sound/soc/sof/intel/hda.c |
Shares the enumeration timeout across peripherals during SoundWire machine selection. |
Review effort: Balanced
| remaining = max_t(long, (long)(deadline - jiffies), 0); | ||
| if (!wait_for_completion_timeout(&slave->enumeration_complete, | ||
| remaining) || | ||
| !slave->dev_num_sticky) { |
There was a problem hiding this comment.
The !slave->dev_num_sticky is granted here, no?
There was a problem hiding this comment.
slave->dev_num_sticky could be set after timeout.
| continue; | ||
| remaining = max_t(long, (long)(deadline - jiffies), 0); | ||
| if (!wait_for_completion_timeout(&slave->enumeration_complete, | ||
| remaining) || |
There was a problem hiding this comment.
if the first peripheral is the 'ghost' one than it will not appear and we will timeout and will not check the other peripherals?
I guess you want to have single timeout for all the peripherals to show up instead of the per device, but what is the issue with the per device? It will not wait if the peripheral said hello, it will only times out for the ones that are ghosts.
There was a problem hiding this comment.
The issue is that we will wait 3 sec * ghost device number. For example, if the ACPI claim that there are 3 codecs and only 1 is real, we need to wait for 6 seconds.
Use a common deadline so that we will still wait at most x seconds when there are more than 1 ghost peripherals.