stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind
@ 2022-11-06 17:03 Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 02/30] spi: tegra210-quad: Fix combined sequence Sasha Levin
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Akhil P Oommen, Rob Clark, Sasha Levin, robdclark, quic_abhinavk,
	dmitry.baryshkov, airlied, daniel, angelogioacchino.delregno,
	andersson, olvaffe, konrad.dybcio, nathan, vladimir.lypak,
	linux-arm-msm, dri-devel, freedreno

From: Akhil P Oommen <quic_akhilpo@quicinc.com>

[ Upstream commit 76efc2453d0e8e5d6692ef69981b183ad674edea ]

In adreno_unbind, we should clean up gpu device's drvdata to avoid
accessing a stale pointer during system suspend. Also, check for NULL
ptr in both system suspend/resume callbacks.

Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/505075/
Link: https://lore.kernel.org/r/20220928124830.2.I5ee0ac073ccdeb81961e5ec0cce5f741a7207a71@changeid
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/adreno/adreno_device.c | 10 +++++++++-
 drivers/gpu/drm/msm/msm_gpu.c              |  2 ++
 drivers/gpu/drm/msm/msm_gpu.h              |  4 ++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 24b489b6129a..628806423f7d 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -679,6 +679,9 @@ static int adreno_system_suspend(struct device *dev)
 	struct msm_gpu *gpu = dev_to_gpu(dev);
 	int remaining, ret;
 
+	if (!gpu)
+		return 0;
+
 	suspend_scheduler(gpu);
 
 	remaining = wait_event_timeout(gpu->retire_event,
@@ -700,7 +703,12 @@ static int adreno_system_suspend(struct device *dev)
 
 static int adreno_system_resume(struct device *dev)
 {
-	resume_scheduler(dev_to_gpu(dev));
+	struct msm_gpu *gpu = dev_to_gpu(dev);
+
+	if (!gpu)
+		return 0;
+
+	resume_scheduler(gpu);
 	return pm_runtime_force_resume(dev);
 }
 
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index c2bfcf3f1f40..01aae792ffa9 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -993,4 +993,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
 	}
 
 	msm_devfreq_cleanup(gpu);
+
+	platform_set_drvdata(gpu->pdev, NULL);
 }
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index 4d935fedd2ac..fd22cf4041af 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -282,6 +282,10 @@ struct msm_gpu {
 static inline struct msm_gpu *dev_to_gpu(struct device *dev)
 {
 	struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(dev);
+
+	if (!adreno_smmu)
+		return NULL;
+
 	return container_of(adreno_smmu, struct msm_gpu, adreno_smmu);
 }
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 02/30] spi: tegra210-quad: Fix combined sequence
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 03/30] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" Sasha Levin
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Krishna Yarlagadda, Mark Brown, Sasha Levin, thierry.reding,
	jonathanh, skomatineni, ldewangan, linux-tegra, linux-spi

From: Krishna Yarlagadda <kyarlagadda@nvidia.com>

[ Upstream commit 8777dd9dff4020bba66654ec92e4b0ab6367ad30 ]

Return value should be updated to zero in combined sequence routine
if transfer is completed successfully. Currently it holds timeout value
resulting in errors.

Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Link: https://lore.kernel.org/r/20221001122148.9158-1-kyarlagadda@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-tegra210-quad.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index c89592b21ffc..904972606bd4 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1157,6 +1157,11 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
 		msg->actual_length += xfer->len;
 		transfer_phase++;
 	}
+	if (!xfer->cs_change) {
+		tegra_qspi_transfer_end(spi);
+		spi_transfer_delay_exec(xfer);
+	}
+	ret = 0;
 
 exit:
 	msg->status = ret;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 03/30] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe"
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 02/30] spi: tegra210-quad: Fix combined sequence Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 04/30] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe" Sasha Levin
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Zhang Qilong, Charles Keepax, Mark Brown, Sasha Levin, lgirdwood,
	perex, tiwai, patches, alsa-devel

From: Zhang Qilong <zhangqilong3@huawei.com>

[ Upstream commit de71d7567e358effd06dfc3e2a154b25f1331c10 ]

This reverts commit fcbb60820cd3008bb44334a0395e5e57ccb77329.

The pm_runtime_disable is redundant when error returns in
wm5102_probe, we just revert the old patch to fix it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010114852.88127-2-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/wm5102.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index c09c9ac51b3e..af7d324e3352 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -2099,6 +2099,9 @@ static int wm5102_probe(struct platform_device *pdev)
 		regmap_update_bits(arizona->regmap, wm5102_digital_vu[i],
 				   WM5102_DIG_VU, WM5102_DIG_VU);
 
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_idle(&pdev->dev);
+
 	ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
 				  "ADSP2 Compressed IRQ", wm5102_adsp2_irq,
 				  wm5102);
@@ -2131,9 +2134,6 @@ static int wm5102_probe(struct platform_device *pdev)
 		goto err_spk_irqs;
 	}
 
-	pm_runtime_enable(&pdev->dev);
-	pm_runtime_idle(&pdev->dev);
-
 	return ret;
 
 err_spk_irqs:
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 04/30] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe"
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 02/30] spi: tegra210-quad: Fix combined sequence Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 03/30] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 05/30] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe" Sasha Levin
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Zhang Qilong, Charles Keepax, Mark Brown, Sasha Levin, lgirdwood,
	perex, tiwai, patches, alsa-devel

From: Zhang Qilong <zhangqilong3@huawei.com>

[ Upstream commit 7d4e966f4cd73ff69bf06934e8e14a33fb7ef447 ]

This reverts commit 86b46bf1feb83898d89a2b4a8d08d21e9ea277a7.

The pm_runtime_disable is redundant when error returns in
wm5110_probe, we just revert the old patch to fix it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010114852.88127-3-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/wm5110.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index fc634c995834..f3f4a10bf0f7 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -2457,6 +2457,9 @@ static int wm5110_probe(struct platform_device *pdev)
 		regmap_update_bits(arizona->regmap, wm5110_digital_vu[i],
 				   WM5110_DIG_VU, WM5110_DIG_VU);
 
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_idle(&pdev->dev);
+
 	ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
 				  "ADSP2 Compressed IRQ", wm5110_adsp2_irq,
 				  wm5110);
@@ -2489,9 +2492,6 @@ static int wm5110_probe(struct platform_device *pdev)
 		goto err_spk_irqs;
 	}
 
-	pm_runtime_enable(&pdev->dev);
-	pm_runtime_idle(&pdev->dev);
-
 	return ret;
 
 err_spk_irqs:
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 05/30] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe"
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (2 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 04/30] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe" Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 06/30] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Sasha Levin
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Zhang Qilong, Charles Keepax, Mark Brown, Sasha Levin, lgirdwood,
	perex, tiwai, patches, alsa-devel

From: Zhang Qilong <zhangqilong3@huawei.com>

[ Upstream commit 68ce83e3bb26feba0fcdd59667fde942b3a600a1 ]

This reverts commit 41a736ac20602f64773e80f0f5b32cde1830a44a.

The pm_runtime_disable is redundant when error returns in
wm8997_probe, we just revert the old patch to fix it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010114852.88127-4-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/wm8997.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index 77136a521605..210ad662fc26 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1161,6 +1161,9 @@ static int wm8997_probe(struct platform_device *pdev)
 		regmap_update_bits(arizona->regmap, wm8997_digital_vu[i],
 				   WM8997_DIG_VU, WM8997_DIG_VU);
 
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_idle(&pdev->dev);
+
 	arizona_init_common(arizona);
 
 	ret = arizona_init_vol_limit(arizona);
