From 3342d48e9ea76f8ec5c859d30d293d7a2c50e035 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 13 Aug 2022 16:23:58 +0200 Subject: [PATCH] 5.19-stable patches added patches: soundwire-qcom-check-device-status-before-reading-devid.patch --- queue-5.19/series | 1 + ...k-device-status-before-reading-devid.patch | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 queue-5.19/soundwire-qcom-check-device-status-before-reading-devid.patch diff --git a/queue-5.19/series b/queue-5.19/series index 6a8826e7bca..d137aafb85e 100644 --- a/queue-5.19/series +++ b/queue-5.19/series @@ -104,3 +104,4 @@ scsi-lpfc-remove-extra-atomic_inc-on-cmd_pending-in-queuecommand-after-vmid.patc scsi-sg-allow-waiting-for-commands-to-complete-on-removed-device.patch scsi-qla2xxx-fix-incorrect-display-of-max-frame-size.patch scsi-qla2xxx-zero-undefined-mailbox-in-registers.patch +soundwire-qcom-check-device-status-before-reading-devid.patch diff --git a/queue-5.19/soundwire-qcom-check-device-status-before-reading-devid.patch b/queue-5.19/soundwire-qcom-check-device-status-before-reading-devid.patch new file mode 100644 index 00000000000..86d8d9192a2 --- /dev/null +++ b/queue-5.19/soundwire-qcom-check-device-status-before-reading-devid.patch @@ -0,0 +1,38 @@ +From aa1262ca66957183ea1fb32a067e145b995f3744 Mon Sep 17 00:00:00 2001 +From: Srinivas Kandagatla +Date: Wed, 6 Jul 2022 10:56:44 +0100 +Subject: soundwire: qcom: Check device status before reading devid + +From: Srinivas Kandagatla + +commit aa1262ca66957183ea1fb32a067e145b995f3744 upstream. + +As per hardware datasheet its recommended that we check the device +status before reading devid assigned by auto-enumeration. + +Without this patch we see SoundWire devices with invalid enumeration +addresses on the bus. + +Cc: stable@vger.kernel.org +Fixes: a6e6581942ca ("soundwire: qcom: add auto enumeration support") +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20220706095644.5852-1-srinivas.kandagatla@linaro.org +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soundwire/qcom.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/soundwire/qcom.c ++++ b/drivers/soundwire/qcom.c +@@ -471,6 +471,10 @@ static int qcom_swrm_enumerate(struct sd + char *buf1 = (char *)&val1, *buf2 = (char *)&val2; + + for (i = 1; i <= SDW_MAX_DEVICES; i++) { ++ /* do not continue if the status is Not Present */ ++ if (!ctrl->status[i]) ++ continue; ++ + /*SCP_Devid5 - Devid 4*/ + ctrl->reg_read(ctrl, SWRM_ENUMERATOR_SLAVE_DEV_ID_1(i), &val1); + -- 2.47.3