From fc1d3e7716b3bd849a7810c0ee6ee01693870d4a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 12 Jun 2024 17:28:46 +0200 Subject: [PATCH] 5.4-stable patches added patches: acpi-resource-do-irq-override-on-tongfang-gxxhrxx-and-gmxhgxx.patch arm64-tegra-correct-tegra132-i2c-alias.patch ata-pata_legacy-make-legacy_exit-work-again.patch md-raid5-fix-deadlock-that-raid5d-wait-for-itself-to-clear-md_sb_change_pending.patch --- ...ride-on-tongfang-gxxhrxx-and-gmxhgxx.patch | 41 +++++++++ ...m64-tegra-correct-tegra132-i2c-alias.patch | 50 +++++++++++ ...a_legacy-make-legacy_exit-work-again.patch | 52 +++++++++++ ...itself-to-clear-md_sb_change_pending.patch | 86 +++++++++++++++++++ queue-5.4/series | 4 + 5 files changed, 233 insertions(+) create mode 100644 queue-5.4/acpi-resource-do-irq-override-on-tongfang-gxxhrxx-and-gmxhgxx.patch create mode 100644 queue-5.4/arm64-tegra-correct-tegra132-i2c-alias.patch create mode 100644 queue-5.4/ata-pata_legacy-make-legacy_exit-work-again.patch create mode 100644 queue-5.4/md-raid5-fix-deadlock-that-raid5d-wait-for-itself-to-clear-md_sb_change_pending.patch diff --git a/queue-5.4/acpi-resource-do-irq-override-on-tongfang-gxxhrxx-and-gmxhgxx.patch b/queue-5.4/acpi-resource-do-irq-override-on-tongfang-gxxhrxx-and-gmxhgxx.patch new file mode 100644 index 00000000000..8d18ab8dd48 --- /dev/null +++ b/queue-5.4/acpi-resource-do-irq-override-on-tongfang-gxxhrxx-and-gmxhgxx.patch @@ -0,0 +1,41 @@ +From c81bf14f9db68311c2e75428eea070d97d603975 Mon Sep 17 00:00:00 2001 +From: Christoffer Sandberg +Date: Mon, 22 Apr 2024 10:04:36 +0200 +Subject: ACPI: resource: Do IRQ override on TongFang GXxHRXx and GMxHGxx + +From: Christoffer Sandberg + +commit c81bf14f9db68311c2e75428eea070d97d603975 upstream. + +Listed devices need the override for the keyboard to work. + +Signed-off-by: Christoffer Sandberg +Signed-off-by: Werner Sembach +Cc: All applicable +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/resource.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -475,6 +475,18 @@ static const struct dmi_system_id asus_l + DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"), + }, + }, ++ { ++ /* TongFang GXxHRXx/TUXEDO InfinityBook Pro Gen9 AMD */ ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "GXxHRXx"), ++ }, ++ }, ++ { ++ /* TongFang GMxHGxx/TUXEDO Stellaris Slim Gen1 AMD */ ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"), ++ }, ++ }, + { } + }; + diff --git a/queue-5.4/arm64-tegra-correct-tegra132-i2c-alias.patch b/queue-5.4/arm64-tegra-correct-tegra132-i2c-alias.patch new file mode 100644 index 00000000000..79528ce9b99 --- /dev/null +++ b/queue-5.4/arm64-tegra-correct-tegra132-i2c-alias.patch @@ -0,0 +1,50 @@ +From 2633c58e1354d7de2c8e7be8bdb6f68a0a01bad7 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 1 Apr 2024 16:08:54 +0200 +Subject: arm64: tegra: Correct Tegra132 I2C alias + +From: Krzysztof Kozlowski + +commit 2633c58e1354d7de2c8e7be8bdb6f68a0a01bad7 upstream. + +There is no such device as "as3722@40", because its name is "pmic". Use +phandles for aliases to fix relying on full node path. This corrects +aliases for RTC devices and also fixes dtc W=1 warning: + + tegra132-norrin.dts:12.3-36: Warning (alias_paths): /aliases:rtc0: aliases property is not a valid node (/i2c@7000d000/as3722@40) + +Fixes: 0f279ebdf3ce ("arm64: tegra: Add NVIDIA Tegra132 Norrin support") +Cc: stable@vger.kernel.org +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Jon Hunter +Signed-off-by: Thierry Reding +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/nvidia/tegra132-norrin.dts | 4 ++-- + arch/arm64/boot/dts/nvidia/tegra132.dtsi | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts ++++ b/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts +@@ -9,8 +9,8 @@ + compatible = "nvidia,norrin", "nvidia,tegra132", "nvidia,tegra124"; + + aliases { +- rtc0 = "/i2c@7000d000/as3722@40"; +- rtc1 = "/rtc@7000e000"; ++ rtc0 = &as3722; ++ rtc1 = &tegra_rtc; + serial0 = &uarta; + }; + +--- a/arch/arm64/boot/dts/nvidia/tegra132.dtsi ++++ b/arch/arm64/boot/dts/nvidia/tegra132.dtsi +@@ -569,7 +569,7 @@ + status = "disabled"; + }; + +- rtc@7000e000 { ++ tegra_rtc: rtc@7000e000 { + compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc"; + reg = <0x0 0x7000e000 0x0 0x100>; + interrupts = ; diff --git a/queue-5.4/ata-pata_legacy-make-legacy_exit-work-again.patch b/queue-5.4/ata-pata_legacy-make-legacy_exit-work-again.patch new file mode 100644 index 00000000000..8ed2d88640c --- /dev/null +++ b/queue-5.4/ata-pata_legacy-make-legacy_exit-work-again.patch @@ -0,0 +1,52 @@ +From d4a89339f17c87c4990070e9116462d16e75894f Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Sat, 4 May 2024 23:27:25 +0300 +Subject: ata: pata_legacy: make legacy_exit() work again + +From: Sergey Shtylyov + +commit d4a89339f17c87c4990070e9116462d16e75894f upstream. + +Commit defc9cd826e4 ("pata_legacy: resychronize with upstream changes and +resubmit") missed to update legacy_exit(), so that it now fails to do any +cleanup -- the loop body there can never be entered. Fix that and finally +remove now useless nr_legacy_host variable... + +Found by Linux Verification Center (linuxtesting.org) with the Svace static +analysis tool. + +Fixes: defc9cd826e4 ("pata_legacy: resychronize with upstream changes and resubmit") +Cc: stable@vger.kernel.org +Signed-off-by: Sergey Shtylyov +Reviewed-by: Niklas Cassel +Signed-off-by: Damien Le Moal +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/pata_legacy.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/ata/pata_legacy.c ++++ b/drivers/ata/pata_legacy.c +@@ -114,8 +114,6 @@ static int legacy_port[NR_HOST] = { 0x1f + static struct legacy_probe probe_list[NR_HOST]; + static struct legacy_data legacy_data[NR_HOST]; + static struct ata_host *legacy_host[NR_HOST]; +-static int nr_legacy_host; +- + + static int probe_all; /* Set to check all ISA port ranges */ + static int ht6560a; /* HT 6560A on primary 1, second 2, both 3 */ +@@ -1239,9 +1237,11 @@ static __exit void legacy_exit(void) + { + int i; + +- for (i = 0; i < nr_legacy_host; i++) { ++ for (i = 0; i < NR_HOST; i++) { + struct legacy_data *ld = &legacy_data[i]; +- ata_host_detach(legacy_host[i]); ++ ++ if (legacy_host[i]) ++ ata_host_detach(legacy_host[i]); + platform_device_unregister(ld->platform_dev); + } + } diff --git a/queue-5.4/md-raid5-fix-deadlock-that-raid5d-wait-for-itself-to-clear-md_sb_change_pending.patch b/queue-5.4/md-raid5-fix-deadlock-that-raid5d-wait-for-itself-to-clear-md_sb_change_pending.patch new file mode 100644 index 00000000000..c5903ef6379 --- /dev/null +++ b/queue-5.4/md-raid5-fix-deadlock-that-raid5d-wait-for-itself-to-clear-md_sb_change_pending.patch @@ -0,0 +1,86 @@ +From 151f66bb618d1fd0eeb84acb61b4a9fa5d8bb0fa Mon Sep 17 00:00:00 2001 +From: Yu Kuai +Date: Fri, 22 Mar 2024 16:10:05 +0800 +Subject: md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING + +From: Yu Kuai + +commit 151f66bb618d1fd0eeb84acb61b4a9fa5d8bb0fa upstream. + +Xiao reported that lvm2 test lvconvert-raid-takeover.sh can hang with +small possibility, the root cause is exactly the same as commit +bed9e27baf52 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"") + +However, Dan reported another hang after that, and junxiao investigated +the problem and found out that this is caused by plugged bio can't issue +from raid5d(). + +Current implementation in raid5d() has a weird dependence: + +1) md_check_recovery() from raid5d() must hold 'reconfig_mutex' to clear + MD_SB_CHANGE_PENDING; +2) raid5d() handles IO in a deadloop, until all IO are issued; +3) IO from raid5d() must wait for MD_SB_CHANGE_PENDING to be cleared; + +This behaviour is introduce before v2.6, and for consequence, if other +context hold 'reconfig_mutex', and md_check_recovery() can't update +super_block, then raid5d() will waste one cpu 100% by the deadloop, until +'reconfig_mutex' is released. + +Refer to the implementation from raid1 and raid10, fix this problem by +skipping issue IO if MD_SB_CHANGE_PENDING is still set after +md_check_recovery(), daemon thread will be woken up when 'reconfig_mutex' +is released. Meanwhile, the hang problem will be fixed as well. + +Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") +Cc: stable@vger.kernel.org # v5.19+ +Reported-and-tested-by: Dan Moulding +Closes: https://lore.kernel.org/all/20240123005700.9302-1-dan@danm.net/ +Investigated-by: Junxiao Bi +Signed-off-by: Yu Kuai +Link: https://lore.kernel.org/r/20240322081005.1112401-1-yukuai1@huaweicloud.com +Signed-off-by: Song Liu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid5.c | 15 +++------------ + 1 file changed, 3 insertions(+), 12 deletions(-) + +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -36,7 +36,6 @@ + */ + + #include +-#include + #include + #include + #include +@@ -6299,6 +6298,9 @@ static void raid5d(struct md_thread *thr + int batch_size, released; + unsigned int offset; + ++ if (test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags)) ++ break; ++ + released = release_stripe_list(conf, conf->temp_inactive_list); + if (released) + clear_bit(R5_DID_ALLOC, &conf->cache_state); +@@ -6335,18 +6337,7 @@ static void raid5d(struct md_thread *thr + spin_unlock_irq(&conf->device_lock); + md_check_recovery(mddev); + spin_lock_irq(&conf->device_lock); +- +- /* +- * Waiting on MD_SB_CHANGE_PENDING below may deadlock +- * seeing md_check_recovery() is needed to clear +- * the flag when using mdmon. +- */ +- continue; + } +- +- wait_event_lock_irq(mddev->sb_wait, +- !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags), +- conf->device_lock); + } + pr_debug("%d stripes handled\n", handled); + diff --git a/queue-5.4/series b/queue-5.4/series index e463c3285e9..22ee1e48b4a 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -172,3 +172,7 @@ x86-mm-remove-broken-vsyscall-emulation-code-from-the-page-fault-code.patch f2fs-fix-to-do-sanity-check-on-i_xattr_nid-in-sanity_check_inode.patch media-lgdt3306a-add-a-check-against-null-pointer-def.patch drm-amdgpu-add-error-handle-to-avoid-out-of-bounds.patch +ata-pata_legacy-make-legacy_exit-work-again.patch +acpi-resource-do-irq-override-on-tongfang-gxxhrxx-and-gmxhgxx.patch +arm64-tegra-correct-tegra132-i2c-alias.patch +md-raid5-fix-deadlock-that-raid5d-wait-for-itself-to-clear-md_sb_change_pending.patch -- 2.47.3