@@ -1179,9 +1182,6 @@ static int wm8997_probe(struct platform_device *pdev)
 		goto err_spk_irqs;
 	}
 
-	pm_runtime_enable(&pdev->dev);
-	pm_runtime_idle(&pdev->dev);
-
 	return ret;
 
 err_spk_irqs:
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 06/30] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (3 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 05/30] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe" Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 07/30] ASoC: rt5682s: Fix the TDM Tx settings Sasha Levin
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Zhang Qilong, AngeloGioacchino Del Regno, Mark Brown,
	Sasha Levin, lgirdwood, perex, tiwai, matthias.bgg, steve,
	chi.minghao, ckeepax, alsa-devel, linux-arm-kernel,
	linux-mediatek

From: Zhang Qilong <zhangqilong3@huawei.com>

[ Upstream commit c4ab29b0f3a6f1e167c5a627f7cd036c1d2b7d65 ]

It would be better to keep the pm_runtime enables before the
IRQ and component stuff. Both of those could start triggering
PM runtime events.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221008140522.134912-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/mt6660.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/mt6660.c b/sound/soc/codecs/mt6660.c
index 45e0df13afb9..b8369eeccc30 100644
--- a/sound/soc/codecs/mt6660.c
+++ b/sound/soc/codecs/mt6660.c
@@ -503,14 +503,14 @@ static int mt6660_i2c_probe(struct i2c_client *client)
 		dev_err(chip->dev, "read chip revision fail\n");
 		goto probe_fail;
 	}
+	pm_runtime_set_active(chip->dev);
+	pm_runtime_enable(chip->dev);
 
 	ret = devm_snd_soc_register_component(chip->dev,
 					       &mt6660_component_driver,
 					       &mt6660_codec_dai, 1);
-	if (!ret) {
-		pm_runtime_set_active(chip->dev);
-		pm_runtime_enable(chip->dev);
-	}
+	if (ret)
+		pm_runtime_disable(chip->dev);
 
 	return ret;
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 07/30] ASoC: rt5682s: Fix the TDM Tx settings
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (4 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 06/30] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 08/30] ASoC: rt1019: Fix the TDM settings Sasha Levin
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Derek Fang, Mark Brown, Sasha Levin, oder_chiou, lgirdwood,
	perex, tiwai, alsa-devel

From: Derek Fang <derek.fang@realtek.com>

[ Upstream commit d94bf16e920047c9b4ea2b57f7b53b4ff5039d9f ]

Complete the missing and correct the TDM Tx settings.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20221012031320.6980-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/rt5682s.c | 15 +++++++++++++--
 sound/soc/codecs/rt5682s.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c
index eb47e7cd485a..95fe993d59cb 100644
--- a/sound/soc/codecs/rt5682s.c
+++ b/sound/soc/codecs/rt5682s.c
@@ -1932,7 +1932,7 @@ static int rt5682s_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 		unsigned int rx_mask, int slots, int slot_width)
 {
 	struct snd_soc_component *component = dai->component;
-	unsigned int cl, val = 0;
+	unsigned int cl, val = 0, tx_slotnum;
 
 	if (tx_mask || rx_mask)
 		snd_soc_component_update_bits(component,
@@ -1941,6 +1941,16 @@ static int rt5682s_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 		snd_soc_component_update_bits(component,
 			RT5682S_TDM_ADDA_CTRL_2, RT5682S_TDM_EN, 0);
 
+	/* Tx slot configuration */
+	tx_slotnum = hweight_long(tx_mask);
+	if (tx_slotnum) {
+		if (tx_slotnum > slots) {
+			dev_err(component->dev, "Invalid or oversized Tx slots.\n");
+			return -EINVAL;
+		}
+		val |= (tx_slotnum - 1) << RT5682S_TDM_ADC_DL_SFT;
+	}
+
 	switch (slots) {
 	case 4:
 		val |= RT5682S_TDM_TX_CH_4;
@@ -1961,7 +1971,8 @@ static int rt5682s_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 	}
 
 	snd_soc_component_update_bits(component, RT5682S_TDM_CTRL,
-		RT5682S_TDM_TX_CH_MASK | RT5682S_TDM_RX_CH_MASK, val);
+		RT5682S_TDM_TX_CH_MASK | RT5682S_TDM_RX_CH_MASK |
+		RT5682S_TDM_ADC_DL_MASK, val);
 
 	switch (slot_width) {
 	case 8:
diff --git a/sound/soc/codecs/rt5682s.h b/sound/soc/codecs/rt5682s.h
index 7353831c73dd..b660a311b6c2 100644
--- a/sound/soc/codecs/rt5682s.h
+++ b/sound/soc/codecs/rt5682s.h
@@ -899,6 +899,7 @@
 #define RT5682S_TDM_RX_CH_8			(0x3 << 8)
 #define RT5682S_TDM_ADC_LCA_MASK		(0x7 << 4)
 #define RT5682S_TDM_ADC_LCA_SFT			4
+#define RT5682S_TDM_ADC_DL_MASK			(0x3 << 0)
 #define RT5682S_TDM_ADC_DL_SFT			0
 
 /* TDM control 2 (0x007a) */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 08/30] ASoC: rt1019: Fix the TDM settings
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (5 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 07/30] ASoC: rt5682s: Fix the TDM Tx settings Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 09/30] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK Sasha Levin
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Derek Fang, Mark Brown, Sasha Levin, oder_chiou, lgirdwood,
	perex, tiwai, alsa-devel

From: Derek Fang <derek.fang@realtek.com>

[ Upstream commit f2635d45a750182c6d5de15e2d6b059e0c302d7e ]

