--- /dev/null
+From 06000d398650bf06afba3baa773f49489a026f3d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 25 Oct 2022 14:12:23 +0200
+Subject: ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[]
+
+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
+
--- /dev/null
+From 05d82d5280464ba7dde8ad90c4eb6202204268dd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 Oct 2022 07:11:36 -0500
+Subject: ACPI: x86: Add another system to quirk list for forcing
+ StorageD3Enable
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+[ Upstream commit 2124becad797245d49252d2d733aee0322233d7e ]
+
+commit 018d6711c26e4 ("ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1
+for StorageD3Enable") introduced a quirk to allow a system with ambiguous
+use of _ADR 0 to force StorageD3Enable.
+
+Julius Brockmann reports that Inspiron 16 5625 suffers that same symptoms.
+Add this other system to the list as well.
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=216440
+Reported-and-tested-by: Julius Brockmann <mail@juliusbrockmann.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/acpi/x86/utils.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
+index d7cdd8406c84..950a93922ca8 100644
+--- a/drivers/acpi/x86/utils.c
++++ b/drivers/acpi/x86/utils.c
+@@ -219,6 +219,12 @@ static const struct dmi_system_id force_storage_d3_dmi[] = {
+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"),
+ }
+ },
++ {
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 16 5625"),
++ }
++ },
+ {}
+ };
+
+--
+2.35.1
+
--- /dev/null
+From e021acbf86b8a69c8caac15af300a71ed3e010c3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 21 Oct 2022 14:34:32 +0800
+Subject: ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table
+
+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
+
--- /dev/null
+From c99b22a121b9da9d4d8badb22148e298aa609e1c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 11 Oct 2022 10:51:36 +0800
+Subject: ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo
+ ThinkBook 16 Gen 4+ ARA to the Quirks List
+
+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
+
--- /dev/null
+From fab0ccc4657ce26c55aaada2f78e8b5bfd05cbc8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 16 Oct 2022 16:26:42 +0300
+Subject: ASoC: codecs: jz4725b: add missed Line In power control bit
+
+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
+
--- /dev/null
+From 28c77ef1123b3eb29f024c306deeb1bc71bfb012 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 16 Oct 2022 16:26:45 +0300
+Subject: ASoC: codecs: jz4725b: fix capture selector naming
+
+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
+
--- /dev/null
+From 447427e7c406c09c82c9cfd3b9335e39548bb235 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 16 Oct 2022 16:26:43 +0300
+Subject: ASoC: codecs: jz4725b: fix reported volume for Master ctl
+
+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
+
--- /dev/null
+From c8e3d0eb280ab43d4cae3f99135e9989ef1534b5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 Oct 2022 08:16:39 +0100
+Subject: ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source",
+ "Routee" -> "Route"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Colin Ian King <colin.i.king@gmail.com>
+
+[ Upstream commit df496157a5afa1b6d1f4c46ad6549c2c346d1e59 ]
+
+There are two spelling mistakes in codec routing description. Fix it.
+
+Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
+Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
+Acked-by: Paul Cercueil <paul@crapouillou.net>
+Link: https://lore.kernel.org/r/20221019071639.1003730-1-colin.i.king@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 d57c2c6a3add..71ea576f7e67 100644
+--- a/sound/soc/codecs/jz4725b.c
++++ b/sound/soc/codecs/jz4725b.c
+@@ -288,7 +288,7 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = {
+
+ {"Mixer to ADC", NULL, "Mixer"},
+ {"ADC Source Capture Route", "Mixer", "Mixer to ADC"},
+- {"ADC Sourc Capture Routee", "Line In", "Line In"},
++ {"ADC Source Capture Route", "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"},
+--
+2.35.1
+
--- /dev/null
+From 141f17f70177967891e9ed4371f796d6ff9bba9f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 16 Oct 2022 16:26:44 +0300
+Subject: ASoC: codecs: jz4725b: use right control for Capture Volume
+
+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
+
--- /dev/null
+From fdbf206f6c99f67aa0431e8d9df1c36929c0c82c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 17 Oct 2022 15:57:28 -0500
+Subject: ASoC: Intel: sof_rt5682: Add quirk for Rex board
+
+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
+
--- /dev/null
+From 89fb69fca5f6c7e4480953d5ab72b800eb3e6dd5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 17 Oct 2022 15:40:54 -0500
+Subject: ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
+
+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
+
--- /dev/null
+From 1162d92b4f75b1acf8337c3ac5b7f998b1c6ba55 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 8 Oct 2022 22:05:22 +0800
+Subject: ASoC: mt6660: Keep the pm_runtime enables before component stuff in
+ mt6660_i2c_probe
+
+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
+
--- /dev/null
+From 9313f5956ba417651a58603231a0ee02a030ca0f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 12 Oct 2022 11:01:02 +0800
+Subject: ASoC: rt1019: Fix the TDM settings
+
+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
+
--- /dev/null
+From 073675eb0108c0adfd0c0be2fff0e37b4d733ee2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 Oct 2022 17:57:15 +0800
+Subject: ASoC: rt1308-sdw: add the default value of some registers
+
+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
+
--- /dev/null
+From ebb3e924477f0d8270d7432cd419425b314d4ddb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 12 Oct 2022 11:13:20 +0800
+Subject: ASoC: rt5682s: Fix the TDM Tx settings
+
+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
+
--- /dev/null
+From ec0f801f2b8db828eba7e30fb8707047935aede1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 19:48:50 +0800
+Subject: ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in
+ wm5102_probe"
+
+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
+
--- /dev/null
+From e9367b53c8af2dbe72100e15f46b4e7d7cec67fa Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 19:48:51 +0800
+Subject: ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in
+ wm5110_probe"
+
+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
+
--- /dev/null
+From be123d6495348c2a2cbfb099a8d54ffab5566b9c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 17:20:14 +0800
+Subject: ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK
+
+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
+
--- /dev/null
+From 870ac279a05c23af468f5ebd5a02ca57e6bbaa4a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 19:48:52 +0800
+Subject: ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in
+ wm8997_probe"
+
+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
+
--- /dev/null
+From 82eddad3d0378870b3c2f2693fb494657a510d9c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 1 Nov 2022 00:54:13 +0000
+Subject: block: blk_add_rq_to_plug(): clear stale 'last' after flush
+
+From: Al Viro <viro@zeniv.linux.org.uk>
+
+[ Upstream commit 878eb6e48f240d02ed1c9298020a0b6370695f24 ]
+
+blk_mq_flush_plug_list() empties ->mq_list and request we'd peeked there
+before that call is gone; in any case, we are not dealing with a mix
+of requests for different queues now - there's no requests left in the
+plug.
+
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ block/blk-mq.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/block/blk-mq.c b/block/blk-mq.c
+index edf41959a705..4402e4ecb8b1 100644
+--- a/block/blk-mq.c
++++ b/block/blk-mq.c
+@@ -1183,6 +1183,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
+ (!blk_queue_nomerges(rq->q) &&
+ blk_rq_bytes(last) >= BLK_PLUG_FLUSH_SIZE)) {
+ blk_mq_flush_plug_list(plug, false);
++ last = NULL;
+ trace_block_plug(rq->q);
+ }
+
+--
+2.35.1
+
--- /dev/null
+From ef54325838551ab60028a3da77c34bd7a2e99e0f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 31 Oct 2022 16:10:33 -0700
+Subject: Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
+
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+
+[ Upstream commit f937b758a188d6fd328a81367087eddbb2fce50f ]
+
+l2cap_global_chan_by_psm shall not return fixed channels as they are not
+meant to be connected by (S)PSM.
+
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/bluetooth/l2cap_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
+index 4df3d0ed6c80..9c24947aa41e 100644
+--- a/net/bluetooth/l2cap_core.c
++++ b/net/bluetooth/l2cap_core.c
+@@ -1990,7 +1990,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
+ if (link_type == LE_LINK && c->src_type == BDADDR_BREDR)
+ continue;
+
+- if (c->psm == psm) {
++ if (c->chan_type != L2CAP_CHAN_FIXED && c->psm == psm) {
+ int src_match, dst_match;
+ int src_any, dst_any;
+
+--
+2.35.1
+
--- /dev/null
+From 7310e15a7b0a129a46a8736fc37c669b7d5241cd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 18:36:06 +0800
+Subject: btrfs: raid56: properly handle the error when unable to find the
+ missing stripe
+
+From: Qu Wenruo <wqu@suse.com>
+
+[ Upstream commit f15fb2cd979a07fbfc666e2f04b8b30ec9233b2a ]
+
+In raid56_alloc_missing_rbio(), if we can not determine where the
+missing device is inside the full stripe, we just BUG_ON().
+
+This is not necessary especially the only caller inside scrub.c is
+already properly checking the return value, and will treat it as a
+memory allocation failure.
+
+Fix the error handling by:
+
+- Add an extra warning for the reason
+ Although personally speaking it may be better to be an ASSERT().
+
+- Properly free the allocated rbio
+
+Signed-off-by: Qu Wenruo <wqu@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/raid56.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
+index 2feb5c20641a..a21b9e085d1b 100644
+--- a/fs/btrfs/raid56.c
++++ b/fs/btrfs/raid56.c
+@@ -2767,8 +2767,10 @@ raid56_alloc_missing_rbio(struct bio *bio, struct btrfs_io_context *bioc)
+
+ rbio->faila = find_logical_bio_stripe(rbio, bio);
+ if (rbio->faila == -1) {
+- BUG();
+- kfree(rbio);
++ btrfs_warn_rl(fs_info,
++ "can not determine the failed stripe number for full stripe %llu",
++ bioc->raid_map[0]);
++ __free_raid_bio(rbio);
+ return NULL;
+ }
+
+--
+2.35.1
+
--- /dev/null
+From 24886697b3c797defdf54bfa3f5f246ea6273043 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 1 Nov 2022 16:15:40 +0000
+Subject: btrfs: remove pointless and double ulist frees in error paths of
+ qgroup tests
+
+From: Filipe Manana <fdmanana@suse.com>
+
+[ Upstream commit d0ea17aec12ea0f7b9d2ed727d8ef8169d1e7699 ]
+
+Several places in the qgroup self tests follow the pattern of freeing the
+ulist pointer they passed to btrfs_find_all_roots() if the call to that
+function returned an error. That is pointless because that function always
+frees the ulist in case it returns an error.
+
+Also In some places like at test_multiple_refs(), after a call to
+btrfs_qgroup_account_extent() we also leave "old_roots" and "new_roots"
+pointing to ulists that were freed, because btrfs_qgroup_account_extent()
+has freed those ulists, and if after that the next call to
+btrfs_find_all_roots() fails, we call ulist_free() on the "old_roots"
+ulist again, resulting in a double free.
+
+So remove those calls to reduce the code size and avoid double ulist
+free in case of an error.
+
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/tests/qgroup-tests.c | 16 ++++------------
+ 1 file changed, 4 insertions(+), 12 deletions(-)
+
+diff --git a/fs/btrfs/tests/qgroup-tests.c b/fs/btrfs/tests/qgroup-tests.c
+index 843dd3d3adbe..63676ea19f29 100644
+--- a/fs/btrfs/tests/qgroup-tests.c
++++ b/fs/btrfs/tests/qgroup-tests.c
+@@ -225,7 +225,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
+ */
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
+ if (ret) {
+- ulist_free(old_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -240,7 +239,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
+ if (ret) {
+ ulist_free(old_roots);
+- ulist_free(new_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -252,17 +250,18 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
+ return ret;
+ }
+
++ /* btrfs_qgroup_account_extent() always frees the ulists passed to it. */
++ old_roots = NULL;
++ new_roots = NULL;
++
+ if (btrfs_verify_qgroup_counts(fs_info, BTRFS_FS_TREE_OBJECTID,
+ nodesize, nodesize)) {
+ test_err("qgroup counts didn't match expected values");
+ return -EINVAL;
+ }
+- old_roots = NULL;
+- new_roots = NULL;
+
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
+ if (ret) {
+- ulist_free(old_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -276,7 +275,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
+ if (ret) {
+ ulist_free(old_roots);
+- ulist_free(new_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -326,7 +324,6 @@ static int test_multiple_refs(struct btrfs_root *root,
+
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
+ if (ret) {
+- ulist_free(old_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -341,7 +338,6 @@ static int test_multiple_refs(struct btrfs_root *root,
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
+ if (ret) {
+ ulist_free(old_roots);
+- ulist_free(new_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -361,7 +357,6 @@ static int test_multiple_refs(struct btrfs_root *root,
+
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
+ if (ret) {
+- ulist_free(old_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -376,7 +371,6 @@ static int test_multiple_refs(struct btrfs_root *root,
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
+ if (ret) {
+ ulist_free(old_roots);
+- ulist_free(new_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -402,7 +396,6 @@ static int test_multiple_refs(struct btrfs_root *root,
+
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
+ if (ret) {
+- ulist_free(old_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+@@ -417,7 +410,6 @@ static int test_multiple_refs(struct btrfs_root *root,
+ ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
+ if (ret) {
+ ulist_free(old_roots);
+- ulist_free(new_roots);
+ test_err("couldn't find old roots: %d", ret);
+ return ret;
+ }
+--
+2.35.1
+
--- /dev/null
+From 6b53e96d1a3b9e379e26464e5dcbc586014e0c3e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 28 Oct 2022 09:52:26 +0000
+Subject: cifs: always iterate smb sessions using primary channel
+
+From: Shyam Prasad N <sprasad@microsoft.com>
+
+[ Upstream commit 8abcaeaed38109e5ccaf40218e0e9e387f07bfe6 ]
+
+smb sessions and tcons currently hang off primary channel only.
+Secondary channels have the lists as empty. Whenever there's a
+need to iterate sessions or tcons, we should use the list in the
+corresponding primary channel.
+
+Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
+Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/cifs/misc.c | 6 +++++-
+ fs/cifs/smb2misc.c | 12 ++++++++++--
+ fs/cifs/smb2ops.c | 6 +++++-
+ fs/cifs/smb2transport.c | 6 +++++-
+ 4 files changed, 25 insertions(+), 5 deletions(-)
+
+diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
+index 87f60f736731..35085fa86636 100644
+--- a/fs/cifs/misc.c
++++ b/fs/cifs/misc.c
+@@ -400,6 +400,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
+ {
+ struct smb_hdr *buf = (struct smb_hdr *)buffer;
+ struct smb_com_lock_req *pSMB = (struct smb_com_lock_req *)buf;
++ struct TCP_Server_Info *pserver;
+ struct cifs_ses *ses;
+ struct cifs_tcon *tcon;
+ struct cifsInodeInfo *pCifsInode;
+@@ -464,9 +465,12 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
+ if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE))
+ return false;
+
++ /* If server is a channel, select the primary channel */
++ pserver = CIFS_SERVER_IS_CHAN(srv) ? srv->primary_server : srv;
++
+ /* look up tcon based on tid & uid */
+ spin_lock(&cifs_tcp_ses_lock);
+- list_for_each_entry(ses, &srv->smb_ses_list, smb_ses_list) {
++ list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
+ list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
+ if (tcon->tid != buf->Tid)
+ continue;
+diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
+index d73e5672aac4..3bcd3ac65dc1 100644
+--- a/fs/cifs/smb2misc.c
++++ b/fs/cifs/smb2misc.c
+@@ -135,6 +135,7 @@ static __u32 get_neg_ctxt_len(struct smb2_hdr *hdr, __u32 len,
+ int
+ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)
+ {
++ struct TCP_Server_Info *pserver;
+ struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
+ struct smb2_pdu *pdu = (struct smb2_pdu *)shdr;
+ int hdr_size = sizeof(struct smb2_hdr);
+@@ -143,6 +144,9 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)
+ __u32 calc_len; /* calculated length */
+ __u64 mid;
+
++ /* If server is a channel, select the primary channel */
++ pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
++
+ /*
+ * Add function to do table lookup of StructureSize by command
+ * ie Validate the wct via smb2_struct_sizes table above
+@@ -155,7 +159,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)
+
+ /* decrypt frame now that it is completely read in */
+ spin_lock(&cifs_tcp_ses_lock);
+- list_for_each_entry(iter, &server->smb_ses_list, smb_ses_list) {
++ list_for_each_entry(iter, &pserver->smb_ses_list, smb_ses_list) {
+ if (iter->Suid == le64_to_cpu(thdr->SessionId)) {
+ ses = iter;
+ break;
+@@ -671,6 +675,7 @@ bool
+ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
+ {
+ struct smb2_oplock_break *rsp = (struct smb2_oplock_break *)buffer;
++ struct TCP_Server_Info *pserver;
+ struct cifs_ses *ses;
+ struct cifs_tcon *tcon;
+ struct cifsInodeInfo *cinode;
+@@ -691,9 +696,12 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
+
+ cifs_dbg(FYI, "oplock level 0x%x\n", rsp->OplockLevel);
+
++ /* If server is a channel, select the primary channel */
++ pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
++
+ /* look up tcon based on tid & uid */
+ spin_lock(&cifs_tcp_ses_lock);
+- list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
++ list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
+ list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
+
+ spin_lock(&tcon->open_file_lock);
+diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
+index 14376437187a..c258a7b122b6 100644
+--- a/fs/cifs/smb2ops.c
++++ b/fs/cifs/smb2ops.c
+@@ -2288,14 +2288,18 @@ static void
+ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server)
+ {
+ struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
++ struct TCP_Server_Info *pserver;
+ struct cifs_ses *ses;
+ struct cifs_tcon *tcon;
+
+ if (shdr->Status != STATUS_NETWORK_NAME_DELETED)
+ return;
+
++ /* If server is a channel, select the primary channel */
++ pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
++
+ spin_lock(&cifs_tcp_ses_lock);
+- list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
++ list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
+ list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
+ if (tcon->tid == le32_to_cpu(shdr->Id.SyncId.TreeId)) {
+ spin_lock(&tcon->tc_lock);
+diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
+index 4640fc4a8b13..da85cfd7803b 100644
+--- a/fs/cifs/smb2transport.c
++++ b/fs/cifs/smb2transport.c
+@@ -140,9 +140,13 @@ int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key)
+ static struct cifs_ses *
+ smb2_find_smb_ses_unlocked(struct TCP_Server_Info *server, __u64 ses_id)
+ {
++ struct TCP_Server_Info *pserver;
+ struct cifs_ses *ses;
+
+- list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
++ /* If server is a channel, select the primary channel */
++ pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
++
++ list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
+ if (ses->Suid != ses_id)
+ continue;
+ ++ses->ses_count;
+--
+2.35.1
+
--- /dev/null
+From 4719254e6d3f8aa24fd114fcf290a08556ada9f3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 15 Aug 2022 16:40:43 +0100
+Subject: cxl/mbox: Add a check on input payload size
+
+From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+
+[ Upstream commit cf00b33058b196b4db928419dde68993b15a975b ]
+
+A bug in the LSA code resulted in transfers slightly larger
+than the mailbox size. Let us make it easier to catch similar
+issues in future by adding a low level check.
+
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Link: https://lore.kernel.org/r/20220815154044.24733-2-Jonathan.Cameron@huawei.com
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/cxl/core/mbox.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
+index 16176b9278b4..0c90f13870a4 100644
+--- a/drivers/cxl/core/mbox.c
++++ b/drivers/cxl/core/mbox.c
+@@ -174,7 +174,7 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in,
+ };
+ int rc;
+
+- if (out_size > cxlds->payload_size)
++ if (in_size > cxlds->payload_size || out_size > cxlds->payload_size)
+ return -E2BIG;
+
+ rc = cxlds->mbox_send(cxlds, &mbox_cmd);
+--
+2.35.1
+
--- /dev/null
+From 07185503c15cfdbf094a0726b3c8294b5e90053d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 27 Sep 2022 15:02:47 +0800
+Subject: cxl/pmem: Use size_add() against integer overflow
+
+From: Yu Zhe <yuzhe@nfschina.com>
+
+[ Upstream commit 4f1aa35f1fb7d51b125487c835982af792697ecb ]
+
+"struct_size() + n" may cause a integer overflow,
+use size_add() to handle it.
+
+Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
+Link: https://lore.kernel.org/r/20220927070247.23148-1-yuzhe@nfschina.com
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/cxl/pmem.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c
+index faade12279f0..e0646097a3d4 100644
+--- a/drivers/cxl/pmem.c
++++ b/drivers/cxl/pmem.c
+@@ -151,7 +151,7 @@ static int cxl_pmem_set_config_data(struct cxl_dev_state *cxlds,
+ return -EINVAL;
+
+ /* 4-byte status follows the input data in the payload */
+- if (struct_size(cmd, in_buf, cmd->in_length) + 4 > buf_len)
++ if (size_add(struct_size(cmd, in_buf, cmd->in_length), 4) > buf_len)
+ return -EINVAL;
+
+ set_lsa =
+--
+2.35.1
+
--- /dev/null
+From 7c399426d11173304ab37b053da23b26432c484f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Oct 2022 17:26:49 -0400
+Subject: drm/amd/display: Don't return false if no stream
+
+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
+
--- /dev/null
+From 2251eb4c4bae05f88c175e217ca46a875e9e1d79 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Oct 2022 11:46:51 -0400
+Subject: drm/amd/display: Enable timing sync on DCN32
+
+From: Alvin Lee <Alvin.Lee2@amd.com>
+
+[ Upstream commit c3d3f35b725bf9c93bec6d3c056f6bb7cfd27403 ]
+
+Missed enabling timing sync on DCN32 because DCN32 has a different DML
+param.
+
+Tested-by: Mark Broadworth <mark.broadworth@amd.com>
+Reviewed-by: Martin Leung <Martin.Leung@amd.com>
+Reviewed-by: Jun Lei <Jun.Lei@amd.com>
+Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@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/dml/dcn20/dcn20_fpu.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+index d34e0f1314d9..bc4f48ea8d4c 100644
+--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+@@ -1228,6 +1228,7 @@ int dcn20_populate_dml_pipes_from_context(
+ pipes[pipe_cnt].pipe.src.dcc = false;
+ pipes[pipe_cnt].pipe.src.dcc_rate = 1;
+ pipes[pipe_cnt].pipe.dest.synchronized_vblank_all_planes = synchronized_vblank;
++ pipes[pipe_cnt].pipe.dest.synchronize_timings = synchronized_vblank;
+ pipes[pipe_cnt].pipe.dest.hblank_start = timing->h_total - timing->h_front_porch;
+ pipes[pipe_cnt].pipe.dest.hblank_end = pipes[pipe_cnt].pipe.dest.hblank_start
+ - timing->h_addressable
+--
+2.35.1
+
--- /dev/null
+From 3d6bc2d1ffaf3e639ee125cea55cd35c78e1ec18 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 7 Oct 2022 12:43:26 -0400
+Subject: drm/amd/display: Fix DCN32 DSC delay calculation
+
+From: George Shen <george.shen@amd.com>
+
+[ Upstream commit bad610c97c08eef3ed1fa769a8b08b94f95b451e ]
+
+[Why]
+DCN32 DSC delay calculation had an unintentional integer division,
+resulting in a mismatch against the DML spreadsheet.
+
+[How]
+Cast numerator to double before performing the division.
+
+Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
+Acked-by: Alex Hung <alex.hung@amd.com>
+Signed-off-by: George Shen <george.shen@amd.com>
+Tested-by: Mark Broadworth <mark.broadworth@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
+index 365d290bba99..67af8f4df8b8 100644
+--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
+@@ -1746,7 +1746,7 @@ unsigned int dml32_DSCDelayRequirement(bool DSCEnabled,
+ }
+
+ DSCDelayRequirement_val = DSCDelayRequirement_val + (HTotal - HActive) *
+- dml_ceil(DSCDelayRequirement_val / HActive, 1);
++ dml_ceil((double)DSCDelayRequirement_val / HActive, 1);
+
+ DSCDelayRequirement_val = DSCDelayRequirement_val * PixelClock / PixelClockBackEnd;
+
+--
+2.35.1
+
--- /dev/null
+From 2a68c185f3d713c8b1f388ef5839a142626daefe Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Oct 2022 11:46:41 -0400
+Subject: drm/amd/display: Ignore Cable ID Feature
+
+From: Fangzhi Zuo <Jerry.Zuo@amd.com>
+
+[ Upstream commit 14aed119942f6c2f1286022323139f7404db5d2b ]
+
+Ignore cable ID for DP2 receivers that does not support the feature.
+
+Tested-by: Mark Broadworth <mark.broadworth@amd.com>
+Reviewed-by: Roman Li <Roman.Li@amd.com>
+Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
+Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+index 3be70848b202..54c76ed1ad75 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -1549,6 +1549,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
+
+ adev->dm.dc->debug.visual_confirm = amdgpu_dc_visual_confirm;
+
++ /* TODO: Remove after DP2 receiver gets proper support of Cable ID feature */
++ adev->dm.dc->debug.ignore_cable_id = true;
++
+ r = dm_dmub_hw_init(adev);
+ if (r) {
+ DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
+--
+2.35.1
+
--- /dev/null
+From 00955c45fb779c9bbd9617d4551d78f0b687fab0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 6 May 2022 16:32:38 -0400
+Subject: drm/amd/display: Investigate tool reported FCLK P-state deviations
+
+From: Nevenko Stupar <Nevenko.Stupar@amd.com>
+
+[ Upstream commit 7461016c5706eb8c477752bf69e5c9f5a38f502b ]
+
+[Why]
+Fix for some of the tool reported modes for FCLK
+P-state deviations and UCLK P-state deviations that
+are coming from DSC terms and/or Scaling terms
+causing MinActiveFCLKChangeLatencySupported
+and MaxActiveDRAMClockChangeLatencySupported
+incorrectly calculated in DML for these configurations.
+
+Reviewed-by: Chaitanya Dhere <Chaitanya.Dhere@amd.com>
+Acked-by: Jasdeep Dhillon <jdhillon@amd.com>
+Acked-by: Alex Hung <alex.hung@amd.com>
+Signed-off-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
+Tested-by: Mark Broadworth <mark.broadworth@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/dml/dcn32/display_mode_vba_32.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
+index 6704465fe5b6..ea80874474e3 100644
+--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
+@@ -364,7 +364,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
+ for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) {
+ v->DSCDelay[k] = dml32_DSCDelayRequirement(mode_lib->vba.DSCEnabled[k],
+ mode_lib->vba.ODMCombineEnabled[k], mode_lib->vba.DSCInputBitPerComponent[k],
+- mode_lib->vba.OutputBpp[k], mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k],
++ mode_lib->vba.OutputBppPerState[mode_lib->vba.VoltageLevel][k],
++ mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k],
+ mode_lib->vba.NumberOfDSCSlices[k], mode_lib->vba.OutputFormat[k],
+ mode_lib->vba.Output[k], mode_lib->vba.PixelClock[k],
+ mode_lib->vba.PixelClockBackEnd[k]);
+--
+2.35.1
+
--- /dev/null
+From 7e8240d44031b106a1c381022b8853516074d2fb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Oct 2022 17:26:48 -0400
+Subject: drm/amd/display: Remove wrong pipe control lock
+
+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
+
--- /dev/null
+From 4c32fe78d60a8e9961e88b453c9425f7f1bb70ec Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 Oct 2022 17:40:08 -0400
+Subject: drm/amd/display: Round up DST_after_scaler to nearest int
+
+From: George Shen <george.shen@amd.com>
+
+[ Upstream commit 8dc323133d74518e3b5b07242e2b2f088799ea6e ]
+
+[Why]
+The DST_after_scaler value that DML spreadsheet outputs is
+generally the driver value round up to the nearest int.
+
+Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
+Acked-by: Alex Hung <alex.hung@amd.com>
+Signed-off-by: George Shen <george.shen@amd.com>
+Tested-by: Mark Broadworth <mark.broadworth@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c
+index a1276f6b9581..395ae8761980 100644
+--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c
++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c
+@@ -291,8 +291,8 @@ void dml32_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
+
+ dml_print("DML_DLG: %s: vready_after_vcount0 = %d\n", __func__, dlg_regs->vready_after_vcount0);
+
+- dst_x_after_scaler = get_dst_x_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx);
+- dst_y_after_scaler = get_dst_y_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx);
++ dst_x_after_scaler = dml_ceil(get_dst_x_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx), 1);
++ dst_y_after_scaler = dml_ceil(get_dst_y_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx), 1);
+
+ // do some adjustment on the dst_after scaler to account for odm combine mode
+ dml_print("DML_DLG: %s: input dst_x_after_scaler = %d\n", __func__, dst_x_after_scaler);
+--
+2.35.1
+
--- /dev/null
+From 4ca1726ca1e69ca45b7bb2ca3361bdc5e6a1c11f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 Oct 2022 17:36:32 -0400
+Subject: drm/amd/display: Use forced DSC bpp in DML
+
+From: George Shen <george.shen@amd.com>
+
+[ Upstream commit ab007e5db5d3b8b8975c7eec69992ff38fe2a46c ]
+
+[Why]
+DSC config is calculated separately from DML calculations.
+DML should use these separately calculated DSC params. The issue is
+that the calculated bpp is not properly propagated into DML.
+
+[How]
+Correctly used forced_bpp value in DML.
+
+Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
+Acked-by: Alex Hung <alex.hung@amd.com>
+Signed-off-by: George Shen <george.shen@amd.com>
+Tested-by: Mark Broadworth <mark.broadworth@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/dml/dcn32/display_mode_vba_32.c | 2 +-
+ drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
+index 52525833a99b..6704465fe5b6 100644
+--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
+@@ -1627,7 +1627,7 @@ static void mode_support_configuration(struct vba_vars_st *v,
+ && !mode_lib->vba.MSOOrODMSplitWithNonDPLink
+ && !mode_lib->vba.NotEnoughLanesForMSO
+ && mode_lib->vba.LinkCapacitySupport[i] == true && !mode_lib->vba.P2IWith420
+- && !mode_lib->vba.DSCOnlyIfNecessaryWithBPP
++ //&& !mode_lib->vba.DSCOnlyIfNecessaryWithBPP
+ && !mode_lib->vba.DSC422NativeNotSupported
+ && !mode_lib->vba.MPCCombineMethodIncompatible
+ && mode_lib->vba.ODMCombine2To1SupportCheckOK[i] == true
+diff --git a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c b/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
+index 503e7d984ff0..cb34ac0af349 100644
+--- a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
++++ b/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
+@@ -624,7 +624,7 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib)
+ mode_lib->vba.skip_dio_check[mode_lib->vba.NumberOfActivePlanes] =
+ dout->is_virtual;
+
+- if (!dout->dsc_enable)
++ if (dout->dsc_enable)
+ mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] = dout->output_bpp;
+ else
+ mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] = 0.0;
+--
+2.35.1
+
--- /dev/null
+From 17cf9287a38bceff20e382a8cb7e4125910088a4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 26 Oct 2022 14:03:55 -0500
+Subject: drm/amd: Fail the suspend if resources can't be evicted
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+[ Upstream commit 8d4de331f1b24a22d18e3c6116aa25228cf54854 ]
+
+If a system does not have swap and memory is under 100% usage,
+amdgpu will fail to evict resources. Currently the suspend
+carries on proceeding to reset the GPU:
+
+```
+[drm] evicting device resources failed
+[drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block <vcn_v3_0> failed -12
+[drm] free PSP TMR buffer
+[TTM] Failed allocating page table
+[drm] evicting device resources failed
+amdgpu 0000:03:00.0: amdgpu: MODE1 reset
+amdgpu 0000:03:00.0: amdgpu: GPU mode1 reset
+amdgpu 0000:03:00.0: amdgpu: GPU smu mode1 reset
+```
+
+At this point if the suspend actually succeeded I think that amdgpu
+would have recovered because the GPU would have power cut off and
+restored. However the kernel fails to continue the suspend from the
+memory pressure and amdgpu fails to run the "resume" from the aborted
+suspend.
+
+```
+ACPI: PM: Preparing to enter system sleep state S3
+SLUB: Unable to allocate memory on node -1, gfp=0xdc0(GFP_KERNEL|__GFP_ZERO)
+ cache: Acpi-State, object size: 80, buffer size: 80, default order: 0, min order: 0
+ node 0: slabs: 22, objs: 1122, free: 0
+ACPI Error: AE_NO_MEMORY, Could not update object reference count (20210730/utdelete-651)
+
+[drm:psp_hw_start [amdgpu]] *ERROR* PSP load kdb failed!
+[drm:psp_resume [amdgpu]] *ERROR* PSP resume failed
+[drm:amdgpu_device_fw_loading [amdgpu]] *ERROR* resume of IP block <psp> failed -62
+amdgpu 0000:03:00.0: amdgpu: amdgpu_device_ip_resume failed (-62).
+PM: dpm_run_callback(): pci_pm_resume+0x0/0x100 returns -62
+amdgpu 0000:03:00.0: PM: failed to resume async: error -62
+```
+
+To avoid this series of unfortunate events, fail amdgpu's suspend
+when the memory eviction fails. This will let the system gracefully
+recover and the user can try suspend again when the memory pressure
+is relieved.
+
+Reported-by: post@davidak.de
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2223
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Acked-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index 9170aeaad93e..e0c960cc1d2e 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -4055,15 +4055,18 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)
+ * at suspend time.
+ *
+ */
+-static void amdgpu_device_evict_resources(struct amdgpu_device *adev)
++static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
+ {
++ int ret;
++
+ /* No need to evict vram on APUs for suspend to ram or s2idle */
+ if ((adev->in_s3 || adev->in_s0ix) && (adev->flags & AMD_IS_APU))
+- return;
++ return 0;
+
+- if (amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM))
++ ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
++ if (ret)
+ DRM_WARN("evicting device resources failed\n");
+-
++ return ret;
+ }
+
+ /*
+@@ -4113,7 +4116,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
+ if (!adev->in_s0ix)
+ amdgpu_amdkfd_suspend(adev, adev->in_runpm);
+
+- amdgpu_device_evict_resources(adev);
++ r = amdgpu_device_evict_resources(adev);
++ if (r)
++ return r;
+
+ amdgpu_fence_driver_hw_fini(adev);
+
+--
+2.35.1
+
--- /dev/null
+From c00602878e8abc48871e3689ff5f560a135927e7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 18 Oct 2022 15:17:59 +0800
+Subject: drm/amdgpu: Adjust MES polling timeout for sriov
+
+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 2dd827472d6e..3bff0ae15e64 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
+
--- /dev/null
+From c6792d29128575014d050160684d1de71bfbe713 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 24 Oct 2022 12:47:47 +0800
+Subject: drm/amdgpu: set fb_modifiers_not_supported in vkms
+
+From: Yifan Zhang <yifan1.zhang@amd.com>
+
+[ Upstream commit 89b3554782e6b65894f0551e9e0a82ad02dac94d ]
+
+This patch to fix the gdm3 start failure with virual display:
+
+/usr/libexec/gdm-x-session[1711]: (II) AMDGPU(0): Setting screen physical size to 270 x 203
+/usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to make import prime FD as pixmap: 22
+/usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument
+/usr/libexec/gdm-x-session[1711]: (WW) AMDGPU(0): Failed to set mode on CRTC 0
+/usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to enable any CRTC
+gnome-shell[1840]: Running GNOME Shell (using mutter 42.2) as a X11 window and compositing manager
+/usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument
+
+vkms doesn't have modifiers support, set fb_modifiers_not_supported to bring the gdm back.
+
+Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
+Acked-by: Guchun Chen <guchun.chen@amd.com>
+Reviewed-by: Tim Huang <Tim.Huang@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+index 576849e95296..f69827aefb57 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+@@ -500,6 +500,8 @@ static int amdgpu_vkms_sw_init(void *handle)
+
+ adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
+
++ adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
++
+ r = amdgpu_display_modeset_create_props(adev);
+ if (r)
+ return r;
+--
+2.35.1
+
--- /dev/null
+From 15a7ac47ececbe2425d63e3b6e96c0abc2454e51 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 13 Sep 2022 13:55:44 -0700
+Subject: drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid
+
+From: Nathan Huckleberry <nhuck@google.com>
+
+[ Upstream commit fc007fb815ab5395c3962c09b79a1630b0fbed9c ]
+
+The mode_valid field in drm_connector_helper_funcs is expected to be of
+type:
+enum drm_mode_status (* mode_valid) (struct drm_connector *connector,
+ struct drm_display_mode *mode);
+
+The mismatched return type breaks forward edge kCFI since the underlying
+function definition does not match the function hook definition.
+
+The return type of imx_tve_connector_mode_valid should be changed from
+int to enum drm_mode_status.
+
+Reported-by: Dan Carpenter <error27@gmail.com>
+Link: https://github.com/ClangBuiltLinux/linux/issues/1703
+Cc: llvm@lists.linux.dev
+Signed-off-by: Nathan Huckleberry <nhuck@google.com>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+Reviewed-by: Fabio Estevam <festevam@gmail.com>
+Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+Link: https://patchwork.freedesktop.org/patch/msgid/20220913205544.155106-1-nhuck@google.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/imx/imx-tve.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
+index 6b34fac3f73a..ab4d1c878fda 100644
+--- a/drivers/gpu/drm/imx/imx-tve.c
++++ b/drivers/gpu/drm/imx/imx-tve.c
+@@ -218,8 +218,9 @@ static int imx_tve_connector_get_modes(struct drm_connector *connector)
+ return ret;
+ }
+
+-static int imx_tve_connector_mode_valid(struct drm_connector *connector,
+- struct drm_display_mode *mode)
++static enum drm_mode_status
++imx_tve_connector_mode_valid(struct drm_connector *connector,
++ struct drm_display_mode *mode)
+ {
+ struct imx_tve *tve = con_to_tve(connector);
+ unsigned long rate;
+--
+2.35.1
+
--- /dev/null
+From 51873e45fdab36b6d2a33459a311ff95eee86bfb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 28 Sep 2022 12:49:00 +0530
+Subject: drm/msm/gpu: Fix crash during system suspend after unbind
+
+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
+
--- /dev/null
+From bef14d1439d9ec60ed579302f3c8f8158a90599f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 28 Oct 2022 11:52:06 +0200
+Subject: drm/rockchip: vop2: disable planes when disabling the crtc
+
+From: Michael Tretter <m.tretter@pengutronix.de>
+
+[ Upstream commit 447fb14bf07905b880c9ed1ea92c53d6dd0649d7 ]
+
+The vop2 driver needs to explicitly disable the planes if the crtc is
+disabled. Unless the planes are explicitly disabled, the address of the
+last framebuffer is kept in the registers of the VOP2. When re-enabling
+the encoder after it has been disabled by the driver, the VOP2 will
+start and read the framebuffer that has been freed but is still pointed
+to by the register. The iommu will catch these read accesses and print
+errors.
+
+Explicitly disable the planes when the crtc is disabled to reset the
+registers.
+
+Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+Link: https://patchwork.freedesktop.org/patch/msgid/20221028095206.2136601-3-m.tretter@pengutronix.de
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+index bf9c3e92e1cd..1fc04019dfd8 100644
+--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
++++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+@@ -878,10 +878,14 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc,
+ {
+ struct vop2_video_port *vp = to_vop2_video_port(crtc);
+ struct vop2 *vop2 = vp->vop2;
++ struct drm_crtc_state *old_crtc_state;
+ int ret;
+
+ vop2_lock(vop2);
+
++ old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
++ drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, false);
++
+ drm_crtc_vblank_off(crtc);
+
+ /*
+--
+2.35.1
+
--- /dev/null
+From 829f6385416ac91e44e9ac103642a13f7cd3cd60 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 28 Oct 2022 11:52:05 +0200
+Subject: drm/rockchip: vop2: fix null pointer in plane_atomic_disable
+
+From: Michael Tretter <m.tretter@pengutronix.de>
+
+[ Upstream commit 471bf2406c043491b1a8288e5f04bc278f7d7ca1 ]
+
+If the vop2_plane_atomic_disable function is called with NULL as a
+state, accessing the old_pstate runs into a null pointer exception.
+However, the drm_atomic_helper_disable_planes_on_crtc function calls the
+atomic_disable callback with state NULL.
+
+Allow to disable a plane without passing a plane state by checking the
+old_pstate only if a state is passed.
+
+Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+Link: https://patchwork.freedesktop.org/patch/msgid/20221028095206.2136601-2-m.tretter@pengutronix.de
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+index f9aa8b96c695..bf9c3e92e1cd 100644
+--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
++++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+@@ -997,13 +997,15 @@ static int vop2_plane_atomic_check(struct drm_plane *plane,
+ static void vop2_plane_atomic_disable(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+ {
+- struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(state, plane);
++ struct drm_plane_state *old_pstate = NULL;
+ struct vop2_win *win = to_vop2_win(plane);
+ struct vop2 *vop2 = win->vop2;
+
+ drm_dbg(vop2->drm, "%s disable\n", win->data->name);
+
+- if (!old_pstate->crtc)
++ if (state)
++ old_pstate = drm_atomic_get_old_plane_state(state, plane);
++ if (old_pstate && !old_pstate->crtc)
+ return;
+
+ vop2_win_disable(win);
+--
+2.35.1
+
--- /dev/null
+From d68103f3d75dd240d43544ff956238f36953f134 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 27 Sep 2022 18:43:03 +0200
+Subject: drm/scheduler: fix fence ref counting
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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
+
--- /dev/null
+From 44eba3d30dab875035e60ea8275709192a595cf0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 28 Oct 2022 15:08:26 +0100
+Subject: firmware: arm_scmi: Cleanup the core driver removal callback
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Cristian Marussi <cristian.marussi@arm.com>
+
+[ Upstream commit 3f4071cbd2063b917486d1047a4da47718215fee ]
+
+Platform drivers .remove callbacks are not supposed to fail and report
+errors. Such errors are indeed ignored by the core platform drivers
+and the driver unbind process is anyway completed.
+
+The SCMI core platform driver as it is now, instead, bails out reporting
+an error in case of an explicit unbind request.
+
+Fix the removal path by adding proper device links between the core SCMI
+device and the SCMI protocol devices so that a full SCMI stack unbind is
+triggered when the core driver is removed. The remove process does not
+bail out anymore on the anomalous conditions triggered by an explicit
+unbind but the user is still warned.
+
+Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
+Link: https://lore.kernel.org/r/20221028140833.280091-1-cristian.marussi@arm.com
+Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/firmware/arm_scmi/bus.c | 11 +++++++++++
+ drivers/firmware/arm_scmi/common.h | 1 +
+ drivers/firmware/arm_scmi/driver.c | 31 ++++++++++++++++++------------
+ 3 files changed, 31 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
+index d4e23101448a..35bb70724d44 100644
+--- a/drivers/firmware/arm_scmi/bus.c
++++ b/drivers/firmware/arm_scmi/bus.c
+@@ -216,9 +216,20 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)
+ device_unregister(&scmi_dev->dev);
+ }
+
++void scmi_device_link_add(struct device *consumer, struct device *supplier)
++{
++ struct device_link *link;
++
++ link = device_link_add(consumer, supplier, DL_FLAG_AUTOREMOVE_CONSUMER);
++
++ WARN_ON(!link);
++}
++
+ void scmi_set_handle(struct scmi_device *scmi_dev)
+ {
+ scmi_dev->handle = scmi_handle_get(&scmi_dev->dev);
++ if (scmi_dev->handle)
++ scmi_device_link_add(&scmi_dev->dev, scmi_dev->handle->dev);
+ }
+
+ int scmi_protocol_register(const struct scmi_protocol *proto)
+diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
+index 61aba7447c32..9b87b5b69535 100644
+--- a/drivers/firmware/arm_scmi/common.h
++++ b/drivers/firmware/arm_scmi/common.h
+@@ -97,6 +97,7 @@ static inline void unpack_scmi_header(u32 msg_hdr, struct scmi_msg_hdr *hdr)
+ struct scmi_revision_info *
+ scmi_revision_area_get(const struct scmi_protocol_handle *ph);
+ int scmi_handle_put(const struct scmi_handle *handle);
++void scmi_device_link_add(struct device *consumer, struct device *supplier);
+ struct scmi_handle *scmi_handle_get(struct device *dev);
+ void scmi_set_handle(struct scmi_device *scmi_dev);
+ void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph,
+diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
+index 9022f5ee29aa..244d94eeb092 100644
+--- a/drivers/firmware/arm_scmi/driver.c
++++ b/drivers/firmware/arm_scmi/driver.c
+@@ -2277,10 +2277,16 @@ int scmi_protocol_device_request(const struct scmi_device_id *id_table)
+ sdev = scmi_get_protocol_device(child, info,
+ id_table->protocol_id,
+ id_table->name);
+- /* Set handle if not already set: device existed */
+- if (sdev && !sdev->handle)
+- sdev->handle =
+- scmi_handle_get_from_info_unlocked(info);
++ if (sdev) {
++ /* Set handle if not already set: device existed */
++ if (!sdev->handle)
++ sdev->handle =
++ scmi_handle_get_from_info_unlocked(info);
++ /* Relink consumer and suppliers */
++ if (sdev->handle)
++ scmi_device_link_add(&sdev->dev,
++ sdev->handle->dev);
++ }
+ } else {
+ dev_err(info->dev,
+ "Failed. SCMI protocol %d not active.\n",
+@@ -2479,20 +2485,17 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id)
+
+ static int scmi_remove(struct platform_device *pdev)
+ {
+- int ret = 0, id;
++ int ret, id;
+ struct scmi_info *info = platform_get_drvdata(pdev);
+ struct device_node *child;
+
+ mutex_lock(&scmi_list_mutex);
+ if (info->users)
+- ret = -EBUSY;
+- else
+- list_del(&info->node);
++ dev_warn(&pdev->dev,
++ "Still active SCMI users will be forcibly unbound.\n");
++ list_del(&info->node);
+ mutex_unlock(&scmi_list_mutex);
+
+- if (ret)
+- return ret;
+-
+ scmi_notification_exit(&info->handle);
+
+ mutex_lock(&info->protocols_mtx);
+@@ -2504,7 +2507,11 @@ static int scmi_remove(struct platform_device *pdev)
+ idr_destroy(&info->active_protocols);
+
+ /* Safe to free channels since no more users */
+- return scmi_cleanup_txrx_channels(info);
++ ret = scmi_cleanup_txrx_channels(info);
++ if (ret)
++ dev_warn(&pdev->dev, "Failed to cleanup SCMI channels.\n");
++
++ return 0;
+ }
+
+ static ssize_t protocol_version_show(struct device *dev,
+--
+2.35.1
+
--- /dev/null
+From 6154f0355415bd2f3a154a20cb7d7dd2ce488aae Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 28 Oct 2022 15:08:28 +0100
+Subject: firmware: arm_scmi: Make tx_prepare time out eventually
+
+From: Cristian Marussi <cristian.marussi@arm.com>
+
+[ Upstream commit 59172b212ec0dbb97ceb5671d912e6e61fa802d5 ]
+
+SCMI transports based on shared memory, at start of transmissions, have
+to wait for the shared Tx channel area to be eventually freed by the
+SCMI platform before accessing the channel. In fact the channel is owned
+by the SCMI platform until marked as free by the platform itself and,
+as such, cannot be used by the agent until relinquished.
+
+As a consequence a badly misbehaving SCMI platform firmware could lock
+the channel indefinitely and make the kernel side SCMI stack loop
+forever waiting for such channel to be freed, possibly hanging the
+whole boot sequence.
+
+Add a timeout to the existent Tx waiting spin-loop so that, when the
+system ends up in this situation, the SCMI stack can at least bail-out,
+nosily warn the user, and abort the transmission.
+
+Reported-by: YaxiongTian <iambestgod@outlook.com>
+Suggested-by: YaxiongTian <iambestgod@outlook.com>
+Cc: Vincent Guittot <vincent.guittot@linaro.org>
+Cc: Etienne Carriere <etienne.carriere@linaro.org>
+Cc: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
+Link: https://lore.kernel.org/r/20221028140833.280091-3-cristian.marussi@arm.com
+Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/firmware/arm_scmi/common.h | 4 +++-
+ drivers/firmware/arm_scmi/driver.c | 1 +
+ drivers/firmware/arm_scmi/mailbox.c | 2 +-
+ drivers/firmware/arm_scmi/optee.c | 2 +-
+ drivers/firmware/arm_scmi/shmem.c | 31 +++++++++++++++++++++++++----
+ drivers/firmware/arm_scmi/smc.c | 2 +-
+ 6 files changed, 34 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
+index 9b87b5b69535..a1c0154c31c6 100644
+--- a/drivers/firmware/arm_scmi/common.h
++++ b/drivers/firmware/arm_scmi/common.h
+@@ -118,6 +118,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id);
+ *
+ * @dev: Reference to device in the SCMI hierarchy corresponding to this
+ * channel
++ * @rx_timeout_ms: The configured RX timeout in milliseconds.
+ * @handle: Pointer to SCMI entity handle
+ * @no_completion_irq: Flag to indicate that this channel has no completion
+ * interrupt mechanism for synchronous commands.
+@@ -127,6 +128,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id);
+ */
+ struct scmi_chan_info {
+ struct device *dev;
++ unsigned int rx_timeout_ms;
+ struct scmi_handle *handle;
+ bool no_completion_irq;
+ void *transport_info;
+@@ -233,7 +235,7 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id);
+ struct scmi_shared_mem;
+
+ void shmem_tx_prepare(struct scmi_shared_mem __iomem *shmem,
+- struct scmi_xfer *xfer);
++ struct scmi_xfer *xfer, struct scmi_chan_info *cinfo);
+ u32 shmem_read_header(struct scmi_shared_mem __iomem *shmem);
+ void shmem_fetch_response(struct scmi_shared_mem __iomem *shmem,
+ struct scmi_xfer *xfer);
+diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
+index 244d94eeb092..f818d00bb2c6 100644
+--- a/drivers/firmware/arm_scmi/driver.c
++++ b/drivers/firmware/arm_scmi/driver.c
+@@ -2013,6 +2013,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device *dev,
+ return -ENOMEM;
+
+ cinfo->dev = dev;
++ cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms;
+
+ ret = info->desc->ops->chan_setup(cinfo, info->dev, tx);
+ if (ret)
+diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c
+index 08ff4d110beb..1e40cb035044 100644
+--- a/drivers/firmware/arm_scmi/mailbox.c
++++ b/drivers/firmware/arm_scmi/mailbox.c
+@@ -36,7 +36,7 @@ static void tx_prepare(struct mbox_client *cl, void *m)
+ {
+ struct scmi_mailbox *smbox = client_to_scmi_mailbox(cl);
+
+- shmem_tx_prepare(smbox->shmem, m);
++ shmem_tx_prepare(smbox->shmem, m, smbox->cinfo);
+ }
+
+ static void rx_callback(struct mbox_client *cl, void *m)
+diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c
+index f42dad997ac9..2a7aeab40e54 100644
+--- a/drivers/firmware/arm_scmi/optee.c
++++ b/drivers/firmware/arm_scmi/optee.c
+@@ -498,7 +498,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo,
+ msg_tx_prepare(channel->req.msg, xfer);
+ ret = invoke_process_msg_channel(channel, msg_command_size(xfer));
+ } else {
+- shmem_tx_prepare(channel->req.shmem, xfer);
++ shmem_tx_prepare(channel->req.shmem, xfer, cinfo);
+ ret = invoke_process_smt_channel(channel);
+ }
+
+diff --git a/drivers/firmware/arm_scmi/shmem.c b/drivers/firmware/arm_scmi/shmem.c
+index 0e3eaea5d852..1dfe534b8518 100644
+--- a/drivers/firmware/arm_scmi/shmem.c
++++ b/drivers/firmware/arm_scmi/shmem.c
+@@ -5,10 +5,13 @@
+ * Copyright (C) 2019 ARM Ltd.
+ */
+
++#include <linux/ktime.h>
+ #include <linux/io.h>
+ #include <linux/processor.h>
+ #include <linux/types.h>
+
++#include <asm-generic/bug.h>
++
+ #include "common.h"
+
+ /*
+@@ -30,16 +33,36 @@ struct scmi_shared_mem {
+ };
+
+ void shmem_tx_prepare(struct scmi_shared_mem __iomem *shmem,
+- struct scmi_xfer *xfer)
++ struct scmi_xfer *xfer, struct scmi_chan_info *cinfo)
+ {
++ ktime_t stop;
++
+ /*
+ * Ideally channel must be free by now unless OS timeout last
+ * request and platform continued to process the same, wait
+ * until it releases the shared memory, otherwise we may endup
+- * overwriting its response with new message payload or vice-versa
++ * overwriting its response with new message payload or vice-versa.
++ * Giving up anyway after twice the expected channel timeout so as
++ * not to bail-out on intermittent issues where the platform is
++ * occasionally a bit slower to answer.
++ *
++ * Note that after a timeout is detected we bail-out and carry on but
++ * the transport functionality is probably permanently compromised:
++ * this is just to ease debugging and avoid complete hangs on boot
++ * due to a misbehaving SCMI firmware.
+ */
+- spin_until_cond(ioread32(&shmem->channel_status) &
+- SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE);
++ stop = ktime_add_ms(ktime_get(), 2 * cinfo->rx_timeout_ms);
++ spin_until_cond((ioread32(&shmem->channel_status) &
++ SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE) ||
++ ktime_after(ktime_get(), stop));
++ if (!(ioread32(&shmem->channel_status) &
++ SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE)) {
++ WARN_ON_ONCE(1);
++ dev_err(cinfo->dev,
++ "Timeout waiting for a free TX channel !\n");
++ return;
++ }
++
+ /* Mark channel busy + clear error */
+ iowrite32(0x0, &shmem->channel_status);
+ iowrite32(xfer->hdr.poll_completion ? 0 : SCMI_SHMEM_FLAG_INTR_ENABLED,
+diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c
+index 745acfdd0b3d..87a7b13cf868 100644
+--- a/drivers/firmware/arm_scmi/smc.c
++++ b/drivers/firmware/arm_scmi/smc.c
+@@ -188,7 +188,7 @@ static int smc_send_message(struct scmi_chan_info *cinfo,
+ */
+ smc_channel_lock_acquire(scmi_info, xfer);
+
+- shmem_tx_prepare(scmi_info->shmem, xfer);
++ shmem_tx_prepare(scmi_info->shmem, xfer, cinfo);
+
+ arm_smccc_1_1_invoke(scmi_info->func_id, 0, 0, 0, 0, 0, 0, 0, &res);
+
+--
+2.35.1
+
--- /dev/null
+From 0257d4f1abc5b9528d1f569e4128c01a162519f6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Oct 2022 16:54:40 +0200
+Subject: i2c: i801: add lis3lv02d's I2C address for Vostro 5568
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Nam Cao <namcaov@gmail.com>
+
+[ Upstream commit d6643d7207c572c1b0305ed505101f15502c6c87 ]
+
+Dell Vostro 5568 laptop has lis3lv02d, but its i2c address is not known
+to the kernel. Add this address.
+
+Output of "cat /sys/devices/platform/lis3lv02d/position" on Dell Vostro
+5568 laptop:
+ - Horizontal: (-18,0,1044)
+ - Front elevated: (522,-18,1080)
+ - Left elevated: (-18,-360,1080)
+ - Upside down: (36,108,-1134)
+
+Signed-off-by: Nam Cao <namcaov@gmail.com>
+Reviewed-by: Jean Delvare <jdelvare@suse.de>
+Reviewed-by: Pali Rohár <pali@kernel.org>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-i801.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
+index a176296f4fff..e46561e095c6 100644
+--- a/drivers/i2c/busses/i2c-i801.c
++++ b/drivers/i2c/busses/i2c-i801.c
+@@ -1243,6 +1243,7 @@ static const struct {
+ */
+ { "Latitude 5480", 0x29 },
+ { "Vostro V131", 0x1d },
++ { "Vostro 5568", 0x29 },
+ };
+
+ static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
+--
+2.35.1
+
--- /dev/null
+From c9a1da981badf102e0652d89f11ac1ae0a9cfc01 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Oct 2022 16:39:33 +0200
+Subject: i2c: tegra: Allocate DMA memory for DMA engine
+
+From: Thierry Reding <treding@nvidia.com>
+
+[ Upstream commit cdbf26251d3b35c4ccaea0c3a6de4318f727d3d2 ]
+
+When the I2C controllers are running in DMA mode, it is the DMA engine
+that performs the memory accesses rather than the I2C controller. Pass
+the DMA engine's struct device pointer to the DMA API to make sure the
+correct DMA operations are used.
+
+This fixes an issue where the DMA engine's SMMU stream ID needs to be
+misleadingly set for the I2C controllers in device tree.
+
+Suggested-by: Robin Murphy <robin.murphy@arm.com>
+Signed-off-by: Thierry Reding <treding@nvidia.com>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-tegra.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
+index 031c78ac42e6..a24cc413c89b 100644
+--- a/drivers/i2c/busses/i2c-tegra.c
++++ b/drivers/i2c/busses/i2c-tegra.c
+@@ -284,6 +284,7 @@ struct tegra_i2c_dev {
+ struct dma_chan *tx_dma_chan;
+ struct dma_chan *rx_dma_chan;
+ unsigned int dma_buf_size;
++ struct device *dma_dev;
+ dma_addr_t dma_phys;
+ void *dma_buf;
+
+@@ -420,7 +421,7 @@ static int tegra_i2c_dma_submit(struct tegra_i2c_dev *i2c_dev, size_t len)
+ static void tegra_i2c_release_dma(struct tegra_i2c_dev *i2c_dev)
+ {
+ if (i2c_dev->dma_buf) {
+- dma_free_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
++ dma_free_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
+ i2c_dev->dma_buf, i2c_dev->dma_phys);
+ i2c_dev->dma_buf = NULL;
+ }
+@@ -467,10 +468,13 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
+
+ i2c_dev->tx_dma_chan = chan;
+
++ WARN_ON(i2c_dev->tx_dma_chan->device != i2c_dev->rx_dma_chan->device);
++ i2c_dev->dma_dev = chan->device->dev;
++
+ i2c_dev->dma_buf_size = i2c_dev->hw->quirks->max_write_len +
+ I2C_PACKET_HEADER_SIZE;
+
+- dma_buf = dma_alloc_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
++ dma_buf = dma_alloc_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
+ &dma_phys, GFP_KERNEL | __GFP_NOWARN);
+ if (!dma_buf) {
+ dev_err(i2c_dev->dev, "failed to allocate DMA buffer\n");
+@@ -1267,7 +1271,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
+
+ if (i2c_dev->dma_mode) {
+ if (i2c_dev->msg_read) {
+- dma_sync_single_for_device(i2c_dev->dev,
++ dma_sync_single_for_device(i2c_dev->dma_dev,
+ i2c_dev->dma_phys,
+ xfer_size, DMA_FROM_DEVICE);
+
+@@ -1275,7 +1279,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
+ if (err)
+ return err;
+ } else {
+- dma_sync_single_for_cpu(i2c_dev->dev,
++ dma_sync_single_for_cpu(i2c_dev->dma_dev,
+ i2c_dev->dma_phys,
+ xfer_size, DMA_TO_DEVICE);
+ }
+@@ -1288,7 +1292,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
+ memcpy(i2c_dev->dma_buf + I2C_PACKET_HEADER_SIZE,
+ msg->buf, msg->len);
+
+- dma_sync_single_for_device(i2c_dev->dev,
++ dma_sync_single_for_device(i2c_dev->dma_dev,
+ i2c_dev->dma_phys,
+ xfer_size, DMA_TO_DEVICE);
+
+@@ -1339,7 +1343,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
+ }
+
+ if (i2c_dev->msg_read && i2c_dev->msg_err == I2C_ERR_NONE) {
+- dma_sync_single_for_cpu(i2c_dev->dev,
++ dma_sync_single_for_cpu(i2c_dev->dma_dev,
+ i2c_dev->dma_phys,
+ xfer_size, DMA_FROM_DEVICE);
+
+--
+2.35.1
+
--- /dev/null
+From 17c27be9a7fb7e927b7f93ec9ed9c87c8e231afc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 1 Sep 2022 03:10:07 +0000
+Subject: ksefltests: pidfd: Fix wait_states: Test terminated by timeout
+
+From: Li Zhijian <lizhijian@fujitsu.com>
+
+[ Upstream commit 88e1f16ba58665e9edfce437ea487da2fa759af9 ]
+
+0Day/LKP observed that the kselftest blocks forever since one of the
+pidfd_wait doesn't terminate in 1 of 30 runs. After digging into
+the source, we found that it blocks at:
+ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0);
+
+wait_states has below testing flow:
+ CHILD PARENT
+ ---------------+--------------
+1 STOP itself
+2 WAIT for CHILD STOPPED
+3 SIGNAL CHILD to CONT
+4 CONT
+5 STOP itself
+5' WAIT for CHILD CONT
+6 WAIT for CHILD STOPPED
+
+The problem is that the kernel cannot ensure the order of 5 and 5', once
+5 goes first, the test will fail.
+
+we can reproduce it by:
+$ while true; do make run_tests -C pidfd; done
+
+Introduce a blocking read in child process to make sure the parent can
+check its WCONTINUED.
+
+CC: Philip Li <philip.li@intel.com>
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
+Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
+Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/pidfd/pidfd_wait.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/tools/testing/selftests/pidfd/pidfd_wait.c b/tools/testing/selftests/pidfd/pidfd_wait.c
+index 070c1c876df1..c3e2a3041f55 100644
+--- a/tools/testing/selftests/pidfd/pidfd_wait.c
++++ b/tools/testing/selftests/pidfd/pidfd_wait.c
+@@ -95,20 +95,28 @@ TEST(wait_states)
+ .flags = CLONE_PIDFD | CLONE_PARENT_SETTID,
+ .exit_signal = SIGCHLD,
+ };
++ int pfd[2];
+ pid_t pid;
+ siginfo_t info = {
+ .si_signo = 0,
+ };
+
++ ASSERT_EQ(pipe(pfd), 0);
+ pid = sys_clone3(&args);
+ ASSERT_GE(pid, 0);
+
+ if (pid == 0) {
++ char buf[2];
++
++ close(pfd[1]);
+ kill(getpid(), SIGSTOP);
++ ASSERT_EQ(read(pfd[0], buf, 1), 1);
++ close(pfd[0]);
+ kill(getpid(), SIGSTOP);
+ exit(EXIT_SUCCESS);
+ }
+
++ close(pfd[0]);
+ ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WSTOPPED, NULL), 0);
+ ASSERT_EQ(info.si_signo, SIGCHLD);
+ ASSERT_EQ(info.si_code, CLD_STOPPED);
+@@ -117,6 +125,8 @@ TEST(wait_states)
+ ASSERT_EQ(sys_pidfd_send_signal(pidfd, SIGCONT, NULL, 0), 0);
+
+ ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0);
++ ASSERT_EQ(write(pfd[1], "C", 1), 1);
++ close(pfd[1]);
+ ASSERT_EQ(info.si_signo, SIGCHLD);
+ ASSERT_EQ(info.si_code, CLD_CONTINUED);
+ ASSERT_EQ(info.si_pid, parent_tid);
+--
+2.35.1
+
--- /dev/null
+From 2f7a6bd2d02ef592dba4e4f66135c657aa1640be Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 Oct 2022 12:09:18 -0400
+Subject: NFSv4: Retry LOCK on OLD_STATEID during delegation return
+
+From: Benjamin Coddington <bcodding@redhat.com>
+
+[ Upstream commit f5ea16137a3fa2858620dc9084466491c128535f ]
+
+There's a small window where a LOCK sent during a delegation return can
+race with another OPEN on client, but the open stateid has not yet been
+updated. In this case, the client doesn't handle the OLD_STATEID error
+from the server and will lose this lock, emitting:
+"NFS: nfs4_handle_delegation_recall_error: unhandled error -10024".
+
+Fix this by sending the task through the nfs4 error handling in
+nfs4_lock_done() when we may have to reconcile our stateid with what the
+server believes it to be. For this case, the result is a retry of the
+LOCK operation with the updated stateid.
+
+Reported-by: Gonzalo Siero Humet <gsierohu@redhat.com>
+Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/nfs/nfs4proc.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
+index 3ed14a2a84a4..313e9145b6c9 100644
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -7137,6 +7137,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
+ {
+ struct nfs4_lockdata *data = calldata;
+ struct nfs4_lock_state *lsp = data->lsp;
++ struct nfs_server *server = NFS_SERVER(d_inode(data->ctx->dentry));
+
+ if (!nfs4_sequence_done(task, &data->res.seq_res))
+ return;
+@@ -7144,8 +7145,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
+ data->rpc_status = task->tk_status;
+ switch (task->tk_status) {
+ case 0:
+- renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
+- data->timestamp);
++ renew_lease(server, data->timestamp);
+ if (data->arg.new_lock && !data->cancelled) {
+ data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
+ if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0)
+@@ -7166,6 +7166,8 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
+ if (!nfs4_stateid_match(&data->arg.open_stateid,
+ &lsp->ls_state->open_stateid))
+ goto out_restart;
++ else if (nfs4_async_handle_error(task, server, lsp->ls_state, NULL) == -EAGAIN)
++ goto out_restart;
+ } else if (!nfs4_stateid_match(&data->arg.lock_stateid,
+ &lsp->ls_stateid))
+ goto out_restart;
+--
+2.35.1
+
--- /dev/null
+From 9b710e56d2268314225c49c62e3424e000a250a5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 12 Sep 2022 16:33:07 -0700
+Subject: platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core
+ driver
+
+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
+
--- /dev/null
+From 5178d81a7588379e11c343277a216b57ad7bd495 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 Oct 2022 21:47:51 +0200
+Subject: platform/x86: thinkpad_acpi: Fix reporting a non present second fan
+ on some models
+
+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
+
--- /dev/null
+From 64a3f70d017605f39bb17c03d6fb7f15348a884d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 27 Oct 2022 23:56:26 +1100
+Subject: powerpc/64e: Fix amdgpu build on Book3E w/o AltiVec
+
+From: Michael Ellerman <mpe@ellerman.id.au>
+
+[ Upstream commit 2153fc9623e5465f503d793d4c94ad65e9ec9b5f ]
+
+There's a build failure for Book3E without AltiVec:
+ Error: cc1: error: AltiVec not supported in this target
+ make[6]: *** [/linux/scripts/Makefile.build:250:
+ drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o] Error 1
+
+This happens because the amdgpu build is only gated by
+PPC_LONG_DOUBLE_128, but that symbol can be enabled even though AltiVec
+is disabled.
+
+The only user of PPC_LONG_DOUBLE_128 is amdgpu, so just add a dependency
+on AltiVec to that symbol to fix the build.
+
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20221027125626.1383092-1-mpe@ellerman.id.au
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
+index cbe7bb029aec..c1d36a22de30 100644
+--- a/arch/powerpc/Kconfig
++++ b/arch/powerpc/Kconfig
+@@ -284,7 +284,7 @@ config PPC
+ #
+
+ config PPC_LONG_DOUBLE_128
+- depends on PPC64
++ depends on PPC64 && ALTIVEC
+ def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1)
+
+ config PPC_BARRIER_NOSPEC
+--
+2.35.1
+
--- /dev/null
+From 57cbef9749ae3502059157c7325cbf4bfd71f707 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Oct 2022 18:19:49 +0300
+Subject: RDMA/efa: Add EFA 0xefa2 PCI ID
+
+From: Michael Margolin <mrgolin@amazon.com>
+
+[ Upstream commit b75927cff13e0b3b652a12da7eb9a012911799e8 ]
+
+Add support for 0xefa2 devices.
+
+Reviewed-by: Firas Jahjah <firasj@amazon.com>
+Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
+Signed-off-by: Michael Margolin <mrgolin@amazon.com>
+Link: https://lore.kernel.org/r/20221020151949.1768-1-mrgolin@amazon.com
+Signed-off-by: Leon Romanovsky <leon@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/efa/efa_main.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
+index 94b94cca4870..15ee92081118 100644
+--- a/drivers/infiniband/hw/efa/efa_main.c
++++ b/drivers/infiniband/hw/efa/efa_main.c
+@@ -1,6 +1,6 @@
+ // SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+ /*
+- * Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
++ * Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved.
+ */
+
+ #include <linux/module.h>
+@@ -14,10 +14,12 @@
+
+ #define PCI_DEV_ID_EFA0_VF 0xefa0
+ #define PCI_DEV_ID_EFA1_VF 0xefa1
++#define PCI_DEV_ID_EFA2_VF 0xefa2
+
+ static const struct pci_device_id efa_pci_tbl[] = {
+ { PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA0_VF) },
+ { PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA1_VF) },
++ { PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA2_VF) },
+ { }
+ };
+
+--
+2.35.1
+
--- /dev/null
+From 09dddf260525c390234c6ec2a3452b841ac5248b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 18 Oct 2022 22:35:11 +0200
+Subject: rtc: cmos: fix build on non-ACPI platforms
+
+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
+
--- /dev/null
+From 1beb46ad60fa8d20dac341a5134e8eccda5f6bfe Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 08:37:02 +0200
+Subject: selftests/futex: fix build for clang
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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
+
--- /dev/null
+From a9e3726abd3c3075fcc46d2ae6e2941c397cdd70 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 08:38:11 +0200
+Subject: selftests/intel_pstate: fix build for ARCH=x86_64
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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
+
--- /dev/null
+From bd05e72aa46577c643b92fbc11c0ed6c3b5d5f69 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Oct 2022 08:39:27 +0200
+Subject: selftests/kexec: fix build for ARCH=x86_64
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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
+
mtd-rawnand-qcom-handle-ret-from-parse-with-codeword_fixup.patch
+drm-msm-gpu-fix-crash-during-system-suspend-after-un.patch
+spi-tegra210-quad-fix-combined-sequence.patch
+asoc-wm5102-revert-asoc-wm5102-fix-pm-disable-depth-.patch
+asoc-wm5110-revert-asoc-wm5110-fix-pm-disable-depth-.patch
+asoc-wm8997-revert-asoc-wm8997-fix-pm-disable-depth-.patch
+asoc-mt6660-keep-the-pm_runtime-enables-before-compo.patch
+asoc-rt5682s-fix-the-tdm-tx-settings.patch
+asoc-rt1019-fix-the-tdm-settings.patch
+asoc-wm8962-add-an-event-handler-for-temp_hp-and-tem.patch
+spi-intel-fix-the-offset-to-get-the-64k-erase-opcode.patch
+asoc-codecs-jz4725b-add-missed-line-in-power-control.patch
+asoc-codecs-jz4725b-fix-reported-volume-for-master-c.patch
+asoc-codecs-jz4725b-use-right-control-for-capture-vo.patch
+asoc-codecs-jz4725b-fix-capture-selector-naming.patch
+asoc-intel-sof_sdw-add-quirk-variant-for-lapbc710-nu.patch
+selftests-futex-fix-build-for-clang.patch
+selftests-intel_pstate-fix-build-for-arch-x86_64.patch
+selftests-kexec-fix-build-for-arch-x86_64.patch
+asoc-intel-sof_rt5682-add-quirk-for-rex-board.patch
+rtc-cmos-fix-build-on-non-acpi-platforms.patch
+asoc-rt1308-sdw-add-the-default-value-of-some-regist.patch
+asoc-amd-yc-adding-lenovo-thinkbook-14-gen-4-ara-and.patch
+asoc-amd-yc-add-lenovo-thinkbook-14-2022-21d0-to-qui.patch
+drm-amdgpu-adjust-mes-polling-timeout-for-sriov.patch
+platform-x86-thinkpad_acpi-fix-reporting-a-non-prese.patch
+platform-x86-intel-pmc-core-add-raptor-lake-support-.patch
+drm-amd-display-remove-wrong-pipe-control-lock.patch
+drm-amd-display-don-t-return-false-if-no-stream.patch
+drm-scheduler-fix-fence-ref-counting.patch
+acpi-scan-add-latt2021-to-acpi_ignore_dep_ids.patch
+cxl-mbox-add-a-check-on-input-payload-size.patch
+rdma-efa-add-efa-0xefa2-pci-id.patch
+btrfs-raid56-properly-handle-the-error-when-unable-t.patch
+nfsv4-retry-lock-on-old_stateid-during-delegation-re.patch
+sunrpc-fix-crasher-in-gss_unwrap_resp_integ.patch
+acpi-x86-add-another-system-to-quirk-list-for-forcin.patch
+drm-rockchip-vop2-fix-null-pointer-in-plane_atomic_d.patch
+drm-rockchip-vop2-disable-planes-when-disabling-the-.patch
+ksefltests-pidfd-fix-wait_states-test-terminated-by-.patch
+powerpc-64e-fix-amdgpu-build-on-book3e-w-o-altivec.patch
+block-blk_add_rq_to_plug-clear-stale-last-after-flus.patch
+firmware-arm_scmi-cleanup-the-core-driver-removal-ca.patch
+firmware-arm_scmi-make-tx_prepare-time-out-eventuall.patch
+i2c-tegra-allocate-dma-memory-for-dma-engine.patch
+i2c-i801-add-lis3lv02d-s-i2c-address-for-vostro-5568.patch
+drm-imx-imx-tve-fix-return-type-of-imx_tve_connector.patch
+btrfs-remove-pointless-and-double-ulist-frees-in-err.patch
+drm-amd-display-ignore-cable-id-feature.patch
+drm-amd-display-enable-timing-sync-on-dcn32.patch
+drm-amdgpu-set-fb_modifiers_not_supported-in-vkms.patch
+drm-amd-fail-the-suspend-if-resources-can-t-be-evict.patch
+drm-amd-display-fix-dcn32-dsc-delay-calculation.patch
+drm-amd-display-use-forced-dsc-bpp-in-dml.patch
+drm-amd-display-round-up-dst_after_scaler-to-nearest.patch
+drm-amd-display-investigate-tool-reported-fclk-p-sta.patch
+bluetooth-l2cap-fix-l2cap_global_chan_by_psm.patch
+cxl-pmem-use-size_add-against-integer-overflow.patch
+x86-cpu-add-several-intel-server-cpu-model-numbers.patch
+tools-testing-cxl-fix-some-error-exits.patch
+cifs-always-iterate-smb-sessions-using-primary-chann.patch
+asoc-codecs-jz4725b-fix-spelling-mistake-sourc-sourc.patch
--- /dev/null
+From b1f818886ff6adc2b07b817d98248eba5cc74d5e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 12 Oct 2022 12:21:35 -0300
+Subject: spi: intel: Fix the offset to get the 64K erase opcode
+
+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 3f6db482b6c7..a1dbd71bf83e 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
+
--- /dev/null
+From ae45309444960beb1ddb0d537aeabd8f59525cf7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 1 Oct 2022 17:51:44 +0530
+Subject: spi: tegra210-quad: Fix combined sequence
+
+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
+
--- /dev/null
+From 2284a125ae50a363cea66b587637dfa73c6722fa Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 8 Oct 2022 14:58:29 -0400
+Subject: SUNRPC: Fix crasher in gss_unwrap_resp_integ()
+
+From: Chuck Lever <chuck.lever@oracle.com>
+
+[ Upstream commit 8a0fa3ff3b606b55c4edc71ad133e61529b64549 ]
+
+If a zero length is passed to kmalloc() it returns 0x10, which is
+not a valid address. gss_unwrap_resp_integ() subsequently crashes
+when it attempts to dereference that pointer.
+
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/sunrpc/auth_gss/auth_gss.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
+index a31a27816cc0..7bb247c51e2f 100644
+--- a/net/sunrpc/auth_gss/auth_gss.c
++++ b/net/sunrpc/auth_gss/auth_gss.c
+@@ -1989,7 +1989,7 @@ gss_unwrap_resp_integ(struct rpc_task *task, struct rpc_cred *cred,
+ goto unwrap_failed;
+ mic.len = len;
+ mic.data = kmalloc(len, GFP_KERNEL);
+- if (!mic.data)
++ if (ZERO_OR_NULL_PTR(mic.data))
+ goto unwrap_failed;
+ if (read_bytes_from_xdr_buf(rcv_buf, offset, mic.data, mic.len))
+ goto unwrap_failed;
+--
+2.35.1
+
--- /dev/null
+From 3e2419a8109528727c0141545ea8080f223ff351 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 3 Nov 2022 17:30:42 -0700
+Subject: tools/testing/cxl: Fix some error exits
+
+From: Dan Williams <dan.j.williams@intel.com>
+
+[ Upstream commit 86e86c3cb63325c12ea99fbce2cc5bafba86bb40 ]
+
+Fix a few typos where 'goto err_port' was used rather than the object
+specific cleanup.
+
+Reviewed-by: Dave Jiang <dave.jiang@intel.com>
+Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
+Link: https://lore.kernel.org/r/166752184255.947915.16163477849330181425.stgit@dwillia2-xfh.jf.intel.com
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/cxl/test/cxl.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
+index a072b2d3e726..133e4c73d370 100644
+--- a/tools/testing/cxl/test/cxl.c
++++ b/tools/testing/cxl/test/cxl.c
+@@ -695,7 +695,7 @@ static __init int cxl_test_init(void)
+
+ pdev = platform_device_alloc("cxl_switch_uport", i);
+ if (!pdev)
+- goto err_port;
++ goto err_uport;
+ pdev->dev.parent = &root_port->dev;
+
+ rc = platform_device_add(pdev);
+@@ -713,7 +713,7 @@ static __init int cxl_test_init(void)
+
+ pdev = platform_device_alloc("cxl_switch_dport", i);
+ if (!pdev)
+- goto err_port;
++ goto err_dport;
+ pdev->dev.parent = &uport->dev;
+
+ rc = platform_device_add(pdev);
+--
+2.35.1
+
--- /dev/null
+From de3c066352824fa28b624c0e1855069d4772253f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 3 Nov 2022 13:33:10 -0700
+Subject: x86/cpu: Add several Intel server CPU model numbers
+
+From: Tony Luck <tony.luck@intel.com>
+
+[ Upstream commit 7beade0dd41d42d797ccb7791b134a77fcebf35b ]
+
+These servers are all on the public versions of the roadmap. The model
+numbers for Grand Ridge, Granite Rapids, and Sierra Forest were included
+in the September 2022 edition of the Instruction Set Extensions document.
+
+Signed-off-by: Tony Luck <tony.luck@intel.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/r/20221103203310.5058-1-tony.luck@intel.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/include/asm/intel-family.h | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h
+index 5d75fe229342..347707d459c6 100644
+--- a/arch/x86/include/asm/intel-family.h
++++ b/arch/x86/include/asm/intel-family.h
+@@ -107,6 +107,11 @@
+
+ #define INTEL_FAM6_SAPPHIRERAPIDS_X 0x8F /* Golden Cove */
+
++#define INTEL_FAM6_EMERALDRAPIDS_X 0xCF
++
++#define INTEL_FAM6_GRANITERAPIDS_X 0xAD
++#define INTEL_FAM6_GRANITERAPIDS_D 0xAE
++
+ #define INTEL_FAM6_ALDERLAKE 0x97 /* Golden Cove / Gracemont */
+ #define INTEL_FAM6_ALDERLAKE_L 0x9A /* Golden Cove / Gracemont */
+ #define INTEL_FAM6_ALDERLAKE_N 0xBE
+@@ -118,7 +123,7 @@
+ #define INTEL_FAM6_METEORLAKE 0xAC
+ #define INTEL_FAM6_METEORLAKE_L 0xAA
+
+-/* "Small Core" Processors (Atom) */
++/* "Small Core" Processors (Atom/E-Core) */
+
+ #define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */
+ #define INTEL_FAM6_ATOM_BONNELL_MID 0x26 /* Silverthorne, Lincroft */
+@@ -145,6 +150,10 @@
+ #define INTEL_FAM6_ATOM_TREMONT 0x96 /* Elkhart Lake */
+ #define INTEL_FAM6_ATOM_TREMONT_L 0x9C /* Jasper Lake */
+
++#define INTEL_FAM6_SIERRAFOREST_X 0xAF
++
++#define INTEL_FAM6_GRANDRIDGE 0xB6
++
+ /* Xeon Phi */
+
+ #define INTEL_FAM6_XEON_PHI_KNL 0x57 /* Knights Landing */
+--
+2.35.1
+