Commit a90def0
soundwire: bus: fix race condition with initialization_complete signaling
Waiting for the enumeration to be complete may not be enough for a
Slave driver, there is a possible race condition between resume
operations and initializations handled in an interrupt thread, which
can results in settings not being fully restored after system or
pm_runtime resume.
This patch builds on the changes added for enumeration_complete,
init_completion() is called when the Slave device becomes UNATTACHED,
as done with enumeration_complete.
The difference with the enumeration_complete case is that complete()
is signaled after the Slave device is fully initialized after the
.update_status() callback is called.
A Slave device driver can decide to wait on either of the two
complete() cases, depending on its initialization code and
requirements.
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200115000844.14695-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>1 parent fb9469e commit a90def0
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| 624 | + | |
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
| |||
1025 | 1026 | | |
1026 | 1027 | | |
1027 | 1028 | | |
| 1029 | + | |
1028 | 1030 | | |
1029 | 1031 | | |
1030 | 1032 | | |
| |||
1070 | 1072 | | |
1071 | 1073 | | |
1072 | 1074 | | |
| 1075 | + | |
| 1076 | + | |
1073 | 1077 | | |
1074 | 1078 | | |
1075 | 1079 | | |
| |||
1096 | 1100 | | |
1097 | 1101 | | |
1098 | 1102 | | |
| 1103 | + | |
| 1104 | + | |
1099 | 1105 | | |
1100 | 1106 | | |
1101 | 1107 | | |
| |||
1114 | 1120 | | |
1115 | 1121 | | |
1116 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
1117 | 1125 | | |
1118 | 1126 | | |
1119 | 1127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
0 commit comments