Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1598bf0

Browse files
plbossartgregkh
authored andcommitted
soundwire: intel_bus_common: enable interrupts before exiting reset
[ Upstream commit 5aedb8d ] The existing code enables the Cadence IP interrupts after the bus reset sequence. The problem with this sequence is that it might be pre-empted, giving SoundWire devices time to sync and report as ATTACHED before the interrupts are enabled. In that case, the Cadence IP will not detect a state change and will not throw an interrupt to proceed with the enumeration of a Device0. In our overnight stress tests, we observed that a slight sub-millisecond delay in enabling interrupts after the reset was correlated with detection failures. This problem is more prevalent on the LunarLake silicon, likely due to SOC integration changes, but it was observed on earlier generations as well. This patch reverts the sequence, with the interrupts enabled before performing the bus reset. This removes the race condition and makes sure the Cadence IP is able to detect the presence of a Device0 in all cases. Signed-off-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a195a42 commit 1598bf0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/soundwire/intel_bus_common.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ int intel_start_bus(struct sdw_intel *sdw)
4545
return ret;
4646
}
4747

48-
ret = sdw_cdns_exit_reset(cdns);
48+
ret = sdw_cdns_enable_interrupt(cdns, true);
4949
if (ret < 0) {
50-
dev_err(dev, "%s: unable to exit bus reset sequence: %d\n", __func__, ret);
50+
dev_err(dev, "%s: cannot enable interrupts: %d\n", __func__, ret);
5151
return ret;
5252
}
5353

54-
ret = sdw_cdns_enable_interrupt(cdns, true);
54+
ret = sdw_cdns_exit_reset(cdns);
5555
if (ret < 0) {
56-
dev_err(dev, "%s: cannot enable interrupts: %d\n", __func__, ret);
56+
dev_err(dev, "%s: unable to exit bus reset sequence: %d\n", __func__, ret);
5757
return ret;
5858
}
5959

@@ -136,15 +136,15 @@ int intel_start_bus_after_reset(struct sdw_intel *sdw)
136136
return ret;
137137
}
138138

139-
ret = sdw_cdns_exit_reset(cdns);
139+
ret = sdw_cdns_enable_interrupt(cdns, true);
140140
if (ret < 0) {
141-
dev_err(dev, "unable to exit bus reset sequence during resume\n");
141+
dev_err(dev, "cannot enable interrupts during resume\n");
142142
return ret;
143143
}
144144

145-
ret = sdw_cdns_enable_interrupt(cdns, true);
145+
ret = sdw_cdns_exit_reset(cdns);
146146
if (ret < 0) {
147-
dev_err(dev, "cannot enable interrupts during resume\n");
147+
dev_err(dev, "unable to exit bus reset sequence during resume\n");
148148
return ret;
149149
}
150150

0 commit comments

Comments
 (0)