From 010f73ba6ac8d306049440545a69052dff12df7d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 Sep 2023 07:57:06 +0100 Subject: [PATCH] 5.10-stable patches added patches: asoc-rt5682-fix-a-problem-with-error-handling-in-the-io-init-function-of-the-soundwire.patch --- ...he-io-init-function-of-the-soundwire.patch | 52 +++++++++++++++++++ queue-5.10/series | 1 + 2 files changed, 53 insertions(+) create mode 100644 queue-5.10/asoc-rt5682-fix-a-problem-with-error-handling-in-the-io-init-function-of-the-soundwire.patch diff --git a/queue-5.10/asoc-rt5682-fix-a-problem-with-error-handling-in-the-io-init-function-of-the-soundwire.patch b/queue-5.10/asoc-rt5682-fix-a-problem-with-error-handling-in-the-io-init-function-of-the-soundwire.patch new file mode 100644 index 00000000000..6f2d1bbae3a --- /dev/null +++ b/queue-5.10/asoc-rt5682-fix-a-problem-with-error-handling-in-the-io-init-function-of-the-soundwire.patch @@ -0,0 +1,52 @@ +From 9266d95405ae0c078f188ec8bca3a004631be429 Mon Sep 17 00:00:00 2001 +From: Oder Chiou +Date: Mon, 7 Jun 2021 17:22:36 -0500 +Subject: ASoC: rt5682: Fix a problem with error handling in the io init function of the soundwire + +From: Oder Chiou + +commit 9266d95405ae0c078f188ec8bca3a004631be429 upstream. + +The device checking error should be a jump to pm_runtime_put_autosuspend() +as done before returning value. + +Fixes: 867f8d18df4f ('ASoC: rt5682: fix getting the wrong device id when the suspend_stress_test') +Reviewed-by: Bard Liao +Signed-off-by: Oder Chiou +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20210607222239.582139-13-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Nobuhiro Iwamatsu +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/codecs/rt5682-sdw.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/sound/soc/codecs/rt5682-sdw.c ++++ b/sound/soc/codecs/rt5682-sdw.c +@@ -413,9 +413,11 @@ static int rt5682_io_init(struct device + usleep_range(30000, 30005); + loop--; + } ++ + if (val != DEVICE_ID) { + dev_err(dev, "Device with ID register %x is not rt5682\n", val); +- return -ENODEV; ++ ret = -ENODEV; ++ goto err_nodev; + } + + rt5682_calibrate(rt5682); +@@ -486,10 +488,11 @@ reinit: + rt5682->hw_init = true; + rt5682->first_hw_init = true; + ++err_nodev: + pm_runtime_mark_last_busy(&slave->dev); + pm_runtime_put_autosuspend(&slave->dev); + +- dev_dbg(&slave->dev, "%s hw_init complete\n", __func__); ++ dev_dbg(&slave->dev, "%s hw_init complete: %d\n", __func__, ret); + + return ret; + } diff --git a/queue-5.10/series b/queue-5.10/series index ccd0d5cc5c7..e1def0428c4 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -20,3 +20,4 @@ fsi-master-ast-cf-add-module_firmware-macro.patch nilfs2-fix-general-protection-fault-in-nilfs_lookup_dirty_data_buffers.patch nilfs2-fix-warning-in-mark_buffer_dirty-due-to-discarded-buffer-reuse.patch pinctrl-amd-don-t-show-invalid-config-param-errors.patch +asoc-rt5682-fix-a-problem-with-error-handling-in-the-io-init-function-of-the-soundwire.patch -- 2.47.3