linux-stable/drivers/soundwire
Johan Hovold c5265691cd soundwire: fix enumeration completion
commit c40d6b3249 upstream.

The soundwire subsystem uses two completion structures that allow
drivers to wait for soundwire device to become enumerated on the bus and
initialised by their drivers, respectively.

The code implementing the signalling is currently broken as it does not
signal all current and future waiters and also uses the wrong
reinitialisation function, which can potentially lead to memory
corruption if there are still waiters on the queue.

Not signalling future waiters specifically breaks sound card probe
deferrals as codec drivers can not tell that the soundwire device is
already attached when being reprobed. Some codec runtime PM
implementations suffer from similar problems as waiting for enumeration
during resume can also timeout despite the device already having been
enumerated.

Fixes: fb9469e54f ("soundwire: bus: fix race condition with enumeration_complete signaling")
Fixes: a90def0681 ("soundwire: bus: fix race condition with initialization_complete signaling")
Cc: stable@vger.kernel.org      # 5.7
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230705123018.30903-2-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-03 10:26:10 +02:00
..
amd_manager.c soundwire: amd: Fix a check for errors in probe() 2023-08-03 10:25:48 +02:00
amd_manager.h soundwire: amd: handle SoundWire wake enable interrupt 2023-04-12 15:30:36 +05:30
bus.c soundwire: fix enumeration completion 2023-08-03 10:26:10 +02:00
bus.h soundwire: export sdw_compute_slave_ports() function 2023-04-12 15:30:35 +05:30
bus_type.c soundwire updates for 6.3 2023-02-24 17:29:52 -08:00
cadence_master.c soundwire: cadence: change access to IP_MCP_CMD_BASE 2023-03-15 19:24:03 +05:30
cadence_master.h soundwire: intel: don't save hw_params for use in prepare 2023-04-12 15:32:57 +05:30
debugfs.c soundwire: debugfs: fix unbalanced pm_runtime_put() 2023-07-19 16:36:31 +02:00
dmi-quirks.c soundwire: dmi-quirks: add new mapping for HP Spectre x360 2023-05-27 16:07:47 +05:30
generic_bandwidth_allocation.c soundwire: export sdw_compute_slave_ports() function 2023-04-12 15:30:35 +05:30
intel.c soundwire: intel: don't save hw_params for use in prepare 2023-04-12 15:32:57 +05:30
intel.h soundwire: intel: move bank switch routine to common intel_bus_common.c 2023-03-15 19:24:02 +05:30
intel_auxdevice.c soundwire: intel_auxdevice: improve pm_prepare step 2023-04-12 15:36:55 +05:30
intel_auxdevice.h soundwire: intel: split auxdevice to different file 2022-11-23 20:11:49 +05:30
intel_bus_common.c soundwire: intel: move bank switch routine to common intel_bus_common.c 2023-03-15 19:24:02 +05:30
intel_init.c soundwire updates for 6.2 2022-12-19 08:47:33 -06:00
Kconfig soundwire: amd: enable build for AMD SoundWire manager driver 2023-04-12 15:30:36 +05:30
Makefile soundwire: amd: enable build for AMD SoundWire manager driver 2023-04-12 15:30:36 +05:30
master.c
mipi_disco.c
qcom.c soundwire: qcom: update status correctly with mask 2023-08-03 10:25:48 +02:00
slave.c Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
stream.c soundwire: stream: Add missing clear of alloc_slave_rt 2023-06-08 17:08:04 +05:30
sysfs_local.h
sysfs_slave.c soundwire: sysfs: Constify static struct attribute_group 2021-01-19 20:21:20 +05:30
sysfs_slave_dpn.c