From d10168ea39f108f70d1d56a1981ec61c7c40f7d7 Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Nov 22 2021 12:29:04 +0000 Subject: Merge remote-tracking branch 'origin/SLE15-SP2' into SLE15-SP3 Conflicts: blacklist.conf config/arm64/default config/ppc64le/default config/s390x/default config/s390x/zfcpdump config/x86_64/default patches.suse/bpf-Add-kconfig-knob-for-disabling-unpriv-bpf-by-def.patch patches.suse/bpf-Disallow-unprivileged-bpf-by-default.patch patches.suse/zram-avoid-race-between-zram_remove-and-disksize_sto.patch patches.suse/zram-don-t-fail-to-remove-zram-during-unloading-modu.patch patches.suse/zram-fix-race-between-zram_reset_device-and-disksize.patch patches.suse/zram-replace-fsync_bdev-with-sync_blockdev.patch series.conf --- diff --git a/blacklist.conf b/blacklist.conf index 8f0f10d..751cd2b 100644 --- a/blacklist.conf +++ b/blacklist.conf @@ -1075,6 +1075,7 @@ c98a76eabbb6e7755f3d4a4c33f8fe869dda6383 # The bug fixed was not backported 8749efc0c0c325bf0c948c0b11d77bd3e497ead5 # printk: just a preparation step for lockless ringbuffer. 0f7636e1654338c34e3c220c02b2ffad78b6ccc0 # printk: cosmetic; documentation 89ccf18f032f26946e2ea6258120472eec6aa745 # printk: not critical; allow to use the full buffer when using log dumpers +57116ce17b04fde2fe30f0859df69d8dbe5809f6 # printk/workqueue: very hard to hit; works well with lockless ringuffer; but it might cause wrong timestamps or even lost messages on 5.3 where using par-CPU buffers 7359608a271ce81803de148befefd309baf88c76 # CONFIG_GDB_SCRIPTS is not enabled for any config 7619517598ad5ba04beb855cde6558e72c73dbb5 # dup of fde9f39ac7f1ffd799a96ffa1e06b2051f0898f1 fd944dc24336922656a48f4608bfb41abdcdc4aa # ksz8795 is not in 5.3 yet @@ -1381,3 +1382,10 @@ c1367ee016e3550745315fb9a2dd1e4ce02cdcf6 # build warning only b7a0a792f864583207c593b50fd1b752ed89f4c1 # xhci: reverted by stable-5.4.x 049849492b77aa0df7f7130f1d522f3553c4084b # xhci: reverting the above 5c9d706f61336d9f7f285df64c734af778c70f39 # requires 30897832d8b97e93833fb52c0a02951db3692ed2 "bpf: Allow local storage to be used from LSM programs", which is not backported +c57fe0037a4e3863d9b740f8c14df9c51ac31aa1 # net: mscc: Unmet dependencies +52849bcf0029ccc553be304e4f804938a39112e2 # net: mscc: Unmet dependencies +fba01283d85a09e0e2ef552c6e764b903111d90a # net: mscc: Unmet dependencies +ebb4c6a990f786d7e0e4618a0d3766cd660125d8 # net: mscc: Unmet dependencies +c1a3d4067309451e68c33dbd356032549cc0bd8e # changes device names, kABI massacre +8520e224f547cd070c7c8f97b1fc6d58cff7ccaa # kABI breaker, see also bsc#1191279 +04f8ef5643bcd8bcde25dfdebef998aea480b2ba # irrelevant without 2b0d3d3e4fcf, rare leak diff --git a/config/arm64/default b/config/arm64/default index 7d45083..0992cee 100644 --- a/config/arm64/default +++ b/config/arm64/default @@ -227,6 +227,9 @@ CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set CONFIG_KALLSYMS_BASE_RELATIVE=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_JIT_ALWAYS_ON=y +CONFIG_BPF_UNPRIV_DEFAULT_OFF=y CONFIG_USERFAULTFD=y CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y CONFIG_RSEQ=y diff --git a/config/ppc64le/default b/config/ppc64le/default index 1e623ee..7c4de3c 100644 --- a/config/ppc64le/default +++ b/config/ppc64le/default @@ -221,6 +221,9 @@ CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set CONFIG_KALLSYMS_BASE_RELATIVE=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_JIT_ALWAYS_ON=y +CONFIG_BPF_UNPRIV_DEFAULT_OFF=y CONFIG_USERFAULTFD=y CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS=y CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y diff --git a/config/s390x/default b/config/s390x/default index 15691f1..8080d9d 100644 --- a/config/s390x/default +++ b/config/s390x/default @@ -215,6 +215,9 @@ CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set CONFIG_KALLSYMS_BASE_RELATIVE=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_JIT_ALWAYS_ON=y +CONFIG_BPF_UNPRIV_DEFAULT_OFF=y CONFIG_USERFAULTFD=y CONFIG_RSEQ=y # CONFIG_DEBUG_RSEQ is not set diff --git a/config/s390x/zfcpdump b/config/s390x/zfcpdump index ae8c0b8..5e36857 100644 --- a/config/s390x/zfcpdump +++ b/config/s390x/zfcpdump @@ -171,6 +171,8 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set CONFIG_KALLSYMS_BASE_RELATIVE=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_UNPRIV_DEFAULT_OFF=y CONFIG_USERFAULTFD=y CONFIG_RSEQ=y # CONFIG_DEBUG_RSEQ is not set diff --git a/config/x86_64/default b/config/x86_64/default index 304877c..0964287 100644 --- a/config/x86_64/default +++ b/config/x86_64/default @@ -245,6 +245,9 @@ CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y CONFIG_KALLSYMS_BASE_RELATIVE=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_JIT_ALWAYS_ON=y +CONFIG_BPF_UNPRIV_DEFAULT_OFF=y CONFIG_USERFAULTFD=y CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y CONFIG_RSEQ=y diff --git a/patches.kabi/kabi-fix-after-kvm-vcpu-id-array-fix.patch b/patches.kabi/kabi-fix-after-kvm-vcpu-id-array-fix.patch deleted file mode 100644 index 9e27c90..0000000 --- a/patches.kabi/kabi-fix-after-kvm-vcpu-id-array-fix.patch +++ /dev/null @@ -1,45 +0,0 @@ -Patch-mainline: Never, kABI fix -References: git-fixes -From: Juergen Gross -Date: Thu, 1 Jul 2021 17:41:00 +0200 -Subject: [PATCH] kABI: Fix kABI after fixing vcpu-id indexed arrays - -Fix kABI after fixing the array sizes of arrays indexed by vcpu-id. -Fortunately the size today being KVM_MAX_VCPU_ID (with an odd value -of that macro) means, that there is always enough padding space in the -arrays for the correct value KVM_MAX_VCPU_ID+1. - -Signed-off-by: Juergen Gross ---- - arch/x86/kvm/ioapic.h | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h -index 660401700075..11e4065e1617 100644 ---- a/arch/x86/kvm/ioapic.h -+++ b/arch/x86/kvm/ioapic.h -@@ -43,13 +43,21 @@ struct kvm_vcpu; - - struct dest_map { - /* vcpu bitmap where IRQ has been sent */ -+#ifdef __GENKSYMS__ -+ DECLARE_BITMAP(map, KVM_MAX_VCPU_ID); -+#else - DECLARE_BITMAP(map, KVM_MAX_VCPU_ID + 1); -+#endif - - /* - * Vector sent to a given vcpu, only valid when - * the vcpu's bit in map is set - */ -+#ifdef __GENKSYMS__ -+ u8 vectors[KVM_MAX_VCPU_ID]; -+#else - u8 vectors[KVM_MAX_VCPU_ID + 1]; -+#endif - }; - - --- -2.26.2 - diff --git a/patches.suse/Input-elantench-fix-misreporting-trackpoint-coordina.patch b/patches.suse/Input-elantench-fix-misreporting-trackpoint-coordina.patch new file mode 100644 index 0000000..86a2247 --- /dev/null +++ b/patches.suse/Input-elantench-fix-misreporting-trackpoint-coordina.patch @@ -0,0 +1,50 @@ +From be896bd3b72b44126c55768f14c22a8729b0992e Mon Sep 17 00:00:00 2001 +From: Phoenix Huang +Date: Sun, 7 Nov 2021 22:00:03 -0800 +Subject: [PATCH] Input: elantench - fix misreporting trackpoint coordinates +Git-commit: be896bd3b72b44126c55768f14c22a8729b0992e +Patch-mainline: v5.16-rc1 +References: bsc#1192918 + +Some firmwares occasionally report bogus data from trackpoint, with X or Y +displacement being too large (outside of [-127, 127] range). Let's drop such +packets so that we do not generate jumps. + +Signed-off-by: Phoenix Huang +Tested-by: Yufei Du +Link: https://lore.kernel.org/r/20210729010940.5752-1-phoenix@emc.com.tw +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov +Acked-by: Takashi Iwai + +--- + drivers/input/mouse/elantech.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c +index 2d0bc029619f..956d9cd34796 100644 +--- a/drivers/input/mouse/elantech.c ++++ b/drivers/input/mouse/elantech.c +@@ -517,6 +517,19 @@ static void elantech_report_trackpoint(struct psmouse *psmouse, + case 0x16008020U: + case 0x26800010U: + case 0x36808000U: ++ ++ /* ++ * This firmware misreport coordinates for trackpoint ++ * occasionally. Discard packets outside of [-127, 127] range ++ * to prevent cursor jumps. ++ */ ++ if (packet[4] == 0x80 || packet[5] == 0x80 || ++ packet[1] >> 7 == packet[4] >> 7 || ++ packet[2] >> 7 == packet[5] >> 7) { ++ elantech_debug("discarding packet [%6ph]\n", packet); ++ break; ++ ++ } + x = packet[4] - (int)((packet[1]^0x80) << 1); + y = (int)((packet[2]^0x80) << 1) - packet[5]; + +-- +2.26.2 + diff --git a/patches.suse/Revert-r8152-adjust-the-settings-about-MAC-clock-spe.patch b/patches.suse/Revert-r8152-adjust-the-settings-about-MAC-clock-spe.patch new file mode 100644 index 0000000..de64ac5 --- /dev/null +++ b/patches.suse/Revert-r8152-adjust-the-settings-about-MAC-clock-spe.patch @@ -0,0 +1,106 @@ +From 4b5dc1a94d4f92b5845e98bd9ae344b26d933aad Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 3 Mar 2021 16:39:47 +0800 +Subject: [PATCH] Revert "r8152: adjust the settings about MAC clock speed down + for RTL8153" +Git-commit: 4b5dc1a94d4f92b5845e98bd9ae344b26d933aad +References: git-fixes +Patch-mainline: v5.12-rc3 + +This reverts commit 134f98bcf1b898fb9d6f2b91bc85dd2e5478b4b8. + +The r8153_mac_clk_spd() is used for RTL8153A only, because the register +table of RTL8153B is different from RTL8153A. However, this function would +be called when RTL8153B calls r8153_first_init() and r8153_enter_oob(). +That causes RTL8153B becomes unstable when suspending and resuming. The +worst case may let the device stop working. + +Besides, revert this commit to disable MAC clock speed down for RTL8153A. +It would avoid the known issue when enabling U1. The data of the first +control transfer may be wrong when exiting U1. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 35 ++++++----------------------------- + 1 file changed, 6 insertions(+), 29 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -2746,29 +2746,6 @@ static void __rtl_set_wol(struct r8152 * + device_set_wakeup_enable(&tp->udev->dev, false); + } + +-static void r8153_mac_clk_spd(struct r8152 *tp, bool enable) +-{ +- /* MAC clock speed down */ +- if (enable) { +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, +- ALDPS_SPDWN_RATIO); +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, +- EEE_SPDWN_RATIO); +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, +- PKT_AVAIL_SPDWN_EN | SUSPEND_SPDWN_EN | +- U1U2_SPDWN_EN | L1_SPDWN_EN); +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, +- PWRSAVE_SPDWN_EN | RXDV_SPDWN_EN | TX10MIDLE_EN | +- TP100_SPDWN_EN | TP500_SPDWN_EN | EEE_SPDWN_EN | +- TP1000_SPDWN_EN); +- } else { +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0); +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0); +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0); +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0); +- } +-} +- + static void r8153_u1u2en(struct r8152 *tp, bool enable) + { + u8 u1u2[8]; +@@ -3004,11 +2981,9 @@ static void rtl8153_runtime_enable(struc + if (enable) { + r8153_u1u2en(tp, false); + r8153_u2p3en(tp, false); +- r8153_mac_clk_spd(tp, true); + rtl_runtime_suspend_enable(tp, true); + } else { + rtl_runtime_suspend_enable(tp, false); +- r8153_mac_clk_spd(tp, false); + + switch (tp->version) { + case RTL_VER_03: +@@ -3603,7 +3578,6 @@ static void r8153_first_init(struct r815 + u32 ocp_data; + int i; + +- r8153_mac_clk_spd(tp, false); + rxdy_gated_en(tp, true); + r8153_teredo_off(tp); + +@@ -3665,8 +3639,6 @@ static void r8153_enter_oob(struct r8152 + u32 ocp_data; + int i; + +- r8153_mac_clk_spd(tp, true); +- + ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); + ocp_data &= ~NOW_IS_OOB; + ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data); +@@ -4378,10 +4350,15 @@ static void r8153_init(struct r8152 *tp) + + ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001); + ++ /* MAC clock speed down */ ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0); ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0); ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0); ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0); ++ + r8153_power_cut_en(tp, false); + rtl_runtime_suspend_enable(tp, false); + r8153_u1u2en(tp, true); +- r8153_mac_clk_spd(tp, false); + usb_enable_lpm(tp->udev); + + ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CONFIG6); diff --git a/patches.suse/Revert-scsi-ufs-fix-a-missing-check-of-devm_reset_control_get b/patches.suse/Revert-scsi-ufs-fix-a-missing-check-of-devm_reset_control_get new file mode 100644 index 0000000..52746ad --- /dev/null +++ b/patches.suse/Revert-scsi-ufs-fix-a-missing-check-of-devm_reset_control_get @@ -0,0 +1,49 @@ +From: Greg Kroah-Hartman +Date: Mon, 3 May 2021 13:56:57 +0200 +Subject: Revert "scsi: ufs: fix a missing check of devm_reset_control_get" +Git-commit: 4d427b408c4c2ff1676966c72119a3a559f8e39b +Patch-mainline: v5.13-rc3 +References: git-fixes + +This reverts commit 63a06181d7ce169d09843645c50fea1901bc9f0a. + +Because of recent interactions with developers from @umn.edu, all +commits from them have been recently re-reviewed to ensure if they were +correct or not. + +Upon review, this commit was found to be incorrect for the reasons +below, so it must be reverted. It will be fixed up "correctly" in a +later kernel change. + +The original commit is incorrect, it does not properly clean up on the +error path, so I'll keep the revert and fix it up properly with a +follow-on patch. + +Cc: Kangjie Lu +Cc: Avri Altman +Cc: Martin K. Petersen +Fixes: 63a06181d7ce ("scsi: ufs: fix a missing check of devm_reset_control_get") +Cc: stable +Link: https://lore.kernel.org/r/20210503115736.2104747-31-gregkh@linuxfoundation.org +Signed-off-by: Greg Kroah-Hartman +Acked-by: Lee Duncan +--- + drivers/scsi/ufs/ufs-hisi.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c +index 0aa58131e791..7d1e07a9d9dd 100644 +--- a/drivers/scsi/ufs/ufs-hisi.c ++++ b/drivers/scsi/ufs/ufs-hisi.c +@@ -468,10 +468,6 @@ static int ufs_hisi_init_common(struct ufs_hba *hba) + ufshcd_set_variant(hba, host); + + host->rst = devm_reset_control_get(dev, "rst"); +- if (IS_ERR(host->rst)) { +- dev_err(dev, "%s: failed to get reset control\n", __func__); +- return PTR_ERR(host->rst); +- } + + ufs_hisi_set_pm_lvl(hba); + + diff --git a/patches.suse/Revert-x86-kvm-fix-vcpu-id-indexed-array-sizes.patch b/patches.suse/Revert-x86-kvm-fix-vcpu-id-indexed-array-sizes.patch new file mode 100644 index 0000000..6638668 --- /dev/null +++ b/patches.suse/Revert-x86-kvm-fix-vcpu-id-indexed-array-sizes.patch @@ -0,0 +1,59 @@ +Patch-mainline: v5.16-rc1 +Git-commit: 1e254d0d86a0f2efd4190a89d5204b37c18c6381 +References: git-fixes +From: Juergen Gross +Date: Mon, 13 Sep 2021 15:57:43 +0200 +Subject: [PATCH] Revert "x86/kvm: fix vcpu-id indexed array sizes" + +This reverts commit 76b4f357d0e7d8f6f0013c733e6cba1773c266d3. + +The commit has the wrong reasoning, as KVM_MAX_VCPU_ID is not defining the +maximum allowed vcpu-id as its name suggests, but the number of vcpu-ids. +So revert this patch again. + +Suggested-by: Eduardo Habkost +Signed-off-by: Juergen Gross +Signed-off-by: Paolo Bonzini +Message-Id: <20210913135745.13944-2-jgross@suse.com> +Signed-off-by: Paolo Bonzini +--- + arch/x86/kvm/ioapic.c | 2 +- + arch/x86/kvm/ioapic.h | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c +index 8c065da73f8e..4e0f52660842 100644 +--- a/arch/x86/kvm/ioapic.c ++++ b/arch/x86/kvm/ioapic.c +@@ -96,7 +96,7 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic, + static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic) + { + ioapic->rtc_status.pending_eoi = 0; +- bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID + 1); ++ bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID); + } + + static void kvm_rtc_eoi_tracking_restore_all(struct kvm_ioapic *ioapic); +diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h +index bbd4a5d18b5d..27e61ff3ac3e 100644 +--- a/arch/x86/kvm/ioapic.h ++++ b/arch/x86/kvm/ioapic.h +@@ -39,13 +39,13 @@ struct kvm_vcpu; + + struct dest_map { + /* vcpu bitmap where IRQ has been sent */ +- DECLARE_BITMAP(map, KVM_MAX_VCPU_ID + 1); ++ DECLARE_BITMAP(map, KVM_MAX_VCPU_ID); + + /* + * Vector sent to a given vcpu, only valid when + * the vcpu's bit in map is set + */ +- u8 vectors[KVM_MAX_VCPU_ID + 1]; ++ u8 vectors[KVM_MAX_VCPU_ID]; + }; + + +-- +2.26.2 + diff --git a/patches.suse/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch b/patches.suse/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch index 86fb2f9..cff99d1 100644 --- a/patches.suse/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch +++ b/patches.suse/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch @@ -1,6 +1,6 @@ From: Thomas Renninger Subject: Introduce acpi_root_table=rsdt boot param and dmi list to force rsdt -Patch-mainline: No, +Patch-mainline: Not yet, References: http://bugzilla.kernel.org/show_bug.cgi?id=8246 This one is part of a patch series: diff --git a/patches.suse/btrfs-block-group-Rework-documentation-of-check_syst.patch b/patches.suse/btrfs-block-group-Rework-documentation-of-check_syst.patch new file mode 100644 index 0000000..c91bed9 --- /dev/null +++ b/patches.suse/btrfs-block-group-Rework-documentation-of-check_syst.patch @@ -0,0 +1,42 @@ +From: Marcos Paulo de Souza +Date: Mon, 7 Oct 2019 21:50:38 -0300 +Git-commit: a9143bd31c6ab52f6a320a1a4254f2a2934610b1 +Patch-mainline: v5.5-rc1 +References: bsc#1192896 +Subject: [PATCH] btrfs: block-group: Rework documentation of + check_system_chunk function + +Commit 4617ea3a52cf (" Btrfs: fix necessary chunk tree space calculation +when allocating a chunk") removed the is_allocation argument from +check_system_chunk, since the formula for reserving the necessary space +for allocation or removing a chunk would be the same. + +So, rework the comment by removing the mention of is_allocation +argument. + +Signed-off-by: Marcos Paulo de Souza +Reviewed-by: Nikolay Borisov +Signed-off-by: David Sterba +Signed-off-by: Filipe Manana +--- + fs/btrfs/block-group.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c +index 53e08f925260..384659dc7818 100644 +--- a/fs/btrfs/block-group.c ++++ b/fs/btrfs/block-group.c +@@ -2987,9 +2987,7 @@ static u64 get_profile_num_devs(struct btrfs_fs_info *fs_info, u64 type) + } + + /* +- * If @is_allocation is true, reserve space in the system space info necessary +- * for allocating a chunk, otherwise if it's false, reserve space necessary for +- * removing a chunk. ++ * Reserve space in the system space for allocating or removing a chunk + */ + void check_system_chunk(struct btrfs_trans_handle *trans, u64 type) + { +-- +2.26.2 + diff --git a/patches.suse/btrfs-fix-deadlock-between-chunk-allocation-and-chun.patch b/patches.suse/btrfs-fix-deadlock-between-chunk-allocation-and-chun.patch new file mode 100644 index 0000000..51b66b8 --- /dev/null +++ b/patches.suse/btrfs-fix-deadlock-between-chunk-allocation-and-chun.patch @@ -0,0 +1,454 @@ +From: Filipe Manana +Date: Wed, 13 Oct 2021 10:12:49 +0100 +Git-commit: 2bb2e00ed9787e52580bb651264b8d6a2b7a9dd2 +Patch-mainline: v5.16-rc1 +References: bsc#1192896 +Subject: [PATCH] btrfs: fix deadlock between chunk allocation and chunk btree + modifications + +When a task is doing some modification to the chunk btree and it is not in +the context of a chunk allocation or a chunk removal, it can deadlock with +another task that is currently allocating a new data or metadata chunk. + +These contexts are the following: + +* When relocating a system chunk, when we need to COW the extent buffers + that belong to the chunk btree; + +* When adding a new device (ioctl), where we need to add a new device item + to the chunk btree; + +* When removing a device (ioctl), where we need to remove a device item + from the chunk btree; + +* When resizing a device (ioctl), where we need to update a device item in + the chunk btree and may need to relocate a system chunk that lies beyond + the new device size when shrinking a device. + +The problem happens due to a sequence of steps like the following: + +1) Task A starts a data or metadata chunk allocation and it locks the + chunk mutex; + +2) Task B is relocating a system chunk, and when it needs to COW an extent + buffer of the chunk btree, it has locked both that extent buffer as + well as its parent extent buffer; + +3) Since there is not enough available system space, either because none + of the existing system block groups have enough free space or because + the only one with enough free space is in RO mode due to the relocation, + task B triggers a new system chunk allocation. It blocks when trying to + acquire the chunk mutex, currently held by task A; + +4) Task A enters btrfs_chunk_alloc_add_chunk_item(), in order to insert + the new chunk item into the chunk btree and update the existing device + items there. But in order to do that, it has to lock the extent buffer + that task B locked at step 2, or its parent extent buffer, but task B + is waiting on the chunk mutex, which is currently locked by task A, + therefore resulting in a deadlock. + +One example report when the deadlock happens with system chunk relocation: + + INFO: task kworker/u9:5:546 blocked for more than 143 seconds. + Not tainted 5.15.0-rc3+ #1 + "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. + task:kworker/u9:5 state:D stack:25936 pid: 546 ppid: 2 flags:0x00004000 + Workqueue: events_unbound btrfs_async_reclaim_metadata_space + Call Trace: + context_switch kernel/sched/core.c:4940 [inline] + __schedule+0xcd9/0x2530 kernel/sched/core.c:6287 + schedule+0xd3/0x270 kernel/sched/core.c:6366 + rwsem_down_read_slowpath+0x4ee/0x9d0 kernel/locking/rwsem.c:993 + __down_read_common kernel/locking/rwsem.c:1214 [inline] + __down_read kernel/locking/rwsem.c:1223 [inline] + down_read_nested+0xe6/0x440 kernel/locking/rwsem.c:1590 + __btrfs_tree_read_lock+0x31/0x350 fs/btrfs/locking.c:47 + btrfs_tree_read_lock fs/btrfs/locking.c:54 [inline] + btrfs_read_lock_root_node+0x8a/0x320 fs/btrfs/locking.c:191 + btrfs_search_slot_get_root fs/btrfs/ctree.c:1623 [inline] + btrfs_search_slot+0x13b4/0x2140 fs/btrfs/ctree.c:1728 + btrfs_update_device+0x11f/0x500 fs/btrfs/volumes.c:2794 + btrfs_chunk_alloc_add_chunk_item+0x34d/0xea0 fs/btrfs/volumes.c:5504 + do_chunk_alloc fs/btrfs/block-group.c:3408 [inline] + btrfs_chunk_alloc+0x84d/0xf50 fs/btrfs/block-group.c:3653 + flush_space+0x54e/0xd80 fs/btrfs/space-info.c:670 + btrfs_async_reclaim_metadata_space+0x396/0xa90 fs/btrfs/space-info.c:953 + process_one_work+0x9df/0x16d0 kernel/workqueue.c:2297 + worker_thread+0x90/0xed0 kernel/workqueue.c:2444 + kthread+0x3e5/0x4d0 kernel/kthread.c:319 + ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 + INFO: task syz-executor:9107 blocked for more than 143 seconds. + Not tainted 5.15.0-rc3+ #1 + "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. + task:syz-executor state:D stack:23200 pid: 9107 ppid: 7792 flags:0x00004004 + Call Trace: + context_switch kernel/sched/core.c:4940 [inline] + __schedule+0xcd9/0x2530 kernel/sched/core.c:6287 + schedule+0xd3/0x270 kernel/sched/core.c:6366 + schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6425 + __mutex_lock_common kernel/locking/mutex.c:669 [inline] + __mutex_lock+0xc96/0x1680 kernel/locking/mutex.c:729 + btrfs_chunk_alloc+0x31a/0xf50 fs/btrfs/block-group.c:3631 + find_free_extent_update_loop fs/btrfs/extent-tree.c:3986 [inline] + find_free_extent+0x25cb/0x3a30 fs/btrfs/extent-tree.c:4335 + btrfs_reserve_extent+0x1f1/0x500 fs/btrfs/extent-tree.c:4415 + btrfs_alloc_tree_block+0x203/0x1120 fs/btrfs/extent-tree.c:4813 + __btrfs_cow_block+0x412/0x1620 fs/btrfs/ctree.c:415 + btrfs_cow_block+0x2f6/0x8c0 fs/btrfs/ctree.c:570 + btrfs_search_slot+0x1094/0x2140 fs/btrfs/ctree.c:1768 + relocate_tree_block fs/btrfs/relocation.c:2694 [inline] + relocate_tree_blocks+0xf73/0x1770 fs/btrfs/relocation.c:2757 + relocate_block_group+0x47e/0xc70 fs/btrfs/relocation.c:3673 + btrfs_relocate_block_group+0x48a/0xc60 fs/btrfs/relocation.c:4070 + btrfs_relocate_chunk+0x96/0x280 fs/btrfs/volumes.c:3181 + __btrfs_balance fs/btrfs/volumes.c:3911 [inline] + btrfs_balance+0x1f03/0x3cd0 fs/btrfs/volumes.c:4301 + btrfs_ioctl_balance+0x61e/0x800 fs/btrfs/ioctl.c:4137 + btrfs_ioctl+0x39ea/0x7b70 fs/btrfs/ioctl.c:4949 + vfs_ioctl fs/ioctl.c:51 [inline] + __do_sys_ioctl fs/ioctl.c:874 [inline] + __se_sys_ioctl fs/ioctl.c:860 [inline] + __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 + do_syscall_x64 arch/x86/entry/common.c:50 [inline] + do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 + entry_SYSCALL_64_after_hwframe+0x44/0xae + +So fix this by making sure that whenever we try to modify the chunk btree +and we are neither in a chunk allocation context nor in a chunk remove +context, we reserve system space before modifying the chunk btree. + +Reported-by: Hao Sun +Link: https://lore.kernel.org/linux-btrfs/CACkBjsax51i4mu6C0C3vJqQN3NR_iVuucoeG3U1HXjrgzn5FFQ@mail.gmail.com/ +Fixes: 79bd37120b1495 ("btrfs: rework chunk allocation to avoid exhaustion of the system chunk array") +CC: stable@vger.kernel.org # 5.14+ +Reviewed-by: Josef Bacik +Signed-off-by: Filipe Manana +Signed-off-by: David Sterba +--- + fs/btrfs/block-group.c | 146 +++++++++++++++++++++++++---------------- + fs/btrfs/block-group.h | 2 + + fs/btrfs/relocation.c | 4 ++ + fs/btrfs/volumes.c | 15 ++++- + 4 files changed, 111 insertions(+), 56 deletions(-) + +diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c +index c9dee3189..bb2c34743 100644 +--- a/fs/btrfs/block-group.c ++++ b/fs/btrfs/block-group.c +@@ -2992,25 +2992,6 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags) + goto out; + } + +- /* +- * If this is a system chunk allocation then stop right here and do not +- * add the chunk item to the chunk btree. This is to prevent a deadlock +- * because this system chunk allocation can be triggered while COWing +- * some extent buffer of the chunk btree and while holding a lock on a +- * parent extent buffer, in which case attempting to insert the chunk +- * item (or update the device item) would result in a deadlock on that +- * parent extent buffer. In this case defer the chunk btree updates to +- * the second phase of chunk allocation and keep our reservation until +- * the second phase completes. +- * +- * This is a rare case and can only be triggered by the very few cases +- * we have where we need to touch the chunk btree outside chunk allocation +- * and chunk removal. These cases are basically adding a device, removing +- * a device or resizing a device. +- */ +- if (flags & BTRFS_BLOCK_GROUP_SYSTEM) +- return 0; +- + ret = btrfs_chunk_alloc_add_chunk_item(trans, bg); + /* + * Normally we are not expected to fail with -ENOSPC here, since we have +@@ -3143,14 +3124,14 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags) + * This has happened before and commit eafa4fd0ad0607 ("btrfs: fix exhaustion of + * the system chunk array due to concurrent allocations") provides more details. + * +- * For allocation of system chunks, we defer the updates and insertions into the +- * chunk btree to phase 2. This is to prevent deadlocks on extent buffers because +- * if the chunk allocation is triggered while COWing an extent buffer of the +- * chunk btree, we are holding a lock on the parent of that extent buffer and +- * doing the chunk btree updates and insertions can require locking that parent. +- * This is for the very few and rare cases where we update the chunk btree that +- * are not chunk allocation or chunk removal: adding a device, removing a device +- * or resizing a device. ++ * Allocation of system chunks does not happen through this function. A task that ++ * needs to update the chunk btree (the only btree that uses system chunks), must ++ * preallocate chunk space by calling either check_system_chunk() or ++ * btrfs_reserve_chunk_metadata() - the former is used when allocating a data or ++ * metadata chunk or when removing a chunk, while the later is used before doing ++ * a modification to the chunk btree - use cases for the later are adding, ++ * removing and resizing a device as well as relocation of a system chunk. ++ * See the comment below for more details. + * + * The reservation of system space, done through check_system_chunk(), as well + * as all the updates and insertions into the chunk btree must be done while +@@ -3187,11 +3168,27 @@ int btrfs_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags, + if (trans->allocating_chunk) + return -ENOSPC; + /* +- * If we are removing a chunk, don't re-enter or we would deadlock. +- * System space reservation and system chunk allocation is done by the +- * chunk remove operation (btrfs_remove_chunk()). ++ * Allocation of system chunks can not happen through this path, as we ++ * could end up in a deadlock if we are allocating a data or metadata ++ * chunk and there is another task modifying the chunk btree. ++ * ++ * This is because while we are holding the chunk mutex, we will attempt ++ * to add the new chunk item to the chunk btree or update an existing ++ * device item in the chunk btree, while the other task that is modifying ++ * the chunk btree is attempting to COW an extent buffer while holding a ++ * lock on it and on its parent - if the COW operation triggers a system ++ * chunk allocation, then we can deadlock because we are holding the ++ * chunk mutex and we may need to access that extent buffer or its parent ++ * in order to add the chunk item or update a device item. ++ * ++ * Tasks that want to modify the chunk tree should reserve system space ++ * before updating the chunk btree, by calling either ++ * btrfs_reserve_chunk_metadata() or check_system_chunk(). ++ * It's possible that after a task reserves the space, it still ends up ++ * here - this happens in the cases described above at do_chunk_alloc(). ++ * The task will have to either retry or fail. + */ +- if (trans->removing_chunk) ++ if (flags & BTRFS_BLOCK_GROUP_SYSTEM) + return -ENOSPC; + + space_info = btrfs_find_space_info(fs_info, flags); +@@ -3290,17 +3287,14 @@ static u64 get_profile_num_devs(struct btrfs_fs_info *fs_info, u64 type) + return num_dev; + } + +-/* +- * Reserve space in the system space for allocating or removing a chunk +- */ +-void check_system_chunk(struct btrfs_trans_handle *trans, u64 type) ++static void reserve_chunk_space(struct btrfs_trans_handle *trans, ++ u64 bytes, ++ u64 type) + { + struct btrfs_fs_info *fs_info = trans->fs_info; + struct btrfs_space_info *info; + u64 left; +- u64 thresh; + int ret = 0; +- u64 num_devs; + + /* + * Needed because we can end up allocating a system chunk and for an +@@ -3313,19 +3307,13 @@ void check_system_chunk(struct btrfs_trans_handle *trans, u64 type) + left = info->total_bytes - btrfs_space_info_used(info, true); + spin_unlock(&info->lock); + +- num_devs = get_profile_num_devs(fs_info, type); +- +- /* num_devs device items to update and 1 chunk item to add or remove */ +- thresh = btrfs_calc_metadata_size(fs_info, num_devs) + +- btrfs_calc_insert_metadata_size(fs_info, 1); +- +- if (left < thresh && btrfs_test_opt(fs_info, ENOSPC_DEBUG)) { ++ if (left < bytes && btrfs_test_opt(fs_info, ENOSPC_DEBUG)) { + btrfs_info(fs_info, "left=%llu, need=%llu, flags=%llu", +- left, thresh, type); ++ left, bytes, type); + btrfs_dump_space_info(fs_info, info, 0, 0); + } + +- if (left < thresh) { ++ if (left < bytes) { + u64 flags = btrfs_system_alloc_profile(fs_info); + struct btrfs_block_group *bg; + +@@ -3334,21 +3322,20 @@ void check_system_chunk(struct btrfs_trans_handle *trans, u64 type) + * needing it, as we might not need to COW all nodes/leafs from + * the paths we visit in the chunk tree (they were already COWed + * or created in the current transaction for example). +- * +- * Also, if our caller is allocating a system chunk, do not +- * attempt to insert the chunk item in the chunk btree, as we +- * could deadlock on an extent buffer since our caller may be +- * COWing an extent buffer from the chunk btree. + */ + bg = btrfs_alloc_chunk(trans, flags); + if (IS_ERR(bg)) { + ret = PTR_ERR(bg); +- } else if (!(type & BTRFS_BLOCK_GROUP_SYSTEM)) { ++ } else { + /* + * If we fail to add the chunk item here, we end up + * trying again at phase 2 of chunk allocation, at + * btrfs_create_pending_block_groups(). So ignore +- * any error here. ++ * any error here. An ENOSPC here could happen, due to ++ * the cases described at do_chunk_alloc() - the system ++ * block group we just created was just turned into RO ++ * mode by a scrub for example, or a running discard ++ * temporarily removed its free space entries, etc. + */ + btrfs_chunk_alloc_add_chunk_item(trans, bg); + } +@@ -3357,12 +3344,61 @@ void check_system_chunk(struct btrfs_trans_handle *trans, u64 type) + if (!ret) { + ret = btrfs_block_rsv_add(fs_info->chunk_root, + &fs_info->chunk_block_rsv, +- thresh, BTRFS_RESERVE_NO_FLUSH); ++ bytes, BTRFS_RESERVE_NO_FLUSH); + if (!ret) +- trans->chunk_bytes_reserved += thresh; ++ trans->chunk_bytes_reserved += bytes; + } + } + ++/* ++ * Reserve space in the system space for allocating or removing a chunk. ++ * The caller must be holding fs_info->chunk_mutex. ++ */ ++void check_system_chunk(struct btrfs_trans_handle *trans, u64 type) ++{ ++ struct btrfs_fs_info *fs_info = trans->fs_info; ++ const u64 num_devs = get_profile_num_devs(fs_info, type); ++ u64 bytes; ++ ++ /* num_devs device items to update and 1 chunk item to add or remove. */ ++ bytes = btrfs_calc_metadata_size(fs_info, num_devs) + ++ btrfs_calc_insert_metadata_size(fs_info, 1); ++ ++ reserve_chunk_space(trans, bytes, type); ++} ++ ++/* ++ * Reserve space in the system space, if needed, for doing a modification to the ++ * chunk btree. ++ * ++ * @trans: A transaction handle. ++ * @is_item_insertion: Indicate if the modification is for inserting a new item ++ * in the chunk btree or if it's for the deletion or update ++ * of an existing item. ++ * ++ * This is used in a context where we need to update the chunk btree outside ++ * block group allocation and removal, to avoid a deadlock with a concurrent ++ * task that is allocating a metadata or data block group and therefore needs to ++ * update the chunk btree while holding the chunk mutex. After the update to the ++ * chunk btree is done, btrfs_trans_release_chunk_metadata() should be called. ++ * ++ */ ++void btrfs_reserve_chunk_metadata(struct btrfs_trans_handle *trans, ++ bool is_item_insertion) ++{ ++ struct btrfs_fs_info *fs_info = trans->fs_info; ++ u64 bytes; ++ ++ if (is_item_insertion) ++ bytes = btrfs_calc_insert_metadata_size(fs_info, 1); ++ else ++ bytes = btrfs_calc_metadata_size(fs_info, 1); ++ ++ mutex_lock(&fs_info->chunk_mutex); ++ reserve_chunk_space(trans, bytes, BTRFS_BLOCK_GROUP_SYSTEM); ++ mutex_unlock(&fs_info->chunk_mutex); ++} ++ + void btrfs_put_block_group_cache(struct btrfs_fs_info *info) + { + struct btrfs_block_group *block_group; +diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h +index fb10eea11..970c79577 100644 +--- a/fs/btrfs/block-group.h ++++ b/fs/btrfs/block-group.h +@@ -237,6 +237,8 @@ int btrfs_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags, + enum btrfs_chunk_alloc_enum force); + int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, u64 type); + void check_system_chunk(struct btrfs_trans_handle *trans, const u64 type); ++void btrfs_reserve_chunk_metadata(struct btrfs_trans_handle *trans, ++ bool is_item_insertion); + u64 btrfs_get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags); + void btrfs_put_block_group_cache(struct btrfs_fs_info *info); + int btrfs_free_block_groups(struct btrfs_fs_info *info); +diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c +index c16181c76..1a50b8071 100644 +--- a/fs/btrfs/relocation.c ++++ b/fs/btrfs/relocation.c +@@ -3199,8 +3199,12 @@ static int relocate_tree_block(struct btrfs_trans_handle *trans, + list_add_tail(&node->list, &rc->backref_cache.changed); + } else { + path->lowest_level = node->level; ++ if (root == root->fs_info->chunk_root) ++ btrfs_reserve_chunk_metadata(trans, false); + ret = btrfs_search_slot(trans, root, key, path, 0, 1); + btrfs_release_path(path); ++ if (root == root->fs_info->chunk_root) ++ btrfs_trans_release_chunk_metadata(trans); + if (ret > 0) + ret = 0; + } +diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c +index 71e993d94..c5849db6e 100644 +--- a/fs/btrfs/volumes.c ++++ b/fs/btrfs/volumes.c +@@ -1992,8 +1992,10 @@ static int btrfs_add_dev_item(struct btrfs_trans_handle *trans, + key.type = BTRFS_DEV_ITEM_KEY; + key.offset = device->devid; + ++ btrfs_reserve_chunk_metadata(trans, true); + ret = btrfs_insert_empty_item(trans, trans->fs_info->chunk_root, path, + &key, sizeof(*dev_item)); ++ btrfs_trans_release_chunk_metadata(trans); + if (ret) + goto out; + +@@ -2064,7 +2066,9 @@ static int btrfs_rm_dev_item(struct btrfs_device *device) + key.type = BTRFS_DEV_ITEM_KEY; + key.offset = device->devid; + ++ btrfs_reserve_chunk_metadata(trans, false); + ret = btrfs_search_slot(trans, root, &key, path, -1, 1); ++ btrfs_trans_release_chunk_metadata(trans); + if (ret) { + if (ret > 0) + ret = -ENOENT; +@@ -2590,7 +2594,9 @@ static int btrfs_finish_sprout(struct btrfs_trans_handle *trans) + key.type = BTRFS_DEV_ITEM_KEY; + + while (1) { ++ btrfs_reserve_chunk_metadata(trans, false); + ret = btrfs_search_slot(trans, root, &key, path, 0, 1); ++ btrfs_trans_release_chunk_metadata(trans); + if (ret < 0) + goto error; + +@@ -2918,6 +2924,7 @@ int btrfs_grow_device(struct btrfs_trans_handle *trans, + struct btrfs_super_block *super_copy = fs_info->super_copy; + u64 old_total; + u64 diff; ++ int ret; + + if (!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) + return -EACCES; +@@ -2946,7 +2953,11 @@ int btrfs_grow_device(struct btrfs_trans_handle *trans, + &trans->transaction->dev_update_list); + mutex_unlock(&fs_info->chunk_mutex); + +- return btrfs_update_device(trans, device); ++ btrfs_reserve_chunk_metadata(trans, false); ++ ret = btrfs_update_device(trans, device); ++ btrfs_trans_release_chunk_metadata(trans); ++ ++ return ret; + } + + static int btrfs_free_chunk(struct btrfs_trans_handle *trans, u64 chunk_offset) +@@ -5032,8 +5043,10 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size) + round_down(old_total - diff, fs_info->sectorsize)); + mutex_unlock(&fs_info->chunk_mutex); + ++ btrfs_reserve_chunk_metadata(trans, false); + /* Now btrfs_update_device() will change the on-disk size. */ + ret = btrfs_update_device(trans, device); ++ btrfs_trans_release_chunk_metadata(trans); + if (ret < 0) { + btrfs_abort_transaction(trans, ret); + btrfs_end_transaction(trans); +-- +2.26.2 + diff --git a/patches.suse/btrfs-fix-memory-ordering-between-normal-and-ordered-work-functions.patch b/patches.suse/btrfs-fix-memory-ordering-between-normal-and-ordered-work-functions.patch new file mode 100644 index 0000000..46c2d5e --- /dev/null +++ b/patches.suse/btrfs-fix-memory-ordering-between-normal-and-ordered-work-functions.patch @@ -0,0 +1,83 @@ +From: Nikolay Borisov +Date: Tue, 2 Nov 2021 14:49:16 +0200 +Subject: btrfs: fix memory ordering between normal and ordered work functions +Git-commit: 45da9c1767ac31857df572f0a909fbe88fd5a7e9 +Patch-mainline: v5.16-rc2 +References: git-fixes + +Ordered work functions aren't guaranteed to be handled by the same thread +which executed the normal work functions. The only way execution between +normal/ordered functions is synchronized is via the WORK_DONE_BIT, +unfortunately the used bitops don't guarantee any ordering whatsoever. + +This manifested as seemingly inexplicable crashes on ARM64, where +async_chunk::inode is seen as non-null in async_cow_submit which causes +submit_compressed_extents to be called and crash occurs because +async_chunk::inode suddenly became NULL. The call trace was similar to: + + pc : submit_compressed_extents+0x38/0x3d0 + lr : async_cow_submit+0x50/0xd0 + sp : ffff800015d4bc20 + + + + Call trace: + submit_compressed_extents+0x38/0x3d0 + async_cow_submit+0x50/0xd0 + run_ordered_work+0xc8/0x280 + btrfs_work_helper+0x98/0x250 + process_one_work+0x1f0/0x4ac + worker_thread+0x188/0x504 + kthread+0x110/0x114 + ret_from_fork+0x10/0x18 + +Fix this by adding respective barrier calls which ensure that all +accesses preceding setting of WORK_DONE_BIT are strictly ordered before +setting the flag. At the same time add a read barrier after reading of +WORK_DONE_BIT in run_ordered_work which ensures all subsequent loads +would be strictly ordered after reading the bit. This in turn ensures +are all accesses before WORK_DONE_BIT are going to be strictly ordered +before any access that can occur in ordered_func. + +Reported-by: Chris Murphy +Fixes: 08a9ff326418 ("btrfs: Added btrfs_workqueue_struct implemented ordered execution based on kernel workqueue") +CC: stable@vger.kernel.org # 4.4+ +Link: https://bugzilla.redhat.com/show_bug.cgi?id=2011928 +Reviewed-by: Josef Bacik +Tested-by: Chris Murphy +Signed-off-by: Nikolay Borisov +Signed-off-by: David Sterba +--- + fs/btrfs/async-thread.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/fs/btrfs/async-thread.c ++++ b/fs/btrfs/async-thread.c +@@ -267,6 +267,13 @@ static void run_ordered_work(struct __bt + ordered_list); + if (!test_bit(WORK_DONE_BIT, &work->flags)) + break; ++ /* ++ * Orders all subsequent loads after reading WORK_DONE_BIT, ++ * paired with the smp_mb__before_atomic in btrfs_work_helper ++ * this guarantees that the ordered function will see all ++ * updates from ordinary work function. ++ */ ++ smp_rmb(); + + /* + * we are going to call the ordered done function, but +@@ -321,6 +328,13 @@ static void normal_work_helper(struct bt + thresh_exec_hook(wq); + work->func(work); + if (need_order) { ++ /* ++ * Ensures all memory accesses done in the work function are ++ * ordered before setting the WORK_DONE_BIT. Ensuring the thread ++ * which is going to executed the ordered work sees them. ++ * Pairs with the smp_rmb in run_ordered_work. ++ */ ++ smp_mb__before_atomic(); + set_bit(WORK_DONE_BIT, &work->flags); + run_ordered_work(wq); + } diff --git a/patches.suse/btrfs-provide-super_operations-get_inode_dev b/patches.suse/btrfs-provide-super_operations-get_inode_dev index 17e856e..ae4e67a 100644 --- a/patches.suse/btrfs-provide-super_operations-get_inode_dev +++ b/patches.suse/btrfs-provide-super_operations-get_inode_dev @@ -1,7 +1,7 @@ From: Jeff Mahoney Subject: btrfs: provide super_operations->inode_get_dev References: bsc#927455 -Patch-mainline: No, upstream wants a super_block per anon dev +Patch-mainline: Never, upstream wants a super_block per anon dev In order to ensure that the per-subvolume anonymous dev_t gets published to userspace, we need to provide the super_operations->get_inode_dev diff --git a/patches.suse/btrfs-update-comments-for-chunk-allocation-ENOSPC-ca.patch b/patches.suse/btrfs-update-comments-for-chunk-allocation-ENOSPC-ca.patch new file mode 100644 index 0000000..a90e8c1 --- /dev/null +++ b/patches.suse/btrfs-update-comments-for-chunk-allocation-ENOSPC-ca.patch @@ -0,0 +1,68 @@ +From: Filipe Manana +Date: Wed, 13 Oct 2021 10:12:50 +0100 +Git-commit: ecd84d54674a06e64613eae33999db8e180f4450 +Patch-mainline: v5.16-rc1 +References: bsc#1192896 +Subject: [PATCH] btrfs: update comments for chunk allocation -ENOSPC cases + +Update the comments at btrfs_chunk_alloc() and do_chunk_alloc() that +describe which cases can lead to a failure to allocate metadata and system +space despite having previously reserved space. This adds one more reason +that I previously forgot to mention. + +Reviewed-by: Josef Bacik +Signed-off-by: Filipe Manana +Signed-off-by: David Sterba +--- + fs/btrfs/block-group.c | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c +index f971d043469c..444e9c89ff3e 100644 +--- a/fs/btrfs/block-group.c ++++ b/fs/btrfs/block-group.c +@@ -3429,7 +3429,7 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags) + /* + * Normally we are not expected to fail with -ENOSPC here, since we have + * previously reserved space in the system space_info and allocated one +- * new system chunk if necessary. However there are two exceptions: ++ * new system chunk if necessary. However there are three exceptions: + * + * 1) We may have enough free space in the system space_info but all the + * existing system block groups have a profile which can not be used +@@ -3455,7 +3455,14 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags) + * with enough free space got turned into RO mode by a running scrub, + * and in this case we have to allocate a new one and retry. We only + * need do this allocate and retry once, since we have a transaction +- * handle and scrub uses the commit root to search for block groups. ++ * handle and scrub uses the commit root to search for block groups; ++ * ++ * 3) We had one system block group with enough free space when we called ++ * check_system_chunk(), but after that, right before we tried to ++ * allocate the last extent buffer we needed, a discard operation came ++ * in and it temporarily removed the last free space entry from the ++ * block group (discard removes a free space entry, discards it, and ++ * then adds back the entry to the block group cache). + */ + if (ret == -ENOSPC) { + const u64 sys_flags = btrfs_system_alloc_profile(trans->fs_info); +@@ -3539,7 +3546,15 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags) + * properly, either intentionally or as a bug. One example where this is + * done intentionally is fsync, as it does not reserve any transaction units + * and ends up allocating a variable number of metadata extents for log +- * tree extent buffers. ++ * tree extent buffers; ++ * ++ * 4) The task has reserved enough transaction units / metadata space, but right ++ * before it tries to allocate the last extent buffer it needs, a discard ++ * operation comes in and, temporarily, removes the last free space entry from ++ * the only metadata block group that had free space (discard starts by ++ * removing a free space entry from a block group, then does the discard ++ * operation and, once it's done, it adds back the free space entry to the ++ * block group). + * + * We also need this 2 phases setup when adding a device to a filesystem with + * a seed device - we must create new metadata and system chunks without adding +-- +2.26.2 + diff --git a/patches.suse/dm-ioctl-fix-out-of-bounds-array-access-when-no-devi.patch b/patches.suse/dm-ioctl-fix-out-of-bounds-array-access-when-no-devi.patch new file mode 100644 index 0000000..1611df5 --- /dev/null +++ b/patches.suse/dm-ioctl-fix-out-of-bounds-array-access-when-no-devi.patch @@ -0,0 +1,42 @@ +From 4edbe1d7bcffcd6269f3b5eb63f710393ff2ec7a Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Fri, 26 Mar 2021 14:32:32 -0400 +Subject: [PATCH] dm ioctl: fix out of bounds array access when no devices +Git-commit: 4edbe1d7bcffcd6269f3b5eb63f710393ff2ec7a +Patch-mainline: v5.12-rc5 +References: CVE-2021-31916 bsc#1192781 + +If there are not any dm devices, we need to zero the "dev" argument in +the first structure dm_name_list. However, this can cause out of +bounds write, because the "needed" variable is zero and len may be +less than eight. + +Fix this bug by reporting DM_BUFFER_FULL_FLAG if the result buffer is +too small to hold the "nl->dev" value. + +Signed-off-by: Mikulas Patocka +Reported-by: Dan Carpenter +Cc: stable@vger.kernel.org +Signed-off-by: Mike Snitzer +Acked-by: Takashi Iwai + +--- + drivers/md/dm-ioctl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c +index 5e306bba4375..1ca65b434f1f 100644 +--- a/drivers/md/dm-ioctl.c ++++ b/drivers/md/dm-ioctl.c +@@ -529,7 +529,7 @@ static int list_devices(struct file *filp, struct dm_ioctl *param, size_t param_ + * Grab our output buffer. + */ + nl = orig_nl = get_result_buffer(param, param_size, &len); +- if (len < needed) { ++ if (len < needed || len < sizeof(nl->dev)) { + param->flags |= DM_BUFFER_FULL_FLAG; + goto out; + } +-- +2.26.2 + diff --git a/patches.suse/edac-sb_edac-fix-top-of-high-memory-value-for-broadwell-haswell.patch b/patches.suse/edac-sb_edac-fix-top-of-high-memory-value-for-broadwell-haswell.patch new file mode 100644 index 0000000..1af228f --- /dev/null +++ b/patches.suse/edac-sb_edac-fix-top-of-high-memory-value-for-broadwell-haswell.patch @@ -0,0 +1,39 @@ +From: Eric Badger +Date: Sun, 10 Oct 2021 10:06:56 -0700 +Subject: EDAC/sb_edac: Fix top-of-high-memory value for Broadwell/Haswell +Git-commit: 537bddd069c743759addf422d0b8f028ff0f8dbc +Patch-mainline: v5.16-rc1 +References: bsc#1152489 + +The computation of TOHM is off by one bit. This missed bit results in +too low a value for TOHM, which can cause errors in regular memory to +incorrectly report: + + EDAC MC0: 1 CE Error at MMIOH area, on addr 0x000000207fffa680 on any memory + +Fixes: 50d1bb93672f ("sb_edac: add support for Haswell based systems") +Cc: stable@vger.kernel.org +Reported-by: Meeta Saggi +Signed-off-by: Eric Badger +Signed-off-by: Tony Luck +Link: https://lore.kernel.org/r/20211010170127.848113-1-ebadger@purestorage.com + +Acked-by: Borislav Petkov +--- + drivers/edac/sb_edac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c +index 4c626fcd4dcb..1522d4aa2ca6 100644 +--- a/drivers/edac/sb_edac.c ++++ b/drivers/edac/sb_edac.c +@@ -1052,7 +1052,7 @@ static u64 haswell_get_tohm(struct sbridge_pvt *pvt) + pci_read_config_dword(pvt->info.pci_vtd, HASWELL_TOHM_1, ®); + rc = ((reg << 6) | rc) << 26; + +- return rc | 0x1ffffff; ++ return rc | 0x3ffffff; + } + + static u64 knl_get_tolm(struct sbridge_pvt *pvt) + diff --git a/patches.suse/fuse-fix-page-stealing.patch b/patches.suse/fuse-fix-page-stealing.patch new file mode 100644 index 0000000..1633690 --- /dev/null +++ b/patches.suse/fuse-fix-page-stealing.patch @@ -0,0 +1,62 @@ +From: Miklos Szeredi +Date: Tue, 2 Nov 2021 11:10:37 +0100 +Subject: fuse: fix page stealing +Git-commit: 712a951025c0667ff00b25afc360f74e639dfabe +Patch-mainline: v5.16-rc1 +References: bsc#1192718 + +It is possible to trigger a crash by splicing anon pipe bufs to the fuse +device. + +The reason for this is that anon_pipe_buf_release() will reuse buf->page if +the refcount is 1, but that page might have already been stolen and its +flags modified (e.g. PG_lru added). + +This happens in the unlikely case of fuse_dev_splice_write() getting around +to calling pipe_buf_release() after a page has been stolen, added to the +page cache and removed from the page cache. + +Fix by calling pipe_buf_release() right after the page was inserted into +the page cache. In this case the page has an elevated refcount so any +release function will know that the page isn't reusable. + +Reported-by: Frank Dinoff +Link: https://lore.kernel.org/r/CAAmZXrsGg2xsP1CK+cbuEMumtrqdvD-NKnWzhNcvn71RV3c1yw@mail.gmail.com/ +Fixes: dd3bb14f44a6 ("fuse: support splice() writing to fuse device") +Cc: # v2.6.35 +Signed-off-by: Miklos Szeredi +Acked-by: Luis Henriques +--- + fs/fuse/dev.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/fs/fuse/dev.c ++++ b/fs/fuse/dev.c +@@ -840,6 +840,12 @@ static int fuse_try_move_page(struct fus + goto out_put_old; + } + ++ /* ++ * Release while we have extra ref on stolen page. Otherwise ++ * anon_pipe_buf_release() might think the page can be reused. ++ */ ++ pipe_buf_release(cs->pipe, buf); ++ + get_page(newpage); + + if (!(buf->flags & PIPE_BUF_FLAG_LRU)) +@@ -2117,8 +2123,12 @@ static ssize_t fuse_dev_splice_write(str + + pipe_lock(pipe); + out_free: +- for (idx = 0; idx < nbuf; idx++) +- pipe_buf_release(pipe, &bufs[idx]); ++ for (idx = 0; idx < nbuf; idx++) { ++ struct pipe_buffer *buf = &bufs[idx]; ++ ++ if (buf->ops) ++ pipe_buf_release(pipe, buf); ++ } + pipe_unlock(pipe); + + kvfree(bufs); diff --git a/patches.suse/gpio-mpc8xxx-Use-devm_gpiochip_add_data-to-simplify-.patch b/patches.suse/gpio-mpc8xxx-Use-devm_gpiochip_add_data-to-simplify-.patch new file mode 100644 index 0000000..ae246f1 --- /dev/null +++ b/patches.suse/gpio-mpc8xxx-Use-devm_gpiochip_add_data-to-simplify-.patch @@ -0,0 +1,42 @@ +From: Christophe JAILLET +Date: Fri, 20 Aug 2021 17:38:13 +0200 +Subject: gpio: mpc8xxx: Use 'devm_gpiochip_add_data()' to simplify the code + and avoid a leak + +Git-commit: 889a1b3f35db6ba5ba6a0c23a3a55594570b6a17 +Patch-mainline: v5.15-rc1 +References: git-fixes + +If an error occurs after a 'gpiochip_add_data()' call it must be undone by +a corresponding 'gpiochip_remove()' as already done in the remove function. + +To simplify the code a fix a leak in the error handling path of the probe, +use the managed version instead (i.e. 'devm_gpiochip_add_data()') + +Fixes: 698b8eeaed72 ("gpio/mpc8xxx: change irq handler from chained to normal") +Signed-off-by: Christophe JAILLET +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Mian Yousaf Kaukab +--- + drivers/gpio/gpio-mpc8xxx.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/gpio/gpio-mpc8xxx.c ++++ b/drivers/gpio/gpio-mpc8xxx.c +@@ -374,7 +374,7 @@ static int mpc8xxx_probe(struct platform + of_device_is_compatible(np, "fsl,ls1088a-gpio")) + gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff); + +- ret = gpiochip_add_data(gc, mpc8xxx_gc); ++ ret = devm_gpiochip_add_data(&pdev->dev, gc, mpc8xxx_gc); + if (ret) { + pr_err("%pOF: GPIO chip registration failed with status %d\n", + np, ret); +@@ -442,7 +442,6 @@ static int mpc8xxx_remove(struct platfor + irq_domain_remove(mpc8xxx_gc->irq); + } + +- gpiochip_remove(&mpc8xxx_gc->gc); + iounmap(mpc8xxx_gc->regs); + + return 0; diff --git a/patches.suse/ipv4-make-exception-cache-less-predictible.patch b/patches.suse/ipv4-make-exception-cache-less-predictible.patch new file mode 100644 index 0000000..2591420 --- /dev/null +++ b/patches.suse/ipv4-make-exception-cache-less-predictible.patch @@ -0,0 +1,121 @@ +From: Eric Dumazet +Subject: ipv4: make exception cache less predictible +Git-commit: 67d6d681e15b578c1725bad8ad079e05d1c48a8e +Patch-mainline: v5.15-rc1 +References: bsc#1191790, CVE-2021-20322 +Acked-by: Jiri Bohac + +Even after commit 6457378fe796 ("ipv4: use siphash instead of Jenkins in +fnhe_hashfun()"), an attacker can still use brute force to learn +some secrets from a victim linux host. + +One way to defeat these attacks is to make the max depth of the hash +table bucket a random value. + +Before this patch, each bucket of the hash table used to store exceptions +could contain 6 items under attack. + +After the patch, each bucket would contains a random number of items, +between 6 and 10. The attacker can no longer infer secrets. + +This is slightly increasing memory size used by the hash table, +by 50% in average, we do not expect this to be a problem. + +This patch is more complex than the prior one (IPv6 equivalent), +because IPv4 was reusing the oldest entry. +Since we need to be able to evict more than one entry per +update_or_create_fnhe() call, I had to replace +fnhe_oldest() with fnhe_remove_oldest(). + +Also note that we will queue extra kfree_rcu() calls under stress, +which hopefully wont be a too big issue. + +Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.") +Signed-off-by: Eric Dumazet +Reported-by: Keyu Man +Cc: Willy Tarreau +Signed-off-by: David S. Miller +Reviewed-by: David Ahern +Tested-by: David Ahern +Signed-off-by: David S. Miller + +diff --git a/net/ipv4/route.c b/net/ipv4/route.c +index 1e3b18797070..1b6c8fad6277 100644 +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -587,18 +587,25 @@ static void fnhe_flush_routes(struct fib_nh_exception *fnhe) + } + } + +-static struct fib_nh_exception *fnhe_oldest(struct fnhe_hash_bucket *hash) ++static void fnhe_remove_oldest(struct fnhe_hash_bucket *hash) + { +- struct fib_nh_exception *fnhe, *oldest; ++ struct fib_nh_exception __rcu **fnhe_p, **oldest_p; ++ struct fib_nh_exception *fnhe, *oldest = NULL; + +- oldest = rcu_dereference(hash->chain); +- for (fnhe = rcu_dereference(oldest->fnhe_next); fnhe; +- fnhe = rcu_dereference(fnhe->fnhe_next)) { +- if (time_before(fnhe->fnhe_stamp, oldest->fnhe_stamp)) ++ for (fnhe_p = &hash->chain; ; fnhe_p = &fnhe->fnhe_next) { ++ fnhe = rcu_dereference_protected(*fnhe_p, ++ lockdep_is_held(&fnhe_lock)); ++ if (!fnhe) ++ break; ++ if (!oldest || ++ time_before(fnhe->fnhe_stamp, oldest->fnhe_stamp)) { + oldest = fnhe; ++ oldest_p = fnhe_p; ++ } + } + fnhe_flush_routes(oldest); +- return oldest; ++ *oldest_p = oldest->fnhe_next; ++ kfree_rcu(oldest, rcu); + } + + static u32 fnhe_hashfun(__be32 daddr) +@@ -677,16 +684,21 @@ static void update_or_create_fnhe(struct fib_nh_common *nhc, __be32 daddr, + if (rt) + fill_route_from_fnhe(rt, fnhe); + } else { +- if (depth > FNHE_RECLAIM_DEPTH) +- fnhe = fnhe_oldest(hash); +- else { +- fnhe = kzalloc(sizeof(*fnhe), GFP_ATOMIC); +- if (!fnhe) +- goto out_unlock; +- +- fnhe->fnhe_next = hash->chain; +- rcu_assign_pointer(hash->chain, fnhe); ++ /* Randomize max depth to avoid some side channels attacks. */ ++ int max_depth = FNHE_RECLAIM_DEPTH + ++ prandom_u32_max(FNHE_RECLAIM_DEPTH); ++ ++ while (depth > max_depth) { ++ fnhe_remove_oldest(hash); ++ depth--; + } ++ ++ fnhe = kzalloc(sizeof(*fnhe), GFP_ATOMIC); ++ if (!fnhe) ++ goto out_unlock; ++ ++ fnhe->fnhe_next = hash->chain; ++ + fnhe->fnhe_genid = genid; + fnhe->fnhe_daddr = daddr; + fnhe->fnhe_gw = gw; +@@ -694,6 +706,8 @@ static void update_or_create_fnhe(struct fib_nh_common *nhc, __be32 daddr, + fnhe->fnhe_mtu_locked = lock; + fnhe->fnhe_expires = max(1UL, expires); + ++ rcu_assign_pointer(hash->chain, fnhe); ++ + /* Exception created; mark the cached routes for the nexthop + * stale, so anyone caching it rechecks if this exception + * applies to them. +-- +2.33.0 + diff --git a/patches.suse/ipv4-use-siphash-instead-of-jenkins-in-fnhe_hashfun.patch b/patches.suse/ipv4-use-siphash-instead-of-jenkins-in-fnhe_hashfun.patch new file mode 100644 index 0000000..7dac782 --- /dev/null +++ b/patches.suse/ipv4-use-siphash-instead-of-jenkins-in-fnhe_hashfun.patch @@ -0,0 +1,48 @@ +From: Eric Dumazet +Subject: ipv4: use siphash instead of Jenkins in fnhe_hashfun() +Git-commit: 6457378fe796815c973f631a1904e147d6ee33b1 +Patch-mainline: v5.14 +References: bsc#1191790, CVE-2021-20322 +Acked-by: Jiri Bohac + +A group of security researchers brought to our attention +the weakness of hash function used in fnhe_hashfun(). + +Lets use siphash instead of Jenkins Hash, to considerably +reduce security risks. + +Also remove the inline keyword, this really is distracting. + +Fixes: d546c621542d ("ipv4: harden fnhe_hashfun()") +Signed-off-by: Eric Dumazet +Reported-by: Keyu Man +Cc: Willy Tarreau +Signed-off-by: David S. Miller + +--- + net/ipv4/route.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -617,14 +617,14 @@ static struct fib_nh_exception *fnhe_old + return oldest; + } + +-static inline u32 fnhe_hashfun(__be32 daddr) ++static u32 fnhe_hashfun(__be32 daddr) + { +- static u32 fnhe_hashrnd __read_mostly; +- u32 hval; ++ static siphash_key_t fnhe_hash_key __read_mostly; ++ u64 hval; + +- net_get_random_once(&fnhe_hashrnd, sizeof(fnhe_hashrnd)); +- hval = jhash_1word((__force u32) daddr, fnhe_hashrnd); +- return hash_32(hval, FNHE_HASH_SHIFT); ++ net_get_random_once(&fnhe_hash_key, sizeof(fnhe_hash_key)); ++ hval = siphash_1u32((__force u32)daddr, &fnhe_hash_key); ++ return hash_64(hval, FNHE_HASH_SHIFT); + } + + static void fill_route_from_fnhe(struct rtable *rt, struct fib_nh_exception *fnhe) diff --git a/patches.suse/ipv6-make-exception-cache-less-predictible.patch b/patches.suse/ipv6-make-exception-cache-less-predictible.patch new file mode 100644 index 0000000..aa76710 --- /dev/null +++ b/patches.suse/ipv6-make-exception-cache-less-predictible.patch @@ -0,0 +1,59 @@ +From: Eric Dumazet +Subject: ipv6: make exception cache less predictible +Git-commit: a00df2caffed3883c341d5685f830434312e4a43 +Patch-mainline: v5.15-rc1 +References: bsc#1191790, CVE-2021-20322 +Acked-by: Jiri Bohac + +Even after commit 4785305c05b2 ("ipv6: use siphash in rt6_exception_hash()"), +an attacker can still use brute force to learn some secrets from a victim +linux host. + +One way to defeat these attacks is to make the max depth of the hash +table bucket a random value. + +Before this patch, each bucket of the hash table used to store exceptions +could contain 6 items under attack. + +After the patch, each bucket would contains a random number of items, +between 6 and 10. The attacker can no longer infer secrets. + +This is slightly increasing memory size used by the hash table, +we do not expect this to be a problem. + +Following patch is dealing with the same issue in IPv4. + +Fixes: 35732d01fe31 ("ipv6: introduce a hash table to store dst cache") +Signed-off-by: Eric Dumazet +Reported-by: Keyu Man +Cc: Wei Wang +Cc: Martin KaFai Lau +Reviewed-by: David Ahern +Signed-off-by: David S. Miller + +diff --git a/net/ipv6/route.c b/net/ipv6/route.c +index f34137d5bf85..dbc224023977 100644 +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -1657,6 +1657,7 @@ static int rt6_insert_exception(struct rt6_info *nrt, + struct in6_addr *src_key = NULL; + struct rt6_exception *rt6_ex; + struct fib6_nh *nh = res->nh; ++ int max_depth; + int err = 0; + + spin_lock_bh(&rt6_exception_lock); +@@ -1711,7 +1712,9 @@ static int rt6_insert_exception(struct rt6_info *nrt, + bucket->depth++; + net->ipv6.rt6_stats->fib_rt_cache++; + +- if (bucket->depth > FIB6_MAX_DEPTH) ++ /* Randomize max depth to avoid some side channels attacks. */ ++ max_depth = FIB6_MAX_DEPTH + prandom_u32_max(FIB6_MAX_DEPTH); ++ while (bucket->depth > max_depth) + rt6_exception_remove_oldest(bucket); + + out: +-- +2.33.0 + diff --git a/patches.suse/ipv6-use-siphash-in-rt6_exception_hash.patch b/patches.suse/ipv6-use-siphash-in-rt6_exception_hash.patch new file mode 100644 index 0000000..8ada13a --- /dev/null +++ b/patches.suse/ipv6-use-siphash-in-rt6_exception_hash.patch @@ -0,0 +1,69 @@ +From: Eric Dumazet +Subject: ipv6: use siphash in rt6_exception_hash() +Git-commit: 4785305c05b25a242e5314cc821f54ade4c18810 +Patch-mainline: v5.14 +References: bsc#1191790, CVE-2021-20322 +Acked-by: Jiri Bohac + +A group of security researchers brought to our attention +the weakness of hash function used in rt6_exception_hash() + +Lets use siphash instead of Jenkins Hash, to considerably +reduce security risks. + +Following patch deals with IPv4. + +Fixes: 35732d01fe31 ("ipv6: introduce a hash table to store dst cache") +Signed-off-by: Eric Dumazet +Reported-by: Keyu Man +Cc: Wei Wang +Cc: Martin KaFai Lau +Acked-by: Wei Wang +Signed-off-by: David S. Miller + +diff --git a/net/ipv6/route.c b/net/ipv6/route.c +index b6ddf23d3833..c5e8ecb96426 100644 +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1484,17 +1485,24 @@ static void rt6_exception_remove_oldest(struct rt6_exception_bucket *bucket) + static u32 rt6_exception_hash(const struct in6_addr *dst, + const struct in6_addr *src) + { +- static u32 seed __read_mostly; +- u32 val; ++ static siphash_key_t rt6_exception_key __read_mostly; ++ struct { ++ struct in6_addr dst; ++ struct in6_addr src; ++ } __aligned(SIPHASH_ALIGNMENT) combined = { ++ .dst = *dst, ++ }; ++ u64 val; + +- net_get_random_once(&seed, sizeof(seed)); +- val = jhash2((const u32 *)dst, sizeof(*dst)/sizeof(u32), seed); ++ net_get_random_once(&rt6_exception_key, sizeof(rt6_exception_key)); + + #ifdef CONFIG_IPV6_SUBTREES + if (src) +- val = jhash2((const u32 *)src, sizeof(*src)/sizeof(u32), val); ++ combined.src = *src; + #endif +- return hash_32(val, FIB6_EXCEPTION_BUCKET_SIZE_SHIFT); ++ val = siphash(&combined, sizeof(combined), &rt6_exception_key); ++ ++ return hash_64(val, FIB6_EXCEPTION_BUCKET_SIZE_SHIFT); + } + + /* Helper function to find the cached rt in the hash table +-- +2.33.0 + diff --git a/patches.suse/mm-hugetlb-initialize-hugetlb_usage-in-mm_init.patch b/patches.suse/mm-hugetlb-initialize-hugetlb_usage-in-mm_init.patch new file mode 100644 index 0000000..2be07b6 --- /dev/null +++ b/patches.suse/mm-hugetlb-initialize-hugetlb_usage-in-mm_init.patch @@ -0,0 +1,76 @@ +From: Liu Zixian +Date: Wed, 8 Sep 2021 18:10:05 -0700 +Subject: mm/hugetlb: initialize hugetlb_usage in mm_init +Git-commit: 13db8c50477d83ad3e3b9b0ae247e5cd833a7ae4 +Patch-mainline: v5.15-rc1 +References: bsc#1192906 + +After fork, the child process will get incorrect (2x) hugetlb_usage. If +a process uses 5 2MB hugetlb pages in an anonymous mapping, + + HugetlbPages: 10240 kB + +and then forks, the child will show, + + HugetlbPages: 20480 kB + +The reason for double the amount is because hugetlb_usage will be copied +from the parent and then increased when we copy page tables from parent +to child. Child will have 2x actual usage. + +Fix this by adding hugetlb_count_init in mm_init. + +Link: https://lkml.kernel.org/r/20210826071742.877-1-liuzixian4@huawei.com +Fixes: 5d317b2b6536 ("mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status") +Signed-off-by: Liu Zixian +Reviewed-by: Naoya Horiguchi +Reviewed-by: Mike Kravetz +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Acked-by: Michal Koutný +--- + include/linux/hugetlb.h | 9 +++++++++ + kernel/fork.c | 1 + + 2 files changed, 10 insertions(+) + +diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h +index f7ca1a3870ea..1faebe1cd0ed 100644 +--- a/include/linux/hugetlb.h ++++ b/include/linux/hugetlb.h +@@ -858,6 +858,11 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h, + + void hugetlb_report_usage(struct seq_file *m, struct mm_struct *mm); + ++static inline void hugetlb_count_init(struct mm_struct *mm) ++{ ++ atomic_long_set(&mm->hugetlb_usage, 0); ++} ++ + static inline void hugetlb_count_add(long l, struct mm_struct *mm) + { + atomic_long_add(l, &mm->hugetlb_usage); +@@ -1042,6 +1047,10 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h, + return &mm->page_table_lock; + } + ++static inline void hugetlb_count_init(struct mm_struct *mm) ++{ ++} ++ + static inline void hugetlb_report_usage(struct seq_file *f, struct mm_struct *m) + { + } +diff --git a/kernel/fork.c b/kernel/fork.c +index ff5be23800af..38681ad44c76 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -1063,6 +1063,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, + mm->pmd_huge_pte = NULL; + #endif + mm_init_uprobes_state(mm); ++ hugetlb_count_init(mm); + + if (current->mm) { + mm->flags = current->mm->flags & MMF_INIT_MASK; + diff --git a/patches.suse/net-dsa-felix-re-enable-TX-flow-control-in-ocelot_po.patch b/patches.suse/net-dsa-felix-re-enable-TX-flow-control-in-ocelot_po.patch new file mode 100644 index 0000000..045b341 --- /dev/null +++ b/patches.suse/net-dsa-felix-re-enable-TX-flow-control-in-ocelot_po.patch @@ -0,0 +1,49 @@ +From: Vladimir Oltean +Date: Tue, 8 Jun 2021 14:15:35 +0300 +Subject: net: dsa: felix: re-enable TX flow control in ocelot_port_flush() + +Git-commit: 1650bdb1c516c248fb06f6d076559ff6437a5853 +Patch-mainline: v5.13-rc7 +References: git-fixes + +Because flow control is set up statically in ocelot_init_port(), and not +in phylink_mac_link_up(), what happens is that after the blamed commit, +the flow control remains disabled after the port flushing procedure. + +Fixes: eb4733d7cffc ("net: dsa: felix: implement port flushing on .phylink_mac_link_down") +Signed-off-by: Vladimir Oltean +Signed-off-by: David S. Miller +Signed-off-by: Mian Yousaf Kaukab +--- + drivers/net/ethernet/mscc/ocelot.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/ethernet/mscc/ocelot.c ++++ b/drivers/net/ethernet/mscc/ocelot.c +@@ -404,6 +404,7 @@ static u32 ocelot_read_eq_avail(struct o + + int ocelot_port_flush(struct ocelot *ocelot, int port) + { ++ unsigned int pause_ena; + int err, val; + + /* Disable dequeuing from the egress queues */ +@@ -412,6 +413,8 @@ int ocelot_port_flush(struct ocelot *oce + QSYS_PORT_MODE, port); + + /* Disable flow control */ ++ pause_ena = ocelot_read_rix(ocelot, SYS_PAUSE_CFG, port) & ++ SYS_PAUSE_CFG_PAUSE_ENA; + ocelot_rmw_rix(ocelot, 0, SYS_PAUSE_CFG_PAUSE_ENA, SYS_PAUSE_CFG, port); + + /* Disable priority flow control */ +@@ -447,6 +450,9 @@ int ocelot_port_flush(struct ocelot *oce + /* Clear flushing again. */ + ocelot_rmw_gix(ocelot, 0, REW_PORT_CFG_FLUSH_ENA, REW_PORT_CFG, port); + ++ /* Re-enable flow control */ ++ ocelot_rmw_rix(ocelot, pause_ena, SYS_PAUSE_CFG_PAUSE_ENA, SYS_PAUSE_CFG, port); ++ + return err; + } + EXPORT_SYMBOL(ocelot_port_flush); diff --git a/patches.suse/net-mscc-ocelot-fix-hardware-timestamp-dequeue-logic.patch b/patches.suse/net-mscc-ocelot-fix-hardware-timestamp-dequeue-logic.patch new file mode 100644 index 0000000..f81b109 --- /dev/null +++ b/patches.suse/net-mscc-ocelot-fix-hardware-timestamp-dequeue-logic.patch @@ -0,0 +1,57 @@ +From: laurent brando +Date: Mon, 27 Jul 2020 18:26:14 +0800 +Subject: net: mscc: ocelot: fix hardware timestamp dequeue logic + + +Git-commit: 5fd82200d870a5dd3e509c98ef2041f580b2c0e1 +Patch-mainline: v5.8 +References: git-fixes + +The next hw timestamp should be snapshoot to the read registers +only once the current timestamp has been read. +If none of the pending skbs matches the current HW timestamp +just gracefully flush the available timestamp by reading it. + +Signed-off-by: laurent brando +Signed-off-by: Vladimir Oltean +Signed-off-by: Yangbo Lu +Signed-off-by: David S. Miller +Signed-off-by: Mian Yousaf Kaukab +--- + drivers/net/ethernet/mscc/ocelot.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c +index 9cfe1fd98c30..f17da67a4622 100644 +--- a/drivers/net/ethernet/mscc/ocelot.c ++++ b/drivers/net/ethernet/mscc/ocelot.c +@@ -748,21 +748,21 @@ void ocelot_get_txtstamp(struct ocelot *ocelot) + + spin_unlock_irqrestore(&port->tx_skbs.lock, flags); + +- /* Next ts */ +- ocelot_write(ocelot, SYS_PTP_NXT_PTP_NXT, SYS_PTP_NXT); ++ /* Get the h/w timestamp */ ++ ocelot_get_hwtimestamp(ocelot, &ts); + + if (unlikely(!skb_match)) + continue; + +- /* Get the h/w timestamp */ +- ocelot_get_hwtimestamp(ocelot, &ts); +- + /* Set the timestamp into the skb */ + memset(&shhwtstamps, 0, sizeof(shhwtstamps)); + shhwtstamps.hwtstamp = ktime_set(ts.tv_sec, ts.tv_nsec); + skb_tstamp_tx(skb_match, &shhwtstamps); + + dev_kfree_skb_any(skb_match); ++ ++ /* Next ts */ ++ ocelot_write(ocelot, SYS_PTP_NXT_PTP_NXT, SYS_PTP_NXT); + } + } + EXPORT_SYMBOL(ocelot_get_txtstamp); +-- +2.31.1 + diff --git a/patches.suse/net-mscc-ocelot-warn-when-a-PTP-IRQ-is-raised-for-an.patch b/patches.suse/net-mscc-ocelot-warn-when-a-PTP-IRQ-is-raised-for-an.patch new file mode 100644 index 0000000..2ee0210 --- /dev/null +++ b/patches.suse/net-mscc-ocelot-warn-when-a-PTP-IRQ-is-raised-for-an.patch @@ -0,0 +1,51 @@ +From: Vladimir Oltean +Date: Tue, 12 Oct 2021 14:40:37 +0300 +Subject: net: mscc: ocelot: warn when a PTP IRQ is raised for an unknown skb + +Git-commit: 9fde506e0c53b8309f69b18b4b8144c544b4b3b1 +Patch-mainline: v5.15-rc6 +References: git-fixes + +When skb_match is NULL, it means we received a PTP IRQ for a timestamp +ID that the kernel has no idea about, since there is no skb in the +timestamping queue with that timestamp ID. + +This is a grave error and not something to just "continue" over. +So print a big warning in case this happens. + +Also, move the check above ocelot_get_hwtimestamp(), there is no point +in reading the full 64-bit current PTP time if we're not going to do +anything with it anyway for this skb. + +Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +Signed-off-by: Mian Yousaf Kaukab +--- + drivers/net/ethernet/mscc/ocelot.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c +index 9c62f1d13adc..687c07c338cd 100644 +--- a/drivers/net/ethernet/mscc/ocelot.c ++++ b/drivers/net/ethernet/mscc/ocelot.c +@@ -747,12 +747,12 @@ void ocelot_get_txtstamp(struct ocelot *ocelot) + + spin_unlock_irqrestore(&port->tx_skbs.lock, flags); + ++ if (WARN_ON(!skb_match)) ++ continue; ++ + /* Get the h/w timestamp */ + ocelot_get_hwtimestamp(ocelot, &ts); + +- if (unlikely(!skb_match)) +- continue; +- + /* Set the timestamp into the skb */ + memset(&shhwtstamps, 0, sizeof(shhwtstamps)); + shhwtstamps.hwtstamp = ktime_set(ts.tv_sec, ts.tv_nsec); +-- +2.31.1 + diff --git a/patches.suse/printk-console-Allow-to-disable-console-output-by-us.patch b/patches.suse/printk-console-Allow-to-disable-console-output-by-us.patch new file mode 100644 index 0000000..5b497e2 --- /dev/null +++ b/patches.suse/printk-console-Allow-to-disable-console-output-by-us.patch @@ -0,0 +1,66 @@ +From 3cffa06aeef7ece30f6b5ac0ea51f264e8fea4d0 Mon Sep 17 00:00:00 2001 +From: Petr Mladek +Date: Wed, 11 Nov 2020 14:54:50 +0100 +Subject: [PATCH] printk/console: Allow to disable console output by using + console="" or console=null +Git-commit: 3cffa06aeef7ece30f6b5ac0ea51f264e8fea4d0 +Patch-mainline: v5.11-rc1 +References: bsc#1192753 + +The commit 48021f98130880dd74 ("printk: handle blank console arguments +passed in.") prevented crash caused by empty console= parameter value. + +Unfortunately, this value is widely used on Chromebooks to disable +the console output. The above commit caused performance regression +because the messages were pushed on slow console even though nobody +was watching it. + +Use ttynull driver explicitly for console="" and console=null +parameters. It has been created for exactly this purpose. + +It causes that preferred_console is set. As a result, ttySX and ttyX +are not used as a fallback. And only ttynull console gets registered by +default. + +It still allows to register other consoles either by additional console= +parameters or SPCR. It prevents regression because it worked this way even +before. Also it is a sane semantic. Preventing output on all consoles +should be done another way, for example, by introducing mute_console +parameter. + +Link: https://lore.kernel.org/r/20201006025935.GA597@jagdpanzerIV.localdomain +Suggested-by: Sergey Senozhatsky +Reviewed-by: Guenter Roeck +Tested-by: Guenter Roeck +Acked-by: Sergey Senozhatsky +Signed-off-by: Petr Mladek +Link: https://lore.kernel.org/r/20201111135450.11214-3-pmladek@suse.com + +--- + kernel/printk/printk.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index fe64a49344bf..ac440b879a2c 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -2189,8 +2189,15 @@ static int __init console_setup(char *str) + char *s, *options, *brl_options = NULL; + int idx; + +- if (str[0] == 0) ++ /* ++ * console="" or console=null have been suggested as a way to ++ * disable console output. Use ttynull that has been created ++ * for exacly this purpose. ++ */ ++ if (str[0] == 0 || strcmp(str, "null") == 0) { ++ __add_preferred_console("ttynull", 0, NULL, NULL); + return 1; ++ } + + if (_braille_console_setup(&str, &brl_options)) + return 1; +-- +2.26.2 + diff --git a/patches.suse/printk-handle-blank-console-arguments-passed-in.patch b/patches.suse/printk-handle-blank-console-arguments-passed-in.patch new file mode 100644 index 0000000..34afe8b --- /dev/null +++ b/patches.suse/printk-handle-blank-console-arguments-passed-in.patch @@ -0,0 +1,44 @@ +From 48021f98130880dd74286459a1ef48b5e9bc374f Mon Sep 17 00:00:00 2001 +From: Shreyas Joshi +Date: Fri, 22 May 2020 16:53:06 +1000 +Subject: [PATCH] printk: handle blank console arguments passed in. +Git-commit: 48021f98130880dd74286459a1ef48b5e9bc374f +Patch-mainline: v5.8-rc1 +References: bsc#1192753 + +If uboot passes a blank string to console_setup then it results in +a trashed memory. Ultimately, the kernel crashes during freeing up +the memory. + +This fix checks if there is a blank parameter being +passed to console_setup from uboot. In case it detects that +the console parameter is blank then it doesn't setup the serial +device and it gracefully exits. + +Link: https://lore.kernel.org/r/20200522065306.83-1-shreyas.joshi@biamp.com +Signed-off-by: Shreyas Joshi +Acked-by: Sergey Senozhatsky +[pmladek@suse.com: Better format the commit message and code, remove unnecessary brackets.] +Signed-off-by: Petr Mladek + +--- + kernel/printk/printk.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 35cc5f548860..a3990505abdf 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -2200,6 +2200,9 @@ static int __init console_setup(char *str) + char *s, *options, *brl_options = NULL; + int idx; + ++ if (str[0] == 0) ++ return 1; ++ + if (_braille_console_setup(&str, &brl_options)) + return 1; + +-- +2.26.2 + diff --git a/patches.suse/r8152-Add-macpassthru-support-for-ThinkPad-Thunderbo.patch b/patches.suse/r8152-Add-macpassthru-support-for-ThinkPad-Thunderbo.patch new file mode 100644 index 0000000..986d735 --- /dev/null +++ b/patches.suse/r8152-Add-macpassthru-support-for-ThinkPad-Thunderbo.patch @@ -0,0 +1,146 @@ +From 9647722befbedcd6735e00655ffec392c05f0c56 Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Tue, 5 Nov 2019 19:24:52 +0800 +Subject: [PATCH] r8152: Add macpassthru support for ThinkPad Thunderbolt 3 + Dock Gen 2 +Git-commit: 9647722befbedcd6735e00655ffec392c05f0c56 +References: git-fixes +Patch-mainline: v5.5-rc1 + +ThinkPad Thunderbolt 3 Dock Gen 2 is another docking station that uses +RTL8153 based USB ethernet. + +The device supports macpassthru, but it failed to pass the test of -AD, +-BND and -BD. Simply bypass these tests since the device supports this +feature just fine. + +Also the ACPI objects have some differences between Dell's and Lenovo's, +so make those ACPI infos no longer hardcoded. + +BugLink: https://bugs.launchpad.net/bugs/1827961 +Signed-off-by: Kai-Heng Feng +Acked-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/cdc_ether.c | 7 +++++ + drivers/net/usb/r8152.c | 58 +++++++++++++++++++++++++++++--------------- + 2 files changed, 46 insertions(+), 19 deletions(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -766,6 +766,13 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + ++/* ThinkPad Thunderbolt 3 Dock Gen 2 (based on Realtek RTL8153) */ ++{ ++ USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3082, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), ++ .driver_info = 0, ++}, ++ + /* Lenovo Thinkpad USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ + { + USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7205, USB_CLASS_COMM, +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -619,6 +619,7 @@ enum rtl8152_flags { + SCHEDULE_TASKLET, + GREEN_ETHERNET, + DELL_TB_RX_AGG_BUG, ++ LENOVO_MACPASSTHRU, + }; + + /* Define these values to match your device */ +@@ -1191,38 +1192,52 @@ static int vendor_mac_passthru_addr_read + int ret = -EINVAL; + u32 ocp_data; + unsigned char buf[6]; +- +- /* test for -AD variant of RTL8153 */ +- ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0); +- if ((ocp_data & AD_MASK) == 0x1000) { +- /* test for MAC address pass-through bit */ +- ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE); +- if ((ocp_data & PASS_THRU_MASK) != 1) { +- netif_dbg(tp, probe, tp->netdev, +- "No efuse for RTL8153-AD MAC pass through\n"); +- return -ENODEV; +- } ++ char *mac_obj_name; ++ acpi_object_type mac_obj_type; ++ int mac_strlen; ++ ++ if (test_bit(LENOVO_MACPASSTHRU, &tp->flags)) { ++ mac_obj_name = "\\MACA"; ++ mac_obj_type = ACPI_TYPE_STRING; ++ mac_strlen = 0x16; + } else { +- /* test for RTL8153-BND and RTL8153-BD */ +- ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1); +- if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) { +- netif_dbg(tp, probe, tp->netdev, +- "Invalid variant for MAC pass through\n"); +- return -ENODEV; ++ /* test for -AD variant of RTL8153 */ ++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0); ++ if ((ocp_data & AD_MASK) == 0x1000) { ++ /* test for MAC address pass-through bit */ ++ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE); ++ if ((ocp_data & PASS_THRU_MASK) != 1) { ++ netif_dbg(tp, probe, tp->netdev, ++ "No efuse for RTL8153-AD MAC pass through\n"); ++ return -ENODEV; ++ } ++ } else { ++ /* test for RTL8153-BND and RTL8153-BD */ ++ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1); ++ if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) { ++ netif_dbg(tp, probe, tp->netdev, ++ "Invalid variant for MAC pass through\n"); ++ return -ENODEV; ++ } + } ++ ++ mac_obj_name = "\\_SB.AMAC"; ++ mac_obj_type = ACPI_TYPE_BUFFER; ++ mac_strlen = 0x17; + } + + /* returns _AUXMAC_#AABBCCDDEEFF# */ +- status = acpi_evaluate_object(NULL, "\\_SB.AMAC", NULL, &buffer); ++ status = acpi_evaluate_object(NULL, mac_obj_name, NULL, &buffer); + obj = (union acpi_object *)buffer.pointer; + if (!ACPI_SUCCESS(status)) + return -ENODEV; +- if (obj->type != ACPI_TYPE_BUFFER || obj->string.length != 0x17) { ++ if (obj->type != mac_obj_type || obj->string.length != mac_strlen) { + netif_warn(tp, probe, tp->netdev, + "Invalid buffer for pass-thru MAC addr: (%d, %d)\n", + obj->type, obj->string.length); + goto amacout; + } ++ + if (strncmp(obj->string.pointer, "_AUXMAC_#", 9) != 0 || + strncmp(obj->string.pointer + 0x15, "#", 1) != 0) { + netif_warn(tp, probe, tp->netdev, +@@ -5370,6 +5385,10 @@ static int rtl8152_probe(struct usb_inte + netdev->hw_features &= ~NETIF_F_RXCSUM; + } + ++ if (le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_LENOVO && ++ le16_to_cpu(udev->descriptor.idProduct) == 0x3082) ++ set_bit(LENOVO_MACPASSTHRU, &tp->flags); ++ + if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x3011 && udev->serial && + (!strcmp(udev->serial, "000001000000") || !strcmp(udev->serial, "000002000000"))) { + dev_info(&udev->dev, "Dell TB16 Dock, disable RX aggregation"); +@@ -5481,6 +5500,7 @@ static const struct usb_device_id rtl815 + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069)}, ++ {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214)}, diff --git a/patches.suse/r8152-Disable-PLA-MCU-clock-speed-down.patch b/patches.suse/r8152-Disable-PLA-MCU-clock-speed-down.patch new file mode 100644 index 0000000..095eeae --- /dev/null +++ b/patches.suse/r8152-Disable-PLA-MCU-clock-speed-down.patch @@ -0,0 +1,76 @@ +From 08997b5eec08a2c29367f19a74abdea54b299406 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 22 Jan 2020 16:02:09 +0800 +Subject: [PATCH] r8152: Disable PLA MCU clock speed down +Git-commit: 08997b5eec08a2c29367f19a74abdea54b299406 +References: git-fixes +Patch-mainline: v5.5 + +PLA MCU clock speed down could only be enabled when tx/rx are disabled. +Otherwise, the packet loss may occur. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -310,6 +310,7 @@ + #define MAC_CLK_SPDWN_EN BIT(15) + + /* PLA_MAC_PWR_CTRL3 */ ++#define PLA_MCU_SPDWN_EN BIT(14) + #define PKT_AVAIL_SPDWN_EN 0x0100 + #define SUSPEND_SPDWN_EN 0x0004 + #define U1U2_SPDWN_EN 0x0002 +@@ -3910,6 +3911,8 @@ static void rtl8153_down(struct r8152 *t + + static void rtl8153b_up(struct r8152 *tp) + { ++ u32 ocp_data; ++ + if (test_bit(RTL8152_UNPLUG, &tp->flags)) + return; + +@@ -3920,17 +3923,27 @@ static void rtl8153b_up(struct r8152 *tp + r8153_first_init(tp); + ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, RX_THR_B); + ++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3); ++ ocp_data &= ~PLA_MCU_SPDWN_EN; ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, ocp_data); ++ + r8153b_aldps_en(tp, true); + r8153b_u1u2en(tp, true); + } + + static void rtl8153b_down(struct r8152 *tp) + { ++ u32 ocp_data; ++ + if (test_bit(RTL8152_UNPLUG, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } + ++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3); ++ ocp_data |= PLA_MCU_SPDWN_EN; ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, ocp_data); ++ + r8153b_u1u2en(tp, false); + r8153_u2p3en(tp, false); + r8153b_power_cut_en(tp, false); +@@ -4409,6 +4422,10 @@ static void r8153b_init(struct r8152 *tp + ocp_data |= MAC_CLK_SPDWN_EN; + ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, ocp_data); + ++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3); ++ ocp_data &= ~PLA_MCU_SPDWN_EN; ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, ocp_data); ++ + set_bit(GREEN_ETHERNET, &tp->flags); + + /* rx aggregation */ diff --git a/patches.suse/r8152-Re-order-napi_disable-in-rtl8152_close.patch b/patches.suse/r8152-Re-order-napi_disable-in-rtl8152_close.patch index 1a7da47..3c94db9 100644 --- a/patches.suse/r8152-Re-order-napi_disable-in-rtl8152_close.patch +++ b/patches.suse/r8152-Re-order-napi_disable-in-rtl8152_close.patch @@ -35,10 +35,10 @@ Acked-by: Thomas Bogendoerfer --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c -@@ -4021,10 +4021,10 @@ static int rtl8152_close(struct net_devi - #ifdef CONFIG_PM_SLEEP +@@ -4097,10 +4097,10 @@ static int rtl8152_close(struct net_devi unregister_pm_notifier(&tp->pm_notifier); #endif + tasklet_disable(&tp->tx_tl); - napi_disable(&tp->napi); clear_bit(WORK_ENABLE, &tp->flags); usb_kill_urb(tp->intr_urb); diff --git a/patches.suse/r8152-add-a-helper-function-about-setting-EEE.patch b/patches.suse/r8152-add-a-helper-function-about-setting-EEE.patch new file mode 100644 index 0000000..577b118 --- /dev/null +++ b/patches.suse/r8152-add-a-helper-function-about-setting-EEE.patch @@ -0,0 +1,273 @@ +From e7bde56b7446ccda351a216ff55af09a96fea940 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Fri, 23 Aug 2019 15:33:41 +0800 +Subject: [PATCH] r8152: add a helper function about setting EEE +Git-commit: e7bde56b7446ccda351a216ff55af09a96fea940 +References: git-fixes +Patch-mainline: v5.4-rc1 + +Add a helper function "rtl_eee_enable" for setting EEE. Besides, I +move r8153_eee_en() and r8153b_eee_en(). And, I remove r8152b_enable_eee(), +r8153_set_eee(), and r8153b_set_eee(). + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 168 ++++++++++++++++++---------------------- + 1 file changed, 77 insertions(+), 91 deletions(-) + +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c +index a7aa48bee732..17f0e9e98697 100644 +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -3202,14 +3202,75 @@ static void r8152_eee_en(struct r8152 *tp, bool enable) + ocp_reg_write(tp, OCP_EEE_CONFIG3, config3); + } + +-static void r8152b_enable_eee(struct r8152 *tp) ++static void r8153_eee_en(struct r8152 *tp, bool enable) + { +- if (tp->eee_en) { +- r8152_eee_en(tp, true); +- r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, tp->eee_adv); ++ u32 ocp_data; ++ u16 config; ++ ++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR); ++ config = ocp_reg_read(tp, OCP_EEE_CFG); ++ ++ if (enable) { ++ ocp_data |= EEE_RX_EN | EEE_TX_EN; ++ config |= EEE10_EN; + } else { +- r8152_eee_en(tp, false); +- r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); ++ ocp_data &= ~(EEE_RX_EN | EEE_TX_EN); ++ config &= ~EEE10_EN; ++ } ++ ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_CR, ocp_data); ++ ocp_reg_write(tp, OCP_EEE_CFG, config); ++} ++ ++static void r8153b_eee_en(struct r8152 *tp, bool enable) ++{ ++ r8153_eee_en(tp, enable); ++ ++ if (enable) ++ r8153b_ups_flags_w1w0(tp, UPS_FLAGS_EN_EEE, 0); ++ else ++ r8153b_ups_flags_w1w0(tp, 0, UPS_FLAGS_EN_EEE); ++} ++ ++static void rtl_eee_enable(struct r8152 *tp, bool enable) ++{ ++ switch (tp->version) { ++ case RTL_VER_01: ++ case RTL_VER_02: ++ case RTL_VER_07: ++ if (enable) { ++ r8152_eee_en(tp, true); ++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, ++ tp->eee_adv); ++ } else { ++ r8152_eee_en(tp, false); ++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); ++ } ++ break; ++ case RTL_VER_03: ++ case RTL_VER_04: ++ case RTL_VER_05: ++ case RTL_VER_06: ++ if (enable) { ++ r8153_eee_en(tp, true); ++ ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); ++ } else { ++ r8153_eee_en(tp, false); ++ ocp_reg_write(tp, OCP_EEE_ADV, 0); ++ } ++ break; ++ case RTL_VER_08: ++ case RTL_VER_09: ++ if (enable) { ++ r8153b_eee_en(tp, true); ++ ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); ++ } else { ++ r8153b_eee_en(tp, false); ++ ocp_reg_write(tp, OCP_EEE_ADV, 0); ++ } ++ break; ++ default: ++ break; + } + } + +@@ -3231,7 +3292,7 @@ static void rtl8152_disable(struct r8152 *tp) + + static void r8152b_hw_phy_cfg(struct r8152 *tp) + { +- r8152b_enable_eee(tp); ++ rtl_eee_enable(tp, tp->eee_en); + r8152_aldps_en(tp, true); + r8152b_enable_fc(tp); + +@@ -3425,36 +3486,6 @@ static void r8153b_aldps_en(struct r8152 *tp, bool enable) + r8153b_ups_flags_w1w0(tp, 0, UPS_FLAGS_EN_ALDPS); + } + +-static void r8153_eee_en(struct r8152 *tp, bool enable) +-{ +- u32 ocp_data; +- u16 config; +- +- ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR); +- config = ocp_reg_read(tp, OCP_EEE_CFG); +- +- if (enable) { +- ocp_data |= EEE_RX_EN | EEE_TX_EN; +- config |= EEE10_EN; +- } else { +- ocp_data &= ~(EEE_RX_EN | EEE_TX_EN); +- config &= ~EEE10_EN; +- } +- +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_CR, ocp_data); +- ocp_reg_write(tp, OCP_EEE_CFG, config); +-} +- +-static void r8153b_eee_en(struct r8152 *tp, bool enable) +-{ +- r8153_eee_en(tp, enable); +- +- if (enable) +- r8153b_ups_flags_w1w0(tp, UPS_FLAGS_EN_EEE, 0); +- else +- r8153b_ups_flags_w1w0(tp, 0, UPS_FLAGS_EN_EEE); +-} +- + static void r8153b_enable_fc(struct r8152 *tp) + { + r8152b_enable_fc(tp); +@@ -3470,8 +3501,7 @@ static void r8153_hw_phy_cfg(struct r8152 *tp) + r8153_aldps_en(tp, false); + + /* disable EEE before updating the PHY parameters */ +- r8153_eee_en(tp, false); +- ocp_reg_write(tp, OCP_EEE_ADV, 0); ++ rtl_eee_enable(tp, false); + + if (tp->version == RTL_VER_03) { + data = ocp_reg_read(tp, OCP_EEE_CFG); +@@ -3502,10 +3532,8 @@ static void r8153_hw_phy_cfg(struct r8152 *tp) + sram_write(tp, SRAM_10M_AMP1, 0x00af); + sram_write(tp, SRAM_10M_AMP2, 0x0208); + +- if (tp->eee_en) { +- r8153_eee_en(tp, true); +- ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); +- } ++ if (tp->eee_en) ++ rtl_eee_enable(tp, true); + + r8153_aldps_en(tp, true); + r8152b_enable_fc(tp); +@@ -3545,8 +3573,7 @@ static void r8153b_hw_phy_cfg(struct r8152 *tp) + r8153b_aldps_en(tp, false); + + /* disable EEE before updating the PHY parameters */ +- r8153b_eee_en(tp, false); +- ocp_reg_write(tp, OCP_EEE_ADV, 0); ++ rtl_eee_enable(tp, false); + + r8153b_green_en(tp, test_bit(GREEN_ETHERNET, &tp->flags)); + +@@ -3608,10 +3635,8 @@ static void r8153b_hw_phy_cfg(struct r8152 *tp) + + r8153b_ups_flags_w1w0(tp, ups_flags, 0); + +- if (tp->eee_en) { +- r8153b_eee_en(tp, true); +- ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); +- } ++ if (tp->eee_en) ++ rtl_eee_enable(tp, true); + + r8153b_aldps_en(tp, true); + r8153b_enable_fc(tp); +@@ -4930,12 +4955,7 @@ static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee) + tp->eee_en = eee->eee_enabled; + tp->eee_adv = val; + +- r8152_eee_en(tp, eee->eee_enabled); +- +- if (eee->eee_enabled) +- r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val); +- else +- r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); ++ rtl_eee_enable(tp, tp->eee_en); + + return 0; + } +@@ -4963,40 +4983,6 @@ static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee) + return 0; + } + +-static int r8153_set_eee(struct r8152 *tp, struct ethtool_eee *eee) +-{ +- u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised); +- +- tp->eee_en = eee->eee_enabled; +- tp->eee_adv = val; +- +- r8153_eee_en(tp, eee->eee_enabled); +- +- if (eee->eee_enabled) +- ocp_reg_write(tp, OCP_EEE_ADV, val); +- else +- ocp_reg_write(tp, OCP_EEE_ADV, 0); +- +- return 0; +-} +- +-static int r8153b_set_eee(struct r8152 *tp, struct ethtool_eee *eee) +-{ +- u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised); +- +- tp->eee_en = eee->eee_enabled; +- tp->eee_adv = val; +- +- r8153b_eee_en(tp, eee->eee_enabled); +- +- if (eee->eee_enabled) +- ocp_reg_write(tp, OCP_EEE_ADV, val); +- else +- ocp_reg_write(tp, OCP_EEE_ADV, 0); +- +- return 0; +-} +- + static int + rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) + { +@@ -5382,7 +5368,7 @@ static int rtl_ops_init(struct r8152 *tp) + ops->down = rtl8153_down; + ops->unload = rtl8153_unload; + ops->eee_get = r8153_get_eee; +- ops->eee_set = r8153_set_eee; ++ ops->eee_set = r8152_set_eee; + ops->in_nway = rtl8153_in_nway; + ops->hw_phy_cfg = r8153_hw_phy_cfg; + ops->autosuspend_en = rtl8153_runtime_enable; +@@ -5400,7 +5386,7 @@ static int rtl_ops_init(struct r8152 *tp) + ops->down = rtl8153b_down; + ops->unload = rtl8153b_unload; + ops->eee_get = r8153_get_eee; +- ops->eee_set = r8153b_set_eee; ++ ops->eee_set = r8152_set_eee; + ops->in_nway = rtl8153_in_nway; + ops->hw_phy_cfg = r8153b_hw_phy_cfg; + ops->autosuspend_en = rtl8153b_runtime_enable; +-- +2.26.2 + diff --git a/patches.suse/r8152-avoid-to-call-napi_disable-twice.patch b/patches.suse/r8152-avoid-to-call-napi_disable-twice.patch index 21d1bf5..41a591a 100644 --- a/patches.suse/r8152-avoid-to-call-napi_disable-twice.patch +++ b/patches.suse/r8152-avoid-to-call-napi_disable-twice.patch @@ -25,10 +25,10 @@ Acked-by: Thomas Bogendoerfer --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c -@@ -4289,10 +4289,10 @@ static int rtl8152_pre_reset(struct usb_ - return 0; +@@ -4366,10 +4366,10 @@ static int rtl8152_pre_reset(struct usb_ netif_stop_queue(netdev); + tasklet_disable(&tp->tx_tl); - napi_disable(&tp->napi); clear_bit(WORK_ENABLE, &tp->flags); usb_kill_urb(tp->intr_urb); @@ -37,7 +37,7 @@ Acked-by: Thomas Bogendoerfer if (netif_carrier_ok(netdev)) { mutex_lock(&tp->control); tp->rtl_ops.disable(tp); -@@ -4409,7 +4409,7 @@ static int rtl8152_system_resume(struct +@@ -4487,7 +4487,7 @@ static int rtl8152_system_resume(struct netif_device_attach(netdev); diff --git a/patches.suse/r8152-disable-U2P3-for-RTL8153B.patch b/patches.suse/r8152-disable-U2P3-for-RTL8153B.patch new file mode 100644 index 0000000..4c7fe76 --- /dev/null +++ b/patches.suse/r8152-disable-U2P3-for-RTL8153B.patch @@ -0,0 +1,43 @@ +From 809a7fc6593f288d6f820ef6cc57b9d69b5f9474 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 22 Jan 2020 16:02:08 +0800 +Subject: [PATCH] r8152: disable U2P3 for RTL8153B +Git-commit: 809a7fc6593f288d6f820ef6cc57b9d69b5f9474 +References: git-fixes +Patch-mainline: v5.5 + +Enable U2P3 may miss zero packet for bulk-in. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -3021,7 +3021,6 @@ static void rtl8153b_runtime_enable(stru + r8153b_ups_en(tp, false); + r8153_queue_wake(tp, false); + rtl_runtime_suspend_enable(tp, false); +- r8153_u2p3en(tp, true); + r8153b_u1u2en(tp, true); + } + } +@@ -3578,7 +3577,6 @@ static void r8153b_hw_phy_cfg(struct r81 + + r8153b_aldps_en(tp, true); + r8153b_enable_fc(tp); +- r8153_u2p3en(tp, true); + + set_bit(PHY_RESET, &tp->flags); + } +@@ -3923,7 +3921,6 @@ static void rtl8153b_up(struct r8152 *tp + ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, RX_THR_B); + + r8153b_aldps_en(tp, true); +- r8153_u2p3en(tp, true); + r8153b_u1u2en(tp, true); + } + diff --git a/patches.suse/r8152-disable-test-IO-for-RTL8153B.patch b/patches.suse/r8152-disable-test-IO-for-RTL8153B.patch index 9703944..aaf8b08 100644 --- a/patches.suse/r8152-disable-test-IO-for-RTL8153B.patch +++ b/patches.suse/r8152-disable-test-IO-for-RTL8153B.patch @@ -19,7 +19,7 @@ Acked-by: Takashi Iwai --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c -@@ -297,6 +297,7 @@ +@@ -298,6 +298,7 @@ /* PLA_PHY_PWR */ #define TX_10M_IDLE_EN 0x0080 #define PFM_PWM_SWITCH 0x0040 @@ -27,9 +27,9 @@ Acked-by: Takashi Iwai /* PLA_MAC_PWR_CTRL */ #define D3_CLK_GATED_EN 0x00004000 -@@ -4264,6 +4265,15 @@ static void r8153b_init(struct r8152 *tp - ocp_data |= MAC_CLK_SPDWN_EN; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, ocp_data); +@@ -4426,6 +4427,15 @@ static void r8153b_init(struct r8152 *tp + ocp_data &= ~PLA_MCU_SPDWN_EN; + ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, ocp_data); + if (tp->version == RTL_VER_09) { + /* Disable Test IO for 32QFN */ diff --git a/patches.suse/r8152-divide-the-tx-and-rx-bottom-functions.patch b/patches.suse/r8152-divide-the-tx-and-rx-bottom-functions.patch new file mode 100644 index 0000000..a85d859 --- /dev/null +++ b/patches.suse/r8152-divide-the-tx-and-rx-bottom-functions.patch @@ -0,0 +1,200 @@ +From d2187f8e445403b7aeb08e64c1528761154e9ab3 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Mon, 19 Aug 2019 14:40:36 +0800 +Subject: [PATCH] r8152: divide the tx and rx bottom functions +Git-commit: d2187f8e445403b7aeb08e64c1528761154e9ab3 +References: git-fixes +Patch-mainline: v5.4-rc1 + +Move the tx bottom function from NAPI to a new tasklet. Then, for +multi-cores, the bottom functions of tx and rx may be run at same +time with different cores. This is used to improve performance. + +On x86, Tx/Rx 943/943 Mbits/sec -> 945/944. +For arm platform, Tx/Rx: 917/917 Mbits/sec -> 933/933. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 39 ++++++++++++++++++++++++++------------- + 1 file changed, 26 insertions(+), 13 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -616,7 +616,7 @@ enum rtl8152_flags { + RTL8152_LINK_CHG, + SELECTIVE_SUSPEND, + PHY_RESET, +- SCHEDULE_NAPI, ++ SCHEDULE_TASKLET, + GREEN_ETHERNET, + DELL_TB_RX_AGG_BUG, + }; +@@ -730,6 +730,7 @@ struct r8152 { + #ifdef CONFIG_PM_SLEEP + struct notifier_block pm_notifier; + #endif ++ struct tasklet_struct tx_tl; + + struct rtl_ops { + void (*init)(struct r8152 *); +@@ -1398,7 +1399,7 @@ static void write_bulk_callback(struct u + return; + + if (!skb_queue_empty(&tp->tx_queue)) +- napi_schedule(&tp->napi); ++ tasklet_schedule(&tp->tx_tl); + } + + static void intr_callback(struct urb *urb) +@@ -2105,8 +2106,12 @@ static void tx_bottom(struct r8152 *tp) + } while (res == 0); + } + +-static void bottom_half(struct r8152 *tp) ++static void bottom_half(unsigned long data) + { ++ struct r8152 *tp; ++ ++ tp = (struct r8152 *)data; ++ + if (test_bit(RTL8152_UNPLUG, &tp->flags)) + return; + +@@ -2118,7 +2123,7 @@ static void bottom_half(struct r8152 *tp + if (!netif_carrier_ok(tp->netdev)) + return; + +- clear_bit(SCHEDULE_NAPI, &tp->flags); ++ clear_bit(SCHEDULE_TASKLET, &tp->flags); + + tx_bottom(tp); + } +@@ -2129,16 +2134,12 @@ static int r8152_poll(struct napi_struct + int work_done; + + work_done = rx_bottom(tp, budget); +- bottom_half(tp); + + if (work_done < budget) { + if (!napi_complete_done(napi, work_done)) + goto out; + if (!list_empty(&tp->rx_done)) + napi_schedule(napi); +- else if (!skb_queue_empty(&tp->tx_queue) && +- !list_empty(&tp->tx_free)) +- napi_schedule(napi); + } + + out: +@@ -2292,11 +2293,11 @@ static netdev_tx_t rtl8152_start_xmit(st + + if (!list_empty(&tp->tx_free)) { + if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { +- set_bit(SCHEDULE_NAPI, &tp->flags); ++ set_bit(SCHEDULE_TASKLET, &tp->flags); + schedule_delayed_work(&tp->schedule, 0); + } else { + usb_mark_last_busy(tp->udev); +- napi_schedule(&tp->napi); ++ tasklet_schedule(&tp->tx_tl); + } + } else if (skb_queue_len(&tp->tx_queue) > tp->tx_qlen) { + netif_stop_queue(netdev); +@@ -3930,9 +3931,11 @@ static void set_carrier(struct r8152 *tp + } else { + if (netif_carrier_ok(netdev)) { + netif_carrier_off(netdev); ++ tasklet_disable(&tp->tx_tl); + napi_disable(napi); + tp->rtl_ops.disable(tp); + napi_enable(napi); ++ tasklet_enable(&tp->tx_tl); + netif_info(tp, link, netdev, "carrier off\n"); + } + } +@@ -3965,10 +3968,10 @@ static void rtl_work_func_t(struct work_ + if (test_and_clear_bit(RTL8152_SET_RX_MODE, &tp->flags)) + _rtl8152_set_rx_mode(tp->netdev); + +- /* don't schedule napi before linking */ +- if (test_and_clear_bit(SCHEDULE_NAPI, &tp->flags) && ++ /* don't schedule tasket before linking */ ++ if (test_and_clear_bit(SCHEDULE_TASKLET, &tp->flags) && + netif_carrier_ok(tp->netdev)) +- napi_schedule(&tp->napi); ++ tasklet_schedule(&tp->tx_tl); + + mutex_unlock(&tp->control); + +@@ -4054,6 +4057,7 @@ static int rtl8152_open(struct net_devic + goto out_unlock; + } + napi_enable(&tp->napi); ++ tasklet_enable(&tp->tx_tl); + + mutex_unlock(&tp->control); + +@@ -4081,6 +4085,7 @@ static int rtl8152_close(struct net_devi + #ifdef CONFIG_PM_SLEEP + unregister_pm_notifier(&tp->pm_notifier); + #endif ++ tasklet_disable(&tp->tx_tl); + napi_disable(&tp->napi); + clear_bit(WORK_ENABLE, &tp->flags); + usb_kill_urb(tp->intr_urb); +@@ -4349,6 +4354,7 @@ static int rtl8152_pre_reset(struct usb_ + return 0; + + netif_stop_queue(netdev); ++ tasklet_disable(&tp->tx_tl); + napi_disable(&tp->napi); + clear_bit(WORK_ENABLE, &tp->flags); + usb_kill_urb(tp->intr_urb); +@@ -4392,6 +4398,7 @@ static int rtl8152_post_reset(struct usb + } + + napi_enable(&tp->napi); ++ tasklet_enable(&tp->tx_tl); + netif_wake_queue(netdev); + usb_submit_urb(tp->intr_urb, GFP_KERNEL); + +@@ -4545,10 +4552,12 @@ static int rtl8152_system_suspend(struct + + clear_bit(WORK_ENABLE, &tp->flags); + usb_kill_urb(tp->intr_urb); ++ tasklet_disable(&tp->tx_tl); + napi_disable(napi); + cancel_delayed_work_sync(&tp->schedule); + tp->rtl_ops.down(tp); + napi_enable(napi); ++ tasklet_enable(&tp->tx_tl); + } + + return 0; +@@ -5333,6 +5342,8 @@ static int rtl8152_probe(struct usb_inte + mutex_init(&tp->control); + INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t); + INIT_DELAYED_WORK(&tp->hw_phy_work, rtl_hw_phy_work_func_t); ++ tasklet_init(&tp->tx_tl, bottom_half, (unsigned long)tp); ++ tasklet_disable(&tp->tx_tl); + + netdev->netdev_ops = &rtl8152_netdev_ops; + netdev->watchdog_timeo = RTL8152_TX_TIMEOUT; +@@ -5415,6 +5426,7 @@ static int rtl8152_probe(struct usb_inte + return 0; + + out1: ++ tasklet_kill(&tp->tx_tl); + usb_set_intfdata(intf, NULL); + out: + free_netdev(netdev); +@@ -5430,6 +5442,7 @@ static void rtl8152_disconnect(struct us + rtl_set_unplug(tp); + + unregister_netdev(tp->netdev); ++ tasklet_kill(&tp->tx_tl); + cancel_delayed_work_sync(&tp->hw_phy_work); + tp->rtl_ops.unload(tp); + free_netdev(tp->netdev); diff --git a/patches.suse/r8152-don-t-enable-U1U2-with-USB_SPEED_HIGH-for-RTL8.patch b/patches.suse/r8152-don-t-enable-U1U2-with-USB_SPEED_HIGH-for-RTL8.patch new file mode 100644 index 0000000..2acf8f2 --- /dev/null +++ b/patches.suse/r8152-don-t-enable-U1U2-with-USB_SPEED_HIGH-for-RTL8.patch @@ -0,0 +1,51 @@ +From a0246dafe684a6d5ad31ccd59af0334ccf0cc7b2 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 22 Jan 2020 16:02:11 +0800 +Subject: [PATCH] r8152: don't enable U1U2 with USB_SPEED_HIGH for RTL8153B +Git-commit: a0246dafe684a6d5ad31ccd59af0334ccf0cc7b2 +References: git-fixes +Patch-mainline: v5.5 + +For certain platforms, it causes USB reset periodically. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -3023,7 +3023,8 @@ static void rtl8153b_runtime_enable(stru + r8153b_ups_en(tp, false); + r8153_queue_wake(tp, false); + rtl_runtime_suspend_enable(tp, false); +- r8153b_u1u2en(tp, true); ++ if (tp->udev->speed != USB_SPEED_HIGH) ++ r8153b_u1u2en(tp, true); + } + } + +@@ -3929,7 +3930,9 @@ static void rtl8153b_up(struct r8152 *tp + ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, ocp_data); + + r8153b_aldps_en(tp, true); +- r8153b_u1u2en(tp, true); ++ ++ if (tp->udev->speed != USB_SPEED_HIGH) ++ r8153b_u1u2en(tp, true); + } + + static void rtl8153b_down(struct r8152 *tp) +@@ -4415,7 +4418,9 @@ static void r8153b_init(struct r8152 *tp + ocp_data &= ~CUR_LINK_OK; + ocp_data |= POLL_LINK_CHG; + ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data); +- r8153b_u1u2en(tp, true); ++ ++ if (tp->udev->speed != USB_SPEED_HIGH) ++ r8153b_u1u2en(tp, true); + usb_enable_lpm(tp->udev); + + /* MAC clock speed down */ diff --git a/patches.suse/r8152-fix-runtime-resume-for-linking-change.patch b/patches.suse/r8152-fix-runtime-resume-for-linking-change.patch new file mode 100644 index 0000000..d9499a7 --- /dev/null +++ b/patches.suse/r8152-fix-runtime-resume-for-linking-change.patch @@ -0,0 +1,73 @@ +From a39142728d0e60a76b67db3cbc187d61fde7b46d Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 22 Jan 2020 16:02:05 +0800 +Subject: [PATCH] r8152: fix runtime resume for linking change +Git-commit: a39142728d0e60a76b67db3cbc187d61fde7b46d +References: git-fixes +Patch-mainline: v5.5 + +Fix the runtime resume doesn't work normally for linking change. + +1. Reset the settings and status of runtime suspend. +2. Sync the linking status. +3. Poll the linking change. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -347,7 +347,9 @@ + #define UPCOMING_RUNTIME_D3 BIT(0) + + /* PLA_EXTRA_STATUS */ ++#define CUR_LINK_OK BIT(15) + #define LINK_CHANGE_FLAG BIT(8) ++#define POLL_LINK_CHG BIT(0) + + /* USB_USB2PHY */ + #define USB2PHY_SUSPEND 0x0001 +@@ -4275,6 +4277,16 @@ static void r8153_init(struct r8152 *tp) + else + ocp_data |= DYNAMIC_BURST; + ocp_write_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY1, ocp_data); ++ ++ r8153_queue_wake(tp, false); ++ ++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS); ++ if (rtl8152_get_speed(tp) & LINK_STATUS) ++ ocp_data |= CUR_LINK_OK; ++ else ++ ocp_data &= ~CUR_LINK_OK; ++ ocp_data |= POLL_LINK_CHG; ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data); + } + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY2); +@@ -4304,6 +4316,7 @@ static void r8153_init(struct r8152 *tp) + ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001); + + r8153_power_cut_en(tp, false); ++ rtl_runtime_suspend_enable(tp, false); + r8153_u1u2en(tp, true); + r8153_mac_clk_spd(tp, false); + usb_enable_lpm(tp->udev); +@@ -4372,6 +4385,14 @@ static void r8153b_init(struct r8152 *tp + r8153b_ups_en(tp, false); + r8153_queue_wake(tp, false); + rtl_runtime_suspend_enable(tp, false); ++ ++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS); ++ if (rtl8152_get_speed(tp) & LINK_STATUS) ++ ocp_data |= CUR_LINK_OK; ++ else ++ ocp_data &= ~CUR_LINK_OK; ++ ocp_data |= POLL_LINK_CHG; ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data); + r8153b_u1u2en(tp, true); + usb_enable_lpm(tp->udev); + diff --git a/patches.suse/r8152-replace-array-with-linking-list-for-rx-informa.patch b/patches.suse/r8152-replace-array-with-linking-list-for-rx-informa.patch new file mode 100644 index 0000000..ac41c6c --- /dev/null +++ b/patches.suse/r8152-replace-array-with-linking-list-for-rx-informa.patch @@ -0,0 +1,292 @@ +From 252df8b86667fe4640a2d9fb5cfc705ad285d578 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 13 Aug 2019 11:42:06 +0800 +Subject: [PATCH] r8152: replace array with linking list for rx information +Git-commit: 252df8b86667fe4640a2d9fb5cfc705ad285d578 +References: git-fixes +Patch-mainline: v5.4-rc1 + +The original method uses an array to store the rx information. The +new one uses a list to link each rx structure. Then, it is possible +to increase/decrease the number of rx structure dynamically. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 182 +++++++++++++++++++++++++++------------- + 1 file changed, 125 insertions(+), 57 deletions(-) + +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c +index 94da79028a65..d063c9b358e5 100644 +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + + /* Information for net-next */ +@@ -694,7 +695,7 @@ struct tx_desc { + struct r8152; + + struct rx_agg { +- struct list_head list; ++ struct list_head list, info_list; + struct urb *urb; + struct r8152 *context; + void *buffer; +@@ -719,7 +720,7 @@ struct r8152 { + struct net_device *netdev; + struct urb *intr_urb; + struct tx_agg tx_info[RTL8152_MAX_TX]; +- struct rx_agg rx_info[RTL8152_MAX_RX]; ++ struct list_head rx_info; + struct list_head rx_done, tx_free; + struct sk_buff_head tx_queue, rx_queue; + spinlock_t rx_lock, tx_lock; +@@ -744,6 +745,8 @@ struct r8152 { + void (*autosuspend_en)(struct r8152 *tp, bool enable); + } rtl_ops; + ++ atomic_t rx_count; ++ + int intr_interval; + u32 saved_wolopts; + u32 msg_enable; +@@ -1468,18 +1471,81 @@ static inline void *tx_agg_align(void *data) + return (void *)ALIGN((uintptr_t)data, TX_ALIGN); + } + ++static void free_rx_agg(struct r8152 *tp, struct rx_agg *agg) ++{ ++ list_del(&agg->info_list); ++ ++ usb_free_urb(agg->urb); ++ kfree(agg->buffer); ++ kfree(agg); ++ ++ atomic_dec(&tp->rx_count); ++} ++ ++static struct rx_agg *alloc_rx_agg(struct r8152 *tp, gfp_t mflags) ++{ ++ struct net_device *netdev = tp->netdev; ++ int node = netdev->dev.parent ? dev_to_node(netdev->dev.parent) : -1; ++ struct rx_agg *rx_agg; ++ unsigned long flags; ++ u8 *buf; ++ ++ rx_agg = kmalloc_node(sizeof(*rx_agg), mflags, node); ++ if (!rx_agg) ++ return NULL; ++ ++ buf = kmalloc_node(tp->rx_buf_sz, mflags, node); ++ if (!buf) ++ goto free_rx; ++ ++ if (buf != rx_agg_align(buf)) { ++ kfree(buf); ++ buf = kmalloc_node(tp->rx_buf_sz + RX_ALIGN, mflags, ++ node); ++ if (!buf) ++ goto free_rx; ++ } ++ ++ rx_agg->buffer = buf; ++ rx_agg->head = rx_agg_align(buf); ++ ++ rx_agg->urb = usb_alloc_urb(0, mflags); ++ if (!rx_agg->urb) ++ goto free_buf; ++ ++ rx_agg->context = tp; ++ ++ INIT_LIST_HEAD(&rx_agg->list); ++ INIT_LIST_HEAD(&rx_agg->info_list); ++ spin_lock_irqsave(&tp->rx_lock, flags); ++ list_add_tail(&rx_agg->info_list, &tp->rx_info); ++ spin_unlock_irqrestore(&tp->rx_lock, flags); ++ ++ atomic_inc(&tp->rx_count); ++ ++ return rx_agg; ++ ++free_buf: ++ kfree(rx_agg->buffer); ++free_rx: ++ kfree(rx_agg); ++ return NULL; ++} ++ + static void free_all_mem(struct r8152 *tp) + { ++ struct rx_agg *agg, *agg_next; ++ unsigned long flags; + int i; + +- for (i = 0; i < RTL8152_MAX_RX; i++) { +- usb_free_urb(tp->rx_info[i].urb); +- tp->rx_info[i].urb = NULL; ++ spin_lock_irqsave(&tp->rx_lock, flags); + +- kfree(tp->rx_info[i].buffer); +- tp->rx_info[i].buffer = NULL; +- tp->rx_info[i].head = NULL; +- } ++ list_for_each_entry_safe(agg, agg_next, &tp->rx_info, info_list) ++ free_rx_agg(tp, agg); ++ ++ spin_unlock_irqrestore(&tp->rx_lock, flags); ++ ++ WARN_ON(atomic_read(&tp->rx_count)); + + for (i = 0; i < RTL8152_MAX_TX; i++) { + usb_free_urb(tp->tx_info[i].urb); +@@ -1503,46 +1569,28 @@ static int alloc_all_mem(struct r8152 *tp) + struct usb_interface *intf = tp->intf; + struct usb_host_interface *alt = intf->cur_altsetting; + struct usb_host_endpoint *ep_intr = alt->endpoint + 2; +- struct urb *urb; + int node, i; +- u8 *buf; + + node = netdev->dev.parent ? dev_to_node(netdev->dev.parent) : -1; + + spin_lock_init(&tp->rx_lock); + spin_lock_init(&tp->tx_lock); ++ INIT_LIST_HEAD(&tp->rx_info); + INIT_LIST_HEAD(&tp->tx_free); + INIT_LIST_HEAD(&tp->rx_done); + skb_queue_head_init(&tp->tx_queue); + skb_queue_head_init(&tp->rx_queue); ++ atomic_set(&tp->rx_count, 0); + + for (i = 0; i < RTL8152_MAX_RX; i++) { +- buf = kmalloc_node(tp->rx_buf_sz, GFP_KERNEL, node); +- if (!buf) ++ if (!alloc_rx_agg(tp, GFP_KERNEL)) + goto err1; +- +- if (buf != rx_agg_align(buf)) { +- kfree(buf); +- buf = kmalloc_node(tp->rx_buf_sz + RX_ALIGN, GFP_KERNEL, +- node); +- if (!buf) +- goto err1; +- } +- +- urb = usb_alloc_urb(0, GFP_KERNEL); +- if (!urb) { +- kfree(buf); +- goto err1; +- } +- +- INIT_LIST_HEAD(&tp->rx_info[i].list); +- tp->rx_info[i].context = tp; +- tp->rx_info[i].urb = urb; +- tp->rx_info[i].buffer = buf; +- tp->rx_info[i].head = rx_agg_align(buf); + } + + for (i = 0; i < RTL8152_MAX_TX; i++) { ++ struct urb *urb; ++ u8 *buf; ++ + buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node); + if (!buf) + goto err1; +@@ -2331,44 +2379,64 @@ static void rxdy_gated_en(struct r8152 *tp, bool enable) + + static int rtl_start_rx(struct r8152 *tp) + { +- int i, ret = 0; ++ struct rx_agg *agg, *agg_next; ++ struct list_head tmp_list; ++ unsigned long flags; ++ int ret = 0; + +- INIT_LIST_HEAD(&tp->rx_done); +- for (i = 0; i < RTL8152_MAX_RX; i++) { +- INIT_LIST_HEAD(&tp->rx_info[i].list); +- ret = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL); +- if (ret) +- break; +- } ++ INIT_LIST_HEAD(&tmp_list); + +- if (ret && ++i < RTL8152_MAX_RX) { +- struct list_head rx_queue; +- unsigned long flags; ++ spin_lock_irqsave(&tp->rx_lock, flags); + +- INIT_LIST_HEAD(&rx_queue); ++ INIT_LIST_HEAD(&tp->rx_done); + +- do { +- struct rx_agg *agg = &tp->rx_info[i++]; +- struct urb *urb = agg->urb; ++ list_splice_init(&tp->rx_info, &tmp_list); + +- urb->actual_length = 0; +- list_add_tail(&agg->list, &rx_queue); +- } while (i < RTL8152_MAX_RX); ++ spin_unlock_irqrestore(&tp->rx_lock, flags); + +- spin_lock_irqsave(&tp->rx_lock, flags); +- list_splice_tail(&rx_queue, &tp->rx_done); +- spin_unlock_irqrestore(&tp->rx_lock, flags); ++ list_for_each_entry_safe(agg, agg_next, &tmp_list, info_list) { ++ INIT_LIST_HEAD(&agg->list); ++ ++ if (ret < 0) ++ list_add_tail(&agg->list, &tp->rx_done); ++ else ++ ret = r8152_submit_rx(tp, agg, GFP_KERNEL); + } + ++ spin_lock_irqsave(&tp->rx_lock, flags); ++ WARN_ON(!list_empty(&tp->rx_info)); ++ list_splice(&tmp_list, &tp->rx_info); ++ spin_unlock_irqrestore(&tp->rx_lock, flags); ++ + return ret; + } + + static int rtl_stop_rx(struct r8152 *tp) + { +- int i; ++ struct rx_agg *agg, *agg_next; ++ struct list_head tmp_list; ++ unsigned long flags; ++ ++ INIT_LIST_HEAD(&tmp_list); ++ ++ /* The usb_kill_urb() couldn't be used in atomic. ++ * Therefore, move the list of rx_info to a tmp one. ++ * Then, list_for_each_entry_safe could be used without ++ * spin lock. ++ */ ++ ++ spin_lock_irqsave(&tp->rx_lock, flags); ++ list_splice_init(&tp->rx_info, &tmp_list); ++ spin_unlock_irqrestore(&tp->rx_lock, flags); ++ ++ list_for_each_entry_safe(agg, agg_next, &tmp_list, info_list) ++ usb_kill_urb(agg->urb); + +- for (i = 0; i < RTL8152_MAX_RX; i++) +- usb_kill_urb(tp->rx_info[i].urb); ++ /* Move back the list of temp to the rx_info */ ++ spin_lock_irqsave(&tp->rx_lock, flags); ++ WARN_ON(!list_empty(&tp->rx_info)); ++ list_splice(&tmp_list, &tp->rx_info); ++ spin_unlock_irqrestore(&tp->rx_lock, flags); + + while (!skb_queue_empty(&tp->rx_queue)) + dev_kfree_skb(__skb_dequeue(&tp->rx_queue)); +-- +2.26.2 + diff --git a/patches.suse/r8152-reset-flow-control-patch-when-linking-on-for-R.patch b/patches.suse/r8152-reset-flow-control-patch-when-linking-on-for-R.patch new file mode 100644 index 0000000..35c862d --- /dev/null +++ b/patches.suse/r8152-reset-flow-control-patch-when-linking-on-for-R.patch @@ -0,0 +1,56 @@ +From f99cd20eda12b1920ffc284a736437c016b3a5a2 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 22 Jan 2020 16:02:06 +0800 +Subject: [PATCH] r8152: reset flow control patch when linking on for RTL8153B +Git-commit: f99cd20eda12b1920ffc284a736437c016b3a5a2 +References: git-fixes +Patch-mainline: v5.5 + +When linking ON, the patch of flow control has to be reset. This +makes sure the patch works normally. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -126,6 +126,7 @@ + #define USB_LPM_CTRL 0xd41a + #define USB_BMU_RESET 0xd4b0 + #define USB_U1U2_TIMER 0xd4da ++#define USB_FW_TASK 0xd4e8 /* RTL8153B */ + #define USB_UPS_CTRL 0xd800 + #define USB_POWER_CUT 0xd80a + #define USB_MISC_0 0xd81a +@@ -394,6 +395,9 @@ + #define OWN_UPDATE BIT(0) + #define OWN_CLEAR BIT(1) + ++/* USB_FW_TASK */ ++#define FC_PATCH_TASK BIT(1) ++ + /* USB_UPS_CTRL */ + #define POWER_CUT 0x0100 + +@@ -2561,6 +2565,17 @@ static int rtl8153_enable(struct r8152 * + r8153_set_rx_early_timeout(tp); + r8153_set_rx_early_size(tp); + ++ if (tp->version == RTL_VER_09) { ++ u32 ocp_data; ++ ++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_TASK); ++ ocp_data &= ~FC_PATCH_TASK; ++ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_TASK, ocp_data); ++ usleep_range(1000, 2000); ++ ocp_data |= FC_PATCH_TASK; ++ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_TASK, ocp_data); ++ } ++ + return rtl_enable(tp); + } + diff --git a/patches.suse/r8152-saving-the-settings-of-EEE.patch b/patches.suse/r8152-saving-the-settings-of-EEE.patch new file mode 100644 index 0000000..33ed62a --- /dev/null +++ b/patches.suse/r8152-saving-the-settings-of-EEE.patch @@ -0,0 +1,214 @@ +From f4a93be689dfc887d73cdaf4245a8a7d031aa912 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Fri, 23 Aug 2019 15:33:40 +0800 +Subject: [PATCH] r8152: saving the settings of EEE +Git-commit: f4a93be689dfc887d73cdaf4245a8a7d031aa912 +References: git-fixes +Patch-mainline: v5.4-rc1 + +Saving the settings of EEE to avoid they become the default settings +after reset_resume(). + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 80 ++++++++++++++++++++++++++++++------------------ + 1 file changed, 50 insertions(+), 30 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -747,6 +747,7 @@ struct r8152 { + + atomic_t rx_count; + ++ bool eee_en; + int intr_interval; + u32 saved_wolopts; + u32 msg_enable; +@@ -755,6 +756,7 @@ struct r8152 { + u32 rx_buf_sz; + u16 ocp_base; + u16 speed; ++ u16 eee_adv; + u8 *intr_buff; + u8 version; + u8 duplex; +@@ -3111,8 +3113,13 @@ static void r8152_eee_en(struct r8152 *t + + static void r8152b_enable_eee(struct r8152 *tp) + { +- r8152_eee_en(tp, true); +- r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, MDIO_EEE_100TX); ++ if (tp->eee_en) { ++ r8152_eee_en(tp, true); ++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, tp->eee_adv); ++ } else { ++ r8152_eee_en(tp, false); ++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); ++ } + } + + static void r8152b_enable_fc(struct r8152 *tp) +@@ -3404,8 +3411,10 @@ static void r8153_hw_phy_cfg(struct r815 + sram_write(tp, SRAM_10M_AMP1, 0x00af); + sram_write(tp, SRAM_10M_AMP2, 0x0208); + +- r8153_eee_en(tp, true); +- ocp_reg_write(tp, OCP_EEE_ADV, MDIO_EEE_1000T | MDIO_EEE_100TX); ++ if (tp->eee_en) { ++ r8153_eee_en(tp, true); ++ ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); ++ } + + r8153_aldps_en(tp, true); + r8152b_enable_fc(tp); +@@ -3508,8 +3517,10 @@ static void r8153b_hw_phy_cfg(struct r81 + + r8153b_ups_flags_w1w0(tp, ups_flags, 0); + +- r8153b_eee_en(tp, true); +- ocp_reg_write(tp, OCP_EEE_ADV, MDIO_EEE_1000T | MDIO_EEE_100TX); ++ if (tp->eee_en) { ++ r8153b_eee_en(tp, true); ++ ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); ++ } + + r8153b_aldps_en(tp, true); + r8153b_enable_fc(tp); +@@ -4791,7 +4802,7 @@ static void rtl8152_get_strings(struct n + + static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee) + { +- u32 ocp_data, lp, adv, supported = 0; ++ u32 lp, adv, supported = 0; + u16 val; + + val = r8152_mmd_read(tp, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE); +@@ -4803,13 +4814,10 @@ static int r8152_get_eee(struct r8152 *t + val = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE); + lp = mmd_eee_adv_to_ethtool_adv_t(val); + +- ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR); +- ocp_data &= EEE_RX_EN | EEE_TX_EN; +- +- eee->eee_enabled = !!ocp_data; ++ eee->eee_enabled = tp->eee_en; + eee->eee_active = !!(supported & adv & lp); + eee->supported = supported; +- eee->advertised = adv; ++ eee->advertised = tp->eee_adv; + eee->lp_advertised = lp; + + return 0; +@@ -4819,19 +4827,22 @@ static int r8152_set_eee(struct r8152 *t + { + u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised); + +- r8152_eee_en(tp, eee->eee_enabled); ++ tp->eee_en = eee->eee_enabled; ++ tp->eee_adv = val; + +- if (!eee->eee_enabled) +- val = 0; ++ r8152_eee_en(tp, eee->eee_enabled); + +- r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val); ++ if (eee->eee_enabled) ++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val); ++ else ++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); + + return 0; + } + + static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee) + { +- u32 ocp_data, lp, adv, supported = 0; ++ u32 lp, adv, supported = 0; + u16 val; + + val = ocp_reg_read(tp, OCP_EEE_ABLE); +@@ -4843,13 +4854,10 @@ static int r8153_get_eee(struct r8152 *t + val = ocp_reg_read(tp, OCP_EEE_LPABLE); + lp = mmd_eee_adv_to_ethtool_adv_t(val); + +- ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR); +- ocp_data &= EEE_RX_EN | EEE_TX_EN; +- +- eee->eee_enabled = !!ocp_data; ++ eee->eee_enabled = tp->eee_en; + eee->eee_active = !!(supported & adv & lp); + eee->supported = supported; +- eee->advertised = adv; ++ eee->advertised = tp->eee_adv; + eee->lp_advertised = lp; + + return 0; +@@ -4859,12 +4867,15 @@ static int r8153_set_eee(struct r8152 *t + { + u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised); + +- r8153_eee_en(tp, eee->eee_enabled); ++ tp->eee_en = eee->eee_enabled; ++ tp->eee_adv = val; + +- if (!eee->eee_enabled) +- val = 0; ++ r8153_eee_en(tp, eee->eee_enabled); + +- ocp_reg_write(tp, OCP_EEE_ADV, val); ++ if (eee->eee_enabled) ++ ocp_reg_write(tp, OCP_EEE_ADV, val); ++ else ++ ocp_reg_write(tp, OCP_EEE_ADV, 0); + + return 0; + } +@@ -4873,12 +4884,15 @@ static int r8153b_set_eee(struct r8152 * + { + u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised); + +- r8153b_eee_en(tp, eee->eee_enabled); ++ tp->eee_en = eee->eee_enabled; ++ tp->eee_adv = val; + +- if (!eee->eee_enabled) +- val = 0; ++ r8153b_eee_en(tp, eee->eee_enabled); + +- ocp_reg_write(tp, OCP_EEE_ADV, val); ++ if (eee->eee_enabled) ++ ocp_reg_write(tp, OCP_EEE_ADV, val); ++ else ++ ocp_reg_write(tp, OCP_EEE_ADV, 0); + + return 0; + } +@@ -5178,6 +5192,8 @@ static int rtl_ops_init(struct r8152 *tp + ops->hw_phy_cfg = r8152b_hw_phy_cfg; + ops->autosuspend_en = rtl_runtime_suspend_enable; + tp->rx_buf_sz = 16 * 1024; ++ tp->eee_en = true; ++ tp->eee_adv = MDIO_EEE_100TX; + break; + + case RTL_VER_03: +@@ -5196,6 +5212,8 @@ static int rtl_ops_init(struct r8152 *tp + ops->hw_phy_cfg = r8153_hw_phy_cfg; + ops->autosuspend_en = rtl8153_runtime_enable; + tp->rx_buf_sz = 32 * 1024; ++ tp->eee_en = true; ++ tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; + break; + + case RTL_VER_08: +@@ -5212,6 +5230,8 @@ static int rtl_ops_init(struct r8152 *tp + ops->hw_phy_cfg = r8153b_hw_phy_cfg; + ops->autosuspend_en = rtl8153b_runtime_enable; + tp->rx_buf_sz = 32 * 1024; ++ tp->eee_en = true; ++ tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; + break; + + default: diff --git a/patches.suse/r8152-separate-the-rx-buffer-size.patch b/patches.suse/r8152-separate-the-rx-buffer-size.patch new file mode 100644 index 0000000..54a0b9e --- /dev/null +++ b/patches.suse/r8152-separate-the-rx-buffer-size.patch @@ -0,0 +1,91 @@ +From ec5791c202aca90c1b3b99dff268a995cf2d6aa1 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 13 Aug 2019 11:42:05 +0800 +Subject: [PATCH] r8152: separate the rx buffer size +Git-commit: ec5791c202aca90c1b3b99dff268a995cf2d6aa1 +References: git-fixes +Patch-mainline: v5.4-rc1 + +The different chips may accept different rx buffer sizes. The RTL8152 +supports 16K bytes, and RTL8153 support 32K bytes. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c +index 0cc03a9ff545..94da79028a65 100644 +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -749,6 +749,7 @@ struct r8152 { + u32 msg_enable; + u32 tx_qlen; + u32 coalesce; ++ u32 rx_buf_sz; + u16 ocp_base; + u16 speed; + u8 *intr_buff; +@@ -1516,13 +1517,13 @@ static int alloc_all_mem(struct r8152 *tp) + skb_queue_head_init(&tp->rx_queue); + + for (i = 0; i < RTL8152_MAX_RX; i++) { +- buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node); ++ buf = kmalloc_node(tp->rx_buf_sz, GFP_KERNEL, node); + if (!buf) + goto err1; + + if (buf != rx_agg_align(buf)) { + kfree(buf); +- buf = kmalloc_node(agg_buf_sz + RX_ALIGN, GFP_KERNEL, ++ buf = kmalloc_node(tp->rx_buf_sz + RX_ALIGN, GFP_KERNEL, + node); + if (!buf) + goto err1; +@@ -2113,7 +2114,7 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags) + return 0; + + usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1), +- agg->head, agg_buf_sz, ++ agg->head, tp->rx_buf_sz, + (usb_complete_t)read_bulk_callback, agg); + + ret = usb_submit_urb(agg->urb, mem_flags); +@@ -2447,7 +2448,7 @@ static void r8153_set_rx_early_timeout(struct r8152 *tp) + + static void r8153_set_rx_early_size(struct r8152 *tp) + { +- u32 ocp_data = agg_buf_sz - rx_reserved_size(tp->netdev->mtu); ++ u32 ocp_data = tp->rx_buf_sz - rx_reserved_size(tp->netdev->mtu); + + switch (tp->version) { + case RTL_VER_03: +@@ -5115,6 +5116,7 @@ static int rtl_ops_init(struct r8152 *tp) + ops->in_nway = rtl8152_in_nway; + ops->hw_phy_cfg = r8152b_hw_phy_cfg; + ops->autosuspend_en = rtl_runtime_suspend_enable; ++ tp->rx_buf_sz = 16 * 1024; + break; + + case RTL_VER_03: +@@ -5132,6 +5134,7 @@ static int rtl_ops_init(struct r8152 *tp) + ops->in_nway = rtl8153_in_nway; + ops->hw_phy_cfg = r8153_hw_phy_cfg; + ops->autosuspend_en = rtl8153_runtime_enable; ++ tp->rx_buf_sz = 32 * 1024; + break; + + case RTL_VER_08: +@@ -5147,6 +5150,7 @@ static int rtl_ops_init(struct r8152 *tp) + ops->in_nway = rtl8153_in_nway; + ops->hw_phy_cfg = r8153b_hw_phy_cfg; + ops->autosuspend_en = rtl8153b_runtime_enable; ++ tp->rx_buf_sz = 32 * 1024; + break; + + default: +-- +2.26.2 + diff --git a/patches.suse/r8152-use-alloc_pages-for-rx-buffer.patch b/patches.suse/r8152-use-alloc_pages-for-rx-buffer.patch new file mode 100644 index 0000000..959c4e1 --- /dev/null +++ b/patches.suse/r8152-use-alloc_pages-for-rx-buffer.patch @@ -0,0 +1,114 @@ +From d55d70894c6d4709b9ae61109a9fa7c319586b53 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 13 Aug 2019 11:42:07 +0800 +Subject: [PATCH] r8152: use alloc_pages for rx buffer +Git-commit: d55d70894c6d4709b9ae61109a9fa7c319586b53 +References: git-fixes +Patch-mainline: v5.4-rc1 + +Replace kmalloc_node() with alloc_pages() for rx buffer. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/r8152.c | 31 +++++++++++-------------------- + 1 file changed, 11 insertions(+), 20 deletions(-) + +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c +index d063c9b358e5..f41cb728e999 100644 +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -698,8 +698,8 @@ struct rx_agg { + struct list_head list, info_list; + struct urb *urb; + struct r8152 *context; ++ struct page *page; + void *buffer; +- void *head; + }; + + struct tx_agg { +@@ -1476,7 +1476,7 @@ static void free_rx_agg(struct r8152 *tp, struct rx_agg *agg) + list_del(&agg->info_list); + + usb_free_urb(agg->urb); +- kfree(agg->buffer); ++ __free_pages(agg->page, get_order(tp->rx_buf_sz)); + kfree(agg); + + atomic_dec(&tp->rx_count); +@@ -1486,28 +1486,19 @@ static struct rx_agg *alloc_rx_agg(struct r8152 *tp, gfp_t mflags) + { + struct net_device *netdev = tp->netdev; + int node = netdev->dev.parent ? dev_to_node(netdev->dev.parent) : -1; ++ unsigned int order = get_order(tp->rx_buf_sz); + struct rx_agg *rx_agg; + unsigned long flags; +- u8 *buf; + + rx_agg = kmalloc_node(sizeof(*rx_agg), mflags, node); + if (!rx_agg) + return NULL; + +- buf = kmalloc_node(tp->rx_buf_sz, mflags, node); +- if (!buf) ++ rx_agg->page = alloc_pages(mflags, order); ++ if (!rx_agg->page) + goto free_rx; + +- if (buf != rx_agg_align(buf)) { +- kfree(buf); +- buf = kmalloc_node(tp->rx_buf_sz + RX_ALIGN, mflags, +- node); +- if (!buf) +- goto free_rx; +- } +- +- rx_agg->buffer = buf; +- rx_agg->head = rx_agg_align(buf); ++ rx_agg->buffer = page_address(rx_agg->page); + + rx_agg->urb = usb_alloc_urb(0, mflags); + if (!rx_agg->urb) +@@ -1526,7 +1517,7 @@ static struct rx_agg *alloc_rx_agg(struct r8152 *tp, gfp_t mflags) + return rx_agg; + + free_buf: +- kfree(rx_agg->buffer); ++ __free_pages(rx_agg->page, order); + free_rx: + kfree(rx_agg); + return NULL; +@@ -2003,8 +1994,8 @@ static int rx_bottom(struct r8152 *tp, int budget) + if (urb->actual_length < ETH_ZLEN) + goto submit; + +- rx_desc = agg->head; +- rx_data = agg->head; ++ rx_desc = agg->buffer; ++ rx_data = agg->buffer; + len_used += sizeof(struct rx_desc); + + while (urb->actual_length > len_used) { +@@ -2051,7 +2042,7 @@ static int rx_bottom(struct r8152 *tp, int budget) + find_next_rx: + rx_data = rx_agg_align(rx_data + pkt_len + ETH_FCS_LEN); + rx_desc = (struct rx_desc *)rx_data; +- len_used = (int)(rx_data - (u8 *)agg->head); ++ len_used = (int)(rx_data - (u8 *)agg->buffer); + len_used += sizeof(struct rx_desc); + } + +@@ -2162,7 +2153,7 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags) + return 0; + + usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1), +- agg->head, tp->rx_buf_sz, ++ agg->buffer, tp->rx_buf_sz, + (usb_complete_t)read_bulk_callback, agg); + + ret = usb_submit_urb(agg->urb, mem_flags); +-- +2.26.2 + diff --git a/patches.suse/rndis_host-set-proper-input-size-for-OID_GEN_PHYSICA.patch b/patches.suse/rndis_host-set-proper-input-size-for-OID_GEN_PHYSICA.patch new file mode 100644 index 0000000..6de38d3 --- /dev/null +++ b/patches.suse/rndis_host-set-proper-input-size-for-OID_GEN_PHYSICA.patch @@ -0,0 +1,44 @@ +From e56b3d94d939f52d46209b9e1b6700c5bfff3123 Mon Sep 17 00:00:00 2001 +From: Andrey Zhizhikin +Date: Fri, 8 Jan 2021 09:58:39 +0000 +Subject: [PATCH] rndis_host: set proper input size for OID_GEN_PHYSICAL_MEDIUM + request +Git-commit: e56b3d94d939f52d46209b9e1b6700c5bfff3123 +References: git-fixes +Patch-mainline: v5.11-rc4 + +MSFT ActiveSync implementation requires that the size of the response for +incoming query is to be provided in the request input length. Failure to +set the input size proper results in failed request transfer, where the +ActiveSync counterpart reports the NDIS_STATUS_INVALID_LENGTH (0xC0010014L) +error. + +Set the input size for OID_GEN_PHYSICAL_MEDIUM query to the expected size +of the response in order for the ActiveSync to properly respond to the +request. + +Fixes: 039ee17d1baa ("rndis_host: Add RNDIS physical medium checking into generic_rndis_bind()") +Signed-off-by: Andrey Zhizhikin +Link: https://lore.kernel.org/r/20210108095839.3335-1-andrey.zhizhikin@leica-geosystems.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Oliver Neukum +--- + drivers/net/usb/rndis_host.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c +index 6609d21ef894..f813ca9dec53 100644 +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -387,7 +387,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) + reply_len = sizeof *phym; + retval = rndis_query(dev, intf, u.buf, + RNDIS_OID_GEN_PHYSICAL_MEDIUM, +- 0, (void **) &phym, &reply_len); ++ reply_len, (void **)&phym, &reply_len); + if (retval != 0 || !phym) { + /* OID is optional so don't fail here. */ + phym_unspec = cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED); +-- +2.26.2 + diff --git a/patches.suse/s390-qeth-Fix-deadlock-in-remove_discipline b/patches.suse/s390-qeth-Fix-deadlock-in-remove_discipline new file mode 100644 index 0000000..fdedf10 --- /dev/null +++ b/patches.suse/s390-qeth-Fix-deadlock-in-remove_discipline @@ -0,0 +1,112 @@ +From: Alexandra Winter +Date: Tue, 21 Sep 2021 16:52:16 +0200 +Subject: s390/qeth: Fix deadlock in remove_discipline +Git-commit: ee909d0b1dac8632eeb78cbf17661d6c7674bbd0 +Patch-mainline: v5.15-rc3 +References: git-fixes + +Problem: qeth_close_dev_handler is a worker that tries to acquire +card->discipline_mutex via drv->set_offline() in ccwgroup_set_offline(). +Since commit b41b554c1ee7 +("s390/qeth: fix locking for discipline setup / removal") +qeth_remove_discipline() is called under card->discipline_mutex and +cancels the work and waits for it to finish. + +STOPLAN reception with reason code IPA_RC_VEPA_TO_VEB_TRANSITION is the +only situation that schedules close_dev_work. In that situation scheduling +qeth recovery will also result in an offline interface, when resetting the +isolation mode fails, if the external switch is still set to VEB. +And since commit 0b9902c1fcc5 ("s390/qeth: fix deadlock during recovery") +qeth recovery does not aquire card->discipline_mutex anymore. + +So we accept the longer pathlength of qeth_schedule_recovery in this +error situation and re-use the existing function. + +As a side-benefit this changes the hwtrap to behave like during recovery +instead of like during a user-triggered set_offline. + +Fixes: b41b554c1ee7 ("s390/qeth: fix locking for discipline setup / removal") +Signed-off-by: Alexandra Winter +Acked-by: Julian Wiedmann +Signed-off-by: Julian Wiedmann +Signed-off-by: Jakub Kicinski +Acked-by: Petr Tesarik +--- + drivers/s390/net/qeth_core.h | 1 - + drivers/s390/net/qeth_core_main.c | 16 ++++------------ + drivers/s390/net/qeth_l2_main.c | 1 - + drivers/s390/net/qeth_l3_main.c | 1 - + 4 files changed, 4 insertions(+), 15 deletions(-) + +--- a/drivers/s390/net/qeth_core.h ++++ b/drivers/s390/net/qeth_core.h +@@ -857,7 +857,6 @@ struct qeth_card { + struct napi_struct napi; + struct qeth_rx rx; + struct delayed_work buffer_reclaim_work; +- struct work_struct close_dev_work; + }; + + static inline bool qeth_card_hw_is_reachable(struct qeth_card *card) +--- a/drivers/s390/net/qeth_core_main.c ++++ b/drivers/s390/net/qeth_core_main.c +@@ -73,15 +73,6 @@ static void qeth_notify_skbs(struct qeth + enum iucv_tx_notify notification); + static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *, int); + +-static void qeth_close_dev_handler(struct work_struct *work) +-{ +- struct qeth_card *card; +- +- card = container_of(work, struct qeth_card, close_dev_work); +- QETH_CARD_TEXT(card, 2, "cldevhdl"); +- ccwgroup_set_offline(card->gdev); +-} +- + static const char *qeth_get_cardname(struct qeth_card *card) + { + if (IS_VM_NIC(card)) { +@@ -888,10 +888,12 @@ static struct qeth_ipa_cmd *qeth_check_i + case IPA_CMD_STOPLAN: + if (cmd->hdr.return_code == IPA_RC_VEPA_TO_VEB_TRANSITION) { + dev_err(&card->gdev->dev, +- "Interface %s is down because the adjacent port is no longer in reflective relay mode\n", ++ "Adjacent port of interface %s is no longer in reflective relay mode, trigger recovery\n", + netdev_name(card->dev)); +- schedule_work(&card->close_dev_work); ++ /* Set offline, then probably fail to set online: */ ++ qeth_schedule_recovery(card); + } else { ++ /* stay online for subsequent STARTLAN */ + dev_warn(&card->gdev->dev, + "The link for interface %s on CHPID 0x%X failed\n", + netdev_name(card->dev), card->info.chpid); +@@ -1627,7 +1629,6 @@ static void qeth_setup_card(struct qeth_ + INIT_LIST_HEAD(&card->ipato.entries); + qeth_init_qdio_info(card); + INIT_DELAYED_WORK(&card->buffer_reclaim_work, qeth_buffer_reclaim_work); +- INIT_WORK(&card->close_dev_work, qeth_close_dev_handler); + hash_init(card->rx_mode_addrs); + hash_init(card->local_addrs4); + hash_init(card->local_addrs6); +static void qeth_core_sl_print(struct seq_file *m, struct service_level *slr) +--- a/drivers/s390/net/qeth_l2_main.c ++++ b/drivers/s390/net/qeth_l2_main.c +@@ -2207,7 +2207,6 @@ static void qeth_l2_remove_device(struct + if (gdev->state == CCWGROUP_ONLINE) + qeth_set_offline(card, card->discipline, false); + +- cancel_work_sync(&card->close_dev_work); + if (card->dev->reg_state == NETREG_REGISTERED) + unregister_netdev(card->dev); + } +--- a/drivers/s390/net/qeth_l3_main.c ++++ b/drivers/s390/net/qeth_l3_main.c +@@ -1976,7 +1976,6 @@ static void qeth_l3_remove_device(struct + if (cgdev->state == CCWGROUP_ONLINE) + qeth_set_offline(card, card->discipline, false); + +- cancel_work_sync(&card->close_dev_work); + if (card->dev->reg_state == NETREG_REGISTERED) + unregister_netdev(card->dev); + diff --git a/patches.suse/s390-qeth-fix-NULL-deref-in-qeth_clear_working_pool_list b/patches.suse/s390-qeth-fix-NULL-deref-in-qeth_clear_working_pool_list new file mode 100644 index 0000000..1651c9c --- /dev/null +++ b/patches.suse/s390-qeth-fix-NULL-deref-in-qeth_clear_working_pool_list @@ -0,0 +1,53 @@ +From: Julian Wiedmann +Date: Tue, 21 Sep 2021 16:52:15 +0200 +Subject: s390/qeth: fix NULL deref in qeth_clear_working_pool_list() +Git-commit: 248f064af222a1f97ee02c84a98013dfbccad386 +Patch-mainline: v5.15-rc3 +References: git-fixes + +When qeth_set_online() calls qeth_clear_working_pool_list() to roll +back after an error exit from qeth_hardsetup_card(), we are at risk of +accessing card->qdio.in_q before it was allocated by +qeth_alloc_qdio_queues() via qeth_mpc_initialize(). + +qeth_clear_working_pool_list() then dereferences NULL, and by writing to +queue->bufs[i].pool_entry scribbles all over the CPU's lowcore. +Resulting in a crash when those lowcore areas are used next (eg. on +the next machine-check interrupt). + +Such a scenario would typically happen when the device is first set +online and its queues aren't allocated yet. An early IO error or certain +misconfigs (eg. mismatched transport mode, bad portno) then cause us to +error out from qeth_hardsetup_card() with card->qdio.in_q still being +NULL. + +Fix it by checking the pointer for NULL before accessing it. + +Note that we also have (rare) paths inside qeth_mpc_initialize() where +a configuration change can cause us to free the existing queues, +expecting that subsequent code will allocate them again. If we then +error out before that re-allocation happens, the same bug occurs. + +Fixes: eff73e16ee11 ("s390/qeth: tolerate pre-filled RX buffer") +Reported-by: Stefan Raspl +Root-caused-by: Heiko Carstens +Signed-off-by: Julian Wiedmann +Reviewed-by: Alexandra Winter +Signed-off-by: Jakub Kicinski +Acked-by: Petr Tesarik +--- + drivers/s390/net/qeth_core_main.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/s390/net/qeth_core_main.c ++++ b/drivers/s390/net/qeth_core_main.c +@@ -211,6 +211,9 @@ static void qeth_clear_working_pool_list + &card->qdio.in_buf_pool.entry_list, list) + list_del(&pool_entry->list); + ++ if (!queue) ++ return; ++ + for (i = 0; i < ARRAY_SIZE(queue->bufs); i++) + queue->bufs[i].pool_entry = NULL; + } diff --git a/patches.suse/s390-qeth-fix-deadlock-during-failing-recovery b/patches.suse/s390-qeth-fix-deadlock-during-failing-recovery new file mode 100644 index 0000000..1f4a9be --- /dev/null +++ b/patches.suse/s390-qeth-fix-deadlock-during-failing-recovery @@ -0,0 +1,96 @@ +From: Alexandra Winter +Date: Tue, 21 Sep 2021 16:52:17 +0200 +Subject: s390/qeth: fix deadlock during failing recovery +Git-commit: d2b59bd4b06d84a4eadb520b0f71c62fe8ec0a62 +Patch-mainline: v5.15-rc3 +References: git-fixes + +Commit 0b9902c1fcc5 ("s390/qeth: fix deadlock during recovery") removed +taking discipline_mutex inside qeth_do_reset(), fixing potential +deadlocks. An error path was missed though, that still takes +discipline_mutex and thus has the original deadlock potential. + +Intermittent deadlocks were seen when a qeth channel path is configured +offline, causing a race between qeth_do_reset and ccwgroup_remove. +Call qeth_set_offline() directly in the qeth_do_reset() error case and +then a new variant of ccwgroup_set_offline(), without taking +discipline_mutex. + +Fixes: b41b554c1ee7 ("s390/qeth: fix locking for discipline setup / removal") +Signed-off-by: Alexandra Winter +Reviewed-by: Julian Wiedmann +Signed-off-by: Julian Wiedmann +Signed-off-by: Jakub Kicinski +Acked-by: Petr Tesarik +--- + arch/s390/include/asm/ccwgroup.h | 2 +- + drivers/s390/cio/ccwgroup.c | 10 ++++++++-- + drivers/s390/net/qeth_core_main.c | 3 ++- + 3 files changed, 11 insertions(+), 4 deletions(-) + +--- a/arch/s390/include/asm/ccwgroup.h ++++ b/arch/s390/include/asm/ccwgroup.h +@@ -68,7 +68,7 @@ struct ccwgroup_device *get_ccwgroupdev_ + char *bus_id); + + extern int ccwgroup_set_online(struct ccwgroup_device *gdev); +-extern int ccwgroup_set_offline(struct ccwgroup_device *gdev); ++int ccwgroup_set_offline(struct ccwgroup_device *gdev, bool call_gdrv); + + extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev); + extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev); +--- a/drivers/s390/cio/ccwgroup.c ++++ b/drivers/s390/cio/ccwgroup.c +@@ -98,12 +98,13 @@ EXPORT_SYMBOL(ccwgroup_set_online); + /** + * ccwgroup_set_offline() - disable a ccwgroup device + * @gdev: target ccwgroup device ++ * @call_gdrv: Call the registered gdrv set_offline function + * + * This function attempts to put the ccwgroup device into the offline state. + * Returns: + * %0 on success and a negative error value on failure. + */ +-int ccwgroup_set_offline(struct ccwgroup_device *gdev) ++int ccwgroup_set_offline(struct ccwgroup_device *gdev, bool call_gdrv) + { + struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); + int ret = -EINVAL; +@@ -112,11 +113,16 @@ int ccwgroup_set_offline(struct ccwgroup + return -EAGAIN; + if (gdev->state == CCWGROUP_OFFLINE) + goto out; ++ if (!call_gdrv) { ++ ret = 0; ++ goto offline; ++ } + if (gdrv->set_offline) + ret = gdrv->set_offline(gdev); + if (ret) + goto out; + ++offline: + gdev->state = CCWGROUP_OFFLINE; + out: + atomic_set(&gdev->onoff, 0); +@@ -145,7 +151,7 @@ static ssize_t ccwgroup_online_store(str + if (value == 1) + ret = ccwgroup_set_online(gdev); + else if (value == 0) +- ret = ccwgroup_set_offline(gdev); ++ ret = ccwgroup_set_offline(gdev, true); + else + ret = -EINVAL; + out: +--- a/drivers/s390/net/qeth_core_main.c ++++ b/drivers/s390/net/qeth_core_main.c +@@ -5174,7 +5174,8 @@ static int qeth_do_reset(void *data) + dev_info(&card->gdev->dev, + "Device successfully recovered!\n"); + } else { +- ccwgroup_set_offline(card->gdev); ++ qeth_set_offline(card, disc, true); ++ ccwgroup_set_offline(card->gdev, false); + dev_warn(&card->gdev->dev, + "The qeth device driver failed to recover an error on the device\n"); + } diff --git a/patches.suse/scsi-BusLogic-Fix-missing-pr_cont-use b/patches.suse/scsi-BusLogic-Fix-missing-pr_cont-use new file mode 100644 index 0000000..ec0d288 --- /dev/null +++ b/patches.suse/scsi-BusLogic-Fix-missing-pr_cont-use @@ -0,0 +1,109 @@ +From: "Maciej W. Rozycki" +Date: Tue, 20 Apr 2021 20:01:47 +0200 +Subject: scsi: BusLogic: Fix missing pr_cont() use +Git-commit: 44d01fc86d952f5a8b8b32bdb4841504d5833d95 +Patch-mainline: v5.15-rc1 +References: git-fixes + +Update BusLogic driver's messaging system to use pr_cont() for continuation +lines, bringing messy output: + +pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17 +scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 ***** +scsi: Copyright 1995-1998 by Leonard N. Zubkoff +scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter +scsi0: Firmware Version: 5.07B, I/O Address: 0x7000, IRQ Channel: 17/Level +scsi0: PCI Bus: 0, Device: 19, Address: +0xE0012000, +Host Adapter SCSI ID: 7 +scsi0: Parity Checking: Enabled, Extended Translation: Enabled +scsi0: Synchronous Negotiation: Ultra, Wide Negotiation: Enabled +scsi0: Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled +scsi0: Scatter/Gather Limit: 128 of 8192 segments, Mailboxes: 211 +scsi0: Driver Queue Depth: 211, Host Adapter Queue Depth: 192 +scsi0: Tagged Queue Depth: +Automatic +, Untagged Queue Depth: 3 +scsi0: SCSI Bus Termination: Both Enabled +, SCAM: Disabled + +scsi0: *** BusLogic BT-958 Initialized Successfully *** +scsi host0: BusLogic BT-958 + +back to order: + +pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17 +scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 ***** +scsi: Copyright 1995-1998 by Leonard N. Zubkoff +scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter +scsi0: Firmware Version: 5.07B, I/O Address: 0x7000, IRQ Channel: 17/Level +scsi0: PCI Bus: 0, Device: 19, Address: 0xE0012000, Host Adapter SCSI ID: 7 +scsi0: Parity Checking: Enabled, Extended Translation: Enabled +scsi0: Synchronous Negotiation: Ultra, Wide Negotiation: Enabled +scsi0: Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled +scsi0: Scatter/Gather Limit: 128 of 8192 segments, Mailboxes: 211 +scsi0: Driver Queue Depth: 211, Host Adapter Queue Depth: 192 +scsi0: Tagged Queue Depth: Automatic, Untagged Queue Depth: 3 +scsi0: SCSI Bus Termination: Both Enabled, SCAM: Disabled +scsi0: *** BusLogic BT-958 Initialized Successfully *** +scsi host0: BusLogic BT-958 + +Also diagnostic output such as with the BusLogic=TraceConfiguration +parameter is affected and becomes vertical and therefore hard to read. +This has now been corrected, e.g.: + +pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17 +blogic_cmd(86) Status = 30: 4 ==> 4: FF 05 93 00 +blogic_cmd(95) Status = 28: (Modify I/O Address) +blogic_cmd(91) Status = 30: 1 ==> 1: 01 +blogic_cmd(04) Status = 30: 4 ==> 4: 41 41 35 30 +blogic_cmd(8D) Status = 30: 14 ==> 14: 45 DC 00 20 00 00 00 00 00 40 30 37 42 1D +scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 ***** +scsi: Copyright 1995-1998 by Leonard N. Zubkoff +blogic_cmd(04) Status = 30: 4 ==> 4: 41 41 35 30 +blogic_cmd(0B) Status = 30: 3 ==> 3: 00 08 07 +blogic_cmd(0D) Status = 30: 34 ==> 34: 03 01 07 04 00 00 00 00 00 00 00 00 00 00 00 00 FF 42 44 46 FF 00 00 00 00 00 00 00 00 00 FF 00 FF 00 +blogic_cmd(8D) Status = 30: 14 ==> 14: 45 DC 00 20 00 00 00 00 00 40 30 37 42 1D +blogic_cmd(84) Status = 30: 1 ==> 1: 37 +blogic_cmd(8B) Status = 30: 5 ==> 5: 39 35 38 20 20 +blogic_cmd(85) Status = 30: 1 ==> 1: 42 +blogic_cmd(86) Status = 30: 4 ==> 4: FF 05 93 00 +blogic_cmd(91) Status = 30: 64 ==> 64: 41 46 3E 20 39 35 38 20 20 00 C4 00 04 01 07 2F 07 04 35 FF FF FF FF FF FF FF FF FF FF 01 00 FE FF 08 FF FF 00 00 00 00 00 00 00 01 00 01 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 FC +scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter + +etc. + +Link: https://lore.kernel.org/r/alpine.DEB.2.21.2104201940430.44318@angie.orcam.me.uk +Fixes: 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines") +Cc: stable@vger.kernel.org # v4.9+ +Acked-by: Khalid Aziz +Signed-off-by: Maciej W. Rozycki +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/BusLogic.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c +index adddcd589941..4d8556fb5c68 100644 +--- a/drivers/scsi/BusLogic.c ++++ b/drivers/scsi/BusLogic.c +@@ -3451,7 +3451,7 @@ static void blogic_msg(enum blogic_msglevel msglevel, char *fmt, + if (buf[0] != '\n' || len > 1) + printk("%sscsi%d: %s", blogic_msglevelmap[msglevel], adapter->host_no, buf); + } else +- printk("%s", buf); ++ pr_cont("%s", buf); + } else { + if (begin) { + if (adapter != NULL && adapter->adapter_initd) +@@ -3459,7 +3459,7 @@ static void blogic_msg(enum blogic_msglevel msglevel, char *fmt, + else + printk("%s%s", blogic_msglevelmap[msglevel], buf); + } else +- printk("%s", buf); ++ pr_cont("%s", buf); + } + begin = (buf[len - 1] == '\n'); + } + diff --git a/patches.suse/scsi-FlashPoint-Rename-si_flags-field b/patches.suse/scsi-FlashPoint-Rename-si_flags-field new file mode 100644 index 0000000..c550913 --- /dev/null +++ b/patches.suse/scsi-FlashPoint-Rename-si_flags-field @@ -0,0 +1,159 @@ +From: Randy Dunlap +Date: Sat, 29 May 2021 16:48:57 -0700 +Subject: scsi: FlashPoint: Rename si_flags field +Git-commit: 4d431153e751caa93f3b7e6f6313446974e92253 +Patch-mainline: v5.14-rc1 +References: git-fixes + +The BusLogic driver has build errors on ia64 due to a name collision (in +the #included FlashPoint.c file). Rename the struct field in struct +sccb_mgr_info from si_flags to si_mflags (manager flags) to mend the build. + +This is the first problem. There are 50+ others after this one: + +In file included from ../include/uapi/linux/signal.h:6, + from ../include/linux/signal_types.h:10, + from ../include/linux/sched.h:29, + from ../include/linux/hardirq.h:9, + from ../include/linux/interrupt.h:11, + from ../drivers/scsi/BusLogic.c:27: +../arch/ia64/include/uapi/asm/siginfo.h:15:27: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token + 15 | #define si_flags _sifields._sigfault._flags + | ^ +../drivers/scsi/FlashPoint.c:43:6: note: in expansion of macro 'si_flags' + 43 | u16 si_flags; + | ^~~~~~~~ +In file included from ../drivers/scsi/BusLogic.c:51: +../drivers/scsi/FlashPoint.c: In function 'FlashPoint_ProbeHostAdapter': +../drivers/scsi/FlashPoint.c:1076:11: error: 'struct sccb_mgr_info' has no member named '_sifields' + 1076 | pCardInfo->si_flags = 0x0000; + | ^~ +../drivers/scsi/FlashPoint.c:1079:12: error: 'struct sccb_mgr_info' has no member named '_sifields' + +Link: https://lore.kernel.org/r/20210529234857.6870-1-rdunlap@infradead.org +Fixes: 391e2f25601e ("[SCSI] BusLogic: Port driver to 64-bit.") +Cc: "James E.J. Bottomley" +Cc: "Martin K. Petersen" +Cc: Christoph Hellwig +Cc: Jens Axboe +Cc: Hannes Reinecke +Cc: Khalid Aziz +Cc: Khalid Aziz +Reported-by: kernel test robot +Reviewed-by: Hannes Reinecke +Signed-off-by: Randy Dunlap +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/FlashPoint.c | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c +index 0464e37c806a..2e25ef67825a 100644 +--- a/drivers/scsi/FlashPoint.c ++++ b/drivers/scsi/FlashPoint.c +@@ -40,7 +40,7 @@ struct sccb_mgr_info { + u16 si_per_targ_ultra_nego; + u16 si_per_targ_no_disc; + u16 si_per_targ_wide_nego; +- u16 si_flags; ++ u16 si_mflags; + unsigned char si_card_family; + unsigned char si_bustype; + unsigned char si_card_model[3]; +@@ -1073,22 +1073,22 @@ static int FlashPoint_ProbeHostAdapter(struct sccb_mgr_info *pCardInfo) + ScamFlg = + (unsigned char)FPT_utilEERead(ioport, SCAM_CONFIG / 2); + +- pCardInfo->si_flags = 0x0000; ++ pCardInfo->si_mflags = 0x0000; + + if (i & 0x01) +- pCardInfo->si_flags |= SCSI_PARITY_ENA; ++ pCardInfo->si_mflags |= SCSI_PARITY_ENA; + + if (!(i & 0x02)) +- pCardInfo->si_flags |= SOFT_RESET; ++ pCardInfo->si_mflags |= SOFT_RESET; + + if (i & 0x10) +- pCardInfo->si_flags |= EXTENDED_TRANSLATION; ++ pCardInfo->si_mflags |= EXTENDED_TRANSLATION; + + if (ScamFlg & SCAM_ENABLED) +- pCardInfo->si_flags |= FLAG_SCAM_ENABLED; ++ pCardInfo->si_mflags |= FLAG_SCAM_ENABLED; + + if (ScamFlg & SCAM_LEVEL2) +- pCardInfo->si_flags |= FLAG_SCAM_LEVEL2; ++ pCardInfo->si_mflags |= FLAG_SCAM_LEVEL2; + + j = (RD_HARPOON(ioport + hp_bm_ctrl) & ~SCSI_TERM_ENA_L); + if (i & 0x04) { +@@ -1104,7 +1104,7 @@ static int FlashPoint_ProbeHostAdapter(struct sccb_mgr_info *pCardInfo) + + if (!(RD_HARPOON(ioport + hp_page_ctrl) & NARROW_SCSI_CARD)) + +- pCardInfo->si_flags |= SUPPORT_16TAR_32LUN; ++ pCardInfo->si_mflags |= SUPPORT_16TAR_32LUN; + + pCardInfo->si_card_family = HARPOON_FAMILY; + pCardInfo->si_bustype = BUSTYPE_PCI; +@@ -1140,15 +1140,15 @@ static int FlashPoint_ProbeHostAdapter(struct sccb_mgr_info *pCardInfo) + + if (pCardInfo->si_card_model[1] == '3') { + if (RD_HARPOON(ioport + hp_ee_ctrl) & BIT(7)) +- pCardInfo->si_flags |= LOW_BYTE_TERM; ++ pCardInfo->si_mflags |= LOW_BYTE_TERM; + } else if (pCardInfo->si_card_model[2] == '0') { + temp = RD_HARPOON(ioport + hp_xfer_pad); + WR_HARPOON(ioport + hp_xfer_pad, (temp & ~BIT(4))); + if (RD_HARPOON(ioport + hp_ee_ctrl) & BIT(7)) +- pCardInfo->si_flags |= LOW_BYTE_TERM; ++ pCardInfo->si_mflags |= LOW_BYTE_TERM; + WR_HARPOON(ioport + hp_xfer_pad, (temp | BIT(4))); + if (RD_HARPOON(ioport + hp_ee_ctrl) & BIT(7)) +- pCardInfo->si_flags |= HIGH_BYTE_TERM; ++ pCardInfo->si_mflags |= HIGH_BYTE_TERM; + WR_HARPOON(ioport + hp_xfer_pad, temp); + } else { + temp = RD_HARPOON(ioport + hp_ee_ctrl); +@@ -1166,9 +1166,9 @@ static int FlashPoint_ProbeHostAdapter(struct sccb_mgr_info *pCardInfo) + WR_HARPOON(ioport + hp_ee_ctrl, temp); + WR_HARPOON(ioport + hp_xfer_pad, temp2); + if (!(temp3 & BIT(7))) +- pCardInfo->si_flags |= LOW_BYTE_TERM; ++ pCardInfo->si_mflags |= LOW_BYTE_TERM; + if (!(temp3 & BIT(6))) +- pCardInfo->si_flags |= HIGH_BYTE_TERM; ++ pCardInfo->si_mflags |= HIGH_BYTE_TERM; + } + + ARAM_ACCESS(ioport); +@@ -1275,7 +1275,7 @@ static void *FlashPoint_HardwareResetHostAdapter(struct sccb_mgr_info + WR_HARPOON(ioport + hp_arb_id, pCardInfo->si_id); + CurrCard->ourId = pCardInfo->si_id; + +- i = (unsigned char)pCardInfo->si_flags; ++ i = (unsigned char)pCardInfo->si_mflags; + if (i & SCSI_PARITY_ENA) + WR_HARPOON(ioport + hp_portctrl_1, (HOST_MODE8 | CHK_SCSI_P)); + +@@ -1289,14 +1289,14 @@ static void *FlashPoint_HardwareResetHostAdapter(struct sccb_mgr_info + j |= SCSI_TERM_ENA_H; + WR_HARPOON(ioport + hp_ee_ctrl, j); + +- if (!(pCardInfo->si_flags & SOFT_RESET)) { ++ if (!(pCardInfo->si_mflags & SOFT_RESET)) { + + FPT_sresb(ioport, thisCard); + + FPT_scini(thisCard, pCardInfo->si_id, 0); + } + +- if (pCardInfo->si_flags & POST_ALL_UNDERRRUNS) ++ if (pCardInfo->si_mflags & POST_ALL_UNDERRRUNS) + CurrCard->globalFlags |= F_NO_FILTER; + + if (pCurrNvRam) { + diff --git a/patches.suse/scsi-be2iscsi-Fix-an-error-handling-path-in-beiscsi_dev_probe b/patches.suse/scsi-be2iscsi-Fix-an-error-handling-path-in-beiscsi_dev_probe new file mode 100644 index 0000000..c3d38b2 --- /dev/null +++ b/patches.suse/scsi-be2iscsi-Fix-an-error-handling-path-in-beiscsi_dev_probe @@ -0,0 +1,33 @@ +From: Christophe JAILLET +Date: Sat, 12 Jun 2021 09:18:34 +0200 +Subject: scsi: be2iscsi: Fix an error handling path in beiscsi_dev_probe() +Git-commit: 030e4138d11fced3b831c2761e4cecf347bae99c +Patch-mainline: v5.14-rc1 +References: git-fixes + +If an error occurs after a pci_enable_pcie_error_reporting() call, it must +be undone by a corresponding pci_disable_pcie_error_reporting() call, as +already done in the remove function. + +Link: https://lore.kernel.org/r/77adb02cfea7f1364e5603ecf3930d8597ae356e.1623482155.git.christophe.jaillet@wanadoo.fr +Fixes: 3567f36a09d1 ("[SCSI] be2iscsi: Fix AER handling in driver") +Signed-off-by: Christophe JAILLET +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/be2iscsi/be_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c +index 310b801c6c87..b89a7db477c7 100644 +--- a/drivers/scsi/be2iscsi/be_main.c ++++ b/drivers/scsi/be2iscsi/be_main.c +@@ -5743,6 +5743,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, + pci_disable_msix(phba->pcidev); + pci_dev_put(phba->pcidev); + iscsi_host_free(phba->shost); ++ pci_disable_pcie_error_reporting(pcidev); + pci_set_drvdata(pcidev, NULL); + disable_pci: + pci_release_regions(pcidev); + diff --git a/patches.suse/scsi-core-Fix-spelling-in-a-source-code-comment b/patches.suse/scsi-core-Fix-spelling-in-a-source-code-comment new file mode 100644 index 0000000..9d8f61a --- /dev/null +++ b/patches.suse/scsi-core-Fix-spelling-in-a-source-code-comment @@ -0,0 +1,34 @@ +From: Bart Van Assche +Date: Wed, 29 Sep 2021 11:23:18 -0700 +Subject: scsi: core: Fix spelling in a source code comment +Git-commit: e9076e7f23aa087f8b7257f3be9e9586f341e3b1 +Patch-mainline: v5.16-rc1 +References: git-fixes + +The typo in this source code comment makes the comment confusing. Clear up +the confusion by fixing the typo. + +Link: https://lore.kernel.org/r/20210929182318.2060489-1-bvanassche@acm.org +Fixes: bc85dc500f9d ("scsi: remove scsi_end_request") +Cc: Christoph Hellwig +Signed-off-by: Bart Van Assche +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/scsi_lib.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c +index dcf105287a76..5f5ad22512f5 100644 +--- a/drivers/scsi/scsi_lib.c ++++ b/drivers/scsi/scsi_lib.c +@@ -949,7 +949,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) + + /* + * If there had been no error, but we have leftover bytes in the +- * requeues just queue the command up again. ++ * request just queue the command up again. + */ + if (likely(result == 0)) + scsi_io_completion_reprep(cmd, q); + diff --git a/patches.suse/scsi-csiostor-Add-module-softdep-on-cxgb4 b/patches.suse/scsi-csiostor-Add-module-softdep-on-cxgb4 new file mode 100644 index 0000000..749139c --- /dev/null +++ b/patches.suse/scsi-csiostor-Add-module-softdep-on-cxgb4 @@ -0,0 +1,40 @@ +From: Rahul Lakkireddy +Date: Mon, 27 Sep 2021 21:44:08 +0530 +Subject: scsi: csiostor: Add module softdep on cxgb4 +Git-commit: 79a7482249a7353bc86aff8127954d5febf02472 +Patch-mainline: v5.15-rc4 +References: git-fixes + +Both cxgb4 and csiostor drivers run on their own independent Physical +Function. But when cxgb4 and csiostor are both being loaded in parallel via +modprobe, there is a race when firmware upgrade is attempted by both the +drivers. + +When the cxgb4 driver initiates the firmware upgrade, it halts the firmware +and the chip until upgrade is complete. When the csiostor driver is coming +up in parallel, the firmware mailbox communication fails with timeouts and +the csiostor driver probe fails. + +Add a module soft dependency on cxgb4 driver to ensure loading csiostor +triggers cxgb4 to load first when available to avoid the firmware upgrade +race. + +Link: https://lore.kernel.org/r/1632759248-15382-1-git-send-email-rahul.lakkireddy@chelsio.com +Fixes: a3667aaed569 ("[SCSI] csiostor: Chelsio FCoE offload driver") +Signed-off-by: Rahul Lakkireddy +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/csiostor/csio_init.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c +index 390b07bf92b9..ccbded3353bd 100644 +--- a/drivers/scsi/csiostor/csio_init.c ++++ b/drivers/scsi/csiostor/csio_init.c +@@ -1254,3 +1254,4 @@ MODULE_DEVICE_TABLE(pci, csio_pci_tbl); + MODULE_VERSION(CSIO_DRV_VERSION); + MODULE_FIRMWARE(FW_FNAME_T5); + MODULE_FIRMWARE(FW_FNAME_T6); ++MODULE_SOFTDEP("pre: cxgb4"); + diff --git a/patches.suse/scsi-csiostor-Uninitialized-data-in-csio_ln_vnp_read_cbfn b/patches.suse/scsi-csiostor-Uninitialized-data-in-csio_ln_vnp_read_cbfn new file mode 100644 index 0000000..0e02493 --- /dev/null +++ b/patches.suse/scsi-csiostor-Uninitialized-data-in-csio_ln_vnp_read_cbfn @@ -0,0 +1,36 @@ +From: Dan Carpenter +Date: Wed, 6 Oct 2021 10:32:43 +0300 +Subject: scsi: csiostor: Uninitialized data in csio_ln_vnp_read_cbfn() +Git-commit: f4875d509a0a78ad294a1a538d534b5ba94e685a +Patch-mainline: v5.16-rc1 +References: git-fixes + +This variable is just a temporary variable, used to do an endian +conversion. The problem is that the last byte is not initialized. After +the conversion is completely done, the last byte is discarded so it doesn't +cause a problem. But static checkers and the KMSan runtime checker can +detect the uninitialized read and will complain about it. + +Link: https://lore.kernel.org/r/20211006073242.GA8404@kili +Fixes: 5036f0a0ecd3 ("[SCSI] csiostor: Fix sparse warnings.") +Signed-off-by: Dan Carpenter +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/csiostor/csio_lnode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c +index dc98f51f466f..d5ac93897023 100644 +--- a/drivers/scsi/csiostor/csio_lnode.c ++++ b/drivers/scsi/csiostor/csio_lnode.c +@@ -619,7 +619,7 @@ csio_ln_vnp_read_cbfn(struct csio_hw *hw, struct csio_mb *mbp) + struct fc_els_csp *csp; + struct fc_els_cssp *clsp; + enum fw_retval retval; +- __be32 nport_id; ++ __be32 nport_id = 0; + + retval = FW_CMD_RETVAL_G(ntohl(rsp->alloc_to_len16)); + if (retval != FW_SUCCESS) { + diff --git a/patches.suse/scsi-dc395-Fix-error-case-unwinding b/patches.suse/scsi-dc395-Fix-error-case-unwinding new file mode 100644 index 0000000..3ddb301 --- /dev/null +++ b/patches.suse/scsi-dc395-Fix-error-case-unwinding @@ -0,0 +1,39 @@ +From: Tong Zhang +Date: Mon, 6 Sep 2021 21:07:02 -0700 +Subject: scsi: dc395: Fix error case unwinding +Git-commit: cbd9a3347c757383f3d2b50cf7cfd03eb479c481 +Patch-mainline: v5.16-rc1 +References: git-fixes + +dc395x_init_one()->adapter_init() might fail. In this case, the acb is +already cleaned up by adapter_init(), no need to do that in +adapter_uninit(acb) again. + +[ 1.252251] dc395x: adapter init failed +[ 1.254900] RIP: 0010:adapter_uninit+0x94/0x170 [dc395x] +[ 1.260307] Call Trace: +[ 1.260442] dc395x_init_one.cold+0x72a/0x9bb [dc395x] + +Link: https://lore.kernel.org/r/20210907040702.1846409-1-ztong0001@gmail.com +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Reviewed-by: Finn Thain +Signed-off-by: Tong Zhang +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/dc395x.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c +index 24c7cefb0b78..1c79e6c27163 100644 +--- a/drivers/scsi/dc395x.c ++++ b/drivers/scsi/dc395x.c +@@ -4618,6 +4618,7 @@ static int dc395x_init_one(struct pci_dev *dev, const struct pci_device_id *id) + /* initialise the adapter and everything we need */ + if (adapter_init(acb, io_port_base, io_port_len, irq)) { + dprintkl(KERN_INFO, "adapter init failed\n"); ++ acb = NULL; + goto fail; + } + + diff --git a/patches.suse/scsi-fdomain-Fix-error-return-code-in-fdomain_probe b/patches.suse/scsi-fdomain-Fix-error-return-code-in-fdomain_probe new file mode 100644 index 0000000..28b7c0a --- /dev/null +++ b/patches.suse/scsi-fdomain-Fix-error-return-code-in-fdomain_probe @@ -0,0 +1,37 @@ +From: Wei Li +Date: Thu, 15 Jul 2021 11:26:25 +0800 +Subject: scsi: fdomain: Fix error return code in fdomain_probe() +Git-commit: 632c4ae6da1d629eddf9da1e692d7617c568c256 +Patch-mainline: v5.15-rc1 +References: git-fixes + +If request_region() fails the return value is not set. Return -EBUSY on +error. + +Link: https://lore.kernel.org/r/20210715032625.1395495-1-liwei391@huawei.com +Fixes: 8674a8aa2c39 ("scsi: fdomain: Add PCMCIA support") +Reported-by: Hulk Robot +Signed-off-by: Wei Li +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/pcmcia/fdomain_cs.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/pcmcia/fdomain_cs.c b/drivers/scsi/pcmcia/fdomain_cs.c +index e42acf314d06..33df6a9ba9b5 100644 +--- a/drivers/scsi/pcmcia/fdomain_cs.c ++++ b/drivers/scsi/pcmcia/fdomain_cs.c +@@ -45,8 +45,10 @@ static int fdomain_probe(struct pcmcia_device *link) + goto fail_disable; + + if (!request_region(link->resource[0]->start, FDOMAIN_REGION_SIZE, +- "fdomain_cs")) ++ "fdomain_cs")) { ++ ret = -EBUSY; + goto fail_disable; ++ } + + sh = fdomain_create(link->resource[0]->start, link->irq, 7, &link->dev); + if (!sh) { + diff --git a/patches.suse/scsi-iscsi-Fix-iface-sysfs-attr-detection b/patches.suse/scsi-iscsi-Fix-iface-sysfs-attr-detection new file mode 100644 index 0000000..0229113 --- /dev/null +++ b/patches.suse/scsi-iscsi-Fix-iface-sysfs-attr-detection @@ -0,0 +1,142 @@ +From: Mike Christie +Date: Wed, 30 Jun 2021 19:25:59 -0500 +Subject: scsi: iscsi: Fix iface sysfs attr detection +Git-commit: e746f3451ec7f91dcc9fd67a631239c715850a34 +Patch-mainline: v5.14-rc3 +References: git-fixes + +A ISCSI_IFACE_PARAM can have the same value as a ISCSI_NET_PARAM so when +iscsi_iface_attr_is_visible tries to figure out the type by just checking +the value, we can collide and return the wrong type. When we call into the +driver we might not match and return that we don't want attr visible in +sysfs. The patch fixes this by setting the type when we figure out what the +param is. + +Link: https://lore.kernel.org/r/20210701002559.89533-1-michael.christie@oracle.com +Fixes: 3e0f65b34cc9 ("[SCSI] iscsi_transport: Additional parameters for network settings") +Signed-off-by: Mike Christie +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/scsi_transport_iscsi.c | 90 ++++++++++++++----------------------- + 1 file changed, 34 insertions(+), 56 deletions(-) + +diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c +index b07105ae7c91..d8b05d8b5470 100644 +--- a/drivers/scsi/scsi_transport_iscsi.c ++++ b/drivers/scsi/scsi_transport_iscsi.c +@@ -439,39 +439,10 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, + struct device *dev = container_of(kobj, struct device, kobj); + struct iscsi_iface *iface = iscsi_dev_to_iface(dev); + struct iscsi_transport *t = iface->transport; +- int param; +- int param_type; ++ int param = -1; + + if (attr == &dev_attr_iface_enabled.attr) + param = ISCSI_NET_PARAM_IFACE_ENABLE; +- else if (attr == &dev_attr_iface_vlan_id.attr) +- param = ISCSI_NET_PARAM_VLAN_ID; +- else if (attr == &dev_attr_iface_vlan_priority.attr) +- param = ISCSI_NET_PARAM_VLAN_PRIORITY; +- else if (attr == &dev_attr_iface_vlan_enabled.attr) +- param = ISCSI_NET_PARAM_VLAN_ENABLED; +- else if (attr == &dev_attr_iface_mtu.attr) +- param = ISCSI_NET_PARAM_MTU; +- else if (attr == &dev_attr_iface_port.attr) +- param = ISCSI_NET_PARAM_PORT; +- else if (attr == &dev_attr_iface_ipaddress_state.attr) +- param = ISCSI_NET_PARAM_IPADDR_STATE; +- else if (attr == &dev_attr_iface_delayed_ack_en.attr) +- param = ISCSI_NET_PARAM_DELAYED_ACK_EN; +- else if (attr == &dev_attr_iface_tcp_nagle_disable.attr) +- param = ISCSI_NET_PARAM_TCP_NAGLE_DISABLE; +- else if (attr == &dev_attr_iface_tcp_wsf_disable.attr) +- param = ISCSI_NET_PARAM_TCP_WSF_DISABLE; +- else if (attr == &dev_attr_iface_tcp_wsf.attr) +- param = ISCSI_NET_PARAM_TCP_WSF; +- else if (attr == &dev_attr_iface_tcp_timer_scale.attr) +- param = ISCSI_NET_PARAM_TCP_TIMER_SCALE; +- else if (attr == &dev_attr_iface_tcp_timestamp_en.attr) +- param = ISCSI_NET_PARAM_TCP_TIMESTAMP_EN; +- else if (attr == &dev_attr_iface_cache_id.attr) +- param = ISCSI_NET_PARAM_CACHE_ID; +- else if (attr == &dev_attr_iface_redirect_en.attr) +- param = ISCSI_NET_PARAM_REDIRECT_EN; + else if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr) + param = ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO; + else if (attr == &dev_attr_iface_header_digest.attr) +@@ -508,6 +479,38 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, + param = ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN; + else if (attr == &dev_attr_iface_initiator_name.attr) + param = ISCSI_IFACE_PARAM_INITIATOR_NAME; ++ ++ if (param != -1) ++ return t->attr_is_visible(ISCSI_IFACE_PARAM, param); ++ ++ if (attr == &dev_attr_iface_vlan_id.attr) ++ param = ISCSI_NET_PARAM_VLAN_ID; ++ else if (attr == &dev_attr_iface_vlan_priority.attr) ++ param = ISCSI_NET_PARAM_VLAN_PRIORITY; ++ else if (attr == &dev_attr_iface_vlan_enabled.attr) ++ param = ISCSI_NET_PARAM_VLAN_ENABLED; ++ else if (attr == &dev_attr_iface_mtu.attr) ++ param = ISCSI_NET_PARAM_MTU; ++ else if (attr == &dev_attr_iface_port.attr) ++ param = ISCSI_NET_PARAM_PORT; ++ else if (attr == &dev_attr_iface_ipaddress_state.attr) ++ param = ISCSI_NET_PARAM_IPADDR_STATE; ++ else if (attr == &dev_attr_iface_delayed_ack_en.attr) ++ param = ISCSI_NET_PARAM_DELAYED_ACK_EN; ++ else if (attr == &dev_attr_iface_tcp_nagle_disable.attr) ++ param = ISCSI_NET_PARAM_TCP_NAGLE_DISABLE; ++ else if (attr == &dev_attr_iface_tcp_wsf_disable.attr) ++ param = ISCSI_NET_PARAM_TCP_WSF_DISABLE; ++ else if (attr == &dev_attr_iface_tcp_wsf.attr) ++ param = ISCSI_NET_PARAM_TCP_WSF; ++ else if (attr == &dev_attr_iface_tcp_timer_scale.attr) ++ param = ISCSI_NET_PARAM_TCP_TIMER_SCALE; ++ else if (attr == &dev_attr_iface_tcp_timestamp_en.attr) ++ param = ISCSI_NET_PARAM_TCP_TIMESTAMP_EN; ++ else if (attr == &dev_attr_iface_cache_id.attr) ++ param = ISCSI_NET_PARAM_CACHE_ID; ++ else if (attr == &dev_attr_iface_redirect_en.attr) ++ param = ISCSI_NET_PARAM_REDIRECT_EN; + else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { + if (attr == &dev_attr_ipv4_iface_ipaddress.attr) + param = ISCSI_NET_PARAM_IPV4_ADDR; +@@ -598,32 +601,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, + return 0; + } + +- switch (param) { +- case ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO: +- case ISCSI_IFACE_PARAM_HDRDGST_EN: +- case ISCSI_IFACE_PARAM_DATADGST_EN: +- case ISCSI_IFACE_PARAM_IMM_DATA_EN: +- case ISCSI_IFACE_PARAM_INITIAL_R2T_EN: +- case ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN: +- case ISCSI_IFACE_PARAM_PDU_INORDER_EN: +- case ISCSI_IFACE_PARAM_ERL: +- case ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH: +- case ISCSI_IFACE_PARAM_FIRST_BURST: +- case ISCSI_IFACE_PARAM_MAX_R2T: +- case ISCSI_IFACE_PARAM_MAX_BURST: +- case ISCSI_IFACE_PARAM_CHAP_AUTH_EN: +- case ISCSI_IFACE_PARAM_BIDI_CHAP_EN: +- case ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL: +- case ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN: +- case ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN: +- case ISCSI_IFACE_PARAM_INITIATOR_NAME: +- param_type = ISCSI_IFACE_PARAM; +- break; +- default: +- param_type = ISCSI_NET_PARAM; +- } +- +- return t->attr_is_visible(param_type, param); ++ return t->attr_is_visible(ISCSI_NET_PARAM, param); + } + + static struct attribute *iscsi_iface_attrs[] = { + diff --git a/patches.suse/scsi-libsas-Use-_safe-loop-in-sas_resume_port b/patches.suse/scsi-libsas-Use-_safe-loop-in-sas_resume_port new file mode 100644 index 0000000..2704f5e --- /dev/null +++ b/patches.suse/scsi-libsas-Use-_safe-loop-in-sas_resume_port @@ -0,0 +1,47 @@ +From: Dan Carpenter +Date: Wed, 19 May 2021 17:20:27 +0300 +Subject: scsi: libsas: Use _safe() loop in sas_resume_port() +Git-commit: 8c7e7b8486cda21269d393245883c5e4737d5ee7 +Patch-mainline: v5.13-rc4 +References: git-fixes + +If sas_notify_lldd_dev_found() fails then this code calls: + + sas_unregister_dev(port, dev); + +which removes "dev", our list iterator, from the list. This could lead to +an endless loop. We need to use list_for_each_entry_safe(). + +Link: https://lore.kernel.org/r/YKUeq6gwfGcvvhty@mwanda +Fixes: 303694eeee5e ("[SCSI] libsas: suspend / resume support") +Reviewed-by: John Garry +Signed-off-by: Dan Carpenter +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/libsas/sas_port.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c +index 19cf418928fa..e3d03d744713 100644 +--- a/drivers/scsi/libsas/sas_port.c ++++ b/drivers/scsi/libsas/sas_port.c +@@ -25,7 +25,7 @@ static bool phy_is_wideport_member(struct asd_sas_port *port, struct asd_sas_phy + + static void sas_resume_port(struct asd_sas_phy *phy) + { +- struct domain_device *dev; ++ struct domain_device *dev, *n; + struct asd_sas_port *port = phy->port; + struct sas_ha_struct *sas_ha = phy->ha; + struct sas_internal *si = to_sas_internal(sas_ha->core.shost->transportt); +@@ -44,7 +44,7 @@ static void sas_resume_port(struct asd_sas_phy *phy) + * 1/ presume every device came back + * 2/ force the next revalidation to check all expander phys + */ +- list_for_each_entry(dev, &port->dev_list, dev_list_node) { ++ list_for_each_entry_safe(dev, n, &port->dev_list, dev_list_node) { + int i, rc; + + rc = sas_notify_lldd_dev_found(dev); + diff --git a/patches.suse/scsi-mpt3sas-Fix-error-return-value-in-_scsih_expander_add b/patches.suse/scsi-mpt3sas-Fix-error-return-value-in-_scsih_expander_add new file mode 100644 index 0000000..f33f8f7 --- /dev/null +++ b/patches.suse/scsi-mpt3sas-Fix-error-return-value-in-_scsih_expander_add @@ -0,0 +1,39 @@ +From: Zhen Lei +Date: Fri, 14 May 2021 16:13:00 +0800 +Subject: scsi: mpt3sas: Fix error return value in _scsih_expander_add() +Git-commit: d6c2ce435ffe23ef7f395ae76ec747414589db46 +Patch-mainline: v5.14-rc1 +References: git-fixes + +When an expander does not contain any 'phys', an appropriate error code -1 +should be returned, as done elsewhere in this function. However, we +currently do not explicitly assign this error code to 'rc'. As a result, 0 +was incorrectly returned. + +Link: https://lore.kernel.org/r/20210514081300.6650-1-thunder.leizhen@huawei.com +Fixes: f92363d12359 ("[SCSI] mpt3sas: add new driver supporting 12GB SAS") +Reported-by: Hulk Robot +Signed-off-by: Zhen Lei +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c +index dc2aaaf645d3..866d118f7931 100644 +--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c +@@ -6920,8 +6920,10 @@ _scsih_expander_add(struct MPT3SAS_ADAPTER *ioc, u16 handle) + handle, parent_handle, + (u64)sas_expander->sas_address, sas_expander->num_phys); + +- if (!sas_expander->num_phys) ++ if (!sas_expander->num_phys) { ++ rc = -1; + goto out_fail; ++ } + sas_expander->phy = kcalloc(sas_expander->num_phys, + sizeof(struct _sas_phy), GFP_KERNEL); + if (!sas_expander->phy) { + diff --git a/patches.suse/scsi-qedf-Add-pointer-checks-in-qedf_update_link_speed b/patches.suse/scsi-qedf-Add-pointer-checks-in-qedf_update_link_speed new file mode 100644 index 0000000..e7206fa --- /dev/null +++ b/patches.suse/scsi-qedf-Add-pointer-checks-in-qedf_update_link_speed @@ -0,0 +1,58 @@ +From: Javed Hasan +Date: Wed, 12 May 2021 00:25:33 -0700 +Subject: scsi: qedf: Add pointer checks in qedf_update_link_speed() +Git-commit: 73578af92a0fae6609b955fcc9113e50e413c80f +Patch-mainline: v5.13-rc3 +References: git-fixes + +The following trace was observed: + + [ 14.042059] Call Trace: + [ 14.042061] + [ 14.042068] qedf_link_update+0x144/0x1f0 [qedf] + [ 14.042117] qed_link_update+0x5c/0x80 [qed] + [ 14.042135] qed_mcp_handle_link_change+0x2d2/0x410 [qed] + [ 14.042155] ? qed_set_ptt+0x70/0x80 [qed] + [ 14.042170] ? qed_set_ptt+0x70/0x80 [qed] + [ 14.042186] ? qed_rd+0x13/0x40 [qed] + [ 14.042205] qed_mcp_handle_events+0x437/0x690 [qed] + [ 14.042221] ? qed_set_ptt+0x70/0x80 [qed] + [ 14.042239] qed_int_sp_dpc+0x3a6/0x3e0 [qed] + [ 14.042245] tasklet_action_common.isra.14+0x5a/0x100 + [ 14.042250] __do_softirq+0xe4/0x2f8 + [ 14.042253] irq_exit+0xf7/0x100 + [ 14.042255] do_IRQ+0x7f/0xd0 + [ 14.042257] common_interrupt+0xf/0xf + [ 14.042259] + +API qedf_link_update() is getting called from QED but by that time +shost_data is not initialised. This results in a NULL pointer dereference +when we try to dereference shost_data while updating supported_speeds. + +Add a NULL pointer check before dereferencing shost_data. + +[lduncan: refreshed to apply] + +Link: https://lore.kernel.org/r/20210512072533.23618-1-jhasan@marvell.com +Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") +Reviewed-by: Himanshu Madhani +Signed-off-by: Javed Hasan +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/qedf/qedf_main.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/qedf/qedf_main.c ++++ b/drivers/scsi/qedf/qedf_main.c +@@ -530,7 +530,9 @@ static void qedf_update_link_speed(struc + if (linkmode_intersects(link->supported_caps, sup_caps)) + lport->link_supported_speeds |= FC_PORTSPEED_20GBIT; + +- fc_host_supported_speeds(lport->host) = lport->link_supported_speeds; ++ if (lport->host && lport->host->shost_data) ++ fc_host_supported_speeds(lport->host) = ++ lport->link_supported_speeds; + } + + static void qedf_bw_update(void *dev) diff --git a/patches.suse/scsi-qedf-Fix-error-codes-in-qedf_alloc_global_queues b/patches.suse/scsi-qedf-Fix-error-codes-in-qedf_alloc_global_queues new file mode 100644 index 0000000..addbfb1 --- /dev/null +++ b/patches.suse/scsi-qedf-Fix-error-codes-in-qedf_alloc_global_queues @@ -0,0 +1,73 @@ +From: Dan Carpenter +Date: Tue, 10 Aug 2021 11:51:49 +0300 +Subject: scsi: qedf: Fix error codes in qedf_alloc_global_queues() +Git-commit: ccc89737aa6b9f248cf1623014038beb6c2b7f56 +Patch-mainline: v5.15-rc1 +References: git-fixes + +This driver has some left over "return 1" on failure style code mixed with +"return negative error codes" style code. The caller doesn't care so we +should just convert everything to return negative error codes. + +Then there was a problem that there were two variables used to store error +codes which just resulted in confusion. If qedf_alloc_bdq() returned a +negative error code, we accidentally returned success instead of +propagating the error code. So get rid of the "rc" variable and use +"status" every where. + +Also remove the "status = 0" initialization so that these sorts of bugs +will be detected by the compiler in the future. + +Link: https://lore.kernel.org/r/20210810085023.GA23998@kili +Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") +Acked-by: Manish Rangankar +Signed-off-by: Dan Carpenter +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/qedf/qedf_main.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c +index 85f41abcb56c..42d0d941dba5 100644 +--- a/drivers/scsi/qedf/qedf_main.c ++++ b/drivers/scsi/qedf/qedf_main.c +@@ -3004,7 +3004,7 @@ static int qedf_alloc_global_queues(struct qedf_ctx *qedf) + { + u32 *list; + int i; +- int status = 0, rc; ++ int status; + u32 *pbl; + dma_addr_t page; + int num_pages; +@@ -3016,7 +3016,7 @@ static int qedf_alloc_global_queues(struct qedf_ctx *qedf) + */ + if (!qedf->num_queues) { + QEDF_ERR(&(qedf->dbg_ctx), "No MSI-X vectors available!\n"); +- return 1; ++ return -ENOMEM; + } + + /* +@@ -3024,7 +3024,7 @@ static int qedf_alloc_global_queues(struct qedf_ctx *qedf) + * addresses of our queues + */ + if (!qedf->p_cpuq) { +- status = 1; ++ status = -EINVAL; + QEDF_ERR(&qedf->dbg_ctx, "p_cpuq is NULL.\n"); + goto mem_alloc_failure; + } +@@ -3040,8 +3040,8 @@ static int qedf_alloc_global_queues(struct qedf_ctx *qedf) + "qedf->global_queues=%p.\n", qedf->global_queues); + + /* Allocate DMA coherent buffers for BDQ */ +- rc = qedf_alloc_bdq(qedf); +- if (rc) { ++ status = qedf_alloc_bdq(qedf); ++ if (status) { + QEDF_ERR(&qedf->dbg_ctx, "Unable to allocate bdq.\n"); + goto mem_alloc_failure; + } + diff --git a/patches.suse/scsi-qedi-Fix-error-codes-in-qedi_alloc_global_queues b/patches.suse/scsi-qedi-Fix-error-codes-in-qedi_alloc_global_queues new file mode 100644 index 0000000..1802cf6 --- /dev/null +++ b/patches.suse/scsi-qedi-Fix-error-codes-in-qedi_alloc_global_queues @@ -0,0 +1,78 @@ +From: Dan Carpenter +Date: Tue, 10 Aug 2021 11:47:53 +0300 +Subject: scsi: qedi: Fix error codes in qedi_alloc_global_queues() +Git-commit: 4dbe57d46d54a847875fa33e7d05877bb341585e +Patch-mainline: v5.15-rc1 +References: git-fixes + +This function had some left over code that returned 1 on error instead +negative error codes. Convert everything to use negative error codes. The +caller treats all non-zero returns the same so this does not affect run +time. + +A couple places set "rc" instead of "status" so those error paths ended up +returning success by mistake. Get rid of the "rc" variable and use +"status" everywhere. + +Remove the bogus "status = 0" initialization, as a future proofing measure +so the compiler will warn about uninitialized error codes. + +Link: https://lore.kernel.org/r/20210810084753.GD23810@kili +Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") +Acked-by: Manish Rangankar +Signed-off-by: Dan Carpenter +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/qedi/qedi_main.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c +index 0b0acb827071..e6dc0b495a82 100644 +--- a/drivers/scsi/qedi/qedi_main.c ++++ b/drivers/scsi/qedi/qedi_main.c +@@ -1621,7 +1621,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi) + { + u32 *list; + int i; +- int status = 0, rc; ++ int status; + u32 *pbl; + dma_addr_t page; + int num_pages; +@@ -1632,14 +1632,14 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi) + */ + if (!qedi->num_queues) { + QEDI_ERR(&qedi->dbg_ctx, "No MSI-X vectors available!\n"); +- return 1; ++ return -ENOMEM; + } + + /* Make sure we allocated the PBL that will contain the physical + * addresses of our queues + */ + if (!qedi->p_cpuq) { +- status = 1; ++ status = -EINVAL; + goto mem_alloc_failure; + } + +@@ -1654,13 +1654,13 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi) + "qedi->global_queues=%p.\n", qedi->global_queues); + + /* Allocate DMA coherent buffers for BDQ */ +- rc = qedi_alloc_bdq(qedi); +- if (rc) ++ status = qedi_alloc_bdq(qedi); ++ if (status) + goto mem_alloc_failure; + + /* Allocate DMA coherent buffers for NVM_ISCSI_CFG */ +- rc = qedi_alloc_nvm_iscsi_cfg(qedi); +- if (rc) ++ status = qedi_alloc_nvm_iscsi_cfg(qedi); ++ if (status) + goto mem_alloc_failure; + + /* Allocate a CQ and an associated PBL for each MSI-X + diff --git a/patches.suse/scsi-qla2xxx-Fix-a-memory-leak-in-an-error-path-of-qla2x00_process_els b/patches.suse/scsi-qla2xxx-Fix-a-memory-leak-in-an-error-path-of-qla2x00_process_els new file mode 100644 index 0000000..4fcbf8f --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Fix-a-memory-leak-in-an-error-path-of-qla2x00_process_els @@ -0,0 +1,50 @@ +From: Joy Gu +Date: Tue, 12 Oct 2021 12:18:33 -0700 +Subject: scsi: qla2xxx: Fix a memory leak in an error path of + qla2x00_process_els() +Git-commit: 7fb223d0ad801f633c78cbe42b1d1b55f5d163ad +Patch-mainline: v5.15-rc7 +References: git-fixes + +Commit 8c0eb596baa5 ("[SCSI] qla2xxx: Fix a memory leak in an error path of +qla2x00_process_els()"), intended to change: + + bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN + +to: + + bsg_job->request->msgcode != FC_BSG_RPT_ELS + +but changed it to: + + bsg_job->request->msgcode == FC_BSG_RPT_ELS + +instead. + +Change the == to a != to avoid leaking the fcport structure or freeing +unallocated memory. + +Link: https://lore.kernel.org/r/20211012191834.90306-2-jgu@purestorage.com +Fixes: 8c0eb596baa5 ("[SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()") +Reviewed-by: Bart Van Assche +Signed-off-by: Joy Gu +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/qla2xxx/qla_bsg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c +index 4b5d28d89d69..655cf5de604b 100644 +--- a/drivers/scsi/qla2xxx/qla_bsg.c ++++ b/drivers/scsi/qla2xxx/qla_bsg.c +@@ -431,7 +431,7 @@ qla2x00_process_els(struct bsg_job *bsg_job) + goto done_free_fcport; + + done_free_fcport: +- if (bsg_request->msgcode == FC_BSG_RPT_ELS) ++ if (bsg_request->msgcode != FC_BSG_RPT_ELS) + qla2x00_free_fcport(fcport); + done: + return rval; + diff --git a/patches.suse/scsi-qla2xxx-Make-sure-that-aborted-commands-are-freed b/patches.suse/scsi-qla2xxx-Make-sure-that-aborted-commands-are-freed new file mode 100644 index 0000000..90961de --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Make-sure-that-aborted-commands-are-freed @@ -0,0 +1,109 @@ +From: Bart Van Assche +Date: Thu, 8 Aug 2019 20:02:10 -0700 +Subject: scsi: qla2xxx: Make sure that aborted commands are freed +Git-commit: 0dcec41acb85da33841c2ab56dbf337ed00a3914 +Patch-mainline: v5.4-rc1 +References: git-fixes + +The LIO core requires that the target driver callback functions +.queue_data_in() and .queue_status() call target_put_sess_cmd() or +transport_generic_free_cmd(). These calls may happen synchronously or +asynchronously. Make sure that one of these LIO functions is called in case +a command has been aborted. This patch avoids that the code for removing a +session hangs due to commands that do not make progress. + +Cc: Himanshu Madhani +Fixes: 694833ee00c4 ("scsi: tcm_qla2xxx: Do not allow aborted cmd to advance.") # v4.13. +Fixes: a07100e00ac4 ("qla2xxx: Fix TMR ABORT interaction issue between qla2xxx and TCM") # v4.5. +Signed-off-by: Bart Van Assche +Tested-by: Himanshu Madhani +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/qla2xxx/qla_target.c | 13 ++++++++----- + drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 ++++ + 2 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c +index cc0c99b5f3fb..0ffda6171614 100644 +--- a/drivers/scsi/qla2xxx/qla_target.c ++++ b/drivers/scsi/qla2xxx/qla_target.c +@@ -3206,7 +3206,8 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, + if (!qpair->fw_started || (cmd->reset_count != qpair->chip_reset) || + (cmd->sess && cmd->sess->deleted)) { + cmd->state = QLA_TGT_STATE_PROCESSED; +- return 0; ++ res = 0; ++ goto free; + } + + ql_dbg_qp(ql_dbg_tgt, qpair, 0xe018, +@@ -3217,9 +3218,8 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, + + res = qlt_pre_xmit_response(cmd, &prm, xmit_type, scsi_status, + &full_req_cnt); +- if (unlikely(res != 0)) { +- return res; +- } ++ if (unlikely(res != 0)) ++ goto free; + + spin_lock_irqsave(qpair->qp_lock_ptr, flags); + +@@ -3239,7 +3239,8 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, + vha->flags.online, qla2x00_reset_active(vha), + cmd->reset_count, qpair->chip_reset); + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); +- return 0; ++ res = 0; ++ goto free; + } + + /* Does F/W have an IOCBs for this request */ +@@ -3342,6 +3343,8 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, + qlt_unmap_sg(vha, cmd); + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); + ++free: ++ vha->hw->tgt.tgt_ops->free_cmd(cmd); + return res; + } + EXPORT_SYMBOL(qlt_xmit_response); +diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c +index 963c220f8ba8..042a24314edc 100644 +--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c ++++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c +@@ -620,6 +620,7 @@ static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) + { + struct qla_tgt_cmd *cmd = container_of(se_cmd, + struct qla_tgt_cmd, se_cmd); ++ struct scsi_qla_host *vha = cmd->vha; + + if (cmd->aborted) { + /* Cmd can loop during Q-full. tcm_qla2xxx_aborted_task +@@ -632,6 +633,7 @@ static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) + cmd->se_cmd.transport_state, + cmd->se_cmd.t_state, + cmd->se_cmd.se_cmd_flags); ++ vha->hw->tgt.tgt_ops->free_cmd(cmd); + return 0; + } + +@@ -659,6 +661,7 @@ static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) + { + struct qla_tgt_cmd *cmd = container_of(se_cmd, + struct qla_tgt_cmd, se_cmd); ++ struct scsi_qla_host *vha = cmd->vha; + int xmit_type = QLA_TGT_XMIT_STATUS; + + if (cmd->aborted) { +@@ -672,6 +675,7 @@ static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) + cmd, kref_read(&cmd->se_cmd.cmd_kref), + cmd->se_cmd.transport_state, cmd->se_cmd.t_state, + cmd->se_cmd.se_cmd_flags); ++ vha->hw->tgt.tgt_ops->free_cmd(cmd); + return 0; + } + cmd->bufflen = se_cmd->data_length; + diff --git a/patches.suse/scsi-smartpqi-Fix-an-error-code-in-pqi_get_raid_map b/patches.suse/scsi-smartpqi-Fix-an-error-code-in-pqi_get_raid_map new file mode 100644 index 0000000..9939330 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Fix-an-error-code-in-pqi_get_raid_map @@ -0,0 +1,30 @@ +From: Dan Carpenter +Date: Tue, 10 Aug 2021 11:46:13 +0300 +Subject: scsi: smartpqi: Fix an error code in pqi_get_raid_map() +Git-commit: d1f6581a6796c4e9fd8a4a24e8b77463d18f0df1 +Patch-mainline: v5.15-rc1 +References: git-fixes + +Return -EINVAL on failure instead of success. + +[lduncan: refreshed to apply] + +Link: https://lore.kernel.org/r/20210810084613.GB23810@kili +Fixes: a91aaae0243b ("scsi: smartpqi: allow for larger raid maps") +Signed-off-by: Dan Carpenter +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/smartpqi/smartpqi_init.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -1323,6 +1323,7 @@ static int pqi_get_raid_map(struct pqi_c + "requested %u bytes, received %u bytes\n", + raid_map_size, + get_unaligned_le32(&raid_map->structure_size)); ++ rc = -EINVAL; + goto error; + } + } diff --git a/patches.suse/scsi-snic-Fix-an-error-message b/patches.suse/scsi-snic-Fix-an-error-message new file mode 100644 index 0000000..3e3e193 --- /dev/null +++ b/patches.suse/scsi-snic-Fix-an-error-message @@ -0,0 +1,39 @@ +From: Christophe JAILLET +Date: Thu, 6 May 2021 20:38:20 +0200 +Subject: scsi: snic: Fix an error message +Git-commit: 9959d45166faaa75d9d4bf2ad8b945dfbe9888f8 +Patch-mainline: v5.14-rc1 +References: git-fixes + +'ret' is known to be 0 here. No error code is available so just remove +'ret' from the error message. + +While at it, change the word "Queuing" into "Init" which looks more +appropriate. + +Link: https://lore.kernel.org/r/3b9d5d767e09d03a07bede293a6ba32e3735cd1a.1620326191.git.christophe.jaillet@wanadoo.fr +Fixes: c8806b6c9e82 ("snic: driver for Cisco SCSI HBA") +Signed-off-by: Christophe JAILLET +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/snic/snic_ctl.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/scsi/snic/snic_ctl.c b/drivers/scsi/snic/snic_ctl.c +index 4cd86115cfb2..703f229862fc 100644 +--- a/drivers/scsi/snic/snic_ctl.c ++++ b/drivers/scsi/snic/snic_ctl.c +@@ -114,10 +114,7 @@ snic_queue_exch_ver_req(struct snic *snic) + + rqi = snic_req_init(snic, 0); + if (!rqi) { +- SNIC_HOST_ERR(snic->shost, +- "Queuing Exch Ver Req failed, err = %d\n", +- ret); +- ++ SNIC_HOST_ERR(snic->shost, "Init Exch Ver Req failed\n"); + ret = -ENOMEM; + goto error; + } + diff --git a/patches.suse/scsi-ufs-pci-Add-quirk-for-broken-auto-hibernate-for-Intel-EHL b/patches.suse/scsi-ufs-pci-Add-quirk-for-broken-auto-hibernate-for-Intel-EHL new file mode 100644 index 0000000..9ad270f --- /dev/null +++ b/patches.suse/scsi-ufs-pci-Add-quirk-for-broken-auto-hibernate-for-Intel-EHL @@ -0,0 +1,86 @@ +From: Adrian Hunter +Date: Mon, 10 Aug 2020 17:10:24 +0300 +Subject: scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL +Git-commit: 8da76f71fef7d8a1a72af09d48899573feb60065 +Patch-mainline: v5.9-rc2 +References: git-fixes + +Intel EHL UFS host controller advertises auto-hibernate capability but it +does not work correctly. Add a quirk for that. + +[mkp: checkpatch fix] +[lduncan: refreshed to apply] + +Link: https://lore.kernel.org/r/20200810141024.28859-1-adrian.hunter@intel.com +Fixes: 8c09d7527697 ("scsi: ufshdc-pci: Add Intel PCI IDs for EHL") +Acked-by: Stanley Chu +Signed-off-by: Adrian Hunter +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/ufs/ufshcd-pci.c | 16 ++++++++++++++-- + drivers/scsi/ufs/ufshcd.h | 9 ++++++++- + 2 files changed, 22 insertions(+), 3 deletions(-) + +--- a/drivers/scsi/ufs/ufshcd-pci.c ++++ b/drivers/scsi/ufs/ufshcd-pci.c +@@ -67,11 +67,23 @@ static int ufs_intel_link_startup_notify + return err; + } + ++static int ufs_intel_ehl_init(struct ufs_hba *hba) ++{ ++ hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8; ++ return 0; ++} ++ + static struct ufs_hba_variant_ops ufs_intel_cnl_hba_vops = { + .name = "intel-pci", + .link_startup_notify = ufs_intel_link_startup_notify, + }; + ++static struct ufs_hba_variant_ops ufs_intel_ehl_hba_vops = { ++ .name = "intel-pci", ++ .init = ufs_intel_ehl_init, ++ .link_startup_notify = ufs_intel_link_startup_notify, ++}; ++ + #ifdef CONFIG_PM_SLEEP + /** + * ufshcd_pci_suspend - suspend power management function +@@ -200,8 +212,8 @@ static const struct dev_pm_ops ufshcd_pc + static const struct pci_device_id ufshcd_pci_tbl[] = { + { PCI_VENDOR_ID_SAMSUNG, 0xC00C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { PCI_VDEVICE(INTEL, 0x9DFA), (kernel_ulong_t)&ufs_intel_cnl_hba_vops }, +- { PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_cnl_hba_vops }, +- { PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_cnl_hba_vops }, ++ { PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_ehl_hba_vops }, ++ { PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_ehl_hba_vops }, + { } /* terminate list */ + }; + +--- a/drivers/scsi/ufs/ufshcd.h ++++ b/drivers/scsi/ufs/ufshcd.h +@@ -541,6 +541,12 @@ enum ufshcd_quirks { + * OCS FATAL ERROR with device error through sense data + */ + UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR = 1 << 10, ++ ++ /* ++ * This quirk needs to be enabled if the host controller has ++ * auto-hibernate capability but it doesn't work. ++ */ ++ UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8 = 1 << 11, + }; + + /** +@@ -776,7 +782,8 @@ return true; + + static inline bool ufshcd_is_auto_hibern8_supported(struct ufs_hba *hba) + { +- return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT); ++ return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) && ++ !(hba->quirks & UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8); + } + + static inline bool ufshcd_is_auto_hibern8_enabled(struct ufs_hba *hba) diff --git a/patches.suse/scsi-ufs-ufshcd-pltfrm-Fix-memory-leak-due-to-probe-defer b/patches.suse/scsi-ufs-ufshcd-pltfrm-Fix-memory-leak-due-to-probe-defer new file mode 100644 index 0000000..c44976c --- /dev/null +++ b/patches.suse/scsi-ufs-ufshcd-pltfrm-Fix-memory-leak-due-to-probe-defer @@ -0,0 +1,80 @@ +From: Srinivas Kandagatla +Date: Tue, 14 Sep 2021 10:22:14 +0100 +Subject: scsi: ufs: ufshcd-pltfrm: Fix memory leak due to probe defer +Git-commit: b6ca770ae7f2c560a29bbd02c4e3d734fafaf804 +Patch-mainline: v5.16-rc1 +References: git-fixes + +UFS drivers that probe defer will end up leaking memory allocated for clk +and regulator names via kstrdup() because the structure that is holding +this memory is allocated via devm_* variants which will be freed during +probe defer but the names are never freed. + +Use same devm_* variant of kstrdup to free the memory allocated to name +when driver probe defers. + +Kmemleak found around 11 leaks on Qualcomm Dragon Board RB5: + +unreferenced object 0xffff66f243fb2c00 (size 128): + comm "kworker/u16:0", pid 7, jiffies 4294893319 (age 94.848s) + hex dump (first 32 bytes): + 63 6f 72 65 5f 63 6c 6b 00 76 69 72 74 75 61 6c core_clk.virtual + 2f 77 6f 72 6b 71 75 65 75 65 2f 73 63 73 69 5f /workqueue/scsi_ + backtrace: + [<000000006f788cd1>] slab_post_alloc_hook+0x88/0x410 + [<00000000cfd1372b>] __kmalloc_track_caller+0x138/0x230 + [<00000000a92ab17b>] kstrdup+0xb0/0x110 + [<0000000037263ab6>] ufshcd_pltfrm_init+0x1a8/0x500 + [<00000000a20a5caa>] ufs_qcom_probe+0x20/0x58 + [<00000000a5e43067>] platform_probe+0x6c/0x118 + [<00000000ef686e3f>] really_probe+0xc4/0x330 + [<000000005b18792c>] __driver_probe_device+0x88/0x118 + [<00000000a5d295e8>] driver_probe_device+0x44/0x158 + [<000000007e83f58d>] __device_attach_driver+0xb4/0x128 + [<000000004bfa4470>] bus_for_each_drv+0x68/0xd0 + [<00000000b89a83bc>] __device_attach+0xec/0x170 + [<00000000ada2beea>] device_initial_probe+0x14/0x20 + [<0000000079921612>] bus_probe_device+0x9c/0xa8 + [<00000000d268bf7c>] deferred_probe_work_func+0x90/0xd0 + [<000000009ef64bfa>] process_one_work+0x29c/0x788 +unreferenced object 0xffff66f243fb2c80 (size 128): + comm "kworker/u16:0", pid 7, jiffies 4294893319 (age 94.848s) + hex dump (first 32 bytes): + 62 75 73 5f 61 67 67 72 5f 63 6c 6b 00 00 00 00 bus_aggr_clk.... + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +With this patch no memory leaks are reported. + +[lduncan: applied with fuzz=3, refreshed] + +Link: https://lore.kernel.org/r/20210914092214.6468-1-srinivas.kandagatla@linaro.org +Fixes: aa4976130934 ("ufs: Add regulator enable support") +Fixes: c6e79dacd86f ("ufs: Add clock initialization support") +Reviewed-by: Bart Van Assche +Signed-off-by: Srinivas Kandagatla +Signed-off-by: Martin K. Petersen +Acked-by: Lee Duncan +--- + drivers/scsi/ufs/ufshcd-pltfrm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/ufs/ufshcd-pltfrm.c ++++ b/drivers/scsi/ufs/ufshcd-pltfrm.c +@@ -116,7 +116,7 @@ static int ufshcd_parse_clock_info(struc + + clki->min_freq = clkfreq[i]; + clki->max_freq = clkfreq[i+1]; +- clki->name = kstrdup(name, GFP_KERNEL); ++ clki->name = devm_kstrdup(dev, name, GFP_KERNEL); + dev_dbg(dev, "%s: min %u max %u name %s\n", "freq-table-hz", + clki->min_freq, clki->max_freq, clki->name); + list_add_tail(&clki->list, &hba->clk_list_head); +@@ -150,7 +150,7 @@ static int ufshcd_populate_vreg(struct d + if (!vreg) + return -ENOMEM; + +- vreg->name = kstrdup(name, GFP_KERNEL); ++ vreg->name = devm_kstrdup(dev, name, GFP_KERNEL); + + snprintf(prop_name, MAX_PROP_SIZE, "%s-max-microamp", name); + if (of_property_read_u32(np, prop_name, &vreg->max_uA)) { diff --git a/patches.suse/stmmac-platform-Fix-signedness-bug-in-stmmac_probe_c.patch b/patches.suse/stmmac-platform-Fix-signedness-bug-in-stmmac_probe_c.patch new file mode 100644 index 0000000..c125e69 --- /dev/null +++ b/patches.suse/stmmac-platform-Fix-signedness-bug-in-stmmac_probe_c.patch @@ -0,0 +1,44 @@ +From: YueHaibing +Date: Wed, 7 Jul 2021 15:53:35 +0800 +Subject: stmmac: platform: Fix signedness bug in stmmac_probe_config_dt() + +Git-commit: eca81f09145d765c21dd8fb1ba5d874ca255c32c +Patch-mainline: v5.14-rc2 +References: git-fixes + +The "plat->phy_interface" variable is an enum and in this context GCC +will treat it as an unsigned int so the error handling is never +triggered. + +Fixes: b9f0b2f634c0 ("net: stmmac: platform: fix probe for ACPI devices") +Signed-off-by: YueHaibing +Signed-off-by: David S. Miller +Signed-off-by: Mian Yousaf Kaukab +--- + drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +@@ -369,6 +369,7 @@ stmmac_probe_config_dt(struct platform_d + struct device_node *np = pdev->dev.of_node; + struct plat_stmmacenet_data *plat; + struct stmmac_dma_cfg *dma_cfg; ++ int phy_mode; + int rc; + + plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); +@@ -409,7 +409,12 @@ stmmac_probe_config_dt(struct platform_d + *mac = NULL; + } + +- plat->phy_interface = device_get_phy_mode(&pdev->dev); ++ phy_mode = device_get_phy_mode(&pdev->dev); ++ if (phy_mode < 0) ++ return ERR_PTR(phy_mode); ++ ++ plat->interface = phy_mode; ++ + if (plat->phy_interface < 0) + return ERR_PTR(plat->phy_interface); + diff --git a/patches.suse/tracing-Increase-PERF_MAX_TRACE_SIZE-to-handle-Senti.patch b/patches.suse/tracing-Increase-PERF_MAX_TRACE_SIZE-to-handle-Senti.patch new file mode 100644 index 0000000..29cb443 --- /dev/null +++ b/patches.suse/tracing-Increase-PERF_MAX_TRACE_SIZE-to-handle-Senti.patch @@ -0,0 +1,90 @@ +From e531e90b5ab0f7ce5ff298e165214c1aec6ed187 Mon Sep 17 00:00:00 2001 +From: "Robin H. Johnson" +Date: Mon, 30 Aug 2021 21:37:23 -0700 +Subject: [PATCH] tracing: Increase PERF_MAX_TRACE_SIZE to handle Sentinel1 and + docker together +Git-commit: e531e90b5ab0f7ce5ff298e165214c1aec6ed187 +Patch-mainline: v5.16-rc1 +References: bsc#1192745 + +Running endpoint security solutions like Sentinel1 that use perf-based +tracing heavily lead to this repeated dump complaining about dockerd. +The default value of 2048 is nowhere near not large enough. + +Using the prior patch "tracing: show size of requested buffer", we get +"perf buffer not large enough, wanted 6644, have 6144", after repeated +up-sizing (I did 2/4/6/8K). With 8K, the problem doesn't occur at all, +so below is the trace for 6K. + +I'm wondering if this value should be selectable at boot time, but this +is a good starting point. + +``` + +------------[ cut here ]------------ +perf buffer not large enough, wanted 6644, have 6144 +WARNING: CPU: 1 PID: 4997 at kernel/trace/trace_event_perf.c:402 perf_trace_buf_alloc+0x8c/0xa0 +Modules linked in: [..] +CPU: 1 PID: 4997 Comm: sh Tainted: G T 5.13.13-x86_64-00039-gb3959163488e #63 +Hardware name: LENOVO 20KH002JUS/20KH002JUS, BIOS N23ET66W (1.41 ) 09/02/2019 +RIP: 0010:perf_trace_buf_alloc+0x8c/0xa0 +Code: 80 3d 43 97 d0 01 00 74 07 31 c0 5b 5d 41 5c c3 ba 00 18 00 00 89 ee 48 c7 c7 00 82 7d 91 c6 05 25 97 d0 01 01 e8 22 ee bc 00 <0f> 0b 31 c0 eb db 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 55 89 +RSP: 0018:ffffb922026b7d58 EFLAGS: 00010282 +RAX: 0000000000000000 RBX: ffff9da5ee012000 RCX: 0000000000000027 +RDX: ffff9da881657828 RSI: 0000000000000001 RDI: ffff9da881657820 +RBP: 00000000000019f4 R08: 0000000000000000 R09: ffffb922026b7b80 +R10: ffffb922026b7b78 R11: ffffffff91dda688 R12: 000000000000000f +R13: ffff9da5ee012108 R14: ffff9da8816570a0 R15: ffffb922026b7e30 +FS: 00007f420db1a080(0000) GS:ffff9da881640000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000000000000060 CR3: 00000002504a8006 CR4: 00000000003706e0 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +Call Trace: + kprobe_perf_func+0x11e/0x270 + ? do_execveat_common.isra.0+0x1/0x1c0 + ? do_execveat_common.isra.0+0x5/0x1c0 + kprobe_ftrace_handler+0x10e/0x1d0 + 0xffffffffc03aa0c8 + ? do_execveat_common.isra.0+0x1/0x1c0 + do_execveat_common.isra.0+0x5/0x1c0 + __x64_sys_execve+0x33/0x40 + do_syscall_64+0x6b/0xc0 + ? do_syscall_64+0x11/0xc0 + entry_SYSCALL_64_after_hwframe+0x44/0xae +RIP: 0033:0x7f420dc1db37 +Code: ff ff 76 e7 f7 d8 64 41 89 00 eb df 0f 1f 80 00 00 00 00 f7 d8 64 41 89 00 eb dc 0f 1f 84 00 00 00 00 00 b8 3b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 01 43 0f 00 f7 d8 64 89 01 48 +RSP: 002b:00007ffd4e8b4e38 EFLAGS: 00000246 ORIG_RAX: 000000000000003b +RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f420dc1db37 +RDX: 0000564338d1e740 RSI: 0000564338d32d50 RDI: 0000564338d28f00 +RBP: 0000564338d28f00 R08: 0000564338d32d50 R09: 0000000000000020 +R10: 00000000000001b6 R11: 0000000000000246 R12: 0000564338d28f00 +R13: 0000564338d32d50 R14: 0000564338d1e740 R15: 0000564338d28c60 +---[ end trace 83ab3e8e16275e49 ]--- +``` + +Link: https://lkml.kernel.org/r/20210831043723.13481-2-robbat2@gentoo.org + +Signed-off-by: Robin H. Johnson +Signed-off-by: Steven Rostedt (VMware) +Acked-by: Petr Mladek +--- + include/linux/trace_events.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index 3e475eeb5a99..50453b287615 100644 +--- a/include/linux/trace_events.h ++++ b/include/linux/trace_events.h +@@ -671,7 +671,7 @@ struct trace_event_file { + } \ + early_initcall(trace_init_perf_perm_##name); + +-#define PERF_MAX_TRACE_SIZE 2048 ++#define PERF_MAX_TRACE_SIZE 8192 + + #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ + +-- +2.26.2 + diff --git a/patches.suse/x86-sme-use-define-use_early_pgtable_l5-in-mem_encrypt_identity-c.patch b/patches.suse/x86-sme-use-define-use_early_pgtable_l5-in-mem_encrypt_identity-c.patch new file mode 100644 index 0000000..da3dbfe --- /dev/null +++ b/patches.suse/x86-sme-use-define-use_early_pgtable_l5-in-mem_encrypt_identity-c.patch @@ -0,0 +1,57 @@ +From: Tom Lendacky +Date: Fri, 15 Oct 2021 12:24:16 -0500 +Subject: x86/sme: Use #define USE_EARLY_PGTABLE_L5 in mem_encrypt_identity.c +Git-commit: e7d445ab26db833d6640d4c9a08bee176777cc82 +Patch-mainline: v5.16-rc1 +References: bsc#1152489 + +When runtime support for converting between 4-level and 5-level pagetables +was added to the kernel, the SME code that built pagetables was updated +to use the pagetable functions, e.g. p4d_offset(), etc., in order to +simplify the code. However, the use of the pagetable functions in early +boot code requires the use of the USE_EARLY_PGTABLE_L5 #define in order to +ensure that the proper definition of pgtable_l5_enabled() is used. + +Without the #define, pgtable_l5_enabled() is #defined as +cpu_feature_enabled(X86_FEATURE_LA57). In early boot, the CPU features +have not yet been discovered and populated, so pgtable_l5_enabled() will +return false even when 5-level paging is enabled. This causes the SME code +to always build 4-level pagetables to perform the in-place encryption. +If 5-level paging is enabled, switching to the SME pagetables results in +a page-fault that kills the boot. + +Adding the #define results in pgtable_l5_enabled() using the +__pgtable_l5_enabled variable set in early boot and the SME code building +pagetables for the proper paging level. + +Fixes: aad983913d77 ("x86/mm/encrypt: Simplify sme_populate_pgd() and sme_populate_pgd_large()") +Signed-off-by: Tom Lendacky +Signed-off-by: Borislav Petkov +Acked-by: Kirill A. Shutemov +Cc: # 4.18.x +Link: https://lkml.kernel.org/r/2cb8329655f5c753905812d951e212022a480475.1634318656.git.thomas.lendacky@amd.com +--- + arch/x86/mm/mem_encrypt_identity.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c +index 470b20208430..700ce8fdea87 100644 +--- a/arch/x86/mm/mem_encrypt_identity.c ++++ b/arch/x86/mm/mem_encrypt_identity.c +@@ -27,6 +27,15 @@ + #undef CONFIG_PARAVIRT_XXL + #undef CONFIG_PARAVIRT_SPINLOCKS + ++/* ++ * This code runs before CPU feature bits are set. By default, the ++ * pgtable_l5_enabled() function uses bit X86_FEATURE_LA57 to determine if ++ * 5-level paging is active, so that won't work here. USE_EARLY_PGTABLE_L5 ++ * is provided to handle this situation and, instead, use a variable that ++ * has been set by the early boot code. ++ */ ++#define USE_EARLY_PGTABLE_L5 ++ + #include + #include + #include + diff --git a/patches.suse/x86-xen-Mark-cpu_bringup_and_idle-as-dead_end_functi.patch b/patches.suse/x86-xen-Mark-cpu_bringup_and_idle-as-dead_end_functi.patch new file mode 100644 index 0000000..db07314 --- /dev/null +++ b/patches.suse/x86-xen-Mark-cpu_bringup_and_idle-as-dead_end_functi.patch @@ -0,0 +1,45 @@ +Patch-mainline: v5.16-rc1 +Git-commit: 9af9dcf11bda3e2c0e24c1acaacb8685ad974e93 +References: git-fixes +From: Peter Zijlstra +Date: Thu, 24 Jun 2021 11:41:00 +0200 +Subject: [PATCH] x86/xen: Mark cpu_bringup_and_idle() as dead_end_function + +The asm_cpu_bringup_and_idle() function is required to push the return +value on the stack in order to make ORC happy, but the only reason +objtool doesn't complain is because of a happy accident. + +The thing is that asm_cpu_bringup_and_idle() doesn't return, so +validate_branch() never terminates and falls through to the next +function, which in the normal case is the hypercall_page. And that, as +it happens, is 4095 NOPs and a RET. + +Make asm_cpu_bringup_and_idle() terminate on it's own, by making the +function it calls as a dead-end. This way we no longer rely on what +code happens to come after. + +Fixes: c3881eb58d56 ("x86/xen: Make the secondary CPU idle tasks reliable") +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Juergen Gross +Reviewed-by: Miroslav Benes +Link: https://lore.kernel.org/r/20210624095147.693801717@infradead.org +Signed-off-by: Juergen Gross +--- + tools/objtool/check.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/objtool/check.c b/tools/objtool/check.c +index e5947fbb9e7a..0e3981d91afc 100644 +--- a/tools/objtool/check.c ++++ b/tools/objtool/check.c +@@ -161,6 +161,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, + "usercopy_abort", + "machine_real_restart", + "rewind_stack_do_exit", ++ "cpu_bringup_and_idle", + }; + + if (!func) +-- +2.26.2 + diff --git a/patches.suse/xen-Fix-implicit-type-conversion.patch b/patches.suse/xen-Fix-implicit-type-conversion.patch new file mode 100644 index 0000000..2952b65 --- /dev/null +++ b/patches.suse/xen-Fix-implicit-type-conversion.patch @@ -0,0 +1,61 @@ +Patch-mainline: v5.16-rc1 +Git-commit: cbd5458ef19594c7a1ec69e77a624a5502a79eb9 +References: git-fixes +From: Jiasheng Jiang +Date: Tue, 26 Oct 2021 07:32:11 +0000 +Subject: [PATCH] xen: Fix implicit type conversion + +The variable 'i' is defined as UINT. However, in the for_each_possible_cpu +its value is assigned to -1. That doesn't make sense and in the +cpumask_next() it is implicitly type converted to INT. It is universally +accepted that the implicit type conversion is terrible. Also, having the +good programming custom will set an example for others. Thus, it might be +better to change the definition of 'i' from UINT to INT. + +[boris: fixed commit message formatting] + +Fixes: 3fac10145b76 ("xen: Re-upload processor PM data to hypervisor after S3 resume (v2)") +Signed-off-by: Jiasheng Jiang +Link: https://lore.kernel.org/r/1635233531-2437704-1-git-send-email-jiasheng@iscas.ac.cn +Reviewed-by: Juergen Gross +Reviewed-by: Jiamei Xie +Signed-off-by: Boris Ostrovsky +Signed-off-by: Juergen Gross +--- + drivers/xen/xen-acpi-processor.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c +index df7cab870be5..9cb61db67efd 100644 +--- a/drivers/xen/xen-acpi-processor.c ++++ b/drivers/xen/xen-acpi-processor.c +@@ -450,7 +450,7 @@ static struct acpi_processor_performance __percpu *acpi_perf_data; + + static void free_acpi_perf_data(void) + { +- unsigned int i; ++ int i; + + /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */ + for_each_possible_cpu(i) +@@ -462,7 +462,7 @@ static void free_acpi_perf_data(void) + static int xen_upload_processor_pm_data(void) + { + struct acpi_processor *pr_backup = NULL; +- unsigned int i; ++ int i; + int rc = 0; + + pr_info("Uploading Xen processor PM info\n"); +@@ -518,7 +518,7 @@ static struct syscore_ops xap_syscore_ops = { + + static int __init xen_acpi_processor_init(void) + { +- unsigned int i; ++ int i; + int rc; + + if (!xen_initial_domain()) +-- +2.26.2 + diff --git a/patches.suse/xen-pciback-Fix-return-in-pm_ctrl_init.patch b/patches.suse/xen-pciback-Fix-return-in-pm_ctrl_init.patch new file mode 100644 index 0000000..da8c4d8 --- /dev/null +++ b/patches.suse/xen-pciback-Fix-return-in-pm_ctrl_init.patch @@ -0,0 +1,38 @@ +Patch-mainline: v5.16-rc1 +Git-commit: 4745ea2628bb43a7ec34b71763b5a56407b33990 +References: git-fixes +From: YueHaibing +Date: Fri, 8 Oct 2021 15:44:17 +0800 +Subject: [PATCH] xen-pciback: Fix return in pm_ctrl_init() + +Return NULL instead of passing to ERR_PTR while err is zero, +this fix smatch warnings: +drivers/xen/xen-pciback/conf_space_capability.c:163 + pm_ctrl_init() warn: passing zero to 'ERR_PTR' + +Fixes: a92336a1176b ("xen/pciback: Drop two backends, squash and cleanup some code.") +Signed-off-by: YueHaibing +Reviewed-by: Juergen Gross +Link: https://lore.kernel.org/r/20211008074417.8260-1-yuehaibing@huawei.com +Signed-off-by: Boris Ostrovsky +Signed-off-by: Juergen Gross +--- + drivers/xen/xen-pciback/conf_space_capability.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/xen/xen-pciback/conf_space_capability.c b/drivers/xen/xen-pciback/conf_space_capability.c +index 22f13abbe913..5e53b4817f16 100644 +--- a/drivers/xen/xen-pciback/conf_space_capability.c ++++ b/drivers/xen/xen-pciback/conf_space_capability.c +@@ -160,7 +160,7 @@ static void *pm_ctrl_init(struct pci_dev *dev, int offset) + } + + out: +- return ERR_PTR(err); ++ return err ? ERR_PTR(err) : NULL; + } + + static const struct config_field caplist_pm[] = { +-- +2.26.2 + diff --git a/rpm/kernel-cert-subpackage b/rpm/kernel-cert-subpackage index 8bdf47d..44aaa05 100644 --- a/rpm/kernel-cert-subpackage +++ b/rpm/kernel-cert-subpackage @@ -1,8 +1,8 @@ %package -n %{-n*}-ueficert Summary: UEFI Secure Boot Certificate For Package %{-n*}-kmp Group: System/Kernel -Requires(post): suse-kernel-rpm-scriptlets Requires(pre): suse-kernel-rpm-scriptlets +Requires(postun): suse-kernel-rpm-scriptlets %description -n %{-n*}-ueficert This package contains the UEFI Secure Boot certificate used to sign modules in the %{-n*}-kmp packages. diff --git a/rpm/kernel-module-subpackage b/rpm/kernel-module-subpackage index e8c1a89..d00434f 100644 --- a/rpm/kernel-module-subpackage +++ b/rpm/kernel-module-subpackage @@ -26,6 +26,8 @@ Provides: %{-n*}-kmp = %{-v*} Provides: multiversion(kernel) Provides: %{-n*}-kmp-%1-%_this_kmp_kernel_version Requires: coreutils grep +Requires(pre): suse-kernel-rpm-scriptlets +Requires(postun): suse-kernel-rpm-scriptlets %{-c:Requires: %{-n*}-ueficert} Enhances: kernel-%1 Supplements: packageand(kernel-%1:%{-n*}) diff --git a/scripts/git_sort/git_sort.py b/scripts/git_sort/git_sort.py index 2c1b8df..43caf24 100755 --- a/scripts/git_sort/git_sort.py +++ b/scripts/git_sort/git_sort.py @@ -255,6 +255,7 @@ remotes = ( Head(RepoURL("clk/linux.git"), "clk-next"), Head(RepoURL("git://github.com/ceph/ceph-client"), "testing"), Head(RepoURL("bpf/bpf.git")), + Head(RepoURL("linusw/linux-gpio.git"), "for-next"), ) diff --git a/series.conf b/series.conf index 62e8232..d65848b 100644 --- a/series.conf +++ b/series.conf @@ -2461,6 +2461,9 @@ patches.suse/net-phy-add-__set_linkmode_max_speed.patch patches.suse/net-phy-add-phy_speed_down_core-and-phy_resolve_min_.patch patches.suse/net-phy-let-phy_speed_down-up-support-speeds-1Gbps.patch + patches.suse/r8152-separate-the-rx-buffer-size.patch + patches.suse/r8152-replace-array-with-linking-list-for-rx-informa.patch + patches.suse/r8152-use-alloc_pages-for-rx-buffer.patch patches.suse/netfilter-synproxy-rename-mss-synproxy_options-field.patch patches.suse/netfilter-conntrack-use-shared-sysctl-constants.patch patches.suse/0001-ipvs-Improve-robustness-to-the-ipvs-sysctl.patch @@ -2602,6 +2605,7 @@ patches.suse/rtlwifi-rtl8192ce-Convert-inline-routines-to-little-.patch patches.suse/Revert-mwifiex-fix-system-hang-problem-after-resume.patch patches.suse/b43legacy-Remove-pointless-cond_resched-wrapper.patch + patches.suse/r8152-divide-the-tx-and-rx-bottom-functions.patch patches.suse/net-dsa-use-a-single-switch-statement-for-port-setup.patch patches.suse/netdevsim-Fix-build-error-without-CONFIG_INET.patch patches.suse/s390-qeth-use-node_descriptor-struct @@ -2705,6 +2709,8 @@ patches.suse/i40e-fix-retrying-in-i40e_aq_get_phy_capabilities.patch patches.suse/net-fec-add-c45-mdio-read-write-support.patch patches.suse/ethernet-Delete-unnecessary-checks-before-the-macro-.patch + patches.suse/r8152-saving-the-settings-of-EEE.patch + patches.suse/r8152-add-a-helper-function-about-setting-EEE.patch patches.suse/net-ipv6-fix-listify-ip6_rcv_finish-in-case-of-forwa.patch patches.suse/net-mlx5-Fix-return-code-in-case-of-hyperv-wrong-siz.patch patches.suse/drop_monitor-Make-timestamps-y2038-safe.patch @@ -6216,6 +6222,7 @@ patches.suse/scsi-qla2xxx-Make-qlt_handle_abts_completion-more-ro.patch patches.suse/scsi-qla2xxx-Modify-NVMe-include-directives.patch patches.suse/scsi-qla2xxx-Introduce-qla2xxx_get_next_handle.patch + patches.suse/scsi-qla2xxx-Make-sure-that-aborted-commands-are-freed patches.suse/scsi-qla2xxx-Complain-if-sp-done-is-not-called-from-.patch patches.suse/scsi-qla2xxx-Let-the-compiler-check-the-type-of-the-.patch patches.suse/scsi-qla2xxx-Remove-superfluous-sts_entry_-casts.patch @@ -9025,6 +9032,7 @@ patches.suse/btrfs-use-refcount_inc_not_zero-in-kill_all_nodes.patch patches.suse/btrfs-drop-unused-parameter-is_new-from-btrfs_iget.patch patches.suse/btrfs-add-__cold-attribute-to-more-functions.patch + patches.suse/btrfs-block-group-Rework-documentation-of-check_syst.patch patches.suse/btrfs-Avoid-getting-stuck-during-cyclic-writebacks.patch patches.suse/btrfs-Rename-btrfs_join_transaction_nolock.patch patches.suse/btrfs-use-bool-argument-in-free_root_pointers.patch @@ -9872,6 +9880,7 @@ patches.suse/bnx2x-Fix-PF-VF-communication-over-multi-cos-queues.patch patches.suse/cnic-Set-fp_hsi_ver-as-part-of-CLIENT_SETUP-ramrod.patch patches.suse/cxgb4-Add-pci-reset-handler.patch + patches.suse/r8152-Add-macpassthru-support-for-ThinkPad-Thunderbo.patch patches.suse/brcmfmac-send-port-authorized-event-for-FT-802.1X.patch patches.suse/brcmsmac-remove-a-useless-test.patch patches.suse/brcmfmac-don-t-WARN-when-there-are-no-requests.patch @@ -16317,8 +16326,13 @@ patches.suse/airo-Add-missing-CAP_NET_ADMIN-check-in-AIROOLDIOCTL.patch patches.suse/net-rtnetlink-validate-IFLA_MTU-attribute-in-rtnl_cr.patch patches.suse/gtp-make-sure-only-SOCK_DGRAM-UDP-sockets-are-accept.patch + patches.suse/r8152-fix-runtime-resume-for-linking-change.patch + patches.suse/r8152-reset-flow-control-patch-when-linking-on-for-R.patch patches.suse/r8152-get-default-setting-of-WOL-before-initializing.patch + patches.suse/r8152-disable-U2P3-for-RTL8153B.patch + patches.suse/r8152-Disable-PLA-MCU-clock-speed-down.patch patches.suse/r8152-disable-test-IO-for-RTL8153B.patch + patches.suse/r8152-don-t-enable-U1U2-with-USB_SPEED_HIGH-for-RTL8.patch patches.suse/r8152-avoid-the-MCU-to-clear-the-lanwake.patch patches.suse/r8152-disable-DelayPhyPwrChg.patch patches.suse/mlxsw-spectrum_acl-Fix-use-after-free-during-reload.patch @@ -29771,6 +29785,7 @@ patches.suse/pstore-blk-support-non-block-storage-devices.patch patches.suse/pstore-blk-introduce-best_effort-mode.patch patches.suse/mtd-support-kmsg-dumper-based-on-pstore-blk.patch + patches.suse/printk-handle-blank-console-arguments-passed-in.patch patches.suse/edac-skx-i10nm-make-some-configurations-cpu-model-specific.patch patches.suse/edac-i10nm-update-driver-to-support-different-bus-number-config-register-offsets.patch patches.suse/edac-skx-use-the-mcmtr-register-to-retrieve-close_pg-bank_xor_enable.patch @@ -36503,6 +36518,7 @@ patches.suse/i2c-also-convert-placeholder-function-to-return-errn.patch patches.suse/i2c-slave-improve-sanity-check-when-registering.patch patches.suse/i2c-slave-add-sanity-check-when-unregistering.patch + patches.suse/net-mscc-ocelot-fix-hardware-timestamp-dequeue-logic.patch patches.suse/net-hns3-fix-desc-filling-bug-when-skb-is-expanded-o.patch patches.suse/net-hns3-fix-a-TX-timeout-issue.patch patches.suse/net-hns3-add-reset-check-for-VF-updating-port-based-.patch @@ -41993,6 +42009,7 @@ patches.suse/mm-page_alloc-fix-core-hung-in-free_pcppages_bulk.patch patches.suse/of-address-check-for-invalid-range-cpu_addr.patch patches.suse/scsi-fcoe-Fix-I-O-path-allocation.patch + patches.suse/scsi-ufs-pci-Add-quirk-for-broken-auto-hibernate-for-Intel-EHL patches.suse/scsi-zfcp-fix-use-after-free-in-request-timeout-handlers patches.suse/scsi-qla2xxx-Use-MBX_TOV_SECONDS-for-mailbox-command.patch patches.suse/scsi-qla2xxx-Flush-all-sessions-on-zone-disable.patch @@ -46762,6 +46779,7 @@ patches.suse/bitmap-remove-unused-function-declaration.patch patches.suse/lib-string-remove-unnecessary-undefs.patch patches.suse/apparmor-remove-duplicate-macro-list_entry_is_head.patch + patches.suse/printk-console-Allow-to-disable-console-output-by-us.patch patches.suse/selinux-fix-error-initialization-in-inode_doinit_wit.patch patches.suse/selinux-fix-inode_doinit_with_dentry-LABEL_INVALID-e.patch patches.suse/gcc-plugins-simplify-GCC-plugin-dev-capability-test.patch @@ -47381,6 +47399,7 @@ patches.suse/mlxsw-core-Add-validation-of-transceiver-temperature.patch patches.suse/mlxsw-core-Increase-critical-threshold-for-ASIC-ther.patch patches.suse/net-mvpp2-Remove-Pause-and-Asym_Pause-support.patch + patches.suse/rndis_host-set-proper-input-size-for-OID_GEN_PHYSICA.patch patches.suse/r8152-Add-Lenovo-Powered-USB-C-Travel-Hub.patch patches.suse/bnxt_en-Improve-stats-context-resource-accounting-wi.patch patches.suse/smc-fix-out-of-bound-access-in-smc_nl_get_sys_info @@ -48456,6 +48475,7 @@ patches.suse/can-flexcan-invoke-flexcan_chip_freeze-to-enter-free.patch patches.suse/can-skb-can_skb_set_owner-fix-ref-counting-if-socket.patch patches.suse/ibmvnic-Fix-possibly-uninitialized-old_num_tx_queues.patch + patches.suse/Revert-r8152-adjust-the-settings-about-MAC-clock-spe.patch patches.suse/ixgbe-fail-to-create-xfrm-offload-of-IPsec-tunnel-mo.patch patches.suse/net-usb-qmi_wwan-allow-qmimux-add-del-with-master-up.patch patches.suse/netdevsim-init-u64-stats-for-32bit-hardware.patch @@ -48770,6 +48790,7 @@ patches.suse/ACPICA-Always-create-namespace-nodes-using-acpi_ns_c.patch patches.suse/ACPI-video-Add-missing-callback-back-for-Sony-VPCEH3.patch patches.suse/0002-dm-verity-fix-DM_VERITY_OPTS_MAX-value.patch + patches.suse/dm-ioctl-fix-out-of-bounds-array-access-when-no-devi.patch patches.suse/scsi-ibmvfc-Fix-potential-race-in-ibmvfc_wait_for_op.patch patches.suse/scsi-ibmvfc-Make-ibmvfc_wait_for_ops-MQ-aware.patch patches.suse/scsi-qedi-Fix-error-return-code-of-qedi_alloc_global_queues @@ -49859,6 +49880,7 @@ patches.suse/cdrom-gdrom-deallocate-struct-gdrom_unit-fields-in-r.patch patches.suse/Revert-char-hpet-fix-a-missing-check-of-ioremap.patch patches.suse/char-hpet-add-checks-after-calling-ioremap.patch + patches.suse/Revert-scsi-ufs-fix-a-missing-check-of-devm_reset_control_get patches.suse/Revert-video-hgafb-fix-potential-NULL-pointer-derefe.patch patches.suse/video-hgafb-fix-potential-NULL-pointer-dereference.patch patches.suse/Revert-isdn-mISDNinfineon-fix-potential-NULL-pointer.patch @@ -49907,6 +49929,7 @@ patches.suse/ALSA-intel8x0-Don-t-update-period-unless-prepared.patch patches.suse/ALSA-dice-fix-stream-format-for-TC-Electronic-Konnek.patch patches.suse/ALSA-line6-Fix-racy-initialization-of-LINE6-MIDI.patch + patches.suse/scsi-qedf-Add-pointer-checks-in-qedf_update_link_speed patches.suse/scsi-qla2xxx-Fix-error-return-code-in-qla82xx_write_.patch patches.suse/firmware-arm_scpi-Prevent-the-ternary-sign-expansion.patch patches.suse/drm-i915-gt-Disable-HiZ-Raw-Stall-Optimization-on-br.patch @@ -50032,6 +50055,7 @@ patches.suse/s390-dasd-add-missing-discipline-function patches.suse/nvme-fc-short-circuit-reconnect-retries.patch patches.suse/nvme-fabrics-decode-host-pathing-error-for-connect.patch + patches.suse/scsi-libsas-Use-_safe-loop-in-sas_resume_port patches.suse/scsi-target-qla2xxx-Wait-for-stop_phase1-at-WWN-remo.patch patches.suse/USB-usbfs-Don-t-WARN-about-excessively-large-memory-.patch patches.suse/usb-dwc3-gadget-Properly-track-pending-and-queued-SG.patch @@ -50227,6 +50251,7 @@ patches.suse/mlxsw-reg-Spectrum-3-Enforce-lowest-max-shaper-burst.patch patches.suse/vrf-fix-maximum-MTU.patch patches.suse/batman-adv-Avoid-WARN_ON-timing-related-checks.patch + patches.suse/net-dsa-felix-re-enable-TX-flow-control-in-ocelot_po.patch patches.suse/mac80211-remove-warning-in-ieee80211_get_sband.patch patches.suse/mac80211_hwsim-drop-pending-frames-on-stop.patch patches.suse/cfg80211-call-cfg80211_leave_ocb-when-switching-away.patch @@ -50676,6 +50701,7 @@ patches.suse/iommu-dma-fix-compile-warning-in-32-bit-builds patches.suse/xfs-fix-log-intent-recovery-ENOSPC-shutdowns-when-in.patch patches.suse/scsi-lpfc-Remove-redundant-assignment-to-pointer-tem.patch + patches.suse/scsi-snic-Fix-an-error-message patches.suse/scsi-ibmvfc-Handle-move-login-failure.patch patches.suse/scsi-ibmvfc-Avoid-move-login-if-fast-fail-is-enabled.patch patches.suse/scsi-ibmvfc-Reinit-target-retries.patch @@ -50693,6 +50719,7 @@ patches.suse/scsi-lpfc-Reregister-FPIN-types-if-ELS_RDF-is-receiv.patch patches.suse/scsi-lpfc-Update-lpfc-version-to-12.8.0.10.patch patches.suse/scsi-qla2xxx-Log-PCI-address-in-qla_nvme_unregister_.patch + patches.suse/scsi-FlashPoint-Rename-si_flags-field patches.suse/scsi-mpi3mr-Add-mpi30-Rev-R-headers-and-Kconfig patches.suse/scsi-mpi3mr-Base-driver-code patches.suse/scsi-mpi3mr-Create-operational-request-and-reply-queue-pair @@ -50735,6 +50762,7 @@ patches.suse/scsi-qla2xxx-Use-list_move_tail-instead-of-list_del-.patch patches.suse/scsi-mpi3mr-Fix-missing-unlock-on-error patches.suse/scsi-mpi3mr-Fix-error-return-code-in-mpi3mr_init_ioc + patches.suse/scsi-mpt3sas-Fix-error-return-value-in-_scsih_expander_add patches.suse/scsi-lpfc-Fix-build-error-in-lpfc_scsi.c.patch patches.suse/ALSA-usx2y-Avoid-camelCase.patch patches.suse/ALSA-usx2y-Don-t-call-free_pages_exact-with-NULL-add.patch @@ -50978,6 +51006,7 @@ patches.suse/rtc-stm32-Fix-unbalanced-clk_disable_unprepare-on-pr.patch patches.suse/rtc-pcf2127-handle-timestamp-interrupts.patch patches.suse/scsi-qla2xxx-Add-heartbeat-check.patch + patches.suse/scsi-be2iscsi-Fix-an-error-handling-path-in-beiscsi_dev_probe patches.suse/scsi-libfc-Fix-array-index-out-of-bound-exception.patch patches.suse/btrfs-fix-deadlock-with-concurrent-chunk-allocations.patch patches.suse/btrfs-rework-chunk-allocation-to-avoid-exhaustion-of.patch @@ -51010,6 +51039,7 @@ patches.suse/bonding-Add-struct-bond_ipesc-to-manage-SA.patch patches.suse/bonding-fix-suspicious-RCU-usage-in-bond_ipsec_offlo.patch patches.suse/bonding-fix-incorrect-return-value-of-bond_ipsec_off.patch + patches.suse/stmmac-platform-Fix-signedness-bug-in-stmmac_probe_c.patch patches.suse/netfilter-conntrack-do-not-renew-entry-stuck-in-tcp-.patch patches.suse/netfilter-ctnetlink-suspicious-RCU-usage-in-ctnetlin.patch patches.suse/0001-netfilter-conntrack-improve-RST-handling-when-tuple-.patch @@ -51086,6 +51116,7 @@ patches.suse/rbd-don-t-hold-lock_rwsem-while-running_list-is-being-drained.patch patches.suse/ceph-don-t-warn-if-we-re-still-opening-a-session-to-an-mds.patch patches.suse/nvme-fix-refcounting-imbalance-when-all-paths-are-do.patch + patches.suse/scsi-iscsi-Fix-iface-sysfs-attr-detection patches.suse/ACPI-fix-NULL-pointer-dereference.patch patches.suse/efi-tpm-Differentiate-missing-and-invalid-final-even.patch patches.suse/firmware-efi-Tell-memblock-about-EFI-iomem-reservati.patch @@ -51299,6 +51330,8 @@ patches.suse/e1000e-Fix-the-max-snoop-no-snoop-latency-for-10M.patch patches.suse/net-sched-ets-fix-crash-when-flipping-from-strict-to.patch patches.suse/can-usb-esd_usb2-esd_usb2_rx_event-fix-the-interchan.patch + patches.suse/ipv6-use-siphash-in-rt6_exception_hash.patch + patches.suse/ipv4-use-siphash-instead-of-jenkins-in-fnhe_hashfun.patch patches.suse/cxgb4-dont-touch-blocked-freelist-bitmap-after-free.patch patches.suse/bpf-Fix-ringbuf-helper-function-compatibility.patch patches.suse/drm-i915-Fix-syncmap-memory-leak.patch @@ -51410,6 +51443,8 @@ patches.suse/iwlwifi-skip-first-element-in-the-WTAS-ACPI-table.patch patches.suse/bcma-Fix-memory-leak-for-internally-handled-cores.patch patches.suse/brcmfmac-pcie-fix-oops-on-failure-to-resume-and-repr.patch + patches.suse/ipv6-make-exception-cache-less-predictible.patch + patches.suse/ipv4-make-exception-cache-less-predictible.patch patches.suse/ice-Only-lock-to-update-netdev-dev_addr.patch patches.suse/fpga-altera-freeze-bridge-Address-warning-about-unus.patch patches.suse/fpga-xiilnx-spi-Address-warning-about-unused-variabl.patch @@ -51581,8 +51616,10 @@ patches.suse/scsi-qla2xxx-Update-version-to-10.02.00.107-k.patch patches.suse/scsi-qla2xxx-Fix-spelling-mistakes-allloc-alloc.patch patches.suse/scsi-lpfc-Fix-possible-ABBA-deadlock-in-nvmet_xri_ab.patch + patches.suse/scsi-BusLogic-Fix-missing-pr_cont-use patches.suse/scsi-qla2xxx-Fix-use-after-free-in-debug-code.patch patches.suse/scsi-qla2xxx-Remove-redundant-initialization-of-vari.patch + patches.suse/scsi-fdomain-Fix-error-return-code-in-fdomain_probe patches.suse/scsi-core-Introduce-the-scsi_cmd_to_rq-function.patch patches.suse/scsi-lpfc-Use-scsi_cmd_to_rq-instead-of-scsi_cmnd.re.patch patches.suse/scsi-mpi3mr-Use-scsi_cmd_to_rq-instead-of-scsi_cmnd.request @@ -51602,6 +51639,9 @@ patches.suse/scsi-qla2xxx-Sync-queue-idx-with-queue_pair_map-idx.patch patches.suse/scsi-qla2xxx-Update-version-to-10.02.06.100-k.patch patches.suse/scsi-mpi3mr-Use-the-proper-SCSI-midlayer-interfaces-for-PI + patches.suse/scsi-smartpqi-Fix-an-error-code-in-pqi_get_raid_map + patches.suse/scsi-qedi-Fix-error-codes-in-qedi_alloc_global_queues + patches.suse/scsi-qedf-Fix-error-codes-in-qedf_alloc_global_queues patches.suse/scsi-ibmvfc-Do-not-wait-for-initial-device-scan.patch patches.suse/scsi-qla2xxx-edif-Fix-stale-session.patch patches.suse/scsi-qla2xxx-edif-Reject-AUTH-ELS-on-session-down.patch @@ -51671,6 +51711,7 @@ patches.suse/fuse-truncate-pagecache-on-atomic_o_trunc.patch patches.suse/fuse-flush-extending-writes.patch patches.suse/gpio-mpc8xxx-Fix-a-resources-leak-in-the-error-handl.patch + patches.suse/gpio-mpc8xxx-Use-devm_gpiochip_add_data-to-simplify-.patch patches.suse/mfd-axp20x-Update-AXP288-volatile-ranges.patch patches.suse/mfd-Don-t-use-irq_create_mapping-to-resolve-a-mappin.patch patches.suse/mfd-tqmx86-Clear-GPIO-IRQ-resource-when-no-IRQ-is-se.patch @@ -51699,6 +51740,7 @@ patches.suse/PCI-xilinx-nwl-Enable-the-clock-through-CCF.patch patches.suse/ipc-replace-costly-bailout-check-in-sysvipc_find_ipc.patch patches.suse/SUNRPC-improve-error-response-to-over-size-gss-crede.patch + patches.suse/mm-hugetlb-initialize-hugetlb_usage-in-mm_init.patch patches.suse/dmaengine-sprd-Add-missing-MODULE_DEVICE_TABLE.patch patches.suse/dmaengine-idxd-fix-wq-slot-allocation-index-check.patch patches.suse/dmaengine-idxd-clear-block-on-fault-flag-when-clear-.patch @@ -51747,6 +51789,9 @@ patches.suse/bnxt_en-Fix-TX-timeout-when-TX-ring-size-is-set-to-t.patch patches.suse/net-hns3-check-queue-id-range-before-using.patch patches.suse/net-smc-fix-workqueue-leaked-lock-in-smc_conn_abort_work + patches.suse/s390-qeth-fix-NULL-deref-in-qeth_clear_working_pool_list + patches.suse/s390-qeth-Fix-deadlock-in-remove_discipline + patches.suse/s390-qeth-fix-deadlock-during-failing-recovery patches.suse/qed-rdma-don-t-wait-for-resources-under-hw-error-rec.patch patches.suse/net-mlx4_en-Don-t-allow-aRFS-for-encapsulated-packet.patch patches.suse/gpio-uniphier-Fix-void-functions-to-remove-return-va.patch @@ -51819,6 +51864,7 @@ patches.suse/ACPI-NFIT-Use-fallback-node-id-when-numa-info-in-NFI.patch patches.suse/nvme-add-command-id-quirk-for-apple-controllers.patch patches.suse/scsi-qla2xxx-Fix-excessive-messages-during-device-lo.patch + patches.suse/scsi-csiostor-Add-module-softdep-on-cxgb4 patches.suse/hwmon-mlxreg-fan-Return-non-zero-value-when-fan-curr.patch patches.suse/hwmon-tmp421-report-PVLD-condition-as-fault.patch patches.suse/hwmon-tmp421-fix-rounding-for-negative-values.patch @@ -51884,6 +51930,7 @@ patches.suse/ionic-don-t-remove-netdev-dev_addr-when-syncing-uc-l.patch patches.suse/isdn-mISDN-Fix-sleeping-function-called-from-invalid.patch patches.suse/qed-Fix-missing-error-code-in-qed_slowpath_start.patch + patches.suse/net-mscc-ocelot-warn-when-a-PTP-IRQ-is-raised-for-an.patch patches.suse/net-mlx5e-Mutually-exclude-RX-FCS-and-RX-port-timest.patch patches.suse/nfc-fix-error-handling-of-nfc_proto_register.patch patches.suse/NFC-digital-fix-possible-memory-leak-in-digital_tg_l.patch @@ -51944,6 +51991,7 @@ patches.suse/ice-Add-missing-E810-device-ids.patch patches.suse/netfilter-xt_IDLETIMER-fix-panic-that-occurs-when-ti.patch patches.suse/usbnet-sanity-check-for-maxpacket.patch + patches.suse/scsi-qla2xxx-Fix-a-memory-leak-in-an-error-path-of-qla2x00_process_els patches.suse/ata-sata_mv-Fix-the-error-handling-of-mv_chip_id.patch patches.suse/regmap-Fix-possible-double-free-in-regcache_rbtree_e.patch patches.suse/cfg80211-scan-fix-RCU-in-cfg80211_add_nontrans_list.patch @@ -51966,6 +52014,11 @@ patches.suse/mmc-vub300-fix-control-message-timeouts.patch patches.suse/scsi-ibmvfc-Fix-up-duplicate-response-detection.patch patches.suse/tpm-Check-for-integer-overflow-in-tpm2_map_response_.patch + patches.suse/btrfs-fix-deadlock-between-chunk-allocation-and-chun.patch + patches.suse/btrfs-update-comments-for-chunk-allocation-ENOSPC-ca.patch + patches.suse/x86-xen-Mark-cpu_bringup_and_idle-as-dead_end_functi.patch + patches.suse/edac-sb_edac-fix-top-of-high-memory-value-for-broadwell-haswell.patch + patches.suse/x86-sme-use-define-use_early_pgtable_l5-in-mem_encrypt_identity-c.patch patches.suse/firmware-psci-fix-application-of-sizeof-to-pointer.patch patches.suse/media-em28xx-add-missing-em28xx_close_extension.patch patches.suse/media-cxd2880-spi-Fix-a-null-pointer-dereference-on-.patch @@ -51994,6 +52047,7 @@ patches.suse/hwmon-Fix-possible-memleak-in-__hwmon_device_registe.patch patches.suse/hwmon-pmbus-lm25066-Add-offset-coefficients.patch patches.suse/hwmon-pmbus-lm25066-Let-compiler-determine-outer-dim.patch + patches.suse/tracing-Increase-PERF_MAX_TRACE_SIZE-to-handle-Senti.patch patches.suse/crypto-caam-disable-pkc-for-non-E-SoCs.patch patches.suse/crypto-qat-detect-PFVF-collision-after-ACK.patch patches.suse/crypto-qat-disregard-spurious-PFVF-interrupts.patch @@ -52040,6 +52094,7 @@ patches.suse/ibmvnic-don-t-stop-queue-in-xmit.patch patches.suse/ibmvnic-Process-crqs-after-enabling-interrupts.patch patches.suse/ibmvnic-delay-complete.patch + patches.suse/Revert-x86-kvm-fix-vcpu-id-indexed-array-sizes.patch patches.suse/PM-sleep-Do-not-let-syscore-devices-runtime-suspend-.patch patches.suse/drm-sun4i-Fix-macros-in-sun8i_csc.h.patch patches.suse/drm-v3d-fix-wait-for-TMU-write-combiner-flush.patch @@ -52112,6 +52167,10 @@ patches.suse/scsi-lpfc-Zero-CGN-stats-only-during-initial-driver-.patch patches.suse/scsi-lpfc-Improve-PBDE-checks-during-SGL-processing.patch patches.suse/scsi-lpfc-Update-lpfc-version-to-14.0.0.2.patch + patches.suse/scsi-dc395-Fix-error-case-unwinding + patches.suse/scsi-core-Fix-spelling-in-a-source-code-comment + patches.suse/scsi-csiostor-Uninitialized-data-in-csio_ln_vnp_read_cbfn + patches.suse/scsi-ufs-ufshcd-pltfrm-Fix-memory-leak-due-to-probe-defer patches.suse/scsi-lpfc-Revert-LOG_TRACE_EVENT-back-to-LOG_INIT-pr.patch patches.suse/scsi-lpfc-Wait-for-successful-restart-of-SLI3-adapte.patch patches.suse/scsi-lpfc-Correct-sysfs-reporting-of-loop-support-af.patch @@ -52138,12 +52197,17 @@ patches.suse/auxdisplay-img-ascii-lcd-Fix-lock-up-when-displaying.patch patches.suse/auxdisplay-ht16k33-Connect-backlight-to-fbdev.patch patches.suse/auxdisplay-ht16k33-Fix-frame-buffer-device-blanking.patch + patches.suse/fuse-fix-page-stealing.patch patches.suse/zram-fix-race-between-zram_reset_device-and-disksize.patch patches.suse/zram-don-t-fail-to-remove-zram-during-unloading-modu.patch patches.suse/zram-avoid-race-between-zram_remove-and-disksize_sto.patch patches.suse/zram-replace-fsync_bdev-with-sync_blockdev.patch + patches.suse/xen-pciback-Fix-return-in-pm_ctrl_init.patch + patches.suse/xen-Fix-implicit-type-conversion.patch + patches.suse/Input-elantench-fix-misreporting-trackpoint-coordina.patch patches.suse/ALSA-hda-Free-card-instance-properly-at-probe-errors.patch patches.suse/ALSA-hda-fix-general-protection-fault-in-azx_runtime.patch + patches.suse/btrfs-fix-memory-ordering-between-normal-and-ordered-work-functions.patch # out-of-tree patches patches.suse/ibmvfc-disable-MQ-channelization-by-default.patch @@ -52651,7 +52715,6 @@ patches.kabi/rq-qos-fix-missed-wake-ups-kabi.patch patches.kabi/SUNRPC-defer-slow-parts-of-rpc_free_client-to-a-work-kabi.patch patches.kabi/kABI-fix-of-usb_dcd_config_params.patch - patches.kabi/kabi-fix-after-kvm-vcpu-id-array-fix.patch patches.kabi/kabi-fix-bpf_insn_aux_data-revert-sanitize_stack_spill.patch patches.kabi/NFS-pass-cred-explicitly-for-access-tests.patch patches.kabi/scsi-fc-kABI-fixes-for-new-ELS_RDP-definition.patch