Complete the missing and correct the TDM settings.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20221012030102.4042-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/rt1019.c | 20 +++++++++++---------
 sound/soc/codecs/rt1019.h |  6 ++++++
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/rt1019.c b/sound/soc/codecs/rt1019.c
index b66bfecbb879..49f527c61a7a 100644
--- a/sound/soc/codecs/rt1019.c
+++ b/sound/soc/codecs/rt1019.c
@@ -391,18 +391,18 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 			unsigned int rx_mask, int slots, int slot_width)
 {
 	struct snd_soc_component *component = dai->component;
-	unsigned int val = 0, rx_slotnum;
+	unsigned int cn = 0, cl = 0, rx_slotnum;
 	int ret = 0, first_bit;
 
 	switch (slots) {
 	case 4:
-		val |= RT1019_I2S_TX_4CH;
+		cn = RT1019_I2S_TX_4CH;
 		break;
 	case 6:
-		val |= RT1019_I2S_TX_6CH;
+		cn = RT1019_I2S_TX_6CH;
 		break;
 	case 8:
-		val |= RT1019_I2S_TX_8CH;
+		cn = RT1019_I2S_TX_8CH;
 		break;
 	case 2:
 		break;
@@ -412,16 +412,16 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 
 	switch (slot_width) {
 	case 20:
-		val |= RT1019_I2S_DL_20;
+		cl = RT1019_TDM_CL_20;
 		break;
 	case 24:
-		val |= RT1019_I2S_DL_24;
+		cl = RT1019_TDM_CL_24;
 		break;
 	case 32:
-		val |= RT1019_I2S_DL_32;
+		cl = RT1019_TDM_CL_32;
 		break;
 	case 8:
-		val |= RT1019_I2S_DL_8;
+		cl = RT1019_TDM_CL_8;
 		break;
 	case 16:
 		break;
@@ -470,8 +470,10 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 		goto _set_tdm_err_;
 	}
 
+	snd_soc_component_update_bits(component, RT1019_TDM_1,
+		RT1019_TDM_CL_MASK, cl);
 	snd_soc_component_update_bits(component, RT1019_TDM_2,
-		RT1019_I2S_CH_TX_MASK | RT1019_I2S_DF_MASK, val);
+		RT1019_I2S_CH_TX_MASK, cn);
 
 _set_tdm_err_:
 	return ret;
diff --git a/sound/soc/codecs/rt1019.h b/sound/soc/codecs/rt1019.h
index 64df831eeb72..48ba15efb48d 100644
--- a/sound/soc/codecs/rt1019.h
+++ b/sound/soc/codecs/rt1019.h
@@ -95,6 +95,12 @@
 #define RT1019_TDM_BCLK_MASK		(0x1 << 6)
 #define RT1019_TDM_BCLK_NORM		(0x0 << 6)
 #define RT1019_TDM_BCLK_INV			(0x1 << 6)
+#define RT1019_TDM_CL_MASK			(0x7)
+#define RT1019_TDM_CL_8				(0x4)
+#define RT1019_TDM_CL_32			(0x3)
+#define RT1019_TDM_CL_24			(0x2)
+#define RT1019_TDM_CL_20			(0x1)
+#define RT1019_TDM_CL_16			(0x0)
 
 /* 0x0401 TDM Control-2 */
 #define RT1019_I2S_CH_TX_MASK		(0x3 << 6)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 09/30] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (6 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 08/30] ASoC: rt1019: Fix the TDM settings Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 10/30] spi: intel: Fix the offset to get the 64K erase opcode Sasha Levin
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Xiaolei Wang, Adam Ford, Charles Keepax, Mark Brown, Sasha Levin,
	lgirdwood, perex, tiwai, steve, chi.minghao, patches, alsa-devel

From: Xiaolei Wang <xiaolei.wang@windriver.com>

[ Upstream commit ee1aa2ae3eaa96e70229fa61deee87ef4528ffdf ]

In wm8962 driver, the WM8962_ADDITIONAL_CONTROL_4 is used as a volatile
register, but this register mixes a bunch of volatile status bits and a
bunch of non-volatile control bits. The dapm widgets TEMP_HP and
TEMP_SPK leverages the control bits in this register. After the wm8962
probe, the regmap will bet set to cache only mode, then a read error
like below would be triggered when trying to read the initial power
state of the dapm widgets TEMP_HP and TEMP_SPK.
  wm8962 0-001a: ASoC: error at soc_component_read_no_lock
  on wm8962.0-001a: -16

In order to fix this issue, we add event handler to actually power
up/down these widgets. With this change, we also need to explicitly
power off these widgets in the wm8962 probe since they are enabled
by default.

Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Tested-by: Adam Ford <aford173@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010092014.2229246-1-xiaolei.wang@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/wm8962.c | 54 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 52 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 398c448ea854..6df06fba4377 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -1840,6 +1840,49 @@ SOC_SINGLE_TLV("SPKOUTR Mixer DACR Volume", WM8962_SPEAKER_MIXER_5,
 	       4, 1, 0, inmix_tlv),
 };
 
+static int tp_event(struct snd_soc_dapm_widget *w,
+		    struct snd_kcontrol *kcontrol, int event)
+{
+	int ret, reg, val, mask;
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+
+	ret = pm_runtime_resume_and_get(component->dev);
+	if (ret < 0) {
+		dev_err(component->dev, "Failed to resume device: %d\n", ret);
+		return ret;
+	}
+
+	reg = WM8962_ADDITIONAL_CONTROL_4;
+
+	if (!strcmp(w->name, "TEMP_HP")) {
+		mask = WM8962_TEMP_ENA_HP_MASK;
+		val = WM8962_TEMP_ENA_HP;
+	} else if (!strcmp(w->name, "TEMP_SPK")) {
+		mask = WM8962_TEMP_ENA_SPK_MASK;
+		val = WM8962_TEMP_ENA_SPK;
+	} else {
+		pm_runtime_put(component->dev);
+		return -EINVAL;
+	}
+
+	switch (event) {
+	case SND_SOC_DAPM_POST_PMD:
+		val = 0;
+		fallthrough;
+	case SND_SOC_DAPM_POST_PMU:
+		ret = snd_soc_component_update_bits(component, reg, mask, val);
+		break;
+	default:
+		WARN(1, "Invalid event %d\n", event);
+		pm_runtime_put(component->dev);
+		return -EINVAL;
+	}
+
+	pm_runtime_put(component->dev);
+
+	return 0;
+}
+
 static int cp_event(struct snd_soc_dapm_widget *w,
 		    struct snd_kcontrol *kcontrol, int event)
 {
@@ -2140,8 +2183,10 @@ SND_SOC_DAPM_SUPPLY("TOCLK", WM8962_ADDITIONAL_CONTROL_1, 0, 0, NULL, 0),
 SND_SOC_DAPM_SUPPLY_S("DSP2", 1, WM8962_DSP2_POWER_MANAGEMENT,
 		      WM8962_DSP2_ENA_SHIFT, 0, dsp2_event,
 		      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
-SND_SOC_DAPM_SUPPLY("TEMP_HP", WM8962_ADDITIONAL_CONTROL_4, 2, 0, NULL, 0),
-SND_SOC_DAPM_SUPPLY("TEMP_SPK", WM8962_ADDITIONAL_CONTROL_4, 1, 0, NULL, 0),
+SND_SOC_DAPM_SUPPLY("TEMP_HP", SND_SOC_NOPM, 0, 0, tp_event,
+		SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD),
+SND_SOC_DAPM_SUPPLY("TEMP_SPK", SND_SOC_NOPM, 0, 0, tp_event,
+		SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD),
 
 SND_SOC_DAPM_MIXER("INPGAL", WM8962_LEFT_INPUT_PGA_CONTROL, 4, 0,
 		   inpgal, ARRAY_SIZE(inpgal)),
@@ -3763,6 +3808,11 @@ static int wm8962_i2c_probe(struct i2c_client *i2c)
 	if (ret < 0)
 		goto err_pm_runtime;
 
+	regmap_update_bits(wm8962->regmap, WM8962_ADDITIONAL_CONTROL_4,
+			    WM8962_TEMP_ENA_HP_MASK, 0);
+	regmap_update_bits(wm8962->regmap, WM8962_ADDITIONAL_CONTROL_4,
+			    WM8962_TEMP_ENA_SPK_MASK, 0);
+
 	regcache_cache_only(wm8962->regmap, true);
 
 	/* The drivers should power up as needed */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 10/30] spi: intel: Fix the offset to get the 64K erase opcode
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (7 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 09/30] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 11/30] ASoC: codecs: jz4725b: add missed Line In power control bit Sasha Levin
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mauro Lima, Mika Westerberg, Mark Brown, Sasha Levin, linux-spi

From: Mauro Lima <mauro.lima@eclypsium.com>

[ Upstream commit 6a43cd02ddbc597dc9a1f82c1e433f871a2f6f06 ]

According to documentation, the 64K erase opcode is located in VSCC
range [16:23] instead of [8:15].
Use the proper value to shift the mask over the correct range.

