From: Sasha Levin Date: Wed, 16 Nov 2022 12:53:26 +0000 (-0500) Subject: Fixes for 5.15 X-Git-Tag: v4.19.266~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8072cdb3b8bc8659ee30834c7a9641847c65d3d4;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/acpi-scan-add-latt2021-to-acpi_ignore_dep_ids.patch b/queue-5.15/acpi-scan-add-latt2021-to-acpi_ignore_dep_ids.patch new file mode 100644 index 00000000000..3b0b2c8a238 --- /dev/null +++ b/queue-5.15/acpi-scan-add-latt2021-to-acpi_ignore_dep_ids.patch @@ -0,0 +1,44 @@ +From 42b810d7a2701cc26edaceb92587ab52005e3956 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Oct 2022 14:12:23 +0200 +Subject: ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[] + +From: Hans de Goede + +[ 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 +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/scan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c +index 6e9cd41c5f9b..ae74720888db 100644 +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -793,6 +793,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 + diff --git a/queue-5.15/acpi-x86-add-another-system-to-quirk-list-for-forcin.patch b/queue-5.15/acpi-x86-add-another-system-to-quirk-list-for-forcin.patch new file mode 100644 index 00000000000..434d8d9a1c6 --- /dev/null +++ b/queue-5.15/acpi-x86-add-another-system-to-quirk-list-for-forcin.patch @@ -0,0 +1,46 @@ +From c131540063a4e074cff84e9c1fdd431139a87345 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 14 Oct 2022 07:11:36 -0500 +Subject: ACPI: x86: Add another system to quirk list for forcing + StorageD3Enable + +From: Mario Limonciello + +[ 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 +Signed-off-by: Mario Limonciello +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + 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 3a3f09b6cbfc..222b951ff56a 100644 +--- a/drivers/acpi/x86/utils.c ++++ b/drivers/acpi/x86/utils.c +@@ -210,6 +210,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 + diff --git a/queue-5.15/asoc-codecs-jz4725b-add-missed-line-in-power-control.patch b/queue-5.15/asoc-codecs-jz4725b-add-missed-line-in-power-control.patch new file mode 100644 index 00000000000..4d5eb836ce1 --- /dev/null +++ b/queue-5.15/asoc-codecs-jz4725b-add-missed-line-in-power-control.patch @@ -0,0 +1,37 @@ +From 9277967a45a20815c478d3a3bc76da9a1466f864 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 16 Oct 2022 16:26:42 +0300 +Subject: ASoC: codecs: jz4725b: add missed Line In power control bit + +From: Siarhei Volkau + +[ Upstream commit 1013999b431b4bcdc1f5ae47dd3338122751db31 ] + +Line In path stayed powered off during capturing or +bypass to mixer. + +Signed-off-by: Siarhei Volkau +Link: https://lore.kernel.org/r/20221016132648.3011729-2-lis8215@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.15/asoc-codecs-jz4725b-fix-capture-selector-naming.patch b/queue-5.15/asoc-codecs-jz4725b-fix-capture-selector-naming.patch new file mode 100644 index 00000000000..938ccbc0784 --- /dev/null +++ b/queue-5.15/asoc-codecs-jz4725b-fix-capture-selector-naming.patch @@ -0,0 +1,64 @@ +From 71f8466306755e6ca349dd2a62660dedcf0e2980 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 16 Oct 2022 16:26:45 +0300 +Subject: ASoC: codecs: jz4725b: fix capture selector naming + +From: Siarhei Volkau + +[ 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 +Link: https://lore.kernel.org/r/20221016132648.3011729-5-lis8215@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.15/asoc-codecs-jz4725b-fix-reported-volume-for-master-c.patch b/queue-5.15/asoc-codecs-jz4725b-fix-reported-volume-for-master-c.patch new file mode 100644 index 00000000000..533811fa9dc --- /dev/null +++ b/queue-5.15/asoc-codecs-jz4725b-fix-reported-volume-for-master-c.patch @@ -0,0 +1,41 @@ +From ce04f0f21eeb01b5ca8bbd0a601c4210872450a2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 16 Oct 2022 16:26:43 +0300 +Subject: ASoC: codecs: jz4725b: fix reported volume for Master ctl + +From: Siarhei Volkau + +[ 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 +Link: https://lore.kernel.org/r/20221016132648.3011729-3-lis8215@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.15/asoc-codecs-jz4725b-fix-spelling-mistake-sourc-sourc.patch b/queue-5.15/asoc-codecs-jz4725b-fix-spelling-mistake-sourc-sourc.patch new file mode 100644 index 00000000000..747956a3d81 --- /dev/null +++ b/queue-5.15/asoc-codecs-jz4725b-fix-spelling-mistake-sourc-sourc.patch @@ -0,0 +1,41 @@ +From 5d9ffa8cfda9500548ebfd3006a1fec361d249df Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ Upstream commit df496157a5afa1b6d1f4c46ad6549c2c346d1e59 ] + +There are two spelling mistakes in codec routing description. Fix it. + +Signed-off-by: Colin Ian King +Reviewed-by: Philippe Mathieu-Daudé +Acked-by: Paul Cercueil +Link: https://lore.kernel.org/r/20221019071639.1003730-1-colin.i.king@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.15/asoc-codecs-jz4725b-use-right-control-for-capture-vo.patch b/queue-5.15/asoc-codecs-jz4725b-use-right-control-for-capture-vo.patch new file mode 100644 index 00000000000..ecb875cdd83 --- /dev/null +++ b/queue-5.15/asoc-codecs-jz4725b-use-right-control-for-capture-vo.patch @@ -0,0 +1,69 @@ +From d2a1c734fd1a81ad92ece5ffc63c9f207f7ef6d9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 16 Oct 2022 16:26:44 +0300 +Subject: ASoC: codecs: jz4725b: use right control for Capture Volume + +From: Siarhei Volkau + +[ 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 +Link: https://lore.kernel.org/r/20221016132648.3011729-4-lis8215@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.15/asoc-intel-sof_sdw-add-quirk-variant-for-lapbc710-nu.patch b/queue-5.15/asoc-intel-sof_sdw-add-quirk-variant-for-lapbc710-nu.patch new file mode 100644 index 00000000000..1adcda18177 --- /dev/null +++ b/queue-5.15/asoc-intel-sof_sdw-add-quirk-variant-for-lapbc710-nu.patch @@ -0,0 +1,48 @@ +From c746f09f79c0dd10ac19b1c7974bd9bff49ce72a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 17 Oct 2022 15:40:54 -0500 +Subject: ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 + +From: Pierre-Louis Bossart + +[ 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 +Reviewed-by: Ranjani Sridharan +Reviewed-by: Bard Liao +Link: https://lore.kernel.org/r/20221017204054.207512-1-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 abe39a0ef14b..294e76d590ad 100644 +--- a/sound/soc/intel/boards/sof_sdw.c ++++ b/sound/soc/intel/boards/sof_sdw.c +@@ -201,6 +201,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 + diff --git a/queue-5.15/asoc-mt6660-keep-the-pm_runtime-enables-before-compo.patch b/queue-5.15/asoc-mt6660-keep-the-pm_runtime-enables-before-compo.patch new file mode 100644 index 00000000000..fe547446d0d --- /dev/null +++ b/queue-5.15/asoc-mt6660-keep-the-pm_runtime-enables-before-compo.patch @@ -0,0 +1,49 @@ +From fd5e1ff484aaaba7be5d65b0320c24a233ceb4e8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20221008140522.134912-1-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 a0a3fd60e93a..7d7f97b8c7c4 100644 +--- a/sound/soc/codecs/mt6660.c ++++ b/sound/soc/codecs/mt6660.c +@@ -504,14 +504,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 + diff --git a/queue-5.15/asoc-rt1019-fix-the-tdm-settings.patch b/queue-5.15/asoc-rt1019-fix-the-tdm-settings.patch new file mode 100644 index 00000000000..c06474782c6 --- /dev/null +++ b/queue-5.15/asoc-rt1019-fix-the-tdm-settings.patch @@ -0,0 +1,100 @@ +From 76de2d470b441436290fc4d4c622a0f3400b02fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 12 Oct 2022 11:01:02 +0800 +Subject: ASoC: rt1019: Fix the TDM settings + +From: Derek Fang + +[ Upstream commit f2635d45a750182c6d5de15e2d6b059e0c302d7e ] + +Complete the missing and correct the TDM settings. + +Signed-off-by: Derek Fang +Link: https://lore.kernel.org/r/20221012030102.4042-1-derek.fang@realtek.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 8c0b00242bb8..56e7c7ee98fd 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 + diff --git a/queue-5.15/asoc-rt1308-sdw-add-the-default-value-of-some-regist.patch b/queue-5.15/asoc-rt1308-sdw-add-the-default-value-of-some-regist.patch new file mode 100644 index 00000000000..bb93203b394 --- /dev/null +++ b/queue-5.15/asoc-rt1308-sdw-add-the-default-value-of-some-regist.patch @@ -0,0 +1,41 @@ +From 6b0732e6623f53b3970daf00f4a906b6db2e02c1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 19 Oct 2022 17:57:15 +0800 +Subject: ASoC: rt1308-sdw: add the default value of some registers + +From: Shuming Fan + +[ 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 +Link: https://lore.kernel.org/r/20221019095715.31082-1-shumingf@realtek.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 c5ce75666dcc..98293d73ebab 100644 +--- a/sound/soc/codecs/rt1308-sdw.h ++++ b/sound/soc/codecs/rt1308-sdw.h +@@ -139,9 +139,11 @@ 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 }, + { 0xc001 | (RT1308_POWER << 4), 0x00 }, + { 0xc002 | (RT1308_POWER << 4), 0x00 }, ++ { 0xc000 | (RT1308_POWER_STATUS << 4), 0x00 }, + }; + + #define RT1308_SDW_OFFSET 0xc000 +-- +2.35.1 + diff --git a/queue-5.15/asoc-wm5102-revert-asoc-wm5102-fix-pm-disable-depth-.patch b/queue-5.15/asoc-wm5102-revert-asoc-wm5102-fix-pm-disable-depth-.patch new file mode 100644 index 00000000000..6ab890191f0 --- /dev/null +++ b/queue-5.15/asoc-wm5102-revert-asoc-wm5102-fix-pm-disable-depth-.patch @@ -0,0 +1,51 @@ +From 5f7b822d7a7da617e95e559875416d96d3fcec6c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20221010114852.88127-2-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 c8adce8936bc..621598608bf0 100644 +--- a/sound/soc/codecs/wm5102.c ++++ b/sound/soc/codecs/wm5102.c +@@ -2087,6 +2087,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); +@@ -2119,9 +2122,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 + diff --git a/queue-5.15/asoc-wm5110-revert-asoc-wm5110-fix-pm-disable-depth-.patch b/queue-5.15/asoc-wm5110-revert-asoc-wm5110-fix-pm-disable-depth-.patch new file mode 100644 index 00000000000..ec2abd523a2 --- /dev/null +++ b/queue-5.15/asoc-wm5110-revert-asoc-wm5110-fix-pm-disable-depth-.patch @@ -0,0 +1,51 @@ +From cb0100d77eae17f177c20e6676499327790fa7a9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20221010114852.88127-3-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 66a4827c16bd..7c6e01720d65 100644 +--- a/sound/soc/codecs/wm5110.c ++++ b/sound/soc/codecs/wm5110.c +@@ -2458,6 +2458,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); +@@ -2490,9 +2493,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 + diff --git a/queue-5.15/asoc-wm8962-add-an-event-handler-for-temp_hp-and-tem.patch b/queue-5.15/asoc-wm8962-add-an-event-handler-for-temp_hp-and-tem.patch new file mode 100644 index 00000000000..7a2faa7924a --- /dev/null +++ b/queue-5.15/asoc-wm8962-add-an-event-handler-for-temp_hp-and-tem.patch @@ -0,0 +1,116 @@ +From 499a21b037f8e4d7bd0a15ba2b0d875555363377 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Tested-by: Adam Ford +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20221010092014.2229246-1-xiaolei.wang@windriver.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 a5a4ae4440cc..09a73b854964 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) + { +@@ -2133,8 +2176,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 + diff --git a/queue-5.15/asoc-wm8997-revert-asoc-wm8997-fix-pm-disable-depth-.patch b/queue-5.15/asoc-wm8997-revert-asoc-wm8997-fix-pm-disable-depth-.patch new file mode 100644 index 00000000000..ba0544b6059 --- /dev/null +++ b/queue-5.15/asoc-wm8997-revert-asoc-wm8997-fix-pm-disable-depth-.patch @@ -0,0 +1,51 @@ +From 8dc1ca8e0abc0df6c74b77d52a5ce59cfb66932b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20221010114852.88127-4-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 c8c711e555c0..38ef631d1a1f 100644 +--- a/sound/soc/codecs/wm8997.c ++++ b/sound/soc/codecs/wm8997.c +@@ -1162,6 +1162,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); +@@ -1180,9 +1183,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 + diff --git a/queue-5.15/bluetooth-l2cap-fix-l2cap_global_chan_by_psm.patch b/queue-5.15/bluetooth-l2cap-fix-l2cap_global_chan_by_psm.patch new file mode 100644 index 00000000000..d1820116f79 --- /dev/null +++ b/queue-5.15/bluetooth-l2cap-fix-l2cap_global_chan_by_psm.patch @@ -0,0 +1,35 @@ +From a2cf8ccd5c402d034ea3b6bae9bf8bb8523c0c98 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 31 Oct 2022 16:10:33 -0700 +Subject: Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm + +From: Luiz Augusto von Dentz + +[ 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 +Reviewed-by: Tedd Ho-Jeong An +Signed-off-by: Sasha Levin +--- + 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 16f954a4802c..761efd7da514 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 + diff --git a/queue-5.15/btrfs-raid56-properly-handle-the-error-when-unable-t.patch b/queue-5.15/btrfs-raid56-properly-handle-the-error-when-unable-t.patch new file mode 100644 index 00000000000..237722fe786 --- /dev/null +++ b/queue-5.15/btrfs-raid56-properly-handle-the-error-when-unable-t.patch @@ -0,0 +1,51 @@ +From d447bf418ffc6988ac52e7248791966d7ac45ecd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + 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 3157a26ddf7e..5b27c289139a 100644 +--- a/fs/btrfs/raid56.c ++++ b/fs/btrfs/raid56.c +@@ -2728,8 +2728,10 @@ raid56_alloc_missing_rbio(struct btrfs_fs_info *fs_info, struct bio *bio, + + 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 + diff --git a/queue-5.15/btrfs-remove-pointless-and-double-ulist-frees-in-err.patch b/queue-5.15/btrfs-remove-pointless-and-double-ulist-frees-in-err.patch new file mode 100644 index 00000000000..bd440460da5 --- /dev/null +++ b/queue-5.15/btrfs-remove-pointless-and-double-ulist-frees-in-err.patch @@ -0,0 +1,133 @@ +From a412aa15636716cf60bf83b2aa80aaf80ed375ea Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + 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 a374b62c9de9..08c1abd6bb0c 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 + diff --git a/queue-5.15/drm-amd-display-remove-wrong-pipe-control-lock.patch b/queue-5.15/drm-amd-display-remove-wrong-pipe-control-lock.patch new file mode 100644 index 00000000000..5943ac6ec3f --- /dev/null +++ b/queue-5.15/drm-amd-display-remove-wrong-pipe-control-lock.patch @@ -0,0 +1,94 @@ +From 1646a672c26d369f298f0d876dd9ca18091a071d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 6 Oct 2022 17:26:48 -0400 +Subject: drm/amd/display: Remove wrong pipe control lock + +From: Rodrigo Siqueira + +[ 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 +Acked-by: Qingqing Zhuo +Signed-off-by: Rodrigo Siqueira +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +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 0de1bbbabf9a..58eea3aa3bfc 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +@@ -1765,7 +1765,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 + diff --git a/queue-5.15/drm-imx-imx-tve-fix-return-type-of-imx_tve_connector.patch b/queue-5.15/drm-imx-imx-tve-fix-return-type-of-imx_tve_connector.patch new file mode 100644 index 00000000000..b6ba912a72c --- /dev/null +++ b/queue-5.15/drm-imx-imx-tve-fix-return-type-of-imx_tve_connector.patch @@ -0,0 +1,53 @@ +From 92b6c93ca9db8353d64856be0139e635dbe61749 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Link: https://github.com/ClangBuiltLinux/linux/issues/1703 +Cc: llvm@lists.linux.dev +Signed-off-by: Nathan Huckleberry +Reviewed-by: Nathan Chancellor +Reviewed-by: Fabio Estevam +Reviewed-by: Philipp Zabel +Signed-off-by: Philipp Zabel +Link: https://patchwork.freedesktop.org/patch/msgid/20220913205544.155106-1-nhuck@google.com +Signed-off-by: Sasha Levin +--- + 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 bc8c3f802a15..fbfb7adead0b 100644 +--- a/drivers/gpu/drm/imx/imx-tve.c ++++ b/drivers/gpu/drm/imx/imx-tve.c +@@ -217,8 +217,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 + diff --git a/queue-5.15/firmware-arm_scmi-cleanup-the-core-driver-removal-ca.patch b/queue-5.15/firmware-arm_scmi-cleanup-the-core-driver-removal-ca.patch new file mode 100644 index 00000000000..36b1096c239 --- /dev/null +++ b/queue-5.15/firmware-arm_scmi-cleanup-the-core-driver-removal-ca.patch @@ -0,0 +1,139 @@ +From df44dc4bb0fecd1fc9d3c2bf729b959637c330cd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Signed-off-by: Cristian Marussi +Link: https://lore.kernel.org/r/20221028140833.280091-1-cristian.marussi@arm.com +Signed-off-by: Sudeep Holla +Signed-off-by: Sasha Levin +--- + 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 f6fe723ab869..7c1c0951e562 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 dea1bfbe1052..b9f5829c0c4d 100644 +--- a/drivers/firmware/arm_scmi/common.h ++++ b/drivers/firmware/arm_scmi/common.h +@@ -272,6 +272,7 @@ struct scmi_xfer_ops { + 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 16569af4a2ba..a8ff4c9508b7 100644 +--- a/drivers/firmware/arm_scmi/driver.c ++++ b/drivers/firmware/arm_scmi/driver.c +@@ -1731,10 +1731,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", +@@ -1920,20 +1926,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); +@@ -1945,7 +1948,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 + diff --git a/queue-5.15/i2c-i801-add-lis3lv02d-s-i2c-address-for-vostro-5568.patch b/queue-5.15/i2c-i801-add-lis3lv02d-s-i2c-address-for-vostro-5568.patch new file mode 100644 index 00000000000..cfa884265ec --- /dev/null +++ b/queue-5.15/i2c-i801-add-lis3lv02d-s-i2c-address-for-vostro-5568.patch @@ -0,0 +1,46 @@ +From f579b7649b0d54d7230e978563a2959599718c2d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Reviewed-by: Jean Delvare +Reviewed-by: Pali Rohár +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + 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 98e39a17fb83..74d343d1a36b 100644 +--- a/drivers/i2c/busses/i2c-i801.c ++++ b/drivers/i2c/busses/i2c-i801.c +@@ -1242,6 +1242,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 + diff --git a/queue-5.15/i2c-tegra-allocate-dma-memory-for-dma-engine.patch b/queue-5.15/i2c-tegra-allocate-dma-memory-for-dma-engine.patch new file mode 100644 index 00000000000..ec46e336b37 --- /dev/null +++ b/queue-5.15/i2c-tegra-allocate-dma-memory-for-dma-engine.patch @@ -0,0 +1,100 @@ +From ce0202db24da40038cbf3a60cd1f4ba2100f5e0d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 20 Oct 2022 16:39:33 +0200 +Subject: i2c: tegra: Allocate DMA memory for DMA engine + +From: Thierry Reding + +[ 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 +Signed-off-by: Thierry Reding +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + 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 c883044715f3..444867cef682 100644 +--- a/drivers/i2c/busses/i2c-tegra.c ++++ b/drivers/i2c/busses/i2c-tegra.c +@@ -283,6 +283,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; + +@@ -419,7 +420,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; + } +@@ -466,10 +467,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"); +@@ -1255,7 +1259,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); + +@@ -1263,7 +1267,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); + } +@@ -1276,7 +1280,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); + +@@ -1327,7 +1331,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 + diff --git a/queue-5.15/nfsv4-retry-lock-on-old_stateid-during-delegation-re.patch b/queue-5.15/nfsv4-retry-lock-on-old_stateid-during-delegation-re.patch new file mode 100644 index 00000000000..673c1abca45 --- /dev/null +++ b/queue-5.15/nfsv4-retry-lock-on-old_stateid-during-delegation-re.patch @@ -0,0 +1,62 @@ +From b12c2599ce92bfef7d525198780f1aefa902194a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 19 Oct 2022 12:09:18 -0400 +Subject: NFSv4: Retry LOCK on OLD_STATEID during delegation return + +From: Benjamin Coddington + +[ 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 +Signed-off-by: Benjamin Coddington +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + 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 b42e332775fe..dc03924b6b71 100644 +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -7118,6 +7118,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)); + + dprintk("%s: begin!\n", __func__); + +@@ -7127,8 +7128,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) +@@ -7149,6 +7149,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 + diff --git a/queue-5.15/rdma-efa-add-efa-0xefa2-pci-id.patch b/queue-5.15/rdma-efa-add-efa-0xefa2-pci-id.patch new file mode 100644 index 00000000000..72a244f97a1 --- /dev/null +++ b/queue-5.15/rdma-efa-add-efa-0xefa2-pci-id.patch @@ -0,0 +1,49 @@ +From f0ecceec421cc7ecaf691db99dc9c3acdebc11e0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 20 Oct 2022 18:19:49 +0300 +Subject: RDMA/efa: Add EFA 0xefa2 PCI ID + +From: Michael Margolin + +[ Upstream commit b75927cff13e0b3b652a12da7eb9a012911799e8 ] + +Add support for 0xefa2 devices. + +Reviewed-by: Firas Jahjah +Reviewed-by: Yossi Leybovich +Signed-off-by: Michael Margolin +Link: https://lore.kernel.org/r/20221020151949.1768-1-mrgolin@amazon.com +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + 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 417dea5f90cf..d6d48db86681 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 +@@ -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 + diff --git a/queue-5.15/rtc-cmos-fix-build-on-non-acpi-platforms.patch b/queue-5.15/rtc-cmos-fix-build-on-non-acpi-platforms.patch new file mode 100644 index 00000000000..4a78c742360 --- /dev/null +++ b/queue-5.15/rtc-cmos-fix-build-on-non-acpi-platforms.patch @@ -0,0 +1,37 @@ +From 863cc7f3ce0d28362c4f545a64ab67cf60d610f8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 18 Oct 2022 22:35:11 +0200 +Subject: rtc: cmos: fix build on non-ACPI platforms + +From: Alexandre Belloni + +[ 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 +Link: https://lore.kernel.org/r/20221018203512.2532407-1-alexandre.belloni@bootlin.com +Signed-off-by: Alexandre Belloni +Signed-off-by: Sasha Levin +--- + 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 b90a603d6b12..3e7b6834a7b0 100644 +--- a/drivers/rtc/rtc-cmos.c ++++ b/drivers/rtc/rtc-cmos.c +@@ -1296,6 +1296,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 + diff --git a/queue-5.15/selftests-futex-fix-build-for-clang.patch b/queue-5.15/selftests-futex-fix-build-for-clang.patch new file mode 100644 index 00000000000..29e0ed06ca6 --- /dev/null +++ b/queue-5.15/selftests-futex-fix-build-for-clang.patch @@ -0,0 +1,54 @@ +From d1520b3c78e482059ba933604ee3c49a16a74d8e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Reviewed-by: André Almeida +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + 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 bd1fec59e010..ece2e38fbb0b 100644 +--- a/tools/testing/selftests/futex/functional/Makefile ++++ b/tools/testing/selftests/futex/functional/Makefile +@@ -4,11 +4,11 @@ INCLUDES := -I../include -I../../ -I../../../../../usr/include/ \ + CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(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 = ../../../../.. + KSFT_KHDR_INSTALL := 1 + include ../../lib.mk +- +-$(TEST_GEN_FILES): $(HEADERS) +-- +2.35.1 + diff --git a/queue-5.15/selftests-intel_pstate-fix-build-for-arch-x86_64.patch b/queue-5.15/selftests-intel_pstate-fix-build-for-arch-x86_64.patch new file mode 100644 index 00000000000..fcc6a26f6ce --- /dev/null +++ b/queue-5.15/selftests-intel_pstate-fix-build-for-arch-x86_64.patch @@ -0,0 +1,43 @@ +From 2f7f7f0289c3b3efdb80aa9a5a4d9b40b701d824 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.15/series b/queue-5.15/series index d3f6cc7d62b..335aabe7a14 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -1,3 +1,33 @@ mm-hwpoison-refactor-refcount-check-handling.patch mm-hwpoison-handle-non-anonymous-thp-correctly.patch mm-shmem-don-t-truncate-page-if-memory-failure-happens.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-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 +rtc-cmos-fix-build-on-non-acpi-platforms.patch +asoc-rt1308-sdw-add-the-default-value-of-some-regist.patch +drm-amd-display-remove-wrong-pipe-control-lock.patch +acpi-scan-add-latt2021-to-acpi_ignore_dep_ids.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 +acpi-x86-add-another-system-to-quirk-list-for-forcin.patch +firmware-arm_scmi-cleanup-the-core-driver-removal-ca.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 +bluetooth-l2cap-fix-l2cap_global_chan_by_psm.patch +x86-cpu-add-several-intel-server-cpu-model-numbers.patch +asoc-codecs-jz4725b-fix-spelling-mistake-sourc-sourc.patch diff --git a/queue-5.15/spi-intel-fix-the-offset-to-get-the-64k-erase-opcode.patch b/queue-5.15/spi-intel-fix-the-offset-to-get-the-64k-erase-opcode.patch new file mode 100644 index 00000000000..5cef92f0951 --- /dev/null +++ b/queue-5.15/spi-intel-fix-the-offset-to-get-the-64k-erase-opcode.patch @@ -0,0 +1,38 @@ +From 46e1b300059b7dce748d00f44c30e86b19c1b0e8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 12 Oct 2022 12:21:35 -0300 +Subject: spi: intel: Fix the offset to get the 64K erase opcode + +From: Mauro Lima + +[ 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 +Reviewed-by: Mika Westerberg +Link: https://lore.kernel.org/r/20221012152135.28353-1-mauro.lima@eclypsium.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/mtd/spi-nor/controllers/intel-spi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c +index a413892ff449..72dab5937df1 100644 +--- a/drivers/mtd/spi-nor/controllers/intel-spi.c ++++ b/drivers/mtd/spi-nor/controllers/intel-spi.c +@@ -116,7 +116,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 + diff --git a/queue-5.15/x86-cpu-add-several-intel-server-cpu-model-numbers.patch b/queue-5.15/x86-cpu-add-several-intel-server-cpu-model-numbers.patch new file mode 100644 index 00000000000..c1ed14fecfe --- /dev/null +++ b/queue-5.15/x86-cpu-add-several-intel-server-cpu-model-numbers.patch @@ -0,0 +1,57 @@ +From bfb20a3241e5bdbf6d72c3eda24f364cf66f40ac Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 3 Nov 2022 13:33:10 -0700 +Subject: x86/cpu: Add several Intel server CPU model numbers + +From: Tony Luck + +[ 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 +Signed-off-by: Borislav Petkov +Acked-by: Dave Hansen +Link: https://lore.kernel.org/r/20221103203310.5058-1-tony.luck@intel.com +Signed-off-by: Sasha Levin +--- + 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 27158436f322..13922963431a 100644 +--- a/arch/x86/include/asm/intel-family.h ++++ b/arch/x86/include/asm/intel-family.h +@@ -105,10 +105,15 @@ + + #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 */ + +-/* "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 */ +@@ -135,6 +140,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 +