From 050d7a88ca286628d65237d3b6494c22e4b419c3 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 16 Jun 2023 20:33:39 -0400 Subject: [PATCH] Fixes for 6.1 Signed-off-by: Sasha Levin --- ...express-add-missing-cache-properties.patch | 37 +++++ ...-default-regmap-values-for-some-regi.patch | 47 ++++++ ...dma-init-to-snd_soc_dai_driver-probe.patch | 146 ++++++++++++++++++ ...l-avs-account-for-uid-of-acpi-device.patch | 56 +++++++ ...avs-add-missing-checks-on-fe-startup.patch | 71 +++++++++ ...soc-pcm-test-if-a-be-can-be-prepared.patch | 93 +++++++++++ ...ory-allocation-failure-in-btrfs_csum.patch | 48 ++++++ ...harder-to-mark-raid56-block-groups-r.patch | 95 ++++++++++++ ...ix-missing-buffer-object-unlock-in-f.patch | 59 +++++++ ...ation-quirks-change-air-s-quirk-to-s.patch | 41 +++++ ...sqd-lock-before-sq-thread-release-cp.patch | 54 +++++++ ...rectly-validate-of-quirk-descriptors.patch | 41 +++++ ...isable-pseudo-nmis-on-mediatek-devic.patch | 138 +++++++++++++++++ ...io-mark-of-related-data-as-maybe-unu.patch | 42 +++++ queue-6.1/mips-alchemy-fix-dbdma2.patch | 87 +++++++++++ ..._start-check-after-initrd-address-sa.patch | 52 +++++++ queue-6.1/mips-restore-au1300-support.patch | 48 ++++++ queue-6.1/mips-unhide-pata_platform.patch | 34 ++++ ...vme-add-maxio-1602-to-bogus-nid-list.patch | 71 +++++++++ ...issing-of_node_put-in-error-case-of-.patch | 37 +++++ ...t-writes-and-adjust-gatt-mask-in-par.patch | 62 ++++++++ ...ache-flushing-for-pcxl-in-arch_sync_.patch | 57 +++++++ ...o-log-size-for-intel-ice-lake-root-p.patch | 62 ++++++++ ...s-wmi-ignore-wmi-events-with-codes-0.patch | 50 ++++++ ...8500-fix-external_power_changed-race.patch | 73 +++++++++ ...7xxx-use-mod_delayed_work-instead-of.patch | 40 +++++ ...-logic-checking-if-system-is-running.patch | 66 ++++++++ ...upply-ratelimit-no-data-debug-output.patch | 43 ++++++ ...27xx-fix-external_power_changed-race.patch | 70 +++++++++ ...rror-checking-for-debugfs_create_dir.patch | 46 ++++++ ...pio-sim-fix-bug-test-failed-due-to-r.patch | 55 +++++++ queue-6.1/series | 33 ++++ ...-debounce_period_us-output-of-lsgpio.patch | 37 +++++ ...kfront-only-check-req_fua-for-writes.patch | 45 ++++++ 34 files changed, 2036 insertions(+) create mode 100644 queue-6.1/arm-dts-vexpress-add-missing-cache-properties.patch create mode 100644 queue-6.1/asoc-cs35l41-fix-default-regmap-values-for-some-regi.patch create mode 100644 queue-6.1/asoc-dwc-move-dma-init-to-snd_soc_dai_driver-probe.patch create mode 100644 queue-6.1/asoc-intel-avs-account-for-uid-of-acpi-device.patch create mode 100644 queue-6.1/asoc-intel-avs-add-missing-checks-on-fe-startup.patch create mode 100644 queue-6.1/asoc-soc-pcm-test-if-a-be-can-be-prepared.patch create mode 100644 queue-6.1/btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch create mode 100644 queue-6.1/btrfs-scrub-try-harder-to-mark-raid56-block-groups-r.patch create mode 100644 queue-6.1/drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch create mode 100644 queue-6.1/drm-panel-orientation-quirks-change-air-s-quirk-to-s.patch create mode 100644 queue-6.1/io_uring-unlock-sqd-lock-before-sq-thread-release-cp.patch create mode 100644 queue-6.1/irqchip-gic-correctly-validate-of-quirk-descriptors.patch create mode 100644 queue-6.1/irqchip-gic-v3-disable-pseudo-nmis-on-mediatek-devic.patch create mode 100644 queue-6.1/irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch create mode 100644 queue-6.1/mips-alchemy-fix-dbdma2.patch create mode 100644 queue-6.1/mips-move-initrd_start-check-after-initrd-address-sa.patch create mode 100644 queue-6.1/mips-restore-au1300-support.patch create mode 100644 queue-6.1/mips-unhide-pata_platform.patch create mode 100644 queue-6.1/nvme-add-maxio-1602-to-bogus-nid-list.patch create mode 100644 queue-6.1/of-overlay-fix-missing-of_node_put-in-error-case-of-.patch create mode 100644 queue-6.1/parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch create mode 100644 queue-6.1/parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch create mode 100644 queue-6.1/pci-dpc-quirk-pio-log-size-for-intel-ice-lake-root-p.patch create mode 100644 queue-6.1/platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch create mode 100644 queue-6.1/power-supply-ab8500-fix-external_power_changed-race.patch create mode 100644 queue-6.1/power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch create mode 100644 queue-6.1/power-supply-fix-logic-checking-if-system-is-running.patch create mode 100644 queue-6.1/power-supply-ratelimit-no-data-debug-output.patch create mode 100644 queue-6.1/power-supply-sc27xx-fix-external_power_changed-race.patch create mode 100644 queue-6.1/regulator-fix-error-checking-for-debugfs_create_dir.patch create mode 100644 queue-6.1/selftests-gpio-gpio-sim-fix-bug-test-failed-due-to-r.patch create mode 100644 queue-6.1/tools-gpio-fix-debounce_period_us-output-of-lsgpio.patch create mode 100644 queue-6.1/xen-blkfront-only-check-req_fua-for-writes.patch diff --git a/queue-6.1/arm-dts-vexpress-add-missing-cache-properties.patch b/queue-6.1/arm-dts-vexpress-add-missing-cache-properties.patch new file mode 100644 index 00000000000..a5bb26a8ad9 --- /dev/null +++ b/queue-6.1/arm-dts-vexpress-add-missing-cache-properties.patch @@ -0,0 +1,37 @@ +From 695ccbbbb29b5d3df27a182720810001cf1ac205 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 23 Apr 2023 17:08:37 +0200 +Subject: ARM: dts: vexpress: add missing cache properties + +From: Krzysztof Kozlowski + +[ Upstream commit 328acc5657c6197753238d7ce0a6924ead829347 ] + +As all level 2 and level 3 caches are unified, add required +cache-unified property to fix warnings like: + + vexpress-v2p-ca5s.dtb: cache-controller@2c0f0000: 'cache-unified' is a required property + +Signed-off-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20230423150837.118466-1-krzysztof.kozlowski@linaro.org +Signed-off-by: Sudeep Holla +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/vexpress-v2p-ca5s.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts +index 3b88209bacea2..ff1f9a1bcfcfc 100644 +--- a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts ++++ b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts +@@ -132,6 +132,7 @@ L2: cache-controller@2c0f0000 { + reg = <0x2c0f0000 0x1000>; + interrupts = <0 84 4>; + cache-level = <2>; ++ cache-unified; + }; + + pmu { +-- +2.39.2 + diff --git a/queue-6.1/asoc-cs35l41-fix-default-regmap-values-for-some-regi.patch b/queue-6.1/asoc-cs35l41-fix-default-regmap-values-for-some-regi.patch new file mode 100644 index 00000000000..6a874c939cb --- /dev/null +++ b/queue-6.1/asoc-cs35l41-fix-default-regmap-values-for-some-regi.patch @@ -0,0 +1,47 @@ +From 8c5af2c7e8777a9eb459ba37970d3f968413ae47 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 14 Apr 2023 16:25:51 +0100 +Subject: ASoC: cs35l41: Fix default regmap values for some registers + +From: Stefan Binding + +[ Upstream commit e2d035f5a7d597bbabc268e236ec6c0408c4af0e ] + +Several values do not match the defaults of CS35L41, fix them. + +Signed-off-by: Stefan Binding +Acked-by: Mark Brown +Link: https://lore.kernel.org/r/20230414152552.574502-4-sbinding@opensource.cirrus.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/cs35l41-lib.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/codecs/cs35l41-lib.c b/sound/soc/codecs/cs35l41-lib.c +index 04be71435491e..c2c56e5608094 100644 +--- a/sound/soc/codecs/cs35l41-lib.c ++++ b/sound/soc/codecs/cs35l41-lib.c +@@ -46,7 +46,7 @@ static const struct reg_default cs35l41_reg[] = { + { CS35L41_DSP1_RX5_SRC, 0x00000020 }, + { CS35L41_DSP1_RX6_SRC, 0x00000021 }, + { CS35L41_DSP1_RX7_SRC, 0x0000003A }, +- { CS35L41_DSP1_RX8_SRC, 0x00000001 }, ++ { CS35L41_DSP1_RX8_SRC, 0x0000003B }, + { CS35L41_NGATE1_SRC, 0x00000008 }, + { CS35L41_NGATE2_SRC, 0x00000009 }, + { CS35L41_AMP_DIG_VOL_CTRL, 0x00008000 }, +@@ -58,8 +58,8 @@ static const struct reg_default cs35l41_reg[] = { + { CS35L41_IRQ1_MASK2, 0xFFFFFFFF }, + { CS35L41_IRQ1_MASK3, 0xFFFF87FF }, + { CS35L41_IRQ1_MASK4, 0xFEFFFFFF }, +- { CS35L41_GPIO1_CTRL1, 0xE1000001 }, +- { CS35L41_GPIO2_CTRL1, 0xE1000001 }, ++ { CS35L41_GPIO1_CTRL1, 0x81000001 }, ++ { CS35L41_GPIO2_CTRL1, 0x81000001 }, + { CS35L41_MIXER_NGATE_CFG, 0x00000000 }, + { CS35L41_MIXER_NGATE_CH1_CFG, 0x00000303 }, + { CS35L41_MIXER_NGATE_CH2_CFG, 0x00000303 }, +-- +2.39.2 + diff --git a/queue-6.1/asoc-dwc-move-dma-init-to-snd_soc_dai_driver-probe.patch b/queue-6.1/asoc-dwc-move-dma-init-to-snd_soc_dai_driver-probe.patch new file mode 100644 index 00000000000..3f1e0978ed6 --- /dev/null +++ b/queue-6.1/asoc-dwc-move-dma-init-to-snd_soc_dai_driver-probe.patch @@ -0,0 +1,146 @@ +From 3c80aa3e1317c9399577ae393d3b00bf256739e2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 12 May 2023 14:03:42 +0300 +Subject: ASoC: dwc: move DMA init to snd_soc_dai_driver probe() + +From: Maxim Kochetkov + +[ Upstream commit 011a8719d6105dcb48077ea7a6a88ac019d4aa50 ] + +When using DMA mode we are facing with Oops: +[ 396.458157] Unable to handle kernel access to user memory without uaccess routines at virtual address 000000000000000c +[ 396.469374] Oops [#1] +[ 396.471839] Modules linked in: +[ 396.475144] CPU: 0 PID: 114 Comm: arecord Not tainted 6.0.0-00164-g9a8eccdaf2be-dirty #68 +[ 396.483619] Hardware name: YMP ELCT FPGA (DT) +[ 396.488156] epc : dmaengine_pcm_open+0x1d2/0x342 +[ 396.493227] ra : dmaengine_pcm_open+0x1d2/0x342 +[ 396.498140] epc : ffffffff807fe346 ra : ffffffff807fe346 sp : ffffffc804e138f0 +[ 396.505602] gp : ffffffff817bf730 tp : ffffffd8042c8ac0 t0 : 6500000000000000 +[ 396.513045] t1 : 0000000000000064 t2 : 656e69676e65616d s0 : ffffffc804e13990 +[ 396.520477] s1 : ffffffd801b86a18 a0 : 0000000000000026 a1 : ffffffff816920f8 +[ 396.527897] a2 : 0000000000000010 a3 : fffffffffffffffe a4 : 0000000000000000 +[ 396.535319] a5 : 0000000000000000 a6 : ffffffd801b87040 a7 : 0000000000000038 +[ 396.542740] s2 : ffffffd801b94a00 s3 : 0000000000000000 s4 : ffffffd80427f5e8 +[ 396.550153] s5 : ffffffd80427f5e8 s6 : ffffffd801b44410 s7 : fffffffffffffff5 +[ 396.557569] s8 : 0000000000000800 s9 : 0000000000000001 s10: ffffffff8066d254 +[ 396.564978] s11: ffffffd8059cf768 t3 : ffffffff817d5577 t4 : ffffffff817d5577 +[ 396.572391] t5 : ffffffff817d5578 t6 : ffffffc804e136e8 +[ 396.577876] status: 0000000200000120 badaddr: 000000000000000c cause: 000000000000000d +[ 396.586007] [] snd_soc_component_open+0x1a/0x68 +[ 396.592439] [] __soc_pcm_open+0xf0/0x502 +[ 396.598217] [] soc_pcm_open+0x2e/0x4e +[ 396.603741] [] snd_pcm_open_substream+0x442/0x68e +[ 396.610313] [] snd_pcm_open+0xfa/0x212 +[ 396.615868] [] snd_pcm_capture_open+0x3a/0x60 +[ 396.622048] [] snd_open+0xa8/0x17a +[ 396.627421] [] chrdev_open+0xa0/0x218 +[ 396.632893] [] do_dentry_open+0x17c/0x2a6 +[ 396.638713] [] vfs_open+0x1e/0x26 +[ 396.643850] [] path_openat+0x96e/0xc96 +[ 396.649518] [] do_filp_open+0x7c/0xf6 +[ 396.655034] [] do_sys_openat2+0x8a/0x11e +[ 396.660765] [] sys_openat+0x50/0x7c +[ 396.666068] [] ret_from_syscall+0x0/0x2 +[ 396.674964] ---[ end trace 0000000000000000 ]--- + +It happens because of play_dma_data/capture_dma_data pointers are NULL. +Current implementation assigns these pointers at snd_soc_dai_driver +startup() callback and reset them back to NULL at shutdown(). But +soc_pcm_open() sequence uses DMA pointers in dmaengine_pcm_open() +before snd_soc_dai_driver startup(). +Most generic DMA capable I2S drivers use snd_soc_dai_driver probe() +callback to init DMA pointers only once at probe. So move DMA init +to dw_i2s_dai_probe and drop shutdown() and startup() callbacks. + +Signed-off-by: Maxim Kochetkov +Link: https://lore.kernel.org/r/20230512110343.66664-1-fido_max@inbox.ru +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/dwc/dwc-i2s.c | 41 +++++++++-------------------------------- + 1 file changed, 9 insertions(+), 32 deletions(-) + +diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c +index 3496301582b22..f966d39c5c907 100644 +--- a/sound/soc/dwc/dwc-i2s.c ++++ b/sound/soc/dwc/dwc-i2s.c +@@ -183,30 +183,6 @@ static void i2s_stop(struct dw_i2s_dev *dev, + } + } + +-static int dw_i2s_startup(struct snd_pcm_substream *substream, +- struct snd_soc_dai *cpu_dai) +-{ +- struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(cpu_dai); +- union dw_i2s_snd_dma_data *dma_data = NULL; +- +- if (!(dev->capability & DWC_I2S_RECORD) && +- (substream->stream == SNDRV_PCM_STREAM_CAPTURE)) +- return -EINVAL; +- +- if (!(dev->capability & DWC_I2S_PLAY) && +- (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) +- return -EINVAL; +- +- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) +- dma_data = &dev->play_dma_data; +- else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) +- dma_data = &dev->capture_dma_data; +- +- snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)dma_data); +- +- return 0; +-} +- + static void dw_i2s_config(struct dw_i2s_dev *dev, int stream) + { + u32 ch_reg; +@@ -305,12 +281,6 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream, + return 0; + } + +-static void dw_i2s_shutdown(struct snd_pcm_substream *substream, +- struct snd_soc_dai *dai) +-{ +- snd_soc_dai_set_dma_data(dai, substream, NULL); +-} +- + static int dw_i2s_prepare(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) + { +@@ -382,8 +352,6 @@ static int dw_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) + } + + static const struct snd_soc_dai_ops dw_i2s_dai_ops = { +- .startup = dw_i2s_startup, +- .shutdown = dw_i2s_shutdown, + .hw_params = dw_i2s_hw_params, + .prepare = dw_i2s_prepare, + .trigger = dw_i2s_trigger, +@@ -625,6 +593,14 @@ static int dw_configure_dai_by_dt(struct dw_i2s_dev *dev, + + } + ++static int dw_i2s_dai_probe(struct snd_soc_dai *dai) ++{ ++ struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); ++ ++ snd_soc_dai_init_dma_data(dai, &dev->play_dma_data, &dev->capture_dma_data); ++ return 0; ++} ++ + static int dw_i2s_probe(struct platform_device *pdev) + { + const struct i2s_platform_data *pdata = pdev->dev.platform_data; +@@ -643,6 +619,7 @@ static int dw_i2s_probe(struct platform_device *pdev) + return -ENOMEM; + + dw_i2s_dai->ops = &dw_i2s_dai_ops; ++ dw_i2s_dai->probe = dw_i2s_dai_probe; + + dev->i2s_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(dev->i2s_base)) +-- +2.39.2 + diff --git a/queue-6.1/asoc-intel-avs-account-for-uid-of-acpi-device.patch b/queue-6.1/asoc-intel-avs-account-for-uid-of-acpi-device.patch new file mode 100644 index 00000000000..c36bd5a712a --- /dev/null +++ b/queue-6.1/asoc-intel-avs-account-for-uid-of-acpi-device.patch @@ -0,0 +1,56 @@ +From 8ba88c5194d9fd11d0e90123a1279bfe07c22666 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 May 2023 22:17:09 +0200 +Subject: ASoC: Intel: avs: Account for UID of ACPI device +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Cezary Rojewski + +[ Upstream commit 836855100b87b4dd7a82546131779dc255c18b67 ] + +Configurations with multiple codecs attached to the platform are +supported but only if each from the set is different. Add new field +representing the 'Unique ID' so that codecs that share Vendor and Part +IDs can be differentiated and thus enabling support for such +configurations. + +Signed-off-by: Cezary Rojewski +Signed-off-by: Amadeusz Sławiński +Link: https://lore.kernel.org/r/20230519201711.4073845-6-amadeuszx.slawinski@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + include/sound/soc-acpi.h | 1 + + sound/soc/intel/avs/board_selection.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h +index b38fd25c57295..528279056b3ab 100644 +--- a/include/sound/soc-acpi.h ++++ b/include/sound/soc-acpi.h +@@ -170,6 +170,7 @@ struct snd_soc_acpi_link_adr { + /* Descriptor for SST ASoC machine driver */ + struct snd_soc_acpi_mach { + u8 id[ACPI_ID_LEN]; ++ const char *uid; + const struct snd_soc_acpi_codecs *comp_ids; + const u32 link_mask; + const struct snd_soc_acpi_link_adr *links; +diff --git a/sound/soc/intel/avs/board_selection.c b/sound/soc/intel/avs/board_selection.c +index 87f9c18be238d..87353b4b0cd73 100644 +--- a/sound/soc/intel/avs/board_selection.c ++++ b/sound/soc/intel/avs/board_selection.c +@@ -394,7 +394,7 @@ static int avs_register_i2s_boards(struct avs_dev *adev) + } + + for (mach = boards->machs; mach->id[0]; mach++) { +- if (!acpi_dev_present(mach->id, NULL, -1)) ++ if (!acpi_dev_present(mach->id, mach->uid, -1)) + continue; + + if (mach->machine_quirk) +-- +2.39.2 + diff --git a/queue-6.1/asoc-intel-avs-add-missing-checks-on-fe-startup.patch b/queue-6.1/asoc-intel-avs-add-missing-checks-on-fe-startup.patch new file mode 100644 index 00000000000..40097632435 --- /dev/null +++ b/queue-6.1/asoc-intel-avs-add-missing-checks-on-fe-startup.patch @@ -0,0 +1,71 @@ +From 015792d61013e555c9bb0c09896527b10b9bc24b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 May 2023 22:17:11 +0200 +Subject: ASoC: Intel: avs: Add missing checks on FE startup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Amadeusz Sławiński + +[ Upstream commit 25148f57a2a6d157779bae494852e172952ba980 ] + +Constraint functions have return values, they should be checked for +potential errors. + +Reviewed-by: Cezary Rojewski +Signed-off-by: Amadeusz Sławiński +Link: https://lore.kernel.org/r/20230519201711.4073845-8-amadeuszx.slawinski@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/avs/pcm.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c +index 8fe5917b1e263..22f21f3f612d1 100644 +--- a/sound/soc/intel/avs/pcm.c ++++ b/sound/soc/intel/avs/pcm.c +@@ -424,21 +424,34 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so + + host_stream = snd_hdac_ext_stream_assign(bus, substream, HDAC_EXT_STREAM_TYPE_HOST); + if (!host_stream) { +- kfree(data); +- return -EBUSY; ++ ret = -EBUSY; ++ goto err; + } + + data->host_stream = host_stream; +- snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); ++ ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); ++ if (ret < 0) ++ goto err; ++ + /* avoid wrap-around with wall-clock */ +- snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_TIME, 20, 178000000); +- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_rates); ++ ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_TIME, 20, 178000000); ++ if (ret < 0) ++ goto err; ++ ++ ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_rates); ++ if (ret < 0) ++ goto err; ++ + snd_pcm_set_sync(substream); + + dev_dbg(dai->dev, "%s fe STARTUP tag %d str %p", + __func__, hdac_stream(host_stream)->stream_tag, substream); + + return 0; ++ ++err: ++ kfree(data); ++ return ret; + } + + static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) +-- +2.39.2 + diff --git a/queue-6.1/asoc-soc-pcm-test-if-a-be-can-be-prepared.patch b/queue-6.1/asoc-soc-pcm-test-if-a-be-can-be-prepared.patch new file mode 100644 index 00000000000..d27b3fd9437 --- /dev/null +++ b/queue-6.1/asoc-soc-pcm-test-if-a-be-can-be-prepared.patch @@ -0,0 +1,93 @@ +From 1d5876c78922e32d9414cf69b6a583d3b7c2333d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 May 2023 13:57:31 -0500 +Subject: ASoC: soc-pcm: test if a BE can be prepared + +From: Ranjani Sridharan + +[ Upstream commit e123036be377ddf628226a7c6d4f9af5efd113d3 ] + +In the BE hw_params configuration, the existing code checks if any of the +existing FEs are prepared, running, paused or suspended - and skips the +configuration in those cases. This allows multiple calls of hw_params +which the ALSA state machine supports. + +This check is not handled for the prepare stage, which can lead to the +same BE being prepared multiple times. This patch adds a check similar to +that of the hw_params, with the main difference being that the suspended +state is allowed: the ALSA state machine allows a transition from +suspended to prepared with hw_params skipped. + +This problem was detected on Intel IPC4/SoundWire devices, where the BE +dailink .prepare stage is used to configure the SoundWire stream with a +bank switch. Multiple .prepare calls lead to conflicts with the .trigger +operation with IPC4 configurations. This problem was not detected earlier +on Intel devices, HDaudio BE dailinks detect that the link is already +prepared and skip the configuration, and for IPC3 devices there is no BE +trigger. + +Link: https://github.com/thesofproject/sof/issues/7596 +Signed-off-by: Ranjani Sridharan +--- + include/sound/soc-dpcm.h | 4 ++++ + sound/soc/soc-pcm.c | 20 ++++++++++++++++++++ + 2 files changed, 24 insertions(+) + +diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h +index 5b689c663290f..27a5642f07cda 100644 +--- a/include/sound/soc-dpcm.h ++++ b/include/sound/soc-dpcm.h +@@ -125,6 +125,10 @@ int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe, + int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream); + ++/* can this BE perform prepare */ ++int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, ++ struct snd_soc_pcm_runtime *be, int stream); ++ + /* is the current PCM operation for this FE ? */ + int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream); + +diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c +index 7a486ca9633c1..f3964060a0447 100644 +--- a/sound/soc/soc-pcm.c ++++ b/sound/soc/soc-pcm.c +@@ -2403,6 +2403,9 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) + if (!snd_soc_dpcm_be_can_update(fe, be, stream)) + continue; + ++ if (!snd_soc_dpcm_can_be_prepared(fe, be, stream)) ++ continue; ++ + if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && +@@ -3043,3 +3046,20 @@ int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, + return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); + } + EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_params); ++ ++/* ++ * We can only prepare a BE DAI if any of it's FE are not prepared, ++ * running or paused for the specified stream direction. ++ */ ++int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, ++ struct snd_soc_pcm_runtime *be, int stream) ++{ ++ const enum snd_soc_dpcm_state state[] = { ++ SND_SOC_DPCM_STATE_START, ++ SND_SOC_DPCM_STATE_PAUSED, ++ SND_SOC_DPCM_STATE_PREPARE, ++ }; ++ ++ return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); ++} ++EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_prepared); +-- +2.39.2 + diff --git a/queue-6.1/btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch b/queue-6.1/btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch new file mode 100644 index 00000000000..592ee40512b --- /dev/null +++ b/queue-6.1/btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch @@ -0,0 +1,48 @@ +From 6e4bb3c56d408a35a5c6d11ff47162bf7ddc31a5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 4 May 2023 13:58:13 +0200 +Subject: btrfs: handle memory allocation failure in btrfs_csum_one_bio + +From: Johannes Thumshirn + +[ Upstream commit 806570c0bb7b4847828c22c4934fcf2dc8fc572f ] + +Since f8a53bb58ec7 ("btrfs: handle checksum generation in the storage +layer") the failures of btrfs_csum_one_bio() are handled via +bio_end_io(). + +This means, we can return BLK_STS_RESOURCE from btrfs_csum_one_bio() in +case the allocation of the ordered sums fails. + +This also fixes a syzkaller report, where injecting a failure into the +kvzalloc() call results in a BUG_ON(). + +Reported-by: syzbot+d8941552e21eac774778@syzkaller.appspotmail.com +Reviewed-by: Christoph Hellwig +Reviewed-by: Anand Jain +Signed-off-by: Johannes Thumshirn +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/file-item.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c +index 4fab7da632594..b14d2da9b26d3 100644 +--- a/fs/btrfs/file-item.c ++++ b/fs/btrfs/file-item.c +@@ -717,7 +717,9 @@ blk_status_t btrfs_csum_one_bio(struct btrfs_inode *inode, struct bio *bio, + sums = kvzalloc(btrfs_ordered_sum_size(fs_info, + bytes_left), GFP_KERNEL); + memalloc_nofs_restore(nofs_flag); +- BUG_ON(!sums); /* -ENOMEM */ ++ if (!sums) ++ return BLK_STS_RESOURCE; ++ + sums->len = bytes_left; + ordered = btrfs_lookup_ordered_extent(inode, + offset); +-- +2.39.2 + diff --git a/queue-6.1/btrfs-scrub-try-harder-to-mark-raid56-block-groups-r.patch b/queue-6.1/btrfs-scrub-try-harder-to-mark-raid56-block-groups-r.patch new file mode 100644 index 00000000000..eaa537447c0 --- /dev/null +++ b/queue-6.1/btrfs-scrub-try-harder-to-mark-raid56-block-groups-r.patch @@ -0,0 +1,95 @@ +From 7d9e508e6c521c56f62d29c12ec43cccdfc08a0e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 13 Apr 2023 13:57:17 +0800 +Subject: btrfs: scrub: try harder to mark RAID56 block groups read-only + +From: Qu Wenruo + +[ Upstream commit 7561551e7ba870b9659083b95feb520fb2dacce3 ] + +Currently we allow a block group not to be marked read-only for scrub. + +But for RAID56 block groups if we require the block group to be +read-only, then we're allowed to use cached content from scrub stripe to +reduce unnecessary RAID56 reads. + +So this patch would: + +- Make btrfs_inc_block_group_ro() try harder + During my tests, for cases like btrfs/061 and btrfs/064, we can hit + ENOSPC from btrfs_inc_block_group_ro() calls during scrub. + + The reason is if we only have one single data chunk, and trying to + scrub it, we won't have any space left for any newer data writes. + + But this check should be done by the caller, especially for scrub + cases we only temporarily mark the chunk read-only. + And newer data writes would always try to allocate a new data chunk + when needed. + +- Return error for scrub if we failed to mark a RAID56 chunk read-only + +Signed-off-by: Qu Wenruo +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/block-group.c | 14 ++++++++++++-- + fs/btrfs/scrub.c | 9 ++++++++- + 2 files changed, 20 insertions(+), 3 deletions(-) + +diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c +index f33ddd5922b8c..74a5c94898b0f 100644 +--- a/fs/btrfs/block-group.c ++++ b/fs/btrfs/block-group.c +@@ -2621,10 +2621,20 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache, + } + + ret = inc_block_group_ro(cache, 0); +- if (!do_chunk_alloc || ret == -ETXTBSY) +- goto unlock_out; + if (!ret) + goto out; ++ if (ret == -ETXTBSY) ++ goto unlock_out; ++ ++ /* ++ * Skip chunk alloction if the bg is SYSTEM, this is to avoid system ++ * chunk allocation storm to exhaust the system chunk array. Otherwise ++ * we still want to try our best to mark the block group read-only. ++ */ ++ if (!do_chunk_alloc && ret == -ENOSPC && ++ (cache->flags & BTRFS_BLOCK_GROUP_SYSTEM)) ++ goto unlock_out; ++ + alloc_flags = btrfs_get_alloc_profile(fs_info, cache->space_info->flags); + ret = btrfs_chunk_alloc(trans, alloc_flags, CHUNK_ALLOC_FORCE); + if (ret < 0) +diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c +index c5d8dc112fd58..1672d4846baaf 100644 +--- a/fs/btrfs/scrub.c ++++ b/fs/btrfs/scrub.c +@@ -4017,13 +4017,20 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx, + + if (ret == 0) { + ro_set = 1; +- } else if (ret == -ENOSPC && !sctx->is_dev_replace) { ++ } else if (ret == -ENOSPC && !sctx->is_dev_replace && ++ !(cache->flags & BTRFS_BLOCK_GROUP_RAID56_MASK)) { + /* + * btrfs_inc_block_group_ro return -ENOSPC when it + * failed in creating new chunk for metadata. + * It is not a problem for scrub, because + * metadata are always cowed, and our scrub paused + * commit_transactions. ++ * ++ * For RAID56 chunks, we have to mark them read-only ++ * for scrub, as later we would use our own cache ++ * out of RAID56 realm. ++ * Thus we want the RAID56 bg to be marked RO to ++ * prevent RMW from screwing up out cache. + */ + ro_set = 0; + } else if (ret == -ETXTBSY) { +-- +2.39.2 + diff --git a/queue-6.1/drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch b/queue-6.1/drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch new file mode 100644 index 00000000000..cf8a6498d9d --- /dev/null +++ b/queue-6.1/drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch @@ -0,0 +1,59 @@ +From 9092f7412362894f73a1f124b91aedad57053f22 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 May 2023 16:15:07 -0700 +Subject: drm:amd:amdgpu: Fix missing buffer object unlock in failure path + +From: Sukrut Bellary + +[ Upstream commit 60ecaaf54886b0642d5c4744f7fbf1ff0d6b3e42 ] + +smatch warning - +1) drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:3615 gfx_v9_0_kiq_resume() +warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'. + +2) drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:6901 gfx_v10_0_kiq_resume() +warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'. + +Signed-off-by: Sukrut Bellary +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +++- + drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 +++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +index 2127aab74a68f..84a36b50ddd87 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +@@ -6969,8 +6969,10 @@ static int gfx_v10_0_kiq_resume(struct amdgpu_device *adev) + return r; + + r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); +- if (unlikely(r != 0)) ++ if (unlikely(r != 0)) { ++ amdgpu_bo_unreserve(ring->mqd_obj); + return r; ++ } + + gfx_v10_0_kiq_init_queue(ring); + amdgpu_bo_kunmap(ring->mqd_obj); +diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +index 1f3fdf6cb903e..fe371022e5104 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +@@ -3650,8 +3650,10 @@ static int gfx_v9_0_kiq_resume(struct amdgpu_device *adev) + return r; + + r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); +- if (unlikely(r != 0)) ++ if (unlikely(r != 0)) { ++ amdgpu_bo_unreserve(ring->mqd_obj); + return r; ++ } + + gfx_v9_0_kiq_init_queue(ring); + amdgpu_bo_kunmap(ring->mqd_obj); +-- +2.39.2 + diff --git a/queue-6.1/drm-panel-orientation-quirks-change-air-s-quirk-to-s.patch b/queue-6.1/drm-panel-orientation-quirks-change-air-s-quirk-to-s.patch new file mode 100644 index 00000000000..6f2626290f7 --- /dev/null +++ b/queue-6.1/drm-panel-orientation-quirks-change-air-s-quirk-to-s.patch @@ -0,0 +1,41 @@ +From 5eaebc6f103032aab25a63cbffadafde97dc54d5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 May 2023 20:48:43 +0200 +Subject: drm: panel-orientation-quirks: Change Air's quirk to support Air Plus + +From: Maya Matuszczyk + +[ Upstream commit 1aa7f416175619e0286fddc5fc44e968b06bf2aa ] + +It turned out that Aya Neo Air Plus had a different board name than +expected. +This patch changes Aya Neo Air's quirk to account for that, as both +devices share "Air" in DMI product name. + +Tested on Air claiming to be an Air Pro, and on Air Plus. + +Signed-off-by: Maya Matuszczyk +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Link: https://patchwork.freedesktop.org/patch/msgid/20230515184843.1552612-1-maccraft123mc@gmail.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_panel_orientation_quirks.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c +index b1a38e6ce2f8f..0cb646cb04ee1 100644 +--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c ++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c +@@ -179,7 +179,7 @@ static const struct dmi_system_id orientation_data[] = { + }, { /* AYA NEO AIR */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), +- DMI_MATCH(DMI_BOARD_NAME, "AIR"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "AIR"), + }, + .driver_data = (void *)&lcd1080x1920_leftside_up, + }, { /* AYA NEO NEXT */ +-- +2.39.2 + diff --git a/queue-6.1/io_uring-unlock-sqd-lock-before-sq-thread-release-cp.patch b/queue-6.1/io_uring-unlock-sqd-lock-before-sq-thread-release-cp.patch new file mode 100644 index 00000000000..0a636d8675b --- /dev/null +++ b/queue-6.1/io_uring-unlock-sqd-lock-before-sq-thread-release-cp.patch @@ -0,0 +1,54 @@ +From 3378f324f80856d30c02307c6377a2f0cc9d338c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 May 2023 16:26:26 +0800 +Subject: io_uring: unlock sqd->lock before sq thread release CPU + +From: Wenwen Chen + +[ Upstream commit 533ab73f5b5c95dcb4152b52d5482abcc824c690 ] + +The sq thread actively releases CPU resources by calling the +cond_resched() and schedule() interfaces when it is idle. Therefore, +more resources are available for other threads to run. + +There exists a problem in sq thread: it does not unlock sqd->lock before +releasing CPU resources every time. This makes other threads pending on +sqd->lock for a long time. For example, the following interfaces all +require sqd->lock: io_sq_offload_create(), io_register_iowq_max_workers() +and io_ring_exit_work(). + +Before the sq thread releases CPU resources, unlocking sqd->lock will +provide the user a better experience because it can respond quickly to +user requests. + +Signed-off-by: Kanchan Joshi +Signed-off-by: Wenwen Chen +Link: https://lore.kernel.org/r/20230525082626.577862-1-wenwen.chen@samsung.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + io_uring/sqpoll.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c +index 559652380672c..6ffa5cf1bbb86 100644 +--- a/io_uring/sqpoll.c ++++ b/io_uring/sqpoll.c +@@ -256,9 +256,13 @@ static int io_sq_thread(void *data) + sqt_spin = true; + + if (sqt_spin || !time_after(jiffies, timeout)) { +- cond_resched(); + if (sqt_spin) + timeout = jiffies + sqd->sq_thread_idle; ++ if (unlikely(need_resched())) { ++ mutex_unlock(&sqd->lock); ++ cond_resched(); ++ mutex_lock(&sqd->lock); ++ } + continue; + } + +-- +2.39.2 + diff --git a/queue-6.1/irqchip-gic-correctly-validate-of-quirk-descriptors.patch b/queue-6.1/irqchip-gic-correctly-validate-of-quirk-descriptors.patch new file mode 100644 index 00000000000..02343c696c5 --- /dev/null +++ b/queue-6.1/irqchip-gic-correctly-validate-of-quirk-descriptors.patch @@ -0,0 +1,41 @@ +From 90a3f27bcd9a42c16c15e0b4de4cad1478307382 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 May 2023 11:01:22 +0100 +Subject: irqchip/gic: Correctly validate OF quirk descriptors + +From: Marc Zyngier + +[ Upstream commit 91539341a3b6e9c868024a4292455dae36e6f58c ] + +When checking for OF quirks, make sure either 'compatible' or 'property' +is set, and give up otherwise. + +This avoids non-OF quirks being randomly applied as they don't have any +of the OF data that need checking. + +Cc: Douglas Anderson +Reported-by: Geert Uytterhoeven +Tested-by: Geert Uytterhoeven +Fixes: 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues") +Signed-off-by: Marc Zyngier +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-gic-common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c +index de47b51cdadbe..afd6a1841715a 100644 +--- a/drivers/irqchip/irq-gic-common.c ++++ b/drivers/irqchip/irq-gic-common.c +@@ -16,6 +16,8 @@ void gic_enable_of_quirks(const struct device_node *np, + const struct gic_quirk *quirks, void *data) + { + for (; quirks->desc; quirks++) { ++ if (!quirks->compatible && !quirks->property) ++ continue; + if (quirks->compatible && + !of_device_is_compatible(np, quirks->compatible)) + continue; +-- +2.39.2 + diff --git a/queue-6.1/irqchip-gic-v3-disable-pseudo-nmis-on-mediatek-devic.patch b/queue-6.1/irqchip-gic-v3-disable-pseudo-nmis-on-mediatek-devic.patch new file mode 100644 index 00000000000..0b779b9039c --- /dev/null +++ b/queue-6.1/irqchip-gic-v3-disable-pseudo-nmis-on-mediatek-devic.patch @@ -0,0 +1,138 @@ +From 51db7c11a9415e628e92a7eeb925b6022e3feda8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 May 2023 13:13:51 -0700 +Subject: irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware + issues + +From: Douglas Anderson + +[ Upstream commit 44bd78dd2b8897f59b7e3963f088caadb7e4f047 ] + +Some Chromebooks with Mediatek SoCs have a problem where the firmware +doesn't properly save/restore certain GICR registers. Newer +Chromebooks should fix this issue and we may be able to do firmware +updates for old Chromebooks. At the moment, the only known issue with +these Chromebooks is that we can't enable "pseudo NMIs" since the +priority register can be lost. Enabling "pseudo NMIs" on Chromebooks +with the problematic firmware causes crashes and freezes. + +Let's detect devices with this problem and then disable "pseudo NMIs" +on them. We'll detect the problem by looking for the presence of the +"mediatek,broken-save-restore-fw" property in the GIC device tree +node. Any devices with fixed firmware will not have this property. + +Our detection plan works because we never bake a Chromebook's device +tree into firmware. Instead, device trees are always bundled with the +kernel. We'll update the device trees of all affected Chromebooks and +then we'll never enable "pseudo NMI" on a kernel that is bundled with +old device trees. When a firmware update is shipped that fixes this +issue it will know to patch the device tree to remove the property. + +In order to make this work, the quick detection mechanism of the GICv3 +code is extended to be able to look for properties in addition to +looking at "compatible". + +Reviewed-by: Julius Werner +Signed-off-by: Douglas Anderson +Signed-off-by: Marc Zyngier +Link: https://lore.kernel.org/r/20230515131353.v2.2.I88dc0a0eb1d9d537de61604cd8994ecc55c0cac1@changeid +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-gic-common.c | 8 ++++++-- + drivers/irqchip/irq-gic-common.h | 1 + + drivers/irqchip/irq-gic-v3.c | 20 ++++++++++++++++++++ + 3 files changed, 27 insertions(+), 2 deletions(-) + +diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c +index a610821c8ff2a..de47b51cdadbe 100644 +--- a/drivers/irqchip/irq-gic-common.c ++++ b/drivers/irqchip/irq-gic-common.c +@@ -16,7 +16,11 @@ void gic_enable_of_quirks(const struct device_node *np, + const struct gic_quirk *quirks, void *data) + { + for (; quirks->desc; quirks++) { +- if (!of_device_is_compatible(np, quirks->compatible)) ++ if (quirks->compatible && ++ !of_device_is_compatible(np, quirks->compatible)) ++ continue; ++ if (quirks->property && ++ !of_property_read_bool(np, quirks->property)) + continue; + if (quirks->init(data)) + pr_info("GIC: enabling workaround for %s\n", +@@ -28,7 +32,7 @@ void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks, + void *data) + { + for (; quirks->desc; quirks++) { +- if (quirks->compatible) ++ if (quirks->compatible || quirks->property) + continue; + if (quirks->iidr != (quirks->mask & iidr)) + continue; +diff --git a/drivers/irqchip/irq-gic-common.h b/drivers/irqchip/irq-gic-common.h +index 27e3d4ed4f328..3db4592cda1c0 100644 +--- a/drivers/irqchip/irq-gic-common.h ++++ b/drivers/irqchip/irq-gic-common.h +@@ -13,6 +13,7 @@ + struct gic_quirk { + const char *desc; + const char *compatible; ++ const char *property; + bool (*init)(void *data); + u32 iidr; + u32 mask; +diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c +index 2182f87d2d12e..11f7c53e4b634 100644 +--- a/drivers/irqchip/irq-gic-v3.c ++++ b/drivers/irqchip/irq-gic-v3.c +@@ -38,6 +38,7 @@ + + #define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0) + #define FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539 (1ULL << 1) ++#define FLAGS_WORKAROUND_MTK_GICR_SAVE (1ULL << 2) + + #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1) + +@@ -1730,6 +1731,15 @@ static bool gic_enable_quirk_msm8996(void *data) + return true; + } + ++static bool gic_enable_quirk_mtk_gicr(void *data) ++{ ++ struct gic_chip_data *d = data; ++ ++ d->flags |= FLAGS_WORKAROUND_MTK_GICR_SAVE; ++ ++ return true; ++} ++ + static bool gic_enable_quirk_cavium_38539(void *data) + { + struct gic_chip_data *d = data; +@@ -1802,6 +1812,11 @@ static const struct gic_quirk gic_quirks[] = { + .compatible = "qcom,msm8996-gic-v3", + .init = gic_enable_quirk_msm8996, + }, ++ { ++ .desc = "GICv3: Mediatek Chromebook GICR save problem", ++ .property = "mediatek,broken-save-restore-fw", ++ .init = gic_enable_quirk_mtk_gicr, ++ }, + { + .desc = "GICv3: HIP06 erratum 161010803", + .iidr = 0x0204043b, +@@ -1844,6 +1859,11 @@ static void gic_enable_nmi_support(void) + if (!gic_prio_masking_enabled()) + return; + ++ if (gic_data.flags & FLAGS_WORKAROUND_MTK_GICR_SAVE) { ++ pr_warn("Skipping NMI enable due to firmware issues\n"); ++ return; ++ } ++ + ppi_nmi_refs = kcalloc(gic_data.ppi_nr, sizeof(*ppi_nmi_refs), GFP_KERNEL); + if (!ppi_nmi_refs) + return; +-- +2.39.2 + diff --git a/queue-6.1/irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch b/queue-6.1/irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch new file mode 100644 index 00000000000..525af45dcee --- /dev/null +++ b/queue-6.1/irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch @@ -0,0 +1,42 @@ +From d78b5b47936ff889bcac4d323aa64e0e176ecdc7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 12 May 2023 18:45:06 +0200 +Subject: irqchip/meson-gpio: Mark OF related data as maybe unused +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Krzysztof Kozlowski + +[ Upstream commit 14130211be5366a91ec07c3284c183b75d8fba17 ] + +The driver can be compile tested with !CONFIG_OF making certain data +unused: + + drivers/irqchip/irq-meson-gpio.c:153:34: error: ‘meson_irq_gpio_matches’ defined but not used [-Werror=unused-const-variable=] + +Acked-by: Martin Blumenstingl +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Marc Zyngier +Link: https://lore.kernel.org/r/20230512164506.212267-1-krzysztof.kozlowski@linaro.org +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-meson-gpio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c +index 2aaa9aad3e87a..7da18ef952119 100644 +--- a/drivers/irqchip/irq-meson-gpio.c ++++ b/drivers/irqchip/irq-meson-gpio.c +@@ -150,7 +150,7 @@ static const struct meson_gpio_irq_params s4_params = { + INIT_MESON_S4_COMMON_DATA(82) + }; + +-static const struct of_device_id meson_irq_gpio_matches[] = { ++static const struct of_device_id meson_irq_gpio_matches[] __maybe_unused = { + { .compatible = "amlogic,meson8-gpio-intc", .data = &meson8_params }, + { .compatible = "amlogic,meson8b-gpio-intc", .data = &meson8b_params }, + { .compatible = "amlogic,meson-gxbb-gpio-intc", .data = &gxbb_params }, +-- +2.39.2 + diff --git a/queue-6.1/mips-alchemy-fix-dbdma2.patch b/queue-6.1/mips-alchemy-fix-dbdma2.patch new file mode 100644 index 00000000000..e9782b1e363 --- /dev/null +++ b/queue-6.1/mips-alchemy-fix-dbdma2.patch @@ -0,0 +1,87 @@ +From 0e6836ce99a068bec1a673fd719a212d09ee1c07 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 11 May 2023 17:30:10 +0200 +Subject: MIPS: Alchemy: fix dbdma2 + +From: Manuel Lauss + +[ Upstream commit 2d645604f69f3a772d58ead702f9a8e84ab2b342 ] + +Various fixes for the Au1200/Au1550/Au1300 DBDMA2 code: + +- skip cache invalidation if chip has working coherency circuitry. +- invalidate KSEG0-portion of the (physical) data address. +- force the dma channel doorbell write out to bus immediately with + a sync. + +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/alchemy/common/dbdma.c | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c +index 5ab0430004092..6a3c890f7bbfe 100644 +--- a/arch/mips/alchemy/common/dbdma.c ++++ b/arch/mips/alchemy/common/dbdma.c +@@ -30,6 +30,7 @@ + * + */ + ++#include /* for dma_default_coherent */ + #include + #include + #include +@@ -623,17 +624,18 @@ u32 au1xxx_dbdma_put_source(u32 chanid, dma_addr_t buf, int nbytes, u32 flags) + dp->dscr_cmd0 &= ~DSCR_CMD0_IE; + + /* +- * There is an errata on the Au1200/Au1550 parts that could result +- * in "stale" data being DMA'ed. It has to do with the snoop logic on +- * the cache eviction buffer. DMA_NONCOHERENT is on by default for +- * these parts. If it is fixed in the future, these dma_cache_inv will +- * just be nothing more than empty macros. See io.h. ++ * There is an erratum on certain Au1200/Au1550 revisions that could ++ * result in "stale" data being DMA'ed. It has to do with the snoop ++ * logic on the cache eviction buffer. dma_default_coherent is set ++ * to false on these parts. + */ +- dma_cache_wback_inv((unsigned long)buf, nbytes); ++ if (!dma_default_coherent) ++ dma_cache_wback_inv(KSEG0ADDR(buf), nbytes); + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ + wmb(); /* drain writebuffer */ + dma_cache_wback_inv((unsigned long)dp, sizeof(*dp)); + ctp->chan_ptr->ddma_dbell = 0; ++ wmb(); /* force doorbell write out to dma engine */ + + /* Get next descriptor pointer. */ + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); +@@ -685,17 +687,18 @@ u32 au1xxx_dbdma_put_dest(u32 chanid, dma_addr_t buf, int nbytes, u32 flags) + dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1); + #endif + /* +- * There is an errata on the Au1200/Au1550 parts that could result in +- * "stale" data being DMA'ed. It has to do with the snoop logic on the +- * cache eviction buffer. DMA_NONCOHERENT is on by default for these +- * parts. If it is fixed in the future, these dma_cache_inv will just +- * be nothing more than empty macros. See io.h. ++ * There is an erratum on certain Au1200/Au1550 revisions that could ++ * result in "stale" data being DMA'ed. It has to do with the snoop ++ * logic on the cache eviction buffer. dma_default_coherent is set ++ * to false on these parts. + */ +- dma_cache_inv((unsigned long)buf, nbytes); ++ if (!dma_default_coherent) ++ dma_cache_inv(KSEG0ADDR(buf), nbytes); + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ + wmb(); /* drain writebuffer */ + dma_cache_wback_inv((unsigned long)dp, sizeof(*dp)); + ctp->chan_ptr->ddma_dbell = 0; ++ wmb(); /* force doorbell write out to dma engine */ + + /* Get next descriptor pointer. */ + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); +-- +2.39.2 + diff --git a/queue-6.1/mips-move-initrd_start-check-after-initrd-address-sa.patch b/queue-6.1/mips-move-initrd_start-check-after-initrd-address-sa.patch new file mode 100644 index 00000000000..3965e0ff45c --- /dev/null +++ b/queue-6.1/mips-move-initrd_start-check-after-initrd-address-sa.patch @@ -0,0 +1,52 @@ +From ac8e2c4f729f94fa3f56a1308cf3f0dccaa2331d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 May 2023 18:29:21 +0100 +Subject: mips: Move initrd_start check after initrd address sanitisation. + +From: Liviu Dudau + +[ Upstream commit 4897a898a216058dec55e5e5902534e6e224fcdf ] + +PAGE_OFFSET is technically a virtual address so when checking the value of +initrd_start against it we should make sure that it has been sanitised from +the values passed by the bootloader. Without this change, even with a bootloader +that passes correct addresses for an initrd, we are failing to load it on MT7621 +boards, for example. + +Signed-off-by: Liviu Dudau +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/kernel/setup.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c +index f1c88f8a1dc51..81dbb4ef52317 100644 +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -158,10 +158,6 @@ static unsigned long __init init_initrd(void) + pr_err("initrd start must be page aligned\n"); + goto disable; + } +- if (initrd_start < PAGE_OFFSET) { +- pr_err("initrd start < PAGE_OFFSET\n"); +- goto disable; +- } + + /* + * Sanitize initrd addresses. For example firmware +@@ -174,6 +170,11 @@ static unsigned long __init init_initrd(void) + initrd_end = (unsigned long)__va(end); + initrd_start = (unsigned long)__va(__pa(initrd_start)); + ++ if (initrd_start < PAGE_OFFSET) { ++ pr_err("initrd start < PAGE_OFFSET\n"); ++ goto disable; ++ } ++ + ROOT_DEV = Root_RAM0; + return PFN_UP(end); + disable: +-- +2.39.2 + diff --git a/queue-6.1/mips-restore-au1300-support.patch b/queue-6.1/mips-restore-au1300-support.patch new file mode 100644 index 00000000000..e0059b0b0fe --- /dev/null +++ b/queue-6.1/mips-restore-au1300-support.patch @@ -0,0 +1,48 @@ +From 05a03458166b1f2e44eedbe16269d116e68d09b0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 10 May 2023 12:33:23 +0200 +Subject: MIPS: Restore Au1300 support + +From: Manuel Lauss + +[ Upstream commit f2041708dee30a3425f680265c337acd28293782 ] + +The Au1300, at least the one I have to test, uses the NetLogic vendor +ID, but commit 95b8a5e0111a ("MIPS: Remove NETLOGIC support") also +dropped Au1300 detection. Restore Au1300 detection. + +Tested on DB1300 with Au1380 chip. + +Signed-off-by: Manuel Lauss +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/kernel/cpu-probe.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c +index 7ddf07f255f32..6f5d825958778 100644 +--- a/arch/mips/kernel/cpu-probe.c ++++ b/arch/mips/kernel/cpu-probe.c +@@ -1502,6 +1502,10 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) + break; + } + break; ++ case PRID_IMP_NETLOGIC_AU13XX: ++ c->cputype = CPU_ALCHEMY; ++ __cpu_name[cpu] = "Au1300"; ++ break; + } + } + +@@ -1861,6 +1865,7 @@ void cpu_probe(void) + cpu_probe_mips(c, cpu); + break; + case PRID_COMP_ALCHEMY: ++ case PRID_COMP_NETLOGIC: + cpu_probe_alchemy(c, cpu); + break; + case PRID_COMP_SIBYTE: +-- +2.39.2 + diff --git a/queue-6.1/mips-unhide-pata_platform.patch b/queue-6.1/mips-unhide-pata_platform.patch new file mode 100644 index 00000000000..a639cc01c84 --- /dev/null +++ b/queue-6.1/mips-unhide-pata_platform.patch @@ -0,0 +1,34 @@ +From 9aa29baed3029075a066cb198160008ac35c8edd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 May 2023 20:57:44 +0200 +Subject: MIPS: unhide PATA_PLATFORM + +From: Manuel Lauss + +[ Upstream commit 75b18aac6fa39a1720677970cfcb52ecea1eb44c ] + +Alchemy DB1200/DB1300 boards can use the pata_platform driver. +Unhide the config entry in all of MIPS. + +Signed-off-by: Manuel Lauss +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig +index b26b77673c2cc..2f5835e300a8f 100644 +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -82,6 +82,7 @@ config MIPS + select HAVE_LD_DEAD_CODE_DATA_ELIMINATION + select HAVE_MOD_ARCH_SPECIFIC + select HAVE_NMI ++ select HAVE_PATA_PLATFORM + select HAVE_PERF_EVENTS + select HAVE_PERF_REGS + select HAVE_PERF_USER_STACK_DUMP +-- +2.39.2 + diff --git a/queue-6.1/nvme-add-maxio-1602-to-bogus-nid-list.patch b/queue-6.1/nvme-add-maxio-1602-to-bogus-nid-list.patch new file mode 100644 index 00000000000..7b9ef55fad1 --- /dev/null +++ b/queue-6.1/nvme-add-maxio-1602-to-bogus-nid-list.patch @@ -0,0 +1,71 @@ +From ed9a8ee6b74d9b238ab66c7c10c9f13153899943 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 20 May 2023 21:23:50 +0900 +Subject: NVMe: Add MAXIO 1602 to bogus nid list. + +From: Tatsuki Sugiura + +[ Upstream commit a3a9d63dcd15535e7fdf4c7c1b32bfaed762973a ] + +HIKSEMI FUTURE M.2 SSD uses the same dummy nguid and eui64. +I confirmed it with my two devices. + +This patch marks the controller as NVME_QUIRK_BOGUS_NID. + +--------------------------------------------------------- +sugi@tempest:~% sudo nvme id-ctrl /dev/nvme0 +NVME Identify Controller: +vid : 0x1e4b +ssvid : 0x1e4b +sn : 30096022612 +mn : HS-SSD-FUTURE 2048G +fr : SN10542 +rab : 0 +ieee : 000000 +cmic : 0 +mdts : 7 +cntlid : 0 +ver : 0x10400 +rtd3r : 0x7a120 +rtd3e : 0x1e8480 +oaes : 0x200 +ctratt : 0x2 +rrls : 0 +cntrltype : 1 +fguid : 00000000-0000-0000-0000-000000000000 + +--------------------------------------------------------- + +--------------------------------------------------------- +sugi@tempest:~% sudo nvme id-ns /dev/nvme0n1 +NVME Identify Namespace 1: + +nguid : 00000000000000000000000000000000 +eui64 : 0000000000000002 +lbaf 0 : ms:0 lbads:9 rp:0 (in use) +--------------------------------------------------------- + +Signed-off-by: Tatsuki Sugiura +Reviewed-by: Christoph Hellwig +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/pci.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c +index ba4903c86f7ff..145fa7ef3f740 100644 +--- a/drivers/nvme/host/pci.c ++++ b/drivers/nvme/host/pci.c +@@ -3537,6 +3537,8 @@ static const struct pci_device_id nvme_id_table[] = { + .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1e4B, 0x1202), /* MAXIO MAP1202 */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, ++ { PCI_DEVICE(0x1e4B, 0x1602), /* MAXIO MAP1602 */ ++ .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1cc1, 0x5350), /* ADATA XPG GAMMIX S50 */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1dbe, 0x5236), /* ADATA XPG GAMMIX S70 */ +-- +2.39.2 + diff --git a/queue-6.1/of-overlay-fix-missing-of_node_put-in-error-case-of-.patch b/queue-6.1/of-overlay-fix-missing-of_node_put-in-error-case-of-.patch new file mode 100644 index 00000000000..e5b11bfb9b8 --- /dev/null +++ b/queue-6.1/of-overlay-fix-missing-of_node_put-in-error-case-of-.patch @@ -0,0 +1,37 @@ +From 142594e629332ec35cc579cc8cdab0d9cedadfd6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Jun 2023 11:05:02 +0900 +Subject: of: overlay: Fix missing of_node_put() in error case of + init_overlay_changeset() + +From: Kunihiko Hayashi + +[ Upstream commit 39affd1fdf65983904fafc07cf607cff737eaf30 ] + +In init_overlay_changeset(), the variable "node" is from +of_get_child_by_name(), and the "node" should be discarded in error case. + +Fixes: d1651b03c2df ("of: overlay: add overlay symbols to live device tree") +Signed-off-by: Kunihiko Hayashi +Link: https://lore.kernel.org/r/20230602020502.11693-1-hayashi.kunihiko@socionext.com +Signed-off-by: Rob Herring +Signed-off-by: Sasha Levin +--- + drivers/of/overlay.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c +index ed4e6c144a681..5289975bad708 100644 +--- a/drivers/of/overlay.c ++++ b/drivers/of/overlay.c +@@ -811,6 +811,7 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs) + if (!fragment->target) { + pr_err("symbols in overlay, but not in live tree\n"); + ret = -EINVAL; ++ of_node_put(node); + goto err_out; + } + +-- +2.39.2 + diff --git a/queue-6.1/parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch b/queue-6.1/parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch new file mode 100644 index 00000000000..1b7118f4366 --- /dev/null +++ b/queue-6.1/parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch @@ -0,0 +1,62 @@ +From 440d26f4914354aaa1570b0fa70f2e958c28ae45 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 May 2023 15:54:40 +0200 +Subject: parisc: Flush gatt writes and adjust gatt mask in + parisc_agp_mask_memory() + +From: Helge Deller + +[ Upstream commit d703797380c540bbeac03f104ebcfc364eaf47cc ] + +Flush caches after changing gatt entries and calculate entry according +to SBA requirements. + +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/char/agp/parisc-agp.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c +index d68d05d5d3838..514f9f287a781 100644 +--- a/drivers/char/agp/parisc-agp.c ++++ b/drivers/char/agp/parisc-agp.c +@@ -90,6 +90,9 @@ parisc_agp_tlbflush(struct agp_memory *mem) + { + struct _parisc_agp_info *info = &parisc_agp_info; + ++ /* force fdc ops to be visible to IOMMU */ ++ asm_io_sync(); ++ + writeq(info->gart_base | ilog2(info->gart_size), info->ioc_regs+IOC_PCOM); + readq(info->ioc_regs+IOC_PCOM); /* flush */ + } +@@ -158,6 +161,7 @@ parisc_agp_insert_memory(struct agp_memory *mem, off_t pg_start, int type) + info->gatt[j] = + parisc_agp_mask_memory(agp_bridge, + paddr, type); ++ asm_io_fdc(&info->gatt[j]); + } + } + +@@ -191,7 +195,16 @@ static unsigned long + parisc_agp_mask_memory(struct agp_bridge_data *bridge, dma_addr_t addr, + int type) + { +- return SBA_PDIR_VALID_BIT | addr; ++ unsigned ci; /* coherent index */ ++ dma_addr_t pa; ++ ++ pa = addr & IOVP_MASK; ++ asm("lci 0(%1), %0" : "=r" (ci) : "r" (phys_to_virt(pa))); ++ ++ pa |= (ci >> PAGE_SHIFT) & 0xff;/* move CI (8 bits) into lowest byte */ ++ pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */ ++ ++ return cpu_to_le64(pa); + } + + static void +-- +2.39.2 + diff --git a/queue-6.1/parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch b/queue-6.1/parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch new file mode 100644 index 00000000000..a7f8fd37cc5 --- /dev/null +++ b/queue-6.1/parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch @@ -0,0 +1,57 @@ +From 2d53b2d3f5f7f1b1802c4a60a41877c152290eeb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 May 2023 15:52:30 +0200 +Subject: parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu() + +From: Helge Deller + +[ Upstream commit 59fa12646d9f56c842b4d5b6418ed77af625c588 ] + +Add comment in arch_sync_dma_for_device() and handle the direction flag in +arch_sync_dma_for_cpu(). + +When receiving data from the device (DMA_FROM_DEVICE) unconditionally +purge the data cache in arch_sync_dma_for_cpu(). + +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + arch/parisc/kernel/pci-dma.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c +index ba87f791323be..71ed5391f29d6 100644 +--- a/arch/parisc/kernel/pci-dma.c ++++ b/arch/parisc/kernel/pci-dma.c +@@ -446,11 +446,27 @@ void arch_dma_free(struct device *dev, size_t size, void *vaddr, + void arch_sync_dma_for_device(phys_addr_t paddr, size_t size, + enum dma_data_direction dir) + { ++ /* ++ * fdc: The data cache line is written back to memory, if and only if ++ * it is dirty, and then invalidated from the data cache. ++ */ + flush_kernel_dcache_range((unsigned long)phys_to_virt(paddr), size); + } + + void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size, + enum dma_data_direction dir) + { +- flush_kernel_dcache_range((unsigned long)phys_to_virt(paddr), size); ++ unsigned long addr = (unsigned long) phys_to_virt(paddr); ++ ++ switch (dir) { ++ case DMA_TO_DEVICE: ++ case DMA_BIDIRECTIONAL: ++ flush_kernel_dcache_range(addr, size); ++ return; ++ case DMA_FROM_DEVICE: ++ purge_kernel_dcache_range_asm(addr, addr + size); ++ return; ++ default: ++ BUG(); ++ } + } +-- +2.39.2 + diff --git a/queue-6.1/pci-dpc-quirk-pio-log-size-for-intel-ice-lake-root-p.patch b/queue-6.1/pci-dpc-quirk-pio-log-size-for-intel-ice-lake-root-p.patch new file mode 100644 index 00000000000..a1800d47c41 --- /dev/null +++ b/queue-6.1/pci-dpc-quirk-pio-log-size-for-intel-ice-lake-root-p.patch @@ -0,0 +1,62 @@ +From 94a1ffb09e21514bded17fc3b66a5c61b0c402e3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 11 May 2023 15:19:05 +0300 +Subject: PCI/DPC: Quirk PIO log size for Intel Ice Lake Root Ports + +From: Mika Westerberg + +[ Upstream commit 3b8803494a0612acdeee714cb72aa142b1e05ce5 ] + +Commit 5459c0b70467 ("PCI/DPC: Quirk PIO log size for certain Intel Root +Ports") added quirks for Tiger and Alder Lake Root Ports but missed that +the same issue exists also in the previous generation, Ice Lake. + +Apply the quirk for Ice Lake Root Ports as well. This prevents kernel +complaints like: + + DPC: RP PIO log size 0 is invalid + +and also enables the DPC driver to dump the RP PIO Log registers when DPC +is triggered. + +[bhelgaas: add dmesg warning and RP PIO Log dump info] +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=209943 +Link: https://lore.kernel.org/r/20230511121905.73949-1-mika.westerberg@linux.intel.com +Reported-by: Mark Blakeney +Signed-off-by: Mika Westerberg +Signed-off-by: Bjorn Helgaas +Signed-off-by: Sasha Levin +--- + drivers/pci/quirks.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c +index 8d32a3834688f..ccc90656130a0 100644 +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -5995,8 +5995,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56c1, aspm_l1_acceptable_latency + + #ifdef CONFIG_PCIE_DPC + /* +- * Intel Tiger Lake and Alder Lake BIOS has a bug that clears the DPC +- * RP PIO Log Size of the integrated Thunderbolt PCIe Root Ports. ++ * Intel Ice Lake, Tiger Lake and Alder Lake BIOS has a bug that clears ++ * the DPC RP PIO Log Size of the integrated Thunderbolt PCIe Root ++ * Ports. + */ + static void dpc_log_size(struct pci_dev *dev) + { +@@ -6019,6 +6020,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x461f, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x462f, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x463f, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x466e, dpc_log_size); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8a1d, dpc_log_size); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8a1f, dpc_log_size); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8a21, dpc_log_size); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8a23, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a23, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a25, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a27, dpc_log_size); +-- +2.39.2 + diff --git a/queue-6.1/platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch b/queue-6.1/platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch new file mode 100644 index 00000000000..bc8eb3c3bb3 --- /dev/null +++ b/queue-6.1/platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch @@ -0,0 +1,50 @@ +From 4f45f9b9497eefb49bd80a45c4ca9d7fc0eeeded Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 12 May 2023 13:15:17 +0300 +Subject: platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0 + +From: Alexandru Sorodoc + +[ Upstream commit 362c1f2ec82cb65940e1c73e15a395a7a891fc6f ] + +On ASUS GU604V the key 0x7B is issued when the charger is connected or +disconnected, and key 0xC0 is issued when an external display is +connected or disconnected. + +This commit maps them to KE_IGNORE to slience kernel messages about +unknown keys, such as: + + kernel: asus_wmi: Unknown key code 0x7b + +Signed-off-by: Alexandru Sorodoc +Link: https://lore.kernel.org/r/20230512101517.47416-1-ealex95@gmail.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/asus-nb-wmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c +index e2c9a68d12df9..fdf7da06af306 100644 +--- a/drivers/platform/x86/asus-nb-wmi.c ++++ b/drivers/platform/x86/asus-nb-wmi.c +@@ -555,6 +555,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { + { KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */ + { KE_IGNORE, 0x79, }, /* Charger type dectection notification */ + { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */ ++ { KE_IGNORE, 0x7B, }, /* Charger connect/disconnect notification */ + { KE_KEY, 0x7c, { KEY_MICMUTE } }, + { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ + { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ +@@ -584,6 +585,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { + { KE_KEY, 0xAE, { KEY_FN_F5 } }, /* Fn+F5 fan mode on 2020+ */ + { KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */ + { KE_KEY, 0xB5, { KEY_CALC } }, ++ { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */ + { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, + { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, + { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ +-- +2.39.2 + diff --git a/queue-6.1/power-supply-ab8500-fix-external_power_changed-race.patch b/queue-6.1/power-supply-ab8500-fix-external_power_changed-race.patch new file mode 100644 index 00000000000..0e63da7b117 --- /dev/null +++ b/queue-6.1/power-supply-ab8500-fix-external_power_changed-race.patch @@ -0,0 +1,73 @@ +From 8a8bc4d477d13645276bb76ccf902fa25ef8ccd5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Apr 2023 18:07:29 +0200 +Subject: power: supply: ab8500: Fix external_power_changed race + +From: Hans de Goede + +[ Upstream commit a5299ce4e96f3e8930e9c051b28d8093ada87b08 ] + +ab8500_btemp_external_power_changed() dereferences di->btemp_psy, +which gets sets in ab8500_btemp_probe() like this: + + di->btemp_psy = devm_power_supply_register(dev, &ab8500_btemp_desc, + &psy_cfg); + +As soon as devm_power_supply_register() has called device_add() +the external_power_changed callback can get called. So there is a window +where ab8500_btemp_external_power_changed() may get called while +di->btemp_psy has not been set yet leading to a NULL pointer dereference. + +Fixing this is easy. The external_power_changed callback gets passed +the power_supply which will eventually get stored in di->btemp_psy, +so ab8500_btemp_external_power_changed() can simply directly use +the passed in psy argument which is always valid. + +And the same applies to ab8500_fg_external_power_changed(). + +Signed-off-by: Hans de Goede +Reviewed-by: Linus Walleij +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +--- + drivers/power/supply/ab8500_btemp.c | 6 ++---- + drivers/power/supply/ab8500_fg.c | 6 ++---- + 2 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c +index 307ee6f71042e..6f83e99d2eb72 100644 +--- a/drivers/power/supply/ab8500_btemp.c ++++ b/drivers/power/supply/ab8500_btemp.c +@@ -624,10 +624,8 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data) + */ + static void ab8500_btemp_external_power_changed(struct power_supply *psy) + { +- struct ab8500_btemp *di = power_supply_get_drvdata(psy); +- +- class_for_each_device(power_supply_class, NULL, +- di->btemp_psy, ab8500_btemp_get_ext_psy_data); ++ class_for_each_device(power_supply_class, NULL, psy, ++ ab8500_btemp_get_ext_psy_data); + } + + /* ab8500 btemp driver interrupts and their respective isr */ +diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c +index c6c9804280dbe..71ce28eed463f 100644 +--- a/drivers/power/supply/ab8500_fg.c ++++ b/drivers/power/supply/ab8500_fg.c +@@ -2407,10 +2407,8 @@ static int ab8500_fg_init_hw_registers(struct ab8500_fg *di) + */ + static void ab8500_fg_external_power_changed(struct power_supply *psy) + { +- struct ab8500_fg *di = power_supply_get_drvdata(psy); +- +- class_for_each_device(power_supply_class, NULL, +- di->fg_psy, ab8500_fg_get_ext_psy_data); ++ class_for_each_device(power_supply_class, NULL, psy, ++ ab8500_fg_get_ext_psy_data); + } + + /** +-- +2.39.2 + diff --git a/queue-6.1/power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch b/queue-6.1/power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch new file mode 100644 index 00000000000..2b26359922c --- /dev/null +++ b/queue-6.1/power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch @@ -0,0 +1,40 @@ +From 03ee1cf0b94bcf6279f49300292d87be8518b911 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Apr 2023 20:23:39 +0200 +Subject: power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + + schedule() + +From: Hans de Goede + +[ Upstream commit 59dddea9879713423c7b2ade43c423bb71e0d216 ] + +Use mod_delayed_work() instead of separate cancel_delayed_work_sync() + +schedule_delayed_work() calls. + +Signed-off-by: Hans de Goede +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +--- + drivers/power/supply/bq27xxx_battery.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c +index 17a09d103a59c..4a5371a3a5313 100644 +--- a/drivers/power/supply/bq27xxx_battery.c ++++ b/drivers/power/supply/bq27xxx_battery.c +@@ -1083,10 +1083,8 @@ static int poll_interval_param_set(const char *val, const struct kernel_param *k + return ret; + + mutex_lock(&bq27xxx_list_lock); +- list_for_each_entry(di, &bq27xxx_battery_devices, list) { +- cancel_delayed_work_sync(&di->work); +- schedule_delayed_work(&di->work, 0); +- } ++ list_for_each_entry(di, &bq27xxx_battery_devices, list) ++ mod_delayed_work(system_wq, &di->work, 0); + mutex_unlock(&bq27xxx_list_lock); + + return ret; +-- +2.39.2 + diff --git a/queue-6.1/power-supply-fix-logic-checking-if-system-is-running.patch b/queue-6.1/power-supply-fix-logic-checking-if-system-is-running.patch new file mode 100644 index 00000000000..bfd6a753631 --- /dev/null +++ b/queue-6.1/power-supply-fix-logic-checking-if-system-is-running.patch @@ -0,0 +1,66 @@ +From ee49926a848a25169285b92f412d074e67c93bdb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 May 2023 13:25:40 -0500 +Subject: power: supply: Fix logic checking if system is running from battery + +From: Mario Limonciello + +[ Upstream commit 95339f40a8b652b5b1773def31e63fc53c26378a ] + +The logic used for power_supply_is_system_supplied() counts all power +supplies and assumes that the system is running from AC if there is +either a non-battery power-supply reporting to be online or if no +power-supplies exist at all. + +The second rule is for desktop systems, that don't have any +battery/charger devices. These systems will incorrectly report to be +powered from battery once a device scope power-supply is registered +(e.g. a HID device), since these power-supplies increase the counter. + +Apart from HID devices, recent dGPUs provide UCSI power supplies on a +desktop systems. The dGPU by default doesn't have anything plugged in so +it's 'offline'. This makes power_supply_is_system_supplied() return 0 +with a count of 1 meaning all drivers that use this get a wrong judgement. + +To fix this case adjust the logic to also examine the scope of the power +supply. If the power supply is deemed a device power supply, then don't +count it. + +Cc: Evan Quan +Suggested-by: Lijo Lazar +Signed-off-by: Mario Limonciello +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +--- + drivers/power/supply/power_supply_core.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c +index 8382be867d274..7871ab5e979c0 100644 +--- a/drivers/power/supply/power_supply_core.c ++++ b/drivers/power/supply/power_supply_core.c +@@ -348,6 +348,10 @@ static int __power_supply_is_system_supplied(struct device *dev, void *data) + struct power_supply *psy = dev_get_drvdata(dev); + unsigned int *count = data; + ++ if (!psy->desc->get_property(psy, POWER_SUPPLY_PROP_SCOPE, &ret)) ++ if (ret.intval == POWER_SUPPLY_SCOPE_DEVICE) ++ return 0; ++ + (*count)++; + if (psy->desc->type != POWER_SUPPLY_TYPE_BATTERY) + if (!psy->desc->get_property(psy, POWER_SUPPLY_PROP_ONLINE, +@@ -366,8 +370,8 @@ int power_supply_is_system_supplied(void) + __power_supply_is_system_supplied); + + /* +- * If no power class device was found at all, most probably we are +- * running on a desktop system, so assume we are on mains power. ++ * If no system scope power class device was found at all, most probably we ++ * are running on a desktop system, so assume we are on mains power. + */ + if (count == 0) + return 1; +-- +2.39.2 + diff --git a/queue-6.1/power-supply-ratelimit-no-data-debug-output.patch b/queue-6.1/power-supply-ratelimit-no-data-debug-output.patch new file mode 100644 index 00000000000..e1a352bdabf --- /dev/null +++ b/queue-6.1/power-supply-ratelimit-no-data-debug-output.patch @@ -0,0 +1,43 @@ +From b591501e4993e279e31b79be9cecf3adbe0ff614 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 5 Mar 2023 21:52:26 +0100 +Subject: power: supply: Ratelimit no data debug output + +From: Marek Vasut + +[ Upstream commit 155c45a25679f571c2ae57d10db843a9dfc63430 ] + +Reduce the amount of output this dev_dbg() statement emits into logs, +otherwise if system software polls the sysfs entry for data and keeps +getting -ENODATA, it could end up filling the logs up. + +This does in fact make systemd journald choke, since during boot the +sysfs power supply entries are polled and if journald starts at the +same time, the journal is just being repeatedly filled up, and the +system stops on trying to start journald without booting any further. + +Signed-off-by: Marek Vasut +Reviewed-by: Hans de Goede +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +--- + drivers/power/supply/power_supply_sysfs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c +index 5369abaceb5cc..7abd916d005a6 100644 +--- a/drivers/power/supply/power_supply_sysfs.c ++++ b/drivers/power/supply/power_supply_sysfs.c +@@ -285,7 +285,8 @@ static ssize_t power_supply_show_property(struct device *dev, + + if (ret < 0) { + if (ret == -ENODATA) +- dev_dbg(dev, "driver has no data for `%s' property\n", ++ dev_dbg_ratelimited(dev, ++ "driver has no data for `%s' property\n", + attr->attr.name); + else if (ret != -ENODEV && ret != -EAGAIN) + dev_err_ratelimited(dev, +-- +2.39.2 + diff --git a/queue-6.1/power-supply-sc27xx-fix-external_power_changed-race.patch b/queue-6.1/power-supply-sc27xx-fix-external_power_changed-race.patch new file mode 100644 index 00000000000..9bcc30f275c --- /dev/null +++ b/queue-6.1/power-supply-sc27xx-fix-external_power_changed-race.patch @@ -0,0 +1,70 @@ +From 8717987cfb8a9d28fdc2560517817c82aa6367fe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Apr 2023 18:07:32 +0200 +Subject: power: supply: sc27xx: Fix external_power_changed race + +From: Hans de Goede + +[ Upstream commit 4d5c129d6c8993fe96e9ae712141eedcb9ca68c2 ] + +sc27xx_fgu_external_power_changed() dereferences data->battery, +which gets sets in ab8500_btemp_probe() like this: + + data->battery = devm_power_supply_register(dev, &sc27xx_fgu_desc, + &fgu_cfg); + +As soon as devm_power_supply_register() has called device_add() +the external_power_changed callback can get called. So there is a window +where sc27xx_fgu_external_power_changed() may get called while +data->battery has not been set yet leading to a NULL pointer dereference. + +Fixing this is easy. The external_power_changed callback gets passed +the power_supply which will eventually get stored in data->battery, +so sc27xx_fgu_external_power_changed() can simply directly use +the passed in psy argument which is always valid. + +After this change sc27xx_fgu_external_power_changed() is reduced to just +"power_supply_changed(psy);" and it has the same prototype. While at it +simply replace it with making the external_power_changed callback +directly point to power_supply_changed. + +Cc: Orson Zhai +Cc: Chunyan Zhang +Signed-off-by: Hans de Goede +Reviewed-by: Baolin Wang +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +--- + drivers/power/supply/sc27xx_fuel_gauge.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c +index 632977f84b954..bd23c4d9fed43 100644 +--- a/drivers/power/supply/sc27xx_fuel_gauge.c ++++ b/drivers/power/supply/sc27xx_fuel_gauge.c +@@ -733,13 +733,6 @@ static int sc27xx_fgu_set_property(struct power_supply *psy, + return ret; + } + +-static void sc27xx_fgu_external_power_changed(struct power_supply *psy) +-{ +- struct sc27xx_fgu_data *data = power_supply_get_drvdata(psy); +- +- power_supply_changed(data->battery); +-} +- + static int sc27xx_fgu_property_is_writeable(struct power_supply *psy, + enum power_supply_property psp) + { +@@ -774,7 +767,7 @@ static const struct power_supply_desc sc27xx_fgu_desc = { + .num_properties = ARRAY_SIZE(sc27xx_fgu_props), + .get_property = sc27xx_fgu_get_property, + .set_property = sc27xx_fgu_set_property, +- .external_power_changed = sc27xx_fgu_external_power_changed, ++ .external_power_changed = power_supply_changed, + .property_is_writeable = sc27xx_fgu_property_is_writeable, + .no_thermal = true, + }; +-- +2.39.2 + diff --git a/queue-6.1/regulator-fix-error-checking-for-debugfs_create_dir.patch b/queue-6.1/regulator-fix-error-checking-for-debugfs_create_dir.patch new file mode 100644 index 00000000000..8e0243cdce5 --- /dev/null +++ b/queue-6.1/regulator-fix-error-checking-for-debugfs_create_dir.patch @@ -0,0 +1,46 @@ +From 6fffa6602345db68ed1614aba26e80d39b3f0852 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 May 2023 22:29:38 +0500 +Subject: regulator: Fix error checking for debugfs_create_dir + +From: Osama Muhammad + +[ Upstream commit 2bf1c45be3b8f3a3f898d0756c1282f09719debd ] + +This patch fixes the error checking in core.c in debugfs_create_dir. +The correct way to check if an error occurred is 'IS_ERR' inline function. + +Signed-off-by: Osama Muhammad +--- + drivers/regulator/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c +index c417eae887b2d..e01cade8be0c7 100644 +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -5257,7 +5257,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) + } + + rdev->debugfs = debugfs_create_dir(rname, debugfs_root); +- if (!rdev->debugfs) { ++ if (IS_ERR(rdev->debugfs)) { + rdev_warn(rdev, "Failed to create debugfs directory\n"); + return; + } +@@ -6179,7 +6179,7 @@ static int __init regulator_init(void) + ret = class_register(®ulator_class); + + debugfs_root = debugfs_create_dir("regulator", NULL); +- if (!debugfs_root) ++ if (IS_ERR(debugfs_root)) + pr_warn("regulator: Failed to create debugfs directory\n"); + + #ifdef CONFIG_DEBUG_FS +-- +2.39.2 + diff --git a/queue-6.1/selftests-gpio-gpio-sim-fix-bug-test-failed-due-to-r.patch b/queue-6.1/selftests-gpio-gpio-sim-fix-bug-test-failed-due-to-r.patch new file mode 100644 index 00000000000..dfb02814e78 --- /dev/null +++ b/queue-6.1/selftests-gpio-gpio-sim-fix-bug-test-failed-due-to-r.patch @@ -0,0 +1,55 @@ +From 858c616c6cb4b132abbd1b01c6a2a40242c61f3f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 11 Apr 2023 20:15:20 +0300 +Subject: selftests: gpio: gpio-sim: Fix BUG: test FAILED due to recent change + +From: Mirsad Todorovac + +[ Upstream commit 976d3c6778e99390c6d854d140b746d12ea18a51 ] + +According to Mirsad the gpio-sim.sh test appears to FAIL in a wrong way +due to missing initialisation of shell variables: + + 4.2. Bias settings work correctly + cat: /sys/devices/platform/gpio-sim.0/gpiochip18/sim_gpio0/value: No such file or directory + ./gpio-sim.sh: line 393: test: =: unary operator expected + bias setting does not work + GPIO gpio-sim test FAIL + +After this change the test passed: + + 4.2. Bias settings work correctly + GPIO gpio-sim test PASS + +His testing environment is AlmaLinux 8.7 on Lenovo desktop box with +the latest Linux kernel based on v6.2: + + Linux 6.2.0-mglru-kmlk-andy-09238-gd2980d8d8265 x86_64 + +Suggested-by: Mirsad Todorovac +Signed-off-by: Andy Shevchenko +Tested-by: Mirsad Goran Todorovac +Signed-off-by: Mirsad Goran Todorovac +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/gpio/gpio-sim.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tools/testing/selftests/gpio/gpio-sim.sh b/tools/testing/selftests/gpio/gpio-sim.sh +index 341e3de008968..bf67b23ed29ac 100755 +--- a/tools/testing/selftests/gpio/gpio-sim.sh ++++ b/tools/testing/selftests/gpio/gpio-sim.sh +@@ -389,6 +389,9 @@ create_chip chip + create_bank chip bank + set_num_lines chip bank 8 + enable_chip chip ++DEVNAME=`configfs_dev_name chip` ++CHIPNAME=`configfs_chip_name chip bank` ++SYSFS_PATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio0/value" + $BASE_DIR/gpio-mockup-cdev -b pull-up /dev/`configfs_chip_name chip bank` 0 + test `cat $SYSFS_PATH` = "1" || fail "bias setting does not work" + remove_chip chip +-- +2.39.2 + diff --git a/queue-6.1/series b/queue-6.1/series index f439333d21b..9f5eed7dbbd 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -7,3 +7,36 @@ cgroup-fix-missing-cpus_read_-lock-unlock-in-cgroup_.patch qcom-llcc-edac-fix-the-base-address-used-for-accessi.patch edac-qcom-get-rid-of-hardcoded-register-offsets.patch ksmbd-validate-smb-request-protocol-id.patch +of-overlay-fix-missing-of_node_put-in-error-case-of-.patch +power-supply-ab8500-fix-external_power_changed-race.patch +power-supply-sc27xx-fix-external_power_changed-race.patch +power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch +arm-dts-vexpress-add-missing-cache-properties.patch +tools-gpio-fix-debounce_period_us-output-of-lsgpio.patch +selftests-gpio-gpio-sim-fix-bug-test-failed-due-to-r.patch +power-supply-ratelimit-no-data-debug-output.patch +pci-dpc-quirk-pio-log-size-for-intel-ice-lake-root-p.patch +platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch +regulator-fix-error-checking-for-debugfs_create_dir.patch +irqchip-gic-v3-disable-pseudo-nmis-on-mediatek-devic.patch +irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch +power-supply-fix-logic-checking-if-system-is-running.patch +drm-panel-orientation-quirks-change-air-s-quirk-to-s.patch +btrfs-scrub-try-harder-to-mark-raid56-block-groups-r.patch +btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch +asoc-soc-pcm-test-if-a-be-can-be-prepared.patch +asoc-intel-avs-account-for-uid-of-acpi-device.patch +asoc-intel-avs-add-missing-checks-on-fe-startup.patch +parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch +parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch +mips-unhide-pata_platform.patch +mips-restore-au1300-support.patch +mips-alchemy-fix-dbdma2.patch +mips-move-initrd_start-check-after-initrd-address-sa.patch +asoc-cs35l41-fix-default-regmap-values-for-some-regi.patch +asoc-dwc-move-dma-init-to-snd_soc_dai_driver-probe.patch +xen-blkfront-only-check-req_fua-for-writes.patch +drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch +io_uring-unlock-sqd-lock-before-sq-thread-release-cp.patch +nvme-add-maxio-1602-to-bogus-nid-list.patch +irqchip-gic-correctly-validate-of-quirk-descriptors.patch diff --git a/queue-6.1/tools-gpio-fix-debounce_period_us-output-of-lsgpio.patch b/queue-6.1/tools-gpio-fix-debounce_period_us-output-of-lsgpio.patch new file mode 100644 index 00000000000..d1542b871ff --- /dev/null +++ b/queue-6.1/tools-gpio-fix-debounce_period_us-output-of-lsgpio.patch @@ -0,0 +1,37 @@ +From e6c0e7c6924a9c9168c65028487c7478b52a95e4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 May 2023 15:18:48 +0200 +Subject: tools: gpio: fix debounce_period_us output of lsgpio + +From: Milo Spadacini + +[ Upstream commit eb4b8eca1bad98f4b8574558a74f041f9acb5a54 ] + +Fix incorrect output that could occur when more attributes are used and +GPIO_V2_LINE_ATTR_ID_DEBOUNCE is not the first one. + +Signed-off-by: Milo Spadacini +Reviewed-by: Linus Walleij +Reviewed-by: Andy Shevchenko +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + tools/gpio/lsgpio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/gpio/lsgpio.c b/tools/gpio/lsgpio.c +index c61d061247e17..52a0be45410c9 100644 +--- a/tools/gpio/lsgpio.c ++++ b/tools/gpio/lsgpio.c +@@ -94,7 +94,7 @@ static void print_attributes(struct gpio_v2_line_info *info) + for (i = 0; i < info->num_attrs; i++) { + if (info->attrs[i].id == GPIO_V2_LINE_ATTR_ID_DEBOUNCE) + fprintf(stdout, ", debounce_period=%dusec", +- info->attrs[0].debounce_period_us); ++ info->attrs[i].debounce_period_us); + } + } + +-- +2.39.2 + diff --git a/queue-6.1/xen-blkfront-only-check-req_fua-for-writes.patch b/queue-6.1/xen-blkfront-only-check-req_fua-for-writes.patch new file mode 100644 index 00000000000..f5f19a6da7c --- /dev/null +++ b/queue-6.1/xen-blkfront-only-check-req_fua-for-writes.patch @@ -0,0 +1,45 @@ +From de75fac6af523cbd01c4d0f1acf907f5a103bfcd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 26 Apr 2023 17:40:05 +0100 +Subject: xen/blkfront: Only check REQ_FUA for writes + +From: Ross Lagerwall + +[ Upstream commit b6ebaa8100090092aa602530d7e8316816d0c98d ] + +The existing code silently converts read operations with the +REQ_FUA bit set into write-barrier operations. This results in data +loss as the backend scribbles zeroes over the data instead of returning +it. + +While the REQ_FUA bit doesn't make sense on a read operation, at least +one well-known out-of-tree kernel module does set it and since it +results in data loss, let's be safe here and only look at REQ_FUA for +writes. + +Signed-off-by: Ross Lagerwall +Acked-by: Juergen Gross +Link: https://lore.kernel.org/r/20230426164005.2213139-1-ross.lagerwall@citrix.com +Signed-off-by: Juergen Gross +Signed-off-by: Sasha Levin +--- + drivers/block/xen-blkfront.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c +index 35b9bcad9db90..5ddf393aa390f 100644 +--- a/drivers/block/xen-blkfront.c ++++ b/drivers/block/xen-blkfront.c +@@ -780,7 +780,8 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri + ring_req->u.rw.handle = info->handle; + ring_req->operation = rq_data_dir(req) ? + BLKIF_OP_WRITE : BLKIF_OP_READ; +- if (req_op(req) == REQ_OP_FLUSH || req->cmd_flags & REQ_FUA) { ++ if (req_op(req) == REQ_OP_FLUSH || ++ (req_op(req) == REQ_OP_WRITE && (req->cmd_flags & REQ_FUA))) { + /* + * Ideally we can do an unordered flush-to-disk. + * In case the backend onlysupports barriers, use that. +-- +2.39.2 + -- 2.47.2