Signed-off-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20221012152135.28353-1-mauro.lima@eclypsium.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-intel.c b/drivers/spi/spi-intel.c
index 66063687ae27..f59d2ce8629a 100644
--- a/drivers/spi/spi-intel.c
+++ b/drivers/spi/spi-intel.c
@@ -114,7 +114,7 @@
 #define ERASE_OPCODE_SHIFT		8
 #define ERASE_OPCODE_MASK		(0xff << ERASE_OPCODE_SHIFT)
 #define ERASE_64K_OPCODE_SHIFT		16
-#define ERASE_64K_OPCODE_MASK		(0xff << ERASE_OPCODE_SHIFT)
+#define ERASE_64K_OPCODE_MASK		(0xff << ERASE_64K_OPCODE_SHIFT)
 
 #define INTEL_SPI_TIMEOUT		5000 /* ms */
 #define INTEL_SPI_FIFO_SZ		64
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 11/30] ASoC: codecs: jz4725b: add missed Line In power control bit
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (8 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 10/30] spi: intel: Fix the offset to get the 64K erase opcode Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 12/30] ASoC: codecs: jz4725b: fix reported volume for Master ctl Sasha Levin
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Siarhei Volkau, Mark Brown, Sasha Levin, paul, lgirdwood, perex,
	tiwai, linux-mips, alsa-devel

From: Siarhei Volkau <lis8215@gmail.com>

[ Upstream commit 1013999b431b4bcdc1f5ae47dd3338122751db31 ]

Line In path stayed powered off during capturing or
bypass to mixer.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-2-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/jz4725b.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index 5201a8f6d7b6..cc7a48c96aa4 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -236,7 +236,8 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {
 	SND_SOC_DAPM_MIXER("DAC to Mixer", JZ4725B_CODEC_REG_CR1,
 			   REG_CR1_DACSEL_OFFSET, 0, NULL, 0),
 
-	SND_SOC_DAPM_MIXER("Line In", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_MIXER("Line In", JZ4725B_CODEC_REG_PMR1,
+			   REG_PMR1_SB_LIN_OFFSET, 1, NULL, 0),
 	SND_SOC_DAPM_MIXER("HP Out", JZ4725B_CODEC_REG_CR1,
 			   REG_CR1_HP_DIS_OFFSET, 1, NULL, 0),
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 12/30] ASoC: codecs: jz4725b: fix reported volume for Master ctl
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (9 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 11/30] ASoC: codecs: jz4725b: add missed Line In power control bit Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 13/30] ASoC: codecs: jz4725b: use right control for Capture Volume Sasha Levin
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Siarhei Volkau, Mark Brown, Sasha Levin, paul, lgirdwood, perex,
	tiwai, linux-mips, alsa-devel

From: Siarhei Volkau <lis8215@gmail.com>

[ Upstream commit 088777bf65b98cfa4b5378119d0a7d49a58ece44 ]

DAC volume control is the Master Playback Volume at the moment
and it reports wrong levels in alsamixer and other alsa apps.

The patch fixes that, as stated in manual on the jz4725b SoC
(16.6.3.4 Programmable attenuation: GOD) the ctl range varies
from -22.5dB to 0dB with 1.5dB step.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-3-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/jz4725b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index cc7a48c96aa4..72549ee2e789 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -142,8 +142,8 @@ struct jz_icdc {
 	struct clk *clk;
 };
 
-static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0);
 static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600);
+static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);
 
 static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
 	SOC_DOUBLE_TLV("Master Playback Volume",
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 13/30] ASoC: codecs: jz4725b: use right control for Capture Volume
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (10 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 12/30] ASoC: codecs: jz4725b: fix reported volume for Master ctl Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 14/30] ASoC: codecs: jz4725b: fix capture selector naming Sasha Levin
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Siarhei Volkau, Mark Brown, Sasha Levin, paul, lgirdwood, perex,
	tiwai, linux-mips, alsa-devel

From: Siarhei Volkau <lis8215@gmail.com>

[ Upstream commit 1538e2c8c9b7e7a656effcc6e4e7cfe8c1b405fd ]

Line In Bypass control is used as Master Capture at the moment
this is completely incorrect.

Current control routed to Mixer instead of ADC, thus can't affect
Capture path. ADC control shall be used instead.

ADC volume control parameters are different, so the patch fixes that
as well. Manual says (16.6.3.2 Programmable input attenuation amplifier:
PGATM) that gain varies in range 0dB..22.5dB with 1.5dB step.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-4-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/jz4725b.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index 72549ee2e789..4363d898a7d4 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -136,13 +136,16 @@ enum {
 #define REG_CGR3_GO1L_OFFSET		0
 #define REG_CGR3_GO1L_MASK		(0x1f << REG_CGR3_GO1L_OFFSET)
 
+#define REG_CGR10_GIL_OFFSET		0
+#define REG_CGR10_GIR_OFFSET		4
+
 struct jz_icdc {
 	struct regmap *regmap;
 	void __iomem *base;
 	struct clk *clk;
 };
 
-static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600);
+static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv,     0, 150, 0);
 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);
 
 static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
@@ -151,11 +154,11 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
 		       REG_CGR1_GODL_OFFSET,
 		       REG_CGR1_GODR_OFFSET,
 		       0xf, 1, jz4725b_dac_tlv),
-	SOC_DOUBLE_R_TLV("Master Capture Volume",
-			 JZ4725B_CODEC_REG_CGR3,
-			 JZ4725B_CODEC_REG_CGR2,
-			 REG_CGR2_GO1R_OFFSET,
-			 0x1f, 1, jz4725b_line_tlv),
+	SOC_DOUBLE_TLV("Master Capture Volume",
+		       JZ4725B_CODEC_REG_CGR10,
+		       REG_CGR10_GIL_OFFSET,
+		       REG_CGR10_GIR_OFFSET,
+		       0xf, 0, jz4725b_adc_tlv),
 
 	SOC_SINGLE("Master Playback Switch", JZ4725B_CODEC_REG_CR1,
 		   REG_CR1_DAC_MUTE_OFFSET, 1, 1),
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 14/30] ASoC: codecs: jz4725b: fix capture selector naming
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (11 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 13/30] ASoC: codecs: jz4725b: use right control for Capture Volume Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 15/30] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Sasha Levin
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Siarhei Volkau, Mark Brown, Sasha Levin, paul, lgirdwood, perex,
	tiwai, linux-mips, alsa-devel

From: Siarhei Volkau <lis8215@gmail.com>

[ Upstream commit 80852f8268769715db335a22305e81a0c4a38a84 ]

At the moment Capture source selector appears on Playback
tab in the alsamixer and has a senseless name.

Let's fix that.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-5-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/jz4725b.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index 4363d898a7d4..d57c2c6a3add 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -183,7 +183,7 @@ static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum,
 				  jz4725b_codec_adc_src_texts,
 				  jz4725b_codec_adc_src_values);
 static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl =
