mirror-linux/drivers/soundwire
Amit Pundir 834bce6a71 soundwire: Revert "soundwire: qcom: Add set_channel_map api support"
This reverts commit 7796c97df6.

This patch broke Dragonboard 845c (sdm845). I see:

    Unexpected kernel BRK exception at EL1
    Internal error: BRK handler: 00000000f20003e8 [#1]  SMP
    pc : qcom_swrm_set_channel_map+0x7c/0x80 [soundwire_qcom]
    lr : snd_soc_dai_set_channel_map+0x34/0x78
    Call trace:
     qcom_swrm_set_channel_map+0x7c/0x80 [soundwire_qcom] (P)
     sdm845_dai_init+0x18c/0x2e0 [snd_soc_sdm845]
     snd_soc_link_init+0x28/0x6c
     snd_soc_bind_card+0x5f4/0xb0c
     snd_soc_register_card+0x148/0x1a4
     devm_snd_soc_register_card+0x50/0xb0
     sdm845_snd_platform_probe+0x124/0x148 [snd_soc_sdm845]
     platform_probe+0x6c/0xd0
     really_probe+0xc0/0x2a4
     __driver_probe_device+0x7c/0x130
     driver_probe_device+0x40/0x118
     __device_attach_driver+0xc4/0x108
     bus_for_each_drv+0x8c/0xf0
     __device_attach+0xa4/0x198
     device_initial_probe+0x18/0x28
     bus_probe_device+0xb8/0xbc
     deferred_probe_work_func+0xac/0xfc
     process_one_work+0x244/0x658
     worker_thread+0x1b4/0x360
     kthread+0x148/0x228
     ret_from_fork+0x10/0x20
    Kernel panic - not syncing: BRK handler: Fatal exception

Dan has also reported following issues with the original patch
https://lore.kernel.org/all/33fe8fe7-719a-405a-9ed2-d9f816ce1d57@sabinyo.mountain/

Bug #1:
The zeroeth element of ctrl->pconfig[] is supposed to be unused.  We
start counting at 1.  However this code sets ctrl->pconfig[0].ch_mask = 128.

Bug #2:
There are SLIM_MAX_TX_PORTS (16) elements in tx_ch[] array but only
QCOM_SDW_MAX_PORTS + 1 (15) in the ctrl->pconfig[] array so it corrupts
memory like Yongqin Liu pointed out.

Bug 3:
Like Jie Gan pointed out, it erases all the tx information with the rx
information.

Cc: stable@vger.kernel.org # v6.15+
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Acked-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://lore.kernel.org/r/20250709174949.8541-1-amit.pundir@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2025-07-15 18:16:27 +05:30
..
Kconfig soundwire: cadence: add BTP/BRA helpers to format data 2025-03-10 12:31:19 +05:30
Makefile soundwire: amd: refactor amd soundwire manager device node creation 2024-01-30 16:06:34 +00:00
amd_init.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
amd_init.h soundwire: amd: use inline function for register update 2024-03-28 23:39:50 +05:30
amd_manager.c soundwire: amd: fix for clearing command status register 2025-06-26 13:55:18 -07:00
amd_manager.h soundwire: amd: add soundwire host wake interrupt enable/disable sequence 2025-02-13 21:51:07 +05:30
bus.c soundwire updates for 6.16 2025-06-05 08:07:24 -07:00
bus.h soundwire: bus: add send_async/wait APIs for BPT protocol 2025-03-10 12:31:18 +05:30
bus_type.c soundwire: bus: Add internal slave ID and use for IRQs 2025-05-14 12:42:50 +01:00
cadence_master.c soundwire: cadence: add BTP/BRA helpers to format data 2025-03-10 12:31:19 +05:30
cadence_master.h soundwire: cadence: add BTP/BRA helpers to format data 2025-03-10 12:31:19 +05:30
debugfs.c soundwire: debugfs: add interface for BPT/BRA transfers 2025-03-10 12:31:19 +05:30
dmi-quirks.c ASoC: Intel: common: DMI remap for rebranded Intel NUC M15 (LAPRC710) laptops 2024-02-08 21:23:19 +00:00
generic_bandwidth_allocation.c soundwire: only compute port params in specific stream states 2025-05-14 12:44:01 +01:00
intel.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
intel.h soundwire: intel: Add awareness of ACE3+ microphone privacy 2025-05-14 12:43:25 +01:00
intel_ace2x.c soundwire: intel_ace2x: add BPT send_async/wait callbacks 2025-03-10 12:31:19 +05:30
intel_ace2x_debugfs.c soundwire: intel: Add awareness of ACE3+ microphone privacy 2025-05-14 12:43:25 +01:00
intel_auxdevice.c soundwire: intel_auxdevice: Fix system suspend/resume handling 2025-04-30 16:23:37 +02:00
intel_auxdevice.h soundwire: intel: export intel_resume_child_device 2024-04-11 22:52:51 +05:30
intel_bus_common.c soundwire: cadence: add soft-reset on startup 2024-10-10 17:44:41 +05:30
intel_init.c soundwire: intel: Add awareness of ACE3+ microphone privacy 2025-05-14 12:43:25 +01:00
irq.c soundwire: bus: Add internal slave ID and use for IRQs 2025-05-14 12:42:50 +01:00
irq.h soundwire: bus: Move irq mapping cleanup into devres 2024-12-23 11:41:09 +05:30
master.c soundwire: constify the struct device_type usage 2024-03-03 19:28:06 +05:30
mipi_disco.c soundwire: mipi_disco: read lane mapping properties from ACPI 2024-12-23 12:00:33 +05:30
qcom.c soundwire: Revert "soundwire: qcom: Add set_channel_map api support" 2025-07-15 18:16:27 +05:30
slave.c soundwire: slave: fix an OF node reference leak in soundwire slave device 2025-02-13 21:55:57 +05:30
stream.c soundwire: bus: add send_async/wait APIs for BPT protocol 2025-03-10 12:31:18 +05:30
sysfs_local.h soundwire: sysfs: remove sdw_slave_sysfs_init() 2024-03-28 23:38:47 +05:30
sysfs_slave.c soundwire: Correct some typos in comments 2024-10-03 12:46:23 +05:30
sysfs_slave_dpn.c soundwire: sysfs: remove sdw_slave_sysfs_init() 2024-03-28 23:38:47 +05:30