-			SOC_DAPM_ENUM("Route", jz4725b_codec_adc_src_enum);
+	SOC_DAPM_ENUM("ADC Source Capture Route", jz4725b_codec_adc_src_enum);
 
 static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = {
 	SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1,
@@ -228,7 +228,7 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {
 	SND_SOC_DAPM_ADC("ADC", "Capture",
 			 JZ4725B_CODEC_REG_PMR1, REG_PMR1_SB_ADC_OFFSET, 1),
 
-	SND_SOC_DAPM_MUX("ADC Source", SND_SOC_NOPM, 0, 0,
+	SND_SOC_DAPM_MUX("ADC Source Capture Route", SND_SOC_NOPM, 0, 0,
 			 &jz4725b_codec_adc_src_ctrl),
 
 	/* Mixer */
@@ -287,11 +287,11 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = {
 	{"Mixer", NULL, "DAC to Mixer"},
 
 	{"Mixer to ADC", NULL, "Mixer"},
-	{"ADC Source", "Mixer", "Mixer to ADC"},
-	{"ADC Source", "Line In", "Line In"},
-	{"ADC Source", "Mic 1", "Mic 1"},
-	{"ADC Source", "Mic 2", "Mic 2"},
-	{"ADC", NULL, "ADC Source"},
+	{"ADC Source Capture Route", "Mixer", "Mixer to ADC"},
+	{"ADC Sourc Capture Routee", "Line In", "Line In"},
+	{"ADC Source Capture Route", "Mic 1", "Mic 1"},
+	{"ADC Source Capture Route", "Mic 2", "Mic 2"},
+	{"ADC", NULL, "ADC Source Capture Route"},
 
 	{"Out Stage", NULL, "Mixer"},
 	{"HP Out", NULL, "Out Stage"},
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 15/30] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (12 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 14/30] ASoC: codecs: jz4725b: fix capture selector naming Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 16/30] selftests/futex: fix build for clang Sasha Levin
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pierre-Louis Bossart, Ranjani Sridharan, Bard Liao, Mark Brown,
	Sasha Levin, cezary.rojewski, liam.r.girdwood, peter.ujfalusi,
	kai.vehmanen, perex, tiwai, rander.wang, i, yong.zhi, alsa-devel

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit 41deb2db64997d01110faaf763bd911d490dfde7 ]

Some NUC15 LAPBC710 devices don't expose the same DMI information as
the Intel reference, add additional entry in the match table.

BugLink: https://github.com/thesofproject/linux/issues/3885
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221017204054.207512-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/intel/boards/sof_sdw.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 2ff30b40a1e4..ee9857dc3135 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -202,6 +202,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 					SOF_SDW_PCH_DMIC |
 					RT711_JD1),
 	},
+	{
+		/* NUC15 LAPBC710 skews */
+		.callback = sof_sdw_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"),
+		},
+		.driver_data = (void *)(SOF_SDW_TGL_HDMI |
+					SOF_SDW_PCH_DMIC |
+					RT711_JD1),
+	},
 	/* TigerLake-SDCA devices */
 	{
 		.callback = sof_sdw_quirk_cb,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 16/30] selftests/futex: fix build for clang
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (13 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 15/30] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 17/30] selftests/intel_pstate: fix build for ARCH=x86_64 Sasha Levin
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ricardo Cañuelo, André Almeida, Shuah Khan,
	Sasha Levin, tglx, mingo, shuah, nathan, ndesaulniers,
	usama.anjum, guillaume.tucker, linux-kselftest, llvm

From: Ricardo Cañuelo <ricardo.canuelo@collabora.com>

[ Upstream commit 03cab65a07e083b6c1010fbc8f9b817e9aca75d9 ]

Don't use the test-specific header files as source files to force a
target dependency, as clang will complain if more than one source file
is used for a compile command with a single '-o' flag.

Use the proper Makefile variables instead as defined in
tools/testing/selftests/lib.mk.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/futex/functional/Makefile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 732149011692..5a0e0df8de9b 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -3,11 +3,11 @@ INCLUDES := -I../include -I../../ -I../../../../../usr/include/
 CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES)
 LDLIBS := -lpthread -lrt
 
-HEADERS := \
+LOCAL_HDRS := \
 	../include/futextest.h \
 	../include/atomic.h \
 	../include/logging.h
-TEST_GEN_FILES := \
+TEST_GEN_PROGS := \
 	futex_wait_timeout \
 	futex_wait_wouldblock \
 	futex_requeue_pi \
@@ -24,5 +24,3 @@ TEST_PROGS := run.sh
 top_srcdir = ../../../../..
 DEFAULT_INSTALL_HDR_PATH := 1
 include ../../lib.mk
-
-$(TEST_GEN_FILES): $(HEADERS)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 17/30] selftests/intel_pstate: fix build for ARCH=x86_64
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (14 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 16/30] selftests/futex: fix build for clang Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 18/30] selftests/kexec: " Sasha Levin
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ricardo Cañuelo, Shuah Khan, Sasha Levin, shuah, linux-kselftest

From: Ricardo Cañuelo <ricardo.canuelo@collabora.com>

[ Upstream commit beb7d862ed4ac6aa14625418970f22a7d55b8615 ]

Handle the scenario where the build is launched with the ARCH envvar
defined as x86_64.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/intel_pstate/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile
index 39f0fa2a8fd6..05d66ef50c97 100644
--- a/tools/testing/selftests/intel_pstate/Makefile
+++ b/tools/testing/selftests/intel_pstate/Makefile
@@ -2,10 +2,10 @@
 CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE
 LDLIBS += -lm
 
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+ARCH_PROCESSED := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
 
-ifeq (x86,$(ARCH))
+ifeq (x86,$(ARCH_PROCESSED))
 TEST_GEN_FILES := msr aperf
 endif
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 18/30] selftests/kexec: fix build for ARCH=x86_64
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (15 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 17/30] selftests/intel_pstate: fix build for ARCH=x86_64 Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 19/30] ASoC: Intel: sof_rt5682: Add quirk for Rex board Sasha Levin
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ricardo Cañuelo, Shuah Khan, Sasha Levin, shuah, nayna,
	zohar, rnsastry, linux-kselftest

From: Ricardo Cañuelo <ricardo.canuelo@collabora.com>

[ Upstream commit 2a8e366b23fea29a5308f71ba49555e3c8c664f1 ]

Handle the scenario where the build is launched with the ARCH envvar
defined as x86_64.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/kexec/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/kexec/Makefile b/tools/testing/selftests/kexec/Makefile
index 806a150648c3..67fe7a46cb62 100644
--- a/tools/testing/selftests/kexec/Makefile
+++ b/tools/testing/selftests/kexec/Makefile
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 # Makefile for kexec tests
 
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+ARCH_PROCESSED := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
 
-ifeq ($(ARCH),$(filter $(ARCH),x86 ppc64le))
+ifeq ($(ARCH_PROCESSED),$(filter $(ARCH_PROCESSED),x86 ppc64le))
 TEST_PROGS := test_kexec_load.sh test_kexec_file_load.sh
 TEST_FILES := kexec_common_lib.sh
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 19/30] ASoC: Intel: sof_rt5682: Add quirk for Rex board
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (16 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 18/30] selftests/kexec: " Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 20/30] rtc: cmos: fix build on non-ACPI platforms Sasha Levin
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Yong Zhi, Bard Liao, Curtis Malainey, Pierre-Louis Bossart,
	Mark Brown, Sasha Levin, cezary.rojewski, liam.r.girdwood,
	peter.ujfalusi, ranjani.sridharan, kai.vehmanen, perex, tiwai,
	brent.lu, ajye.huang, mac.chiang, akihiko.odaki,
	vamshi.krishna.gopal, alsa-devel

From: Yong Zhi <yong.zhi@intel.com>

[ Upstream commit b4dd2e3758709aa8a2abd1ac34c56bd09b980039 ]

Add mtl_mx98357_rt5682 driver data for Chrome Rex board support.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221017205728.210813-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/intel/boards/sof_rt5682.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index 045965312245..30c53dca342e 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -225,6 +225,18 @@ static const struct dmi_system_id sof_rt5682_quirk_table[] = {
 					SOF_RT5682_SSP_AMP(2) |
 					SOF_RT5682_NUM_HDMIDEV(4)),
 	},
+	{
+		.callback = sof_rt5682_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"),
+		},
+		.driver_data = (void *)(SOF_RT5682_MCLK_EN |
+					SOF_RT5682_SSP_CODEC(2) |
+					SOF_SPEAKER_AMP_PRESENT |
+					SOF_RT5682_SSP_AMP(0) |
+					SOF_RT5682_NUM_HDMIDEV(4)
+					),
+	},
 	{}
 };
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 20/30] rtc: cmos: fix build on non-ACPI platforms
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (17 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 19/30] ASoC: Intel: sof_rt5682: Add quirk for Rex board Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 21/30] ASoC: rt1308-sdw: add the default value of some registers Sasha Levin
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alexandre Belloni, kernel test robot, Sasha Levin, a.zummo, linux-rtc

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

[ Upstream commit db4e955ae333567dea02822624106c0b96a2f84f ]

Now that rtc_wake_setup is called outside of cmos_wake_setup, it also need
to be defined on non-ACPI platforms.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20221018203512.2532407-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/rtc/rtc-cmos.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index bdb1df843c78..31aa11e0e7d4 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1344,6 +1344,9 @@ static void cmos_check_acpi_rtc_status(struct device *dev,
 {
 }
 
+static void rtc_wake_setup(struct device *dev)
+{
+}
 #endif
 
 #ifdef	CONFIG_PNP
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 21/30] ASoC: rt1308-sdw: add the default value of some registers
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (18 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 20/30] rtc: cmos: fix build on non-ACPI platforms Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 22/30] ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List Sasha Levin
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Shuming Fan, Mark Brown, Sasha Levin, oder_chiou, lgirdwood,
	perex, tiwai, alsa-devel

From: Shuming Fan <shumingf@realtek.com>

[ Upstream commit 75d8b1662ca5c20cf8365575222abaef18ff1f50 ]

The driver missed the default value of register 0xc070/0xc360.
This patch adds that default value to avoid invalid register access
when the device doesn't be enumerated yet.
BugLink: https://github.com/thesofproject/linux/issues/3924

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20221019095715.31082-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/rt1308-sdw.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt1308-sdw.h b/sound/soc/codecs/rt1308-sdw.h
index 6668e19d85d4..b5f231f708cb 100644
--- a/sound/soc/codecs/rt1308-sdw.h
+++ b/sound/soc/codecs/rt1308-sdw.h
@@ -139,10 +139,12 @@ static const struct reg_default rt1308_reg_defaults[] = {
 	{ 0x3005, 0x23 },
 	{ 0x3008, 0x02 },
 	{ 0x300a, 0x00 },
+	{ 0xc000 | (RT1308_DATA_PATH << 4), 0x00 },
 	{ 0xc003 | (RT1308_DAC_SET << 4), 0x00 },
 	{ 0xc000 | (RT1308_POWER << 4), 0x00 },
 	{ 0xc001 | (RT1308_POWER << 4), 0x00 },
 	{ 0xc002 | (RT1308_POWER << 4), 0x00 },
+	{ 0xc000 | (RT1308_POWER_STATUS << 4), 0x00 },
 };
 
 #define RT1308_SDW_OFFSET 0xc000
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 22/30] ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (19 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 21/30] ASoC: rt1308-sdw: add the default value of some registers Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 23/30] ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table Sasha Levin
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: linkt, Mario Limonciello, Mark Brown, Sasha Levin, lgirdwood,
	perex, tiwai, Syed.SabaKareem, alsa-devel

From: linkt <xazrael@hotmail.com>

[ Upstream commit a450b5c8739248069e11f72129fca61a56125577 ]

Lenovo ThinkBook 14 Gen 4+ ARA and ThinkBook 16 Gen 4+ ARA
need to be added to the list of quirks for the microphone to work properly.

Signed-off-by: linkt <xazrael@hotmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/MEYPR01MB8397A3C27DE6206FA3EF834DB6239@MEYPR01MB8397.ausprd01.prod.outlook.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/amd/yc/acp6x-mach.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index 2cb50d5cf1a9..09a8aceff22f 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -45,6 +45,20 @@ static struct snd_soc_card acp6x_card = {
 };
 
 static const struct dmi_system_id yc_acp_quirk_table[] = {
+	{
+		.driver_data = &acp6x_card,
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "21D0"),
+		}
+	},
+	{
+		.driver_data = &acp6x_card,
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "21D1"),
+		}
+	},
 	{
 		.driver_data = &acp6x_card,
 		.matches = {
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 23/30] ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (20 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 22/30] ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 24/30] drm/amdgpu: Adjust MES polling timeout for sriov Sasha Levin
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Leohearts, Mark Brown, Sasha Levin, lgirdwood, perex, tiwai,
	mario.limonciello, Syed.SabaKareem, alsa-devel

From: Leohearts <leohearts@leohearts.com>

[ Upstream commit a75481fa00cc06a8763e1795b93140407948c03a ]

Lenovo Thinkbook 14+ 2022 (ThinkBook 14 G4+ ARA) uses Ryzen
6000 processor, and has the same microphone problem as other
ThinkPads with AMD Ryzen 6000 series CPUs, which has been
listed in https://bugzilla.kernel.org/show_bug.cgi?id=216267.

Adding 21D0 to quirks table solves this microphone problem
for ThinkBook 14 G4+ ARA.

Signed-off-by: Taroe Leohearts <leohearts@leohearts.com>
Link: https://lore.kernel.org/r/26B141B486BEF706+313d1732-e00c-ea41-3123-0d048d40ebb6@leohearts.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/amd/yc/acp6x-mach.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index 09a8aceff22f..6c0f1de10429 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -52,6 +52,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "21D0"),
 		}
 	},
+	{
+		.driver_data = &acp6x_card,
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "21D0"),
+		}
+	},
 	{
 		.driver_data = &acp6x_card,
 		.matches = {
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 24/30] drm/amdgpu: Adjust MES polling timeout for sriov
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (21 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 23/30] ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 25/30] platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models Sasha Levin
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Yiqing Yao, Alex Deucher, Sasha Levin, christian.koenig,
	Xinhui.Pan, airlied, daniel, Jack.Xiao, Hawking.Zhang,
	Graham.Sider, yifan1.zhang, amd-gfx, dri-devel

From: Yiqing Yao <yiqing.yao@amd.com>

[ Upstream commit 226dcfad349f23f7744d02b24f8ec3bc4f6198ac ]

[why]
MES response time in sriov may be longer than default value
due to reset or init in other VF. A timeout value specific
to sriov is needed.

[how]
When in sriov, adjust the timeout value to calculated
worst case scenario.

Signed-off-by: Yiqing Yao <yiqing.yao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index f92744b8d79d..e758b4083874 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
@@ -96,7 +96,14 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
 	struct amdgpu_device *adev = mes->adev;
 	struct amdgpu_ring *ring = &mes->ring;
 	unsigned long flags;
+	signed long timeout = adev->usec_timeout;
 
+	if (amdgpu_emu_mode) {
+		timeout *= 100;
+	} else if (amdgpu_sriov_vf(adev)) {
+		/* Worst case in sriov where all other 15 VF timeout, each VF needs about 600ms */
+		timeout = 15 * 600 * 1000;
+	}
 	BUG_ON(size % 4 != 0);
 
 	spin_lock_irqsave(&mes->ring_lock, flags);
@@ -116,7 +123,7 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
 	DRM_DEBUG("MES msg=%d was emitted\n", x_pkt->header.opcode);
 
 	r = amdgpu_fence_wait_polling(ring, ring->fence_drv.sync_seq,
-		      adev->usec_timeout * (amdgpu_emu_mode ? 100 : 1));
+		      timeout);
 	if (r < 1) {
 		DRM_ERROR("MES failed to response msg=%d\n",
 			  x_pkt->header.opcode);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 25/30] platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (22 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 24/30] drm/amdgpu: Adjust MES polling timeout for sriov Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 26/30] platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver Sasha Levin
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jelle van der Waa, Hans de Goede, Sasha Levin, hmh, markgross,
	ibm-acpi-devel, platform-driver-x86

From: Jelle van der Waa <jvanderwaa@redhat.com>

[ Upstream commit a10d50983f7befe85acf95ea7dbf6ba9187c2d70 ]

thinkpad_acpi was reporting 2 fans on a ThinkPad T14s gen 1, even though
the laptop has only 1 fan.

The second, not present fan always reads 65535 (-1 in 16 bit signed),
ignore fans which report 65535 to avoid reporting the non present fan.

Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
Link: https://lore.kernel.org/r/20221019194751.5392-1-jvanderwaa@redhat.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/platform/x86/thinkpad_acpi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 2dbb9fc011a7..353507d18e11 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -263,6 +263,8 @@ enum tpacpi_hkey_event_t {
 #define TPACPI_DBG_BRGHT	0x0020
 #define TPACPI_DBG_MIXER	0x0040
 
+#define FAN_NOT_PRESENT		65535
+
 #define strlencmp(a, b) (strncmp((a), (b), strlen(b)))
 
 
@@ -8876,7 +8878,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
 			/* Try and probe the 2nd fan */
 			tp_features.second_fan = 1; /* needed for get_speed to work */
 			res = fan2_get_speed(&speed);
-			if (res >= 0) {
+			if (res >= 0 && speed != FAN_NOT_PRESENT) {
 				/* It responded - so let's assume it's there */
 				tp_features.second_fan = 1;
 				tp_features.second_fan_ctl = 1;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 26/30] platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (23 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 25/30] platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 27/30] drm/amd/display: Remove wrong pipe control lock Sasha Levin
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Gayatri Kammela, Srinivas Pandruvada, Andy Shevchenko, David Box,
	Rajneesh Bhardwaj, Hans de Goede, Sasha Levin, markgross,
	platform-driver-x86

From: Gayatri Kammela <gayatri.kammela@linux.intel.com>

[ Upstream commit 555a68dd681b7437a2708001d465c85f6dfa6955 ]

Add Raptor Lake client parts (both RPL and RPL_S) support to pmc core
driver. Raptor Lake client parts reuse all the Alder Lake PCH IPs.

Cc: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: David Box <david.e.box@intel.com>
Acked-by: Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela@linux.intel.com>
Link: https://lore.kernel.org/r/20220912233307.409954-2-gayatri.kammela@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/platform/x86/intel/pmc/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index a1fe1e0dcf4a..17ec5825d13d 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -1914,6 +1914,8 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
 	X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_N,		&tgl_reg_map),
 	X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE,		&adl_reg_map),
 	X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P,        &tgl_reg_map),
+	X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE,		&adl_reg_map),
+	X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S,	&adl_reg_map),
 	{}
 };
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 27/30] drm/amd/display: Remove wrong pipe control lock
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (24 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 26/30] platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 28/30] drm/amd/display: Don't return false if no stream Sasha Levin
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Rodrigo Siqueira, Daniel Wheeler, Qingqing Zhuo, Alex Deucher,
	Sasha Levin, harry.wentland, sunpeng.li, christian.koenig,
	Xinhui.Pan, airlied, daniel, Jun.Lei, wenjing.liu, Aric.Cyr,
	Alvin.Lee2, duncan.ma, mwen, Yi-Ling.Chen2, aurabindo.pillai,
	jiapeng.chong, Sungjoon.Kim, amd-gfx, dri-devel

From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

[ Upstream commit ca08a1725d0d78efca8d2dbdbce5ea70355da0f2 ]

When using a device based on DCN32/321,
we have an issue where a second
4k@60Hz display does not light up,
and the system becomes unresponsive
for a few minutes. In the debug process,
it was possible to see a hang
in the function dcn20_post_unlock_program_front_end
in this part:

for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000
	&& hubp->funcs->hubp_is_flip_pending(hubp); j++)
	mdelay(1);
}

The hubp_is_flip_pending always returns positive
for waiting pending flips which is a symptom of
pipe hang. Additionally, the dmesg log shows
this message after a few minutes:

  BUG: soft lockup - CPU#4 stuck for 26s!
  ...
  [  +0.000003]  dcn20_post_unlock_program_front_end+0x112/0x340 [amdgpu]
  [  +0.000171]  dc_commit_state_no_check+0x63d/0xbf0 [amdgpu]
  [  +0.000155]  ? dc_validate_global_state+0x358/0x3d0 [amdgpu]
  [  +0.000154]  dc_commit_state+0xe2/0xf0 [amdgpu]

This confirmed the hypothesis that we had a pipe
hanging somewhere. Next, after checking the
ftrace entries, we have the below weird
sequence:

 [..]
  2)               |        dcn10_lock_all_pipes [amdgpu]() {
  2)   0.120 us    |          optc1_is_tg_enabled [amdgpu]();
  2)               |          dcn20_pipe_control_lock [amdgpu]() {
  2)               |            dc_dmub_srv_clear_inbox0_ack [amdgpu]() {
  2)   0.121 us    |              amdgpu_dm_dmub_reg_write [amdgpu]();
  2)   0.551 us    |            }
  2)               |            dc_dmub_srv_send_inbox0_cmd [amdgpu]() {
  2)   0.110 us    |              amdgpu_dm_dmub_reg_write [amdgpu]();
  2)   0.511 us    |            }
  2)               |            dc_dmub_srv_wait_for_inbox0_ack [amdgpu]() {
  2)   0.110 us    |              amdgpu_dm_dmub_reg_read [amdgpu]();
  2)   0.110 us    |              amdgpu_dm_dmub_reg_read [amdgpu]();
  2)   0.110 us    |              amdgpu_dm_dmub_reg_read [amdgpu]();
  2)   0.110 us    |              amdgpu_dm_dmub_reg_read [amdgpu]();
  2)   0.110 us    |              amdgpu_dm_dmub_reg_read [amdgpu]();
  2)   0.110 us    |              amdgpu_dm_dmub_reg_read [amdgpu]();
  2)   0.110 us    |              amdgpu_dm_dmub_reg_read [amdgpu]();
 [..]

We are not expected to read from dmub register
so many times and for so long. From the trace log,
it was possible to identify that the function
dcn20_pipe_control_lock was triggering the dmub
operation when it was unnecessary and causing
the hang issue. This commit drops the unnecessary
dmub code and, consequently, fixes the second display not
lighting up the issue.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index 598ce872a8d7..0f30df523fdf 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1262,16 +1262,6 @@ void dcn20_pipe_control_lock(
 					lock,
 					&hw_locks,
 					&inst_flags);
-	} else if (pipe->stream && pipe->stream->mall_stream_config.type == SUBVP_MAIN) {
-		union dmub_inbox0_cmd_lock_hw hw_lock_cmd = { 0 };
-		hw_lock_cmd.bits.command_code = DMUB_INBOX0_CMD__HW_LOCK;
-		hw_lock_cmd.bits.hw_lock_client = HW_LOCK_CLIENT_DRIVER;
-		hw_lock_cmd.bits.lock_pipe = 1;
-		hw_lock_cmd.bits.otg_inst = pipe->stream_res.tg->inst;
-		hw_lock_cmd.bits.lock = lock;
-		if (!lock)
-			hw_lock_cmd.bits.should_release = 1;
-		dmub_hw_lock_mgr_inbox0_cmd(dc->ctx->dmub_srv, hw_lock_cmd);
 	} else if (pipe->plane_state != NULL && pipe->plane_state->triplebuffer_flips) {
 		if (lock)
 			pipe->stream_res.tg->funcs->triplebuffer_lock(pipe->stream_res.tg);
@@ -1848,7 +1838,7 @@ void dcn20_post_unlock_program_front_end(
 
 			for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000
 					&& hubp->funcs->hubp_is_flip_pending(hubp); j++)
-				mdelay(1);
+				udelay(1);
 		}
 	}
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 28/30] drm/amd/display: Don't return false if no stream
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (25 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 27/30] drm/amd/display: Remove wrong pipe control lock Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 29/30] drm/scheduler: fix fence ref counting Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 30/30] ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[] Sasha Levin
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alvin Lee, Daniel Wheeler, Rodrigo Siqueira, Qingqing Zhuo,
	Alex Deucher, Sasha Levin, harry.wentland, sunpeng.li,
	christian.koenig, Xinhui.Pan, airlied, daniel, Jun.Lei,
	Syed.Hassan, Ethan.Wellenreiter, amd-gfx, dri-devel

From: Alvin Lee <Alvin.Lee2@amd.com>

[ Upstream commit abe4d9f03fae76c9650b0d942faf6990b35c377b ]

pipe_ctx[i] exists even if the pipe is not
in use. If the pipe is not in use it will
always have a null stream, so don't return
false in this case.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
index 1f195c5b3377..13cd1f2e50ca 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
@@ -187,7 +187,7 @@ bool dcn32_all_pipes_have_stream_and_plane(struct dc *dc,
 		struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
 
 		if (!pipe->stream)
-			return false;
+			continue;
 
 		if (!pipe->plane_state)
 			return false;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 29/30] drm/scheduler: fix fence ref counting
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (26 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 28/30] drm/amd/display: Don't return false if no stream Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 30/30] ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[] Sasha Levin
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Christian König, Andrey Grodzovsky, Sasha Levin, airlied,
	daniel, dri-devel

From: Christian König <christian.koenig@amd.com>

[ Upstream commit b3af84383e7abdc5e63435817bb73a268e7c3637 ]

We leaked dependency fences when processes were beeing killed.

Additional to that grab a reference to the last scheduled fence.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220929180151.139751-1-christian.koenig@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/scheduler/sched_entity.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index 6b25b2f4f5a3..7ef1a086a6fb 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -207,6 +207,7 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
 	struct drm_sched_job *job = container_of(cb, struct drm_sched_job,
 						 finish_cb);
 
+	dma_fence_put(f);
 	INIT_WORK(&job->work, drm_sched_entity_kill_jobs_work);
 	schedule_work(&job->work);
 }
@@ -234,8 +235,10 @@ static void drm_sched_entity_kill_jobs(struct drm_sched_entity *entity)
 		struct drm_sched_fence *s_fence = job->s_fence;
 
 		/* Wait for all dependencies to avoid data corruptions */
-		while ((f = drm_sched_job_dependency(job, entity)))
+		while ((f = drm_sched_job_dependency(job, entity))) {
 			dma_fence_wait(f, false);
+			dma_fence_put(f);
+		}
 
 		drm_sched_fence_scheduled(s_fence);
 		dma_fence_set_error(&s_fence->finished, -ESRCH);
@@ -250,6 +253,7 @@ static void drm_sched_entity_kill_jobs(struct drm_sched_entity *entity)
 			continue;
 		}
 
+		dma_fence_get(entity->last_scheduled);
 		r = dma_fence_add_callback(entity->last_scheduled,
 					   &job->finish_cb,
 					   drm_sched_entity_kill_jobs_cb);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH AUTOSEL 6.0 30/30] ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[]
  2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
                   ` (27 preceding siblings ...)
  2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 29/30] drm/scheduler: fix fence ref counting Sasha Levin
@ 2022-11-06 17:03 ` Sasha Levin
  28 siblings, 0 replies; 30+ messages in thread
From: Sasha Levin @ 2022-11-06 17:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Rafael J . Wysocki, Sasha Levin, rafael, linux-acpi

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit fa153b7cddce795662d38f78a87612c166c0f692 ]

Some x86/ACPI laptops with MIPI cameras have a LATT2021 ACPI device
in the _DEP dependency list of the ACPI devices for the camera-sensors
(which have flags.honor_deps set).

The _DDN for the LATT2021 device is "Lattice FW Update Client Driver",
suggesting that this is used for firmware updates of something. There
is no Linux driver for this and if Linux gets support for updates it
will likely be in userspace through fwupd.

For now add the LATT2021 HID to acpi_ignore_dep_ids[] so that
acpi_dev_ready_for_enumeration() will return true once the other _DEP
dependencies are met.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/scan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 42cec8120f18..adfeb5770efd 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -796,6 +796,7 @@ static bool acpi_info_matches_ids(struct acpi_device_info *info,
 static const char * const acpi_ignore_dep_ids[] = {
 	"PNP0D80", /* Windows-compatible System Power Management Controller */
 	"INT33BD", /* Intel Baytrail Mailbox Device */
+	"LATT2021", /* Lattice FW Update Client Driver */
 	NULL
 };
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-11-06 17:06 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06 17:03 [PATCH AUTOSEL 6.0 01/30] drm/msm/gpu: Fix crash during system suspend after unbind Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 02/30] spi: tegra210-quad: Fix combined sequence Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 03/30] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 04/30] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe" Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 05/30] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe" Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 06/30] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 07/30] ASoC: rt5682s: Fix the TDM Tx settings Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 08/30] ASoC: rt1019: Fix the TDM settings Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 09/30] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 10/30] spi: intel: Fix the offset to get the 64K erase opcode Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 11/30] ASoC: codecs: jz4725b: add missed Line In power control bit Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 12/30] ASoC: codecs: jz4725b: fix reported volume for Master ctl Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 13/30] ASoC: codecs: jz4725b: use right control for Capture Volume Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 14/30] ASoC: codecs: jz4725b: fix capture selector naming Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 15/30] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 16/30] selftests/futex: fix build for clang Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 17/30] selftests/intel_pstate: fix build for ARCH=x86_64 Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 18/30] selftests/kexec: " Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 19/30] ASoC: Intel: sof_rt5682: Add quirk for Rex board Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 20/30] rtc: cmos: fix build on non-ACPI platforms Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 21/30] ASoC: rt1308-sdw: add the default value of some registers Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 22/30] ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 23/30] ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 24/30] drm/amdgpu: Adjust MES polling timeout for sriov Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 25/30] platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 26/30] platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 27/30] drm/amd/display: Remove wrong pipe control lock Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 28/30] drm/amd/display: Don't return false if no stream Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 29/30] drm/scheduler: fix fence ref counting Sasha Levin
2022-11-06 17:03 ` [PATCH AUTOSEL 6.0 30/30] ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[] Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).