diff --git a/blacklist.conf b/blacklist.conf index 254b890..5665bca 100644 --- a/blacklist.conf +++ b/blacklist.conf @@ -766,7 +766,6 @@ b16503baa8912a5ec5f599914bfdad898588540f # depends on commit 3597dfe01d12f570b ( c0bace798436bca0fdc221ff61143f1376a9c3de # uapi kABI 015dbeb2282030bf56762e21d25f09422edfd750 # usb: host: xhci-rcar: not applicable 12814a3f8f9b247531d7863170cc82b3fe4218fd # usb: dwc2: not applicable -c91815b596245fd7da349ecc43c8def670d2269e # usb: dwc3: not applicable 4a014a7339f441b0851ce012f469c0fadac61c81 # usb: gadget: not applicable 6b37bd78d30c890e575a1bda22978d1d2a233362 # usb: gadget: not applicable 96afb54ece0ee903d23a7ac04ddc461413b972c4 # usb: gadget: not applicable @@ -1173,7 +1172,8 @@ e9d38b08d7a68ede91280036a6657693387e2bcd # bt: revert in the stable tree, but fi 09fe1f8d7e2f461275b1cdd832f2cfa5e9be346d # would break kABI c3acd59014148470dc58519870fbc779785b4bf7 # depends on 09fe1f8d7e2f461275b1cdd832f2cfa5e9be346d 7746a8dfb3f9c91b3a0b63a1d5c2664410e6498d # depends on 09fe1f8d7e2f461275b1cdd832f2cfa5e9be346d -d5443bbf5fc8f8389cce146b1fc2987cdd229d12 # infrastructure, no bug fix +064c5d6881e897077639e04973de26440ee205e6 # not needed +d3669ca9ff33e1dc6414d1e34891d342e4544e71 # not applicable, just changes in comments 24512228b7a3f412b5a51f189df302616b021c33 # DISCONTIGMEM unsupported 0c97bf863efce63d6ab7971dad811601e6171d2f # compiler warning, gcc-9 4a60aa05a0634241ce17f957bf9fb5ac1eed6576 # not needed. We don't build with -ffunction-sections -fdata-sections. @@ -1572,3 +1572,12 @@ e886274031200bb60965c1b9c49b7acda56a93bd # not worth it, and too risky to backpo aadf9dcef9d4cd68c73a4ab934f93319c4becc47 # cosmetic 376bd28d03c97b4d53f5797d5f9b3522c8bd4d3d # not sure we care about sparse warnings 5f9af404eec82981c4345c9943be48422234e7ab # Kconfig change - not needed. +ad6bf88a6c19a39fb3b0045d78ea880325dfcf15 # Enables devices with 64k block size, difficult wrt kABI +aa94b1dc5bca1c23d1a1f4110b4e77bfe88c0061 # Comment fix +d7b0a23d81507deb095859250cd7dd4aa5d8875e # f2fs +ce623f89872df4253719be71531116751eeab85f # Calling convention cleanup +ef1548adada51a2f32ed7faef50aa465e1b4c5da # The problem gets exposed by 69879c01a0c3 which we don't have +61e713bdca3678e84815f2427f7a063fc353a1fc # not affected, see bsc#1171529 +1c49f35e9e9156273124a0cfd38b57f7a7d4828f # Not applicable: video: vt8500lcdfb: fix fallthrough warning +2bbcaaee1fcbd83272e29f31e2bb7e70d8c49e05 # ath9k: leading to a regression (bko#208251) +54d2495b1a787ffb1846efbe1277d2d37f3ebc21 # ath9k: revert of the above commit in stable tree diff --git a/patches.kabi/jbd2-abort-mutex-kabi.patch b/patches.kabi/jbd2-abort-mutex-kabi.patch new file mode 100644 index 0000000..64685aa --- /dev/null +++ b/patches.kabi/jbd2-abort-mutex-kabi.patch @@ -0,0 +1,41 @@ +From: Jan Kara +Subject: jbd2: Preserve kABI when adding j_abort_mutex +Patch-mainline: Never, kABI +References: bsc#1173833 + +Adding j_abort_mutex at the end is safe WRT kABI because journal_s is only +always allocated and initialized by the jbd2 layer (journal_init_common()). + +Signed-off-by: Jan Kara + +--- + include/linux/jbd2.h | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/include/linux/jbd2.h ++++ b/include/linux/jbd2.h +@@ -753,11 +753,6 @@ struct journal_s + int j_errno; + + /** +- * @j_abort_mutex: Lock the whole aborting procedure. +- */ +- struct mutex j_abort_mutex; +- +- /** + * @j_sb_buffer: The first part of the superblock buffer. + */ + struct buffer_head *j_sb_buffer; +@@ -1149,6 +1144,12 @@ struct journal_s + */ + struct lockdep_map j_trans_commit_map; + #endif ++#ifndef __GENKSYMS__ ++ /** ++ * @j_abort_mutex: Lock the whole aborting procedure. ++ */ ++ struct mutex j_abort_mutex; ++#endif + }; + + #define jbd2_might_wait_for_commit(j) \ diff --git a/patches.kabi/net-mlx5-Add-command-entry-handling-completion.patch b/patches.kabi/net-mlx5-Add-command-entry-handling-completion.patch new file mode 100644 index 0000000..ec2a705 --- /dev/null +++ b/patches.kabi/net-mlx5-Add-command-entry-handling-completion.patch @@ -0,0 +1,30 @@ +From: Jiri Slaby +Subject: kABI: protect struct mlx5_cmd_work_ent +Patch-mainline: never, kabi +References: kabi + +In networking-stable-20_05_27, upstream commit +17d00e839d3b592da9659c1977d45f85b77f986a (net/mlx5: Add command entry +handling completion) added handling to struct mlx5_cmd_work_ent. It +made the kABI checker to complain. + +Given the structure is private to mlx5, hide the change from the kABI +checker. + +Signed-off-by: Jiri Slaby +--- + include/linux/mlx5/driver.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/linux/mlx5/driver.h ++++ b/include/linux/mlx5/driver.h +@@ -907,7 +907,9 @@ struct mlx5_cmd_work_ent { + struct delayed_work cb_timeout_work; + void *context; + int idx; ++#ifndef __GENKSYMS__ + struct completion handling; ++#endif + struct completion done; + struct mlx5_cmd *cmd; + struct work_struct work; diff --git a/patches.kabi/padata-reorder-work-kABI-fixup.patch b/patches.kabi/padata-reorder-work-kABI-fixup.patch new file mode 100644 index 0000000..e4713cd --- /dev/null +++ b/patches.kabi/padata-reorder-work-kABI-fixup.patch @@ -0,0 +1,32 @@ +From 4a33db745a742b398ce889529f3bca738b630924 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Tue, 21 Jul 2020 16:42:58 +0200 +Subject: [PATCH] padata: reorder work kABI fixup +Patch-mainline: Never, kABI fixup +References: git-fixes + +Signed-off-by: Oliver Neukum +--- + include/linux/padata.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/include/linux/padata.h b/include/linux/padata.h +index 50704b5..daaa8a8 100644 +--- a/include/linux/padata.h ++++ b/include/linux/padata.h +@@ -94,9 +94,11 @@ struct padata_parallel_queue { + struct padata_list reorder; + struct parallel_data *pd; + struct work_struct work; +- struct work_struct reorder_work; + atomic_t num_obj; + int cpu_index; ++#ifndef __GENKSYMS__ ++ struct work_struct reorder_work; ++#endif + }; + + /** +-- +2.16.4 + diff --git a/patches.suse/0001-PCI-pciehp-Avoid-returning-prematurely-from-sysfs-re.patch b/patches.suse/0001-PCI-pciehp-Avoid-returning-prematurely-from-sysfs-re.patch index 1254c70..ac710d7 100644 --- a/patches.suse/0001-PCI-pciehp-Avoid-returning-prematurely-from-sysfs-re.patch +++ b/patches.suse/0001-PCI-pciehp-Avoid-returning-prematurely-from-sysfs-re.patch @@ -75,7 +75,7 @@ Signed-off-by: Oliver Neukum case POWEROFF_STATE: --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c -@@ -442,6 +442,7 @@ int pciehp_set_raw_indicator_status(stru +@@ -443,6 +443,7 @@ int pciehp_set_raw_indicator_status(stru struct controller *ctrl = hotplug_slot->private; struct pci_dev *pdev = ctrl_dev(ctrl); @@ -83,10 +83,10 @@ Signed-off-by: Oliver Neukum pci_config_pm_runtime_get(pdev); pcie_write_cmd_nowait(ctrl, status << 6, PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC); -@@ -645,6 +646,7 @@ static irqreturn_t pciehp_ist(int irq, v - pciehp_handle_presence_or_link_change(ctrl, events); +@@ -686,6 +687,7 @@ static irqreturn_t pciehp_ist(int irq, v up_read(&ctrl->reset_lock); + pci_config_pm_runtime_put(pdev); + ctrl->ist_running = false; wake_up(&ctrl->requester); return IRQ_HANDLED; diff --git a/patches.suse/0001-PCI-pciehp-Do-not-handle-events-if-interrupts-are-ma.patch b/patches.suse/0001-PCI-pciehp-Do-not-handle-events-if-interrupts-are-ma.patch index df6347f..e13cbd7 100644 --- a/patches.suse/0001-PCI-pciehp-Do-not-handle-events-if-interrupts-are-ma.patch +++ b/patches.suse/0001-PCI-pciehp-Do-not-handle-events-if-interrupts-are-ma.patch @@ -23,7 +23,7 @@ Signed-off-by: Oliver Neukum --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c -@@ -562,9 +562,11 @@ static irqreturn_t pciehp_isr(int irq, v +@@ -552,9 +552,11 @@ static irqreturn_t pciehp_isr(int irq, v u16 status, events; /* @@ -36,4 +36,4 @@ Signed-off-by: Oliver Neukum + (!(ctrl->slot_ctrl & PCI_EXP_SLTCTL_HPIE) && !pciehp_poll_mode)) return IRQ_NONE; - pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &status); + /* diff --git a/patches.suse/0001-PCI-pciehp-Fix-hot-add-vs-powerfault-detection-order.patch b/patches.suse/0001-PCI-pciehp-Fix-hot-add-vs-powerfault-detection-order.patch index b22ac88..0b3e48d 100644 --- a/patches.suse/0001-PCI-pciehp-Fix-hot-add-vs-powerfault-detection-order.patch +++ b/patches.suse/0001-PCI-pciehp-Fix-hot-add-vs-powerfault-detection-order.patch @@ -52,7 +52,7 @@ Signed-off-by: Oliver Neukum --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c -@@ -510,7 +510,7 @@ int pciehp_power_on_slot(struct slot *sl +@@ -511,7 +511,7 @@ int pciehp_power_on_slot(struct slot *sl u16 slot_status; int retval; @@ -61,7 +61,7 @@ Signed-off-by: Oliver Neukum pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); if (slot_status & PCI_EXP_SLTSTA_PFD) pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, -@@ -621,6 +621,14 @@ static irqreturn_t pciehp_ist(int irq, v +@@ -661,6 +661,14 @@ static irqreturn_t pciehp_ist(int irq, v pciehp_handle_button_press(slot); } @@ -76,7 +76,7 @@ Signed-off-by: Oliver Neukum /* * Disable requests have higher priority than Presence Detect Changed * or Data Link Layer State Changed events. -@@ -632,14 +640,6 @@ static irqreturn_t pciehp_ist(int irq, v +@@ -672,14 +680,6 @@ static irqreturn_t pciehp_ist(int irq, v pciehp_handle_presence_or_link_change(slot, events); up_read(&ctrl->reset_lock); @@ -88,6 +88,6 @@ Signed-off-by: Oliver Neukum - pciehp_green_led_off(slot); - } - + pci_config_pm_runtime_put(pdev); wake_up(&ctrl->requester); return IRQ_HANDLED; - } diff --git a/patches.suse/0001-PCI-pciehp-Unify-controller-and-slot-structs.patch b/patches.suse/0001-PCI-pciehp-Unify-controller-and-slot-structs.patch index 5b141a2..50fbd2d 100644 --- a/patches.suse/0001-PCI-pciehp-Unify-controller-and-slot-structs.patch +++ b/patches.suse/0001-PCI-pciehp-Unify-controller-and-slot-structs.patch @@ -96,7 +96,7 @@ Signed-off-by: Oliver Neukum int request_result; wait_queue_head_t requester; }; -@@ -185,28 +163,28 @@ struct controller { +@@ -190,28 +168,28 @@ struct controller { #define PSN(ctrl) (((ctrl)->slot_cap & PCI_EXP_SLTCAP_PSN) >> 19) void pciehp_request(struct controller *ctrl, int action); @@ -142,7 +142,7 @@ Signed-off-by: Oliver Neukum bool pciehp_card_present(struct controller *ctrl); bool pciehp_card_present_or_link_active(struct controller *ctrl); int pciehp_check_link_status(struct controller *ctrl); -@@ -220,9 +198,9 @@ int pciehp_get_attention_status(struct h +@@ -225,9 +203,9 @@ int pciehp_get_attention_status(struct h int pciehp_set_raw_indicator_status(struct hotplug_slot *h_slot, u8 status); int pciehp_get_raw_indicator_status(struct hotplug_slot *h_slot, u8 *status); @@ -833,7 +833,7 @@ Signed-off-by: Oliver Neukum } --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c -@@ -57,7 +57,7 @@ static inline int pciehp_request_irq(str +@@ -58,7 +58,7 @@ static inline int pciehp_request_irq(str if (pciehp_poll_mode) { ctrl->poll_thread = kthread_run(&pciehp_poll, ctrl, "pciehp_poll-%s", @@ -842,7 +842,7 @@ Signed-off-by: Oliver Neukum return PTR_ERR_OR_ZERO(ctrl->poll_thread); } -@@ -332,8 +332,8 @@ static int pciehp_link_enable(struct con +@@ -333,8 +333,8 @@ static int pciehp_link_enable(struct con int pciehp_get_raw_indicator_status(struct hotplug_slot *hotplug_slot, u8 *status) { @@ -853,7 +853,7 @@ Signed-off-by: Oliver Neukum u16 slot_ctrl; pci_config_pm_runtime_get(pdev); -@@ -345,8 +345,7 @@ int pciehp_get_raw_indicator_status(stru +@@ -346,8 +346,7 @@ int pciehp_get_raw_indicator_status(stru int pciehp_get_attention_status(struct hotplug_slot *hotplug_slot, u8 *status) { @@ -863,7 +863,7 @@ Signed-off-by: Oliver Neukum struct pci_dev *pdev = ctrl_dev(ctrl); u16 slot_ctrl; -@@ -374,9 +373,8 @@ int pciehp_get_attention_status(struct h +@@ -375,9 +374,8 @@ int pciehp_get_attention_status(struct h return 0; } @@ -874,7 +874,7 @@ Signed-off-by: Oliver Neukum struct pci_dev *pdev = ctrl_dev(ctrl); u16 slot_ctrl; -@@ -397,9 +395,9 @@ void pciehp_get_power_status(struct slot +@@ -398,9 +396,9 @@ void pciehp_get_power_status(struct slot } } @@ -886,7 +886,7 @@ Signed-off-by: Oliver Neukum u16 slot_status; pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); -@@ -429,9 +427,9 @@ bool pciehp_card_present_or_link_active( +@@ -430,9 +428,9 @@ bool pciehp_card_present_or_link_active( return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl); } @@ -898,7 +898,7 @@ Signed-off-by: Oliver Neukum u16 slot_status; pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); -@@ -441,8 +439,7 @@ int pciehp_query_power_fault(struct slot +@@ -442,8 +440,7 @@ int pciehp_query_power_fault(struct slot int pciehp_set_raw_indicator_status(struct hotplug_slot *hotplug_slot, u8 status) { @@ -908,7 +908,7 @@ Signed-off-by: Oliver Neukum struct pci_dev *pdev = ctrl_dev(ctrl); pci_config_pm_runtime_get(pdev); -@@ -452,9 +449,8 @@ int pciehp_set_raw_indicator_status(stru +@@ -453,9 +450,8 @@ int pciehp_set_raw_indicator_status(stru return 0; } @@ -919,7 +919,7 @@ Signed-off-by: Oliver Neukum u16 slot_cmd; if (!ATTN_LED(ctrl)) -@@ -478,10 +474,8 @@ void pciehp_set_attention_status(struct +@@ -479,10 +475,8 @@ void pciehp_set_attention_status(struct pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd); } @@ -931,7 +931,7 @@ Signed-off-by: Oliver Neukum if (!PWR_LED(ctrl)) return; -@@ -492,10 +486,8 @@ void pciehp_green_led_on(struct slot *sl +@@ -493,10 +487,8 @@ void pciehp_green_led_on(struct slot *sl PCI_EXP_SLTCTL_PWR_IND_ON); } @@ -943,7 +943,7 @@ Signed-off-by: Oliver Neukum if (!PWR_LED(ctrl)) return; -@@ -506,10 +498,8 @@ void pciehp_green_led_off(struct slot *s +@@ -507,10 +499,8 @@ void pciehp_green_led_off(struct slot *s PCI_EXP_SLTCTL_PWR_IND_OFF); } @@ -955,7 +955,7 @@ Signed-off-by: Oliver Neukum if (!PWR_LED(ctrl)) return; -@@ -520,9 +510,8 @@ void pciehp_green_led_blink(struct slot +@@ -521,9 +511,8 @@ void pciehp_green_led_blink(struct slot PCI_EXP_SLTCTL_PWR_IND_BLINK); } @@ -966,7 +966,7 @@ Signed-off-by: Oliver Neukum struct pci_dev *pdev = ctrl_dev(ctrl); u16 slot_status; int retval; -@@ -546,10 +535,8 @@ int pciehp_power_on_slot(struct slot *sl +@@ -547,10 +536,8 @@ int pciehp_power_on_slot(struct slot *sl return retval; } @@ -978,15 +978,15 @@ Signed-off-by: Oliver Neukum pcie_write_cmd(ctrl, PCI_EXP_SLTCTL_PWR_OFF, PCI_EXP_SLTCTL_PCC); ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, -@@ -623,7 +610,6 @@ static irqreturn_t pciehp_isr(int irq, v - static irqreturn_t pciehp_ist(int irq, void *dev_id) +@@ -648,7 +635,6 @@ static irqreturn_t pciehp_ist(int irq, v { struct controller *ctrl = (struct controller *)dev_id; + struct pci_dev *pdev = ctrl_dev(ctrl); - struct slot *slot = ctrl->slot; + irqreturn_t ret; u32 events; - synchronize_hardirq(irq); -@@ -634,16 +620,16 @@ static irqreturn_t pciehp_ist(int irq, v +@@ -674,16 +660,16 @@ static irqreturn_t pciehp_ist(int irq, v /* Check Attention Button Pressed */ if (events & PCI_EXP_SLTSTA_ABP) { ctrl_info(ctrl, "Slot(%s): Attention button pressed\n", @@ -1008,7 +1008,7 @@ Signed-off-by: Oliver Neukum } /* -@@ -652,9 +638,9 @@ static irqreturn_t pciehp_ist(int irq, v +@@ -692,9 +678,9 @@ static irqreturn_t pciehp_ist(int irq, v */ down_read(&ctrl->reset_lock); if (events & DISABLE_SLOT) @@ -1019,8 +1019,8 @@ Signed-off-by: Oliver Neukum + pciehp_handle_presence_or_link_change(ctrl, events); up_read(&ctrl->reset_lock); - wake_up(&ctrl->requester); -@@ -749,8 +735,7 @@ void pcie_clear_hotplug_events(struct co + pci_config_pm_runtime_put(pdev); +@@ -790,8 +776,7 @@ void pcie_clear_hotplug_events(struct co */ int pciehp_reset_slot(struct hotplug_slot *hotplug_slot, int probe) { @@ -1030,7 +1030,7 @@ Signed-off-by: Oliver Neukum struct pci_dev *pdev = ctrl_dev(ctrl); u16 stat_mask = 0, ctrl_mask = 0; int rc; -@@ -800,42 +785,6 @@ void pcie_shutdown_notification(struct c +@@ -841,42 +826,6 @@ void pcie_shutdown_notification(struct c } } @@ -1073,7 +1073,7 @@ Signed-off-by: Oliver Neukum static inline void dbg_ctrl(struct controller *ctrl) { struct pci_dev *pdev = ctrl->pcie->port; -@@ -859,10 +808,11 @@ struct controller *pcie_init(struct pcie +@@ -900,10 +849,11 @@ struct controller *pcie_init(struct pcie u32 slot_cap, link_cap; u8 poweron; struct pci_dev *pdev = dev->port; @@ -1086,7 +1086,7 @@ Signed-off-by: Oliver Neukum ctrl->pcie = dev; pcie_capability_read_dword(pdev, PCI_EXP_SLTCAP, &slot_cap); -@@ -879,11 +829,17 @@ struct controller *pcie_init(struct pcie +@@ -920,11 +870,17 @@ struct controller *pcie_init(struct pcie ctrl->slot_cap = slot_cap; mutex_init(&ctrl->ctrl_lock); @@ -1104,7 +1104,7 @@ Signed-off-by: Oliver Neukum /* Check if Data Link Layer Link Active Reporting is implemented */ pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap); if (link_cap & PCI_EXP_LNKCAP_DLLLARC) -@@ -909,32 +865,24 @@ struct controller *pcie_init(struct pcie +@@ -950,32 +906,24 @@ struct controller *pcie_init(struct pcie FLAG(link_cap, PCI_EXP_LNKCAP_DLLLARC), pdev->broken_cmd_compl ? " (with Cmd Compl erratum)" : ""); diff --git a/patches.suse/0001-PM-genpd-Stop-start-devices-without-pm_runtime_force.patch b/patches.suse/0001-PM-genpd-Stop-start-devices-without-pm_runtime_force.patch index 0888cab..f8f39f8 100644 --- a/patches.suse/0001-PM-genpd-Stop-start-devices-without-pm_runtime_force.patch +++ b/patches.suse/0001-PM-genpd-Stop-start-devices-without-pm_runtime_force.patch @@ -120,16 +120,16 @@ Signed-off-by: Oliver Neukum --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -925,7 +925,8 @@ static int genpd_finish_suspend(struct d - if (ret) - return ret; + if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd)) + return 0; - if (genpd->dev_ops.stop && genpd->dev_ops.start) { + if (genpd->dev_ops.stop && genpd->dev_ops.start && + !pm_runtime_status_suspended(dev)) { ret = pm_runtime_force_suspend(dev); - if (ret) - return ret; -@@ -1012,7 +1013,8 @@ static int pm_genpd_freeze_noirq(struct + if (ret) { + if (poweroff) +@@ -1016,7 +1017,8 @@ static int pm_genpd_freeze_noirq(struct if (ret) return ret; @@ -139,7 +139,7 @@ Signed-off-by: Oliver Neukum ret = pm_runtime_force_suspend(dev); return ret; -@@ -1036,7 +1038,8 @@ static int pm_genpd_thaw_noirq(struct de +@@ -1040,7 +1042,8 @@ static int pm_genpd_thaw_noirq(struct de if (IS_ERR(genpd)) return -EINVAL; @@ -149,7 +149,7 @@ Signed-off-by: Oliver Neukum ret = pm_runtime_force_resume(dev); if (ret) return ret; -@@ -1094,8 +1097,9 @@ static int pm_genpd_restore_noirq(struct +@@ -1098,8 +1101,9 @@ static int pm_genpd_restore_noirq(struct genpd_sync_power_on(genpd, true, 0); genpd_unlock(genpd); diff --git a/patches.suse/0001-bcache-fix-potential-deadlock-problem-in-btree_gc_co.patch b/patches.suse/0001-bcache-fix-potential-deadlock-problem-in-btree_gc_co.patch new file mode 100644 index 0000000..d98ff67 --- /dev/null +++ b/patches.suse/0001-bcache-fix-potential-deadlock-problem-in-btree_gc_co.patch @@ -0,0 +1,94 @@ +From be23e837333a914df3f24bf0b32e87b0331ab8d1 Mon Sep 17 00:00:00 2001 +From: Zhiqiang Liu +Date: Mon, 15 Jun 2020 00:53:30 +0800 +Subject: [PATCH] bcache: fix potential deadlock problem in btree_gc_coalesce +Git-commit: be23e837333a914df3f24bf0b32e87b0331ab8d1 +Patch-mainline: v5.8-rc2 +References: bsc#1171732, CVE-2020-12771 + +coccicheck reports: + drivers/md//bcache/btree.c:1538:1-7: preceding lock on line 1417 + +In btree_gc_coalesce func, if the coalescing process fails, we will goto +to out_nocoalesce tag directly without releasing new_nodes[i]->write_lock. +Then, it will cause a deadlock when trying to acquire new_nodes[i]-> +write_lock for freeing new_nodes[i] before return. + +btree_gc_coalesce func details as follows: + if alloc new_nodes[i] fails: + goto out_nocoalesce; + // obtain new_nodes[i]->write_lock + mutex_lock(&new_nodes[i]->write_lock) + // main coalescing process + for (i = nodes - 1; i > 0; --i) + [snipped] + if coalescing process fails: + // Here, directly goto out_nocoalesce + // tag will cause a deadlock + goto out_nocoalesce; + [snipped] + // release new_nodes[i]->write_lock + mutex_unlock(&new_nodes[i]->write_lock) + // coalesing succ, return + return; +out_nocoalesce: + btree_node_free(new_nodes[i]) // free new_nodes[i] + // obtain new_nodes[i]->write_lock + mutex_lock(&new_nodes[i]->write_lock); + // set flag for reuse + clear_bit(BTREE_NODE_dirty, &ew_nodes[i]->flags); + // release new_nodes[i]->write_lock + mutex_unlock(&new_nodes[i]->write_lock); + +To fix the problem, we add a new tag 'out_unlock_nocoalesce' for +releasing new_nodes[i]->write_lock before out_nocoalesce tag. If +coalescing process fails, we will go to out_unlock_nocoalesce tag +for releasing new_nodes[i]->write_lock before free new_nodes[i] in +out_nocoalesce tag. + +(Coly Li helps to clean up commit log format.) + +Fixes: 2a285686c109816 ("bcache: btree locking rework") +Signed-off-by: Zhiqiang Liu +Signed-off-by: Coly Li +Signed-off-by: Jens Axboe +--- + drivers/md/bcache/btree.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c +index 39de94edd73a..6548a601edf0 100644 +--- a/drivers/md/bcache/btree.c ++++ b/drivers/md/bcache/btree.c +@@ -1389,7 +1389,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op, + if (__set_blocks(n1, n1->keys + n2->keys, + block_bytes(b->c)) > + btree_blocks(new_nodes[i])) +- goto out_nocoalesce; ++ goto out_unlock_nocoalesce; + + keys = n2->keys; + /* Take the key of the node we're getting rid of */ +@@ -1418,7 +1418,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op, + + if (__bch_keylist_realloc(&keylist, + bkey_u64s(&new_nodes[i]->key))) +- goto out_nocoalesce; ++ goto out_unlock_nocoalesce; + + bch_btree_node_write(new_nodes[i], &cl); + bch_keylist_add(&keylist, &new_nodes[i]->key); +@@ -1464,6 +1464,10 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op, + /* Invalidated our iterator */ + return -EINTR; + ++out_unlock_nocoalesce: ++ for (i = 0; i < nodes; i++) ++ mutex_unlock(&new_nodes[i]->write_lock); ++ + out_nocoalesce: + closure_sync(&cl); + +-- +2.26.2 + diff --git a/patches.suse/0001-drm-i915-icl-Fix-hotplug-interrupt-disabling-after-s.patch b/patches.suse/0001-drm-i915-icl-Fix-hotplug-interrupt-disabling-after-s.patch new file mode 100644 index 0000000..7a04285 --- /dev/null +++ b/patches.suse/0001-drm-i915-icl-Fix-hotplug-interrupt-disabling-after-s.patch @@ -0,0 +1,44 @@ +From a3005c2edf7e8c3478880db1ca84028a2b6819bb Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Fri, 12 Jun 2020 15:17:31 +0300 +Subject: drm/i915/icl+: Fix hotplug interrupt disabling after storm detection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: a3005c2edf7e8c3478880db1ca84028a2b6819bb +Patch-mainline: v5.8-rc2 +References: bsc#1112178 + +Atm, hotplug interrupts on TypeC ports are left enabled after detecting +an interrupt storm, fix this. + +Reported-by: Kunal Joshi +References: https://gitlab.freedesktop.org/drm/intel/-/issues/351 +Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/1964 +Cc: Kunal Joshi +Cc: stable@vger.kernel.org +Signed-off-by: Imre Deak +Reviewed-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20200612121731.19596-1-imre.deak@intel.com +(cherry picked from commit 587a87b9d7e94927edcdea018565bc1939381eb1) +Signed-off-by: Joonas Lahtinen +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/i915/i915_irq.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c +index 4dc601dffc08..284cf078135a 100644 +--- a/drivers/gpu/drm/i915/i915_irq.c ++++ b/drivers/gpu/drm/i915/i915_irq.c +@@ -3125,6 +3125,7 @@ static void gen11_hpd_irq_setup(struct drm_i915_private *dev_priv) + + val = I915_READ(GEN11_DE_HPD_IMR); + val &= ~hotplug_irqs; ++ val |= ~enabled_irqs & hotplug_irqs; + I915_WRITE(GEN11_DE_HPD_IMR, val); + POSTING_READ(GEN11_DE_HPD_IMR); + +-- +2.27.0 + diff --git a/patches.suse/0001-drm-mediatek-Check-plane-visibility-in-atomic_update.patch b/patches.suse/0001-drm-mediatek-Check-plane-visibility-in-atomic_update.patch new file mode 100644 index 0000000..9905e5b --- /dev/null +++ b/patches.suse/0001-drm-mediatek-Check-plane-visibility-in-atomic_update.patch @@ -0,0 +1,68 @@ +From c0b8892e2461b5fa740e47efbb1269a487b04020 Mon Sep 17 00:00:00 2001 +From: Hsin-Yi Wang +Date: Mon, 22 Jun 2020 23:57:53 +0800 +Subject: drm/mediatek: Check plane visibility in atomic_update +Git-commit: c0b8892e2461b5fa740e47efbb1269a487b04020 +Patch-mainline: v5.8-rc5 +References: bsc#1113956 + +Disable the plane if it's not visible. Otherwise mtk_ovl_layer_config() +would proceed with invalid plane and we may see vblank timeout. + +Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") +Signed-off-by: Hsin-Yi Wang +Reviewed-by: Tomasz Figa +Signed-off-by: Chun-Kuang Hu +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/mediatek/mtk_drm_plane.c | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c ++++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c +@@ -108,6 +108,16 @@ static int mtk_plane_atomic_check(struct + true, true); + } + ++static void mtk_plane_atomic_disable(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ struct mtk_plane_state *state = to_mtk_plane_state(plane->state); ++ ++ state->pending.enable = false; ++ wmb(); /* Make sure the above parameter is set before update */ ++ state->pending.dirty = true; ++} ++ + static void mtk_plane_atomic_update(struct drm_plane *plane, + struct drm_plane_state *old_state) + { +@@ -122,6 +132,11 @@ static void mtk_plane_atomic_update(stru + if (!crtc || WARN_ON(!fb)) + return; + ++ if (!plane->state->visible) { ++ mtk_plane_atomic_disable(plane, old_state); ++ return; ++ } ++ + gem = fb->obj[0]; + mtk_gem = to_mtk_gem_obj(gem); + addr = mtk_gem->dma_addr; +@@ -143,16 +158,6 @@ static void mtk_plane_atomic_update(stru + state->pending.dirty = true; + } + +-static void mtk_plane_atomic_disable(struct drm_plane *plane, +- struct drm_plane_state *old_state) +-{ +- struct mtk_plane_state *state = to_mtk_plane_state(plane->state); +- +- state->pending.enable = false; +- wmb(); /* Make sure the above parameter is set before update */ +- state->pending.dirty = true; +-} +- + static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = { + .atomic_check = mtk_plane_atomic_check, + .atomic_update = mtk_plane_atomic_update, diff --git a/patches.suse/0001-drm-qxl-Use-correct-notify-port-address-when-creatin.patch b/patches.suse/0001-drm-qxl-Use-correct-notify-port-address-when-creatin.patch new file mode 100644 index 0000000..1d6ea22 --- /dev/null +++ b/patches.suse/0001-drm-qxl-Use-correct-notify-port-address-when-creatin.patch @@ -0,0 +1,43 @@ +From 80e5f89da3ab949fbbf1cae01dfaea29f5483a75 Mon Sep 17 00:00:00 2001 +From: Huacai Chen +Date: Tue, 31 Mar 2020 14:18:08 +0800 +Subject: drm/qxl: Use correct notify port address when creating cursor ring +Git-commit: 80e5f89da3ab949fbbf1cae01dfaea29f5483a75 +Patch-mainline: v5.8-rc1 +References: bsc#1113956 + +The command ring and cursor ring use different notify port addresses +definition: QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR. However, in +qxl_device_init() we use QXL_IO_NOTIFY_CMD to create both command ring +and cursor ring. This doesn't cause any problems now, because QEMU's +behaviors on QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR are the same. +However, QEMU's behavior may be change in future, so let's fix it. + +P.S.: In the X.org QXL driver, the notify port address of cursor ring + is correct. + +Signed-off-by: Huacai Chen +Cc: +Link: http://patchwork.freedesktop.org/patch/msgid/1585635488-17507-1-git-send-email-chenhc@lemote.com +Signed-off-by: Gerd Hoffmann +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/qxl/qxl_kms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c +index 09d7b5f6d172..9eed1a375f24 100644 +--- a/drivers/gpu/drm/qxl/qxl_kms.c ++++ b/drivers/gpu/drm/qxl/qxl_kms.c +@@ -220,7 +220,7 @@ int qxl_device_init(struct qxl_device *qdev, + &(qdev->ram_header->cursor_ring_hdr), + sizeof(struct qxl_command), + QXL_CURSOR_RING_SIZE, +- qdev->io_base + QXL_IO_NOTIFY_CMD, ++ qdev->io_base + QXL_IO_NOTIFY_CURSOR, + false, + &qdev->cursor_event); + +-- +2.27.0 + diff --git a/patches.suse/0001-drm-radeon-fix-double-free.patch b/patches.suse/0001-drm-radeon-fix-double-free.patch new file mode 100644 index 0000000..78c55bf --- /dev/null +++ b/patches.suse/0001-drm-radeon-fix-double-free.patch @@ -0,0 +1,84 @@ +From 41855a898650803e24b284173354cc3e44d07725 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Mon, 6 Jul 2020 05:28:57 -0700 +Subject: drm/radeon: fix double free +Git-commit: 41855a898650803e24b284173354cc3e44d07725 +Patch-mainline: v5.8-rc5 +References: bsc#1113956 + +clang static analysis flags this error + +drivers/gpu/drm/radeon/ci_dpm.c:5652:9: warning: Use of memory after it is freed [unix.Malloc] + kfree(rdev->pm.dpm.ps[i].ps_priv); + ^~~~~~~~~~~~~~~~~~~~~~~~~~ +drivers/gpu/drm/radeon/ci_dpm.c:5654:2: warning: Attempt to free released memory [unix.Malloc] + kfree(rdev->pm.dpm.ps); + ^~~~~~~~~~~~~~~~~~~~~~ + +problem is reported in ci_dpm_fini, with these code blocks. + + for (i = 0; i < rdev->pm.dpm.num_ps; i++) { + kfree(rdev->pm.dpm.ps[i].ps_priv); + } + kfree(rdev->pm.dpm.ps); + +The first free happens in ci_parse_power_table where it cleans up locally +on a failure. ci_dpm_fini also does a cleanup. + + ret = ci_parse_power_table(rdev); + if (ret) { + ci_dpm_fini(rdev); + return ret; + } + +So remove the cleanup in ci_parse_power_table and +move the num_ps calculation to inside the loop so ci_dpm_fini +will know how many array elements to free. + +Fixes: cc8dbbb4f62a ("drm/radeon: add dpm support for CI dGPUs (v2)") + +Signed-off-by: Tom Rix +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/radeon/ci_dpm.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c +index 134aa2b01f90..f434efdeca44 100644 +--- a/drivers/gpu/drm/radeon/ci_dpm.c ++++ b/drivers/gpu/drm/radeon/ci_dpm.c +@@ -5563,6 +5563,7 @@ static int ci_parse_power_table(struct radeon_device *rdev) + if (!rdev->pm.dpm.ps) + return -ENOMEM; + power_state_offset = (u8 *)state_array->states; ++ rdev->pm.dpm.num_ps = 0; + for (i = 0; i < state_array->ucNumEntries; i++) { + u8 *idx; + power_state = (union pplib_power_state *)power_state_offset; +@@ -5572,10 +5573,8 @@ static int ci_parse_power_table(struct radeon_device *rdev) + if (!rdev->pm.power_state[i].clock_info) + return -EINVAL; + ps = kzalloc(sizeof(struct ci_ps), GFP_KERNEL); +- if (ps == NULL) { +- kfree(rdev->pm.dpm.ps); ++ if (ps == NULL) + return -ENOMEM; +- } + rdev->pm.dpm.ps[i].ps_priv = ps; + ci_parse_pplib_non_clock_info(rdev, &rdev->pm.dpm.ps[i], + non_clock_info, +@@ -5597,8 +5596,8 @@ static int ci_parse_power_table(struct radeon_device *rdev) + k++; + } + power_state_offset += 2 + power_state->v2.ucNumDPMLevels; ++ rdev->pm.dpm.num_ps = i + 1; + } +- rdev->pm.dpm.num_ps = state_array->ucNumEntries; + + /* fill in the vce power states */ + for (i = 0; i < RADEON_MAX_VCE_LEVELS; i++) { +-- +2.27.0 + diff --git a/patches.suse/0001-drm-radeon-fix-fb_div-check-in-ni_init_smc_spll_tabl.patch b/patches.suse/0001-drm-radeon-fix-fb_div-check-in-ni_init_smc_spll_tabl.patch new file mode 100644 index 0000000..507921d --- /dev/null +++ b/patches.suse/0001-drm-radeon-fix-fb_div-check-in-ni_init_smc_spll_tabl.patch @@ -0,0 +1,36 @@ +From 35f760b44b1b9cb16a306bdcc7220fbbf78c4789 Mon Sep 17 00:00:00 2001 +From: Denis Efremov +Date: Mon, 22 Jun 2020 23:31:22 +0300 +Subject: drm/radeon: fix fb_div check in ni_init_smc_spll_table() +Git-commit: 35f760b44b1b9cb16a306bdcc7220fbbf78c4789 +Patch-mainline: v5.8-rc3 +References: bsc#1113956 + +clk_s is checked twice in a row in ni_init_smc_spll_table(). +fb_div should be checked instead. + +Fixes: 69e0b57a91ad ("drm/radeon/kms: add dpm support for cayman (v5)") +Cc: stable@vger.kernel.org +Signed-off-by: Denis Efremov +Signed-off-by: Alex Deucher +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/radeon/ni_dpm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c +index b57c37ddd164..c7fbb7932f37 100644 +--- a/drivers/gpu/drm/radeon/ni_dpm.c ++++ b/drivers/gpu/drm/radeon/ni_dpm.c +@@ -2127,7 +2127,7 @@ static int ni_init_smc_spll_table(struct radeon_device *rdev) + if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT)) + ret = -EINVAL; + +- if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT)) ++ if (fb_div & ~(SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT)) + ret = -EINVAL; + + if (clk_v & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_SHIFT)) +-- +2.27.0 + diff --git a/patches.suse/0001-drm-vkms-Hold-gem-object-while-still-in-use.patch b/patches.suse/0001-drm-vkms-Hold-gem-object-while-still-in-use.patch new file mode 100644 index 0000000..37b5bfa --- /dev/null +++ b/patches.suse/0001-drm-vkms-Hold-gem-object-while-still-in-use.patch @@ -0,0 +1,76 @@ +From 0ea2ea42b31abc1141f2fd3911f952a97d401fcb Mon Sep 17 00:00:00 2001 +From: Ezequiel Garcia +Date: Mon, 27 Apr 2020 18:44:05 -0300 +Subject: drm/vkms: Hold gem object while still in-use +Git-commit: 0ea2ea42b31abc1141f2fd3911f952a97d401fcb +Patch-mainline: v5.8-rc1 +References: bsc#1113956 + +We need to keep the reference to the drm_gem_object +until the last access by vkms_dumb_create. + +Therefore, the put the object after it is used. + +This fixes a use-after-free issue reported by syzbot. + +While here, change vkms_gem_create() symbol to static. + +Reported-and-tested-by: syzbot+e3372a2afe1e7ef04bc7@syzkaller.appspotmail.com +Signed-off-by: Ezequiel Garcia +Reviewed-by: Rodrigo Siqueira +Signed-off-by: Rodrigo Siqueira +Link: https://patchwork.freedesktop.org/patch/msgid/20200427214405.13069-1-ezequiel@collabora.com +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/vkms/vkms_drv.h | 5 ----- + drivers/gpu/drm/vkms/vkms_gem.c | 11 ++++++----- + 2 files changed, 6 insertions(+), 10 deletions(-) + +--- a/drivers/gpu/drm/vkms/vkms_drv.h ++++ b/drivers/gpu/drm/vkms/vkms_drv.h +@@ -62,11 +62,6 @@ int vkms_output_init(struct vkms_device + struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev); + + /* Gem stuff */ +-struct drm_gem_object *vkms_gem_create(struct drm_device *dev, +- struct drm_file *file, +- u32 *handle, +- u64 size); +- + int vkms_gem_fault(struct vm_fault *vmf); + + int vkms_dumb_create(struct drm_file *file, struct drm_device *dev, +--- a/drivers/gpu/drm/vkms/vkms_gem.c ++++ b/drivers/gpu/drm/vkms/vkms_gem.c +@@ -93,10 +93,10 @@ int vkms_gem_fault(struct vm_fault *vmf) + return ret; + } + +-struct drm_gem_object *vkms_gem_create(struct drm_device *dev, +- struct drm_file *file, +- u32 *handle, +- u64 size) ++static struct drm_gem_object *vkms_gem_create(struct drm_device *dev, ++ struct drm_file *file, ++ u32 *handle, ++ u64 size) + { + struct vkms_gem_object *obj; + int ret; +@@ -109,7 +109,6 @@ struct drm_gem_object *vkms_gem_create(s + return ERR_CAST(obj); + + ret = drm_gem_handle_create(file, &obj->gem, handle); +- drm_gem_object_put_unlocked(&obj->gem); + if (ret) + return ERR_PTR(ret); + +@@ -138,6 +137,8 @@ int vkms_dumb_create(struct drm_file *fi + args->size = gem_obj->size; + args->pitch = pitch; + ++ drm_gem_object_put_unlocked(gem_obj); ++ + DRM_DEBUG_DRIVER("Created object of size %lld\n", size); + + return 0; diff --git a/patches.suse/0001-nfp-bpf-fix-ALU32-high-bits-clearance-bug.patch b/patches.suse/0001-nfp-bpf-fix-ALU32-high-bits-clearance-bug.patch index 8ad737b..b2cec9d 100644 --- a/patches.suse/0001-nfp-bpf-fix-ALU32-high-bits-clearance-bug.patch +++ b/patches.suse/0001-nfp-bpf-fix-ALU32-high-bits-clearance-bug.patch @@ -26,7 +26,7 @@ Acked-by: Denis Kirjanov --- a/drivers/net/ethernet/netronome/nfp/bpf/jit.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/jit.c -@@ -756,15 +756,10 @@ wrp_alu64_reg(struct nfp_prog *nfp_prog, +@@ -1291,15 +1291,10 @@ wrp_alu64_reg(struct nfp_prog *nfp_prog, static int wrp_alu32_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta, @@ -43,16 +43,16 @@ Acked-by: Denis Kirjanov wrp_alu_imm(nfp_prog, insn->dst_reg * 2, alu_op, insn->imm); wrp_immed(nfp_prog, reg_both(insn->dst_reg * 2 + 1), 0); -@@ -1017,7 +1012,7 @@ static int xor_reg(struct nfp_prog *nfp_ +@@ -2309,7 +2304,7 @@ static int xor_reg(struct nfp_prog *nfp_ static int xor_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) { -- return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !~meta->insn.imm); +- return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !meta->insn.imm); + return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR); } static int and_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) -@@ -1027,7 +1022,7 @@ static int and_reg(struct nfp_prog *nfp_ +@@ -2319,7 +2314,7 @@ static int and_reg(struct nfp_prog *nfp_ static int and_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) { @@ -61,7 +61,7 @@ Acked-by: Denis Kirjanov } static int or_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) -@@ -1037,7 +1032,7 @@ static int or_reg(struct nfp_prog *nfp_p +@@ -2329,7 +2324,7 @@ static int or_reg(struct nfp_prog *nfp_p static int or_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) { @@ -70,7 +70,7 @@ Acked-by: Denis Kirjanov } static int add_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) -@@ -1047,7 +1042,7 @@ static int add_reg(struct nfp_prog *nfp_ +@@ -2339,7 +2334,7 @@ static int add_reg(struct nfp_prog *nfp_ static int add_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) { @@ -79,7 +79,7 @@ Acked-by: Denis Kirjanov } static int sub_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) -@@ -1057,7 +1052,7 @@ static int sub_reg(struct nfp_prog *nfp_ +@@ -2349,7 +2344,7 @@ static int sub_reg(struct nfp_prog *nfp_ static int sub_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) { diff --git a/patches.suse/0002-drm-dp_mst-Increase-ACT-retry-timeout-to-3s.patch b/patches.suse/0002-drm-dp_mst-Increase-ACT-retry-timeout-to-3s.patch new file mode 100644 index 0000000..0cc514d --- /dev/null +++ b/patches.suse/0002-drm-dp_mst-Increase-ACT-retry-timeout-to-3s.patch @@ -0,0 +1,138 @@ +From 873a95e0d59ac06901ae261dda0b7165ffd002b8 Mon Sep 17 00:00:00 2001 +From: Lyude Paul +Date: Fri, 3 Apr 2020 15:47:15 -0400 +Subject: drm/dp_mst: Increase ACT retry timeout to 3s +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: 873a95e0d59ac06901ae261dda0b7165ffd002b8 +Patch-mainline: v5.8-rc1 +References: bsc#1113956 + +Currently we only poll for an ACT up to 30 times, with a busy-wait delay +of 100µs between each attempt - giving us a timeout of 2900µs. While +this might seem sensible, it would appear that in certain scenarios it +can take dramatically longer then that for us to receive an ACT. On one +of the EVGA MST hubs that I have available, I observed said hub +sometimes taking longer then a second before signalling the ACT. These +delays mostly seem to occur when previous sideband messages we've sent +are NAKd by the hub, however it wouldn't be particularly surprising if +it's possible to reproduce times like this simply by introducing branch +devices with large LCTs since payload allocations have to take effect on +every downstream device up to the payload's target. + +So, instead of just retrying 30 times we poll for the ACT for up to 3ms, +and additionally use usleep_range() to avoid a very long and rude +busy-wait. Note that the previous retry count of 30 appears to have been +arbitrarily chosen, as I can't find any mention of a recommended timeout +or retry count for ACTs in the DisplayPort 2.0 specification. This also +goes for the range we were previously using for udelay(), although I +suspect that was just copied from the recommended delay for link +training on SST devices. + +Changes since v1: +* Use readx_poll_timeout() instead of open-coding timeout loop - Sean + Paul +Changes since v2: +* Increase poll interval to 200us - Sean Paul +* Print status in hex when we timeout waiting for ACT - Sean Paul + +Signed-off-by: Lyude Paul +Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)") +Cc: Sean Paul +Cc: # v3.17+ +Reviewed-by: Sean Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20200406221253.1307209-4-lyude@redhat.com +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/drm_dp_mst_topology.c | 62 ++++++++++++++++++++-------------- + 1 file changed, 38 insertions(+), 24 deletions(-) + +--- a/drivers/gpu/drm/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/drm_dp_mst_topology.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -2827,40 +2828,53 @@ fail: + return ret; + } + ++static int do_get_act_status(struct drm_dp_aux *aux) ++{ ++ int ret; ++ u8 status; ++ ++ ret = drm_dp_dpcd_readb(aux, DP_PAYLOAD_TABLE_UPDATE_STATUS, &status); ++ if (ret < 0) ++ return ret; ++ ++ return status; ++} + + /** + * drm_dp_check_act_status() - Check ACT handled status. + * @mgr: manager to use + * +- * Check the payload status bits in the DPCD for ACT handled completion. ++ * Tries waiting for the MST hub to finish updating it's payload table by ++ * polling for the ACT handled bit for up to 3 seconds (yes-some hubs really ++ * take that long). ++ * + */ + int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr) + { +- int count = 0, ret; +- u8 status; ++ /* ++ * There doesn't seem to be any recommended retry count or timeout in ++ * the MST specification. Since some hubs have been observed to take ++ * over 1 second to update their payload allocations under certain ++ * conditions, we use a rather large timeout value. ++ */ ++ const int timeout_ms = 3000; ++ int ret, status; + +- do { +- ret = drm_dp_dpcd_readb(mgr->aux, +- DP_PAYLOAD_TABLE_UPDATE_STATUS, +- &status); +- if (ret < 0) { +- DRM_DEBUG_KMS("failed to read payload table status %d\n", +- ret); +- return ret; +- } ++ ret = readx_poll_timeout(do_get_act_status, mgr->aux, status, ++ status & DP_PAYLOAD_ACT_HANDLED || status < 0, ++ 200, timeout_ms * USEC_PER_MSEC); ++ if (ret < 0 && status >= 0) { ++ DRM_DEBUG_KMS("Failed to get ACT after %dms, last status: %02x\n", ++ timeout_ms, status); ++ return -EINVAL; ++ } else if (status < 0) { ++ DRM_DEBUG_KMS("Failed to read payload table status: %d\n", ++ status); ++ return status; ++ } ++ ++ return 0; + +- if (status & DP_PAYLOAD_ACT_HANDLED) +- break; +- count++; +- udelay(100); +- } while (count < 30); +- +- if (!(status & DP_PAYLOAD_ACT_HANDLED)) { +- DRM_DEBUG_KMS("failed to get ACT bit %d after %d retries\n", +- status, count); +- return -EINVAL; +- } +- return 0; + } + EXPORT_SYMBOL(drm_dp_check_act_status); + diff --git a/patches.suse/ACPI-configfs-Disallow-loading-ACPI-tables-when-lock.patch b/patches.suse/ACPI-configfs-Disallow-loading-ACPI-tables-when-lock.patch new file mode 100644 index 0000000..3d91282 --- /dev/null +++ b/patches.suse/ACPI-configfs-Disallow-loading-ACPI-tables-when-lock.patch @@ -0,0 +1,40 @@ +From 75b0cea7bf307f362057cc778efe89af4c615354 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Mon, 15 Jun 2020 04:43:32 -0600 +Subject: [PATCH] ACPI: configfs: Disallow loading ACPI tables when locked down +Git-commit: 75b0cea7bf307f362057cc778efe89af4c615354 +Patch-mainline: v5.8-rc3 +References: CVE-2020-15780 bsc#1173573 + +[ backport note: Use the downstream kernel_is_locked_down() check instead ] + +Like other vectors already patched, this one here allows the root +user to load ACPI tables, which enables arbitrary physical address +writes, which in turn makes it possible to disable lockdown. + +Prevents this by checking the lockdown status before allowing a new +ACPI table to be installed. The link in the trailer shows a PoC of +how this might be used. + +Link: https://git.zx2c4.com/american-unsigned-language/tree/american-unsigned-language-2.sh +Cc: 5.4+ # 5.4+ +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Rafael J. Wysocki +Acked-by: Takashi Iwai + +--- + drivers/acpi/acpi_configfs.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/acpi/acpi_configfs.c ++++ b/drivers/acpi/acpi_configfs.c +@@ -29,6 +29,9 @@ static ssize_t acpi_table_aml_write(stru + struct acpi_table *table; + int ret; + ++ if (kernel_is_locked_down()) ++ return -EPERM; ++ + table = container_of(cfg, struct acpi_table, cfg); + + if (table->header) { diff --git a/patches.suse/ACPI-sysfs-Fix-pm_profile_attr-type.patch b/patches.suse/ACPI-sysfs-Fix-pm_profile_attr-type.patch new file mode 100644 index 0000000..07eddb4 --- /dev/null +++ b/patches.suse/ACPI-sysfs-Fix-pm_profile_attr-type.patch @@ -0,0 +1,98 @@ +From e6d701dca9893990d999fd145e3e07223c002b06 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Thu, 11 Jun 2020 21:51:50 -0700 +Subject: [PATCH] ACPI: sysfs: Fix pm_profile_attr type +Git-commit: e6d701dca9893990d999fd145e3e07223c002b06 +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +When running a kernel with Clang's Control Flow Integrity implemented, +there is a violation that happens when accessing +/sys/firmware/acpi/pm_profile: + +$ cat /sys/firmware/acpi/pm_profile +0 + +$ dmesg +... +[ 17.352564] ------------[ cut here ]------------ +[ 17.352568] CFI failure (target: acpi_show_profile+0x0/0x8): +[ 17.352572] WARNING: CPU: 3 PID: 497 at kernel/cfi.c:29 __cfi_check_fail+0x33/0x40 +[ 17.352573] Modules linked in: +[ 17.352575] CPU: 3 PID: 497 Comm: cat Tainted: G W 5.7.0-microsoft-standard+ #1 +[ 17.352576] RIP: 0010:__cfi_check_fail+0x33/0x40 +[ 17.352577] Code: 48 c7 c7 50 b3 85 84 48 c7 c6 50 0a 4e 84 e8 a4 d8 60 00 85 c0 75 02 5b c3 48 c7 c7 dc 5e 49 84 48 89 de 31 c0 e8 7d 06 eb ff <0f> 0b 5b c3 00 00 cc cc 00 00 cc cc 00 85 f6 74 25 41 b9 ea ff ff +[ 17.352577] RSP: 0018:ffffaa6dc3c53d30 EFLAGS: 00010246 +[ 17.352578] RAX: 331267e0c06cee00 RBX: ffffffff83d85890 RCX: ffffffff8483a6f8 +[ 17.352579] RDX: ffff9cceabbb37c0 RSI: 0000000000000082 RDI: ffffffff84bb9e1c +[ 17.352579] RBP: ffffffff845b2bc8 R08: 0000000000000001 R09: ffff9cceabbba200 +[ 17.352579] R10: 000000000000019d R11: 0000000000000000 R12: ffff9cc947766f00 +[ 17.352580] R13: ffffffff83d6bd50 R14: ffff9ccc6fa80000 R15: ffffffff845bd328 +[ 17.352582] FS: 00007fdbc8d13580(0000) GS:ffff9cce91ac0000(0000) knlGS:0000000000000000 +[ 17.352582] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 17.352583] CR2: 00007fdbc858e000 CR3: 00000005174d0000 CR4: 0000000000340ea0 +[ 17.352584] Call Trace: +[ 17.352586] ? rev_id_show+0x8/0x8 +[ 17.352587] ? __cfi_check+0x45bac/0x4b640 +[ 17.352589] ? kobj_attr_show+0x73/0x80 +[ 17.352590] ? sysfs_kf_seq_show+0xc1/0x140 +[ 17.352592] ? ext4_seq_options_show.cfi_jt+0x8/0x8 +[ 17.352593] ? seq_read+0x180/0x600 +[ 17.352595] ? sysfs_create_file_ns.cfi_jt+0x10/0x10 +[ 17.352596] ? tlbflush_read_file+0x8/0x8 +[ 17.352597] ? __vfs_read+0x6b/0x220 +[ 17.352598] ? handle_mm_fault+0xa23/0x11b0 +[ 17.352599] ? vfs_read+0xa2/0x130 +[ 17.352599] ? ksys_read+0x6a/0xd0 +[ 17.352601] ? __do_sys_getpgrp+0x8/0x8 +[ 17.352602] ? do_syscall_64+0x72/0x120 +[ 17.352603] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 +[ 17.352604] ---[ end trace 7b1fa81dc897e419 ]--- + +When /sys/firmware/acpi/pm_profile is read, sysfs_kf_seq_show is called, +which in turn calls kobj_attr_show, which gets the ->show callback +member by calling container_of on attr (casting it to struct +kobj_attribute) then calls it. + +There is a CFI violation because pm_profile_attr is of type +struct device_attribute but kobj_attr_show calls ->show expecting it +to be from struct kobj_attribute. CFI checking ensures that function +pointer types match when doing indirect calls. Fix pm_profile_attr to +be defined in terms of kobj_attribute so there is no violation or +mismatch. + +Fixes: 362b646062b2 ("ACPI: Export FADT pm_profile integer value to userspace") +Link: https://github.com/ClangBuiltLinux/linux/issues/1051 +Reported-by: yuu ichii +Signed-off-by: Nathan Chancellor +Cc: 3.10+ # 3.10+ +Signed-off-by: Rafael J. Wysocki +Acked-by: Takashi Iwai + +--- + drivers/acpi/sysfs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c +index 3a89909b50a6..76c668c05fa0 100644 +--- a/drivers/acpi/sysfs.c ++++ b/drivers/acpi/sysfs.c +@@ -938,13 +938,13 @@ static void __exit interrupt_stats_exit(void) + } + + static ssize_t +-acpi_show_profile(struct device *dev, struct device_attribute *attr, ++acpi_show_profile(struct kobject *kobj, struct kobj_attribute *attr, + char *buf) + { + return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile); + } + +-static const struct device_attribute pm_profile_attr = ++static const struct kobj_attribute pm_profile_attr = + __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL); + + static ssize_t hotplug_enabled_show(struct kobject *kobj, +-- +2.16.4 + diff --git a/patches.suse/ALSA-hda-realtek-Enable-Speaker-for-ASUS-UX533-and-U.patch b/patches.suse/ALSA-hda-realtek-Enable-Speaker-for-ASUS-UX533-and-U.patch new file mode 100644 index 0000000..9dfa7dc --- /dev/null +++ b/patches.suse/ALSA-hda-realtek-Enable-Speaker-for-ASUS-UX533-and-U.patch @@ -0,0 +1,38 @@ +From 473fbe13fd6f9082e413aea37e624ecbce5463cc Mon Sep 17 00:00:00 2001 +From: Kailang Yang +Date: Thu, 16 Jul 2020 14:42:33 +0800 +Subject: [PATCH] ALSA: hda/realtek - Enable Speaker for ASUS UX533 and UX534 +Git-commit: 473fbe13fd6f9082e413aea37e624ecbce5463cc +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +ASUS UX533 and UX534 speaker still can't output. +End User feedback speaker didn't have output. +Add this COEF value will enable it. + +Fixes: 4e051106730d ("ALSA: hda/realtek: Enable audio jacks of ASUS UX533FD with ALC294") +Cc: +Signed-off-by: Kailang Yang +Link: https://lore.kernel.org/r/80334402a93b48e385f8f4841b59ae09@realtek.com +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/patch_realtek.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 66e98a5cfea2..fff56fe8caf1 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -7136,6 +7136,8 @@ static const struct hda_fixup alc269_fixups[] = { + /* Set EAPD high */ + { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, + { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, ++ { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, ++ { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, + { } + }, + .chained = true, +-- +2.16.4 + diff --git a/patches.suse/ALSA-usb-audio-Fix-packet-size-calculation.patch b/patches.suse/ALSA-usb-audio-Fix-packet-size-calculation.patch new file mode 100644 index 0000000..6871c89 --- /dev/null +++ b/patches.suse/ALSA-usb-audio-Fix-packet-size-calculation.patch @@ -0,0 +1,41 @@ +From 695cf5ab401c1a368fed228ee4a624784cd17fc5 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Mon, 29 Jun 2020 05:59:33 +0300 +Subject: [PATCH] ALSA: usb-audio: Fix packet size calculation +Git-commit: 695cf5ab401c1a368fed228ee4a624784cd17fc5 +Patch-mainline: v5.8-rc5 +References: bsc#1111666 + +Commit f0bd62b64016 ("ALSA: usb-audio: Improve frames size computation") +introduced a regression for devices which have playback endpoints with +bInterval > 1. Fix this by taking ep->datainterval into account. + +Note that frame and fps are actually mean packet and packets per second +in the code introduces by the mentioned commit. This will be fixed in a +follow-up patch. + +Fixes: f0bd62b64016 ("ALSA: usb-audio: Improve frames size computation") +Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=208353 +Signed-off-by: Alexander Tsoy +Link: https://lore.kernel.org/r/20200629025934.154288-1-alexander@tsoy.me +Signed-off-by: Takashi Iwai + +--- + sound/usb/endpoint.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c +index 9bea7d3f99f8..11f23778f0a5 100644 +--- a/sound/usb/endpoint.c ++++ b/sound/usb/endpoint.c +@@ -1093,6 +1093,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, + ep->freqn = get_usb_high_speed_rate(rate); + ep->fps = 8000; + } ++ ep->fps >>= ep->datainterval; + + ep->sample_rem = rate % ep->fps; + ep->framesize[0] = rate / ep->fps; +-- +2.16.4 + diff --git a/patches.suse/ALSA-usb-audio-Improve-frames-size-computation.patch b/patches.suse/ALSA-usb-audio-Improve-frames-size-computation.patch new file mode 100644 index 0000000..237592e --- /dev/null +++ b/patches.suse/ALSA-usb-audio-Improve-frames-size-computation.patch @@ -0,0 +1,166 @@ +From f0bd62b64016508938df9babe47f65c2c727d25c Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Fri, 24 Apr 2020 05:24:48 +0300 +Subject: [PATCH] ALSA: usb-audio: Improve frames size computation +Git-commit: f0bd62b64016508938df9babe47f65c2c727d25c +Patch-mainline: v5.8-rc1 +References: bsc#1111666 + +For computation of the the next frame size current value of fs/fps and +accumulated fractional parts of fs/fps are used, where values are stored +in Q16.16 format. This is quite natural for computing frame size for +asynchronous endpoints driven by explicit feedback, since in this case +fs/fps is a value provided by the feedback endpoint and it's already in +the Q format. If an error is accumulated over time, the device can +adjust fs/fps value to prevent buffer overruns/underruns. + +But for synchronous endpoints the accuracy provided by these computations +is not enough. Due to accumulated error the driver periodically produces +frames with incorrect size (+/- 1 audio sample). + +This patch fixes this issue by implementing a different algorithm for +frame size computation. It is based on accumulating of the remainders +from division fs/fps and it doesn't accumulate errors over time. This +new method is enabled for synchronous and adaptive playback endpoints. + +Signed-off-by: Alexander Tsoy +Link: https://lore.kernel.org/r/20200424022449.14972-1-alexander@tsoy.me +Signed-off-by: Takashi Iwai + +--- + sound/usb/card.h | 4 ++++ + sound/usb/endpoint.c | 43 ++++++++++++++++++++++++++++++++++++++----- + sound/usb/endpoint.h | 1 + + sound/usb/pcm.c | 2 ++ + 4 files changed, 45 insertions(+), 5 deletions(-) + +diff --git a/sound/usb/card.h b/sound/usb/card.h +index 395403a2d33f..820e564656ed 100644 +--- a/sound/usb/card.h ++++ b/sound/usb/card.h +@@ -84,6 +84,10 @@ struct snd_usb_endpoint { + dma_addr_t sync_dma; /* DMA address of syncbuf */ + + unsigned int pipe; /* the data i/o pipe */ ++ unsigned int framesize[2]; /* small/large frame sizes in samples */ ++ unsigned int sample_rem; /* remainder from division fs/fps */ ++ unsigned int sample_accum; /* sample accumulator */ ++ unsigned int fps; /* frames per second */ + unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */ + unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */ + int freqshift; /* how much to shift the feedback value to get Q16.16 */ +diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c +index 4a9a2f6ef5a4..d8dc7cb56d43 100644 +--- a/sound/usb/endpoint.c ++++ b/sound/usb/endpoint.c +@@ -124,12 +124,12 @@ int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep) + + /* + * For streaming based on information derived from sync endpoints, +- * prepare_outbound_urb_sizes() will call next_packet_size() to ++ * prepare_outbound_urb_sizes() will call slave_next_packet_size() to + * determine the number of samples to be sent in the next packet. + * +- * For implicit feedback, next_packet_size() is unused. ++ * For implicit feedback, slave_next_packet_size() is unused. + */ +-int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep) ++int snd_usb_endpoint_slave_next_packet_size(struct snd_usb_endpoint *ep) + { + unsigned long flags; + int ret; +@@ -146,6 +146,29 @@ int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep) + return ret; + } + ++/* ++ * For adaptive and synchronous endpoints, prepare_outbound_urb_sizes() ++ * will call next_packet_size() to determine the number of samples to be ++ * sent in the next packet. ++ */ ++int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep) ++{ ++ int ret; ++ ++ if (ep->fill_max) ++ return ep->maxframesize; ++ ++ ep->sample_accum += ep->sample_rem; ++ if (ep->sample_accum >= ep->fps) { ++ ep->sample_accum -= ep->fps; ++ ret = ep->framesize[1]; ++ } else { ++ ret = ep->framesize[0]; ++ } ++ ++ return ret; ++} ++ + static void retire_outbound_urb(struct snd_usb_endpoint *ep, + struct snd_urb_ctx *urb_ctx) + { +@@ -190,6 +213,8 @@ static void prepare_silent_urb(struct snd_usb_endpoint *ep, + + if (ctx->packet_size[i]) + counts = ctx->packet_size[i]; ++ else if (ep->sync_master) ++ counts = snd_usb_endpoint_slave_next_packet_size(ep); + else + counts = snd_usb_endpoint_next_packet_size(ep); + +@@ -874,10 +899,17 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, + ep->maxpacksize = fmt->maxpacksize; + ep->fill_max = !!(fmt->attributes & UAC_EP_CS_ATTR_FILL_MAX); + +- if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_FULL) ++ if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_FULL) { + ep->freqn = get_usb_full_speed_rate(rate); +- else ++ ep->fps = 1000; ++ } else { + ep->freqn = get_usb_high_speed_rate(rate); ++ ep->fps = 8000; ++ } ++ ++ ep->sample_rem = rate % ep->fps; ++ ep->framesize[0] = rate / ep->fps; ++ ep->framesize[1] = (rate + (ep->fps - 1)) / ep->fps; + + /* calculate the frequency in 16.16 format */ + ep->freqm = ep->freqn; +@@ -936,6 +968,7 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep) + ep->active_mask = 0; + ep->unlink_mask = 0; + ep->phase = 0; ++ ep->sample_accum = 0; + + snd_usb_endpoint_start_quirk(ep); + +diff --git a/sound/usb/endpoint.h b/sound/usb/endpoint.h +index 63a39d4fa8d8..d23fa0a8c11b 100644 +--- a/sound/usb/endpoint.h ++++ b/sound/usb/endpoint.h +@@ -28,6 +28,7 @@ void snd_usb_endpoint_release(struct snd_usb_endpoint *ep); + void snd_usb_endpoint_free(struct snd_usb_endpoint *ep); + + int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep); ++int snd_usb_endpoint_slave_next_packet_size(struct snd_usb_endpoint *ep); + int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep); + + void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep, +diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c +index a4e4064f9aee..b50965ab3b3a 100644 +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -1579,6 +1579,8 @@ static void prepare_playback_urb(struct snd_usb_substream *subs, + for (i = 0; i < ctx->packets; i++) { + if (ctx->packet_size[i]) + counts = ctx->packet_size[i]; ++ else if (ep->sync_master) ++ counts = snd_usb_endpoint_slave_next_packet_size(ep); + else + counts = snd_usb_endpoint_next_packet_size(ep); + +-- +2.16.4 + diff --git a/patches.suse/PCI-pciehp-Fix-indefinite-wait-on-sysfs-requests.patch b/patches.suse/PCI-pciehp-Fix-indefinite-wait-on-sysfs-requests.patch new file mode 100644 index 0000000..e85c8ac --- /dev/null +++ b/patches.suse/PCI-pciehp-Fix-indefinite-wait-on-sysfs-requests.patch @@ -0,0 +1,122 @@ +From 3e487d2e4aa466decd226353755c9d423e8fbacc Mon Sep 17 00:00:00 2001 +From: Lukas Wunner +Date: Wed, 18 Mar 2020 12:33:12 +0100 +Subject: [PATCH] PCI: pciehp: Fix indefinite wait on sysfs requests +Git-commit: 3e487d2e4aa466decd226353755c9d423e8fbacc +References: git-fixes +Patch-mainline: v5.7-rc1 + +David Hoyer reports that powering pciehp slots up or down via sysfs may +hang: The call to wait_event() in pciehp_sysfs_enable_slot() and +_disable_slot() does not return because ctrl->ist_running remains true. + +This flag, which was introduced by commit 157c1062fcd8 ("PCI: pciehp: Avoid +returning prematurely from sysfs requests"), signifies that the IRQ thread +pciehp_ist() is running. It is set to true at the top of pciehp_ist() and +reset to false at the end. However there are two additional return +statements in pciehp_ist() before which the commit neglected to reset the +flag to false and wake up waiters for the flag. + +That omission opens up the following race when powering up the slot: + +* pciehp_ist() runs because a PCI_EXP_SLTSTA_PDC event was requested + by pciehp_sysfs_enable_slot() + +* pciehp_ist() turns on slot power via the following call stack: + pciehp_handle_presence_or_link_change() -> pciehp_enable_slot() -> + __pciehp_enable_slot() -> board_added() -> pciehp_power_on_slot() + +* after slot power is turned on, the link comes up, resulting in a + PCI_EXP_SLTSTA_DLLSC event + +* the IRQ handler pciehp_isr() stores the event in ctrl->pending_events + and returns IRQ_WAKE_THREAD + +* the IRQ thread is already woken (it's bringing up the slot), but the + genirq code remembers to re-run the IRQ thread after it has finished + (such that it can deal with the new event) by setting IRQTF_RUNTHREAD + via __handle_irq_event_percpu() -> __irq_wake_thread() + +* the IRQ thread removes PCI_EXP_SLTSTA_DLLSC from ctrl->pending_events + via board_added() -> pciehp_check_link_status() in order to deal with + presence and link flaps per commit 6c35a1ac3da6 ("PCI: pciehp: + Tolerate initially unstable link") + +* after pciehp_ist() has successfully brought up the slot, it resets + ctrl->ist_running to false and wakes up the sysfs requester + +* the genirq code re-runs pciehp_ist(), which sets ctrl->ist_running + to true but then returns with IRQ_NONE because ctrl->pending_events + is empty + +* pciehp_sysfs_enable_slot() is finally woken but notices that + ctrl->ist_running is true, hence continues waiting + +The only way to get the hung task going again is to trigger a hotplug +event which brings down the slot, e.g. by yanking out the card. + +The same race exists when powering down the slot because remove_board() +likewise clears link or presence changes in ctrl->pending_events per commit +3943af9d01e9 ("PCI: pciehp: Ignore Link State Changes after powering off a +slot") and thereby may cause a re-run of pciehp_ist() which returns with +IRQ_NONE without resetting ctrl->ist_running to false. + +Fix by adding a goto label before the teardown steps at the end of +pciehp_ist() and jumping to that label from the two return statements which +currently neglect to reset the ctrl->ist_running flag. + +Fixes: 157c1062fcd8 ("PCI: pciehp: Avoid returning prematurely from sysfs requests") +Link: https://lore.kernel.org/r/cca1effa488065cb055120aa01b65719094bdcb5.1584530321.git.lukas@wunner.de +Reported-by: David Hoyer +Signed-off-by: Lukas Wunner +Signed-off-by: Bjorn Helgaas +Reviewed-by: Keith Busch +Cc: stable@vger.kernel.org # v4.19+ +Signed-off-by: Oliver Neukum +--- + drivers/pci/hotplug/pciehp_hpc.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c +index e4627c68b30f..5f1a27bfcb19 100644 +--- a/drivers/pci/hotplug/pciehp_hpc.c ++++ b/drivers/pci/hotplug/pciehp_hpc.c +@@ -663,17 +663,15 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id) + if (atomic_fetch_and(~RERUN_ISR, &ctrl->pending_events) & RERUN_ISR) { + ret = pciehp_isr(irq, dev_id); + enable_irq(irq); +- if (ret != IRQ_WAKE_THREAD) { +- pci_config_pm_runtime_put(pdev); +- return ret; +- } ++ if (ret != IRQ_WAKE_THREAD) ++ goto out; + } + + synchronize_hardirq(irq); + events = atomic_xchg(&ctrl->pending_events, 0); + if (!events) { +- pci_config_pm_runtime_put(pdev); +- return IRQ_NONE; ++ ret = IRQ_NONE; ++ goto out; + } + + /* Check Attention Button Pressed */ +@@ -702,10 +700,12 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id) + pciehp_handle_presence_or_link_change(ctrl, events); + up_read(&ctrl->reset_lock); + ++ ret = IRQ_HANDLED; ++out: + pci_config_pm_runtime_put(pdev); + ctrl->ist_running = false; + wake_up(&ctrl->requester); +- return IRQ_HANDLED; ++ return ret; + } + + static int pciehp_poll(void *data) +-- +2.16.4 + diff --git a/patches.suse/PCI-pciehp-Support-interrupts-sent-from-D3hot.patch b/patches.suse/PCI-pciehp-Support-interrupts-sent-from-D3hot.patch new file mode 100644 index 0000000..872fab7 --- /dev/null +++ b/patches.suse/PCI-pciehp-Support-interrupts-sent-from-D3hot.patch @@ -0,0 +1,203 @@ +From 6b08c3854cfdc5d13165880e2b54642c47edc405 Mon Sep 17 00:00:00 2001 +From: Lukas Wunner +Date: Sat, 28 Jul 2018 07:18:00 +0200 +Subject: [PATCH] PCI: pciehp: Support interrupts sent from D3hot +Git-commit: 6b08c3854cfdc5d13165880e2b54642c47edc405 +References: git-fixes +Patch-mainline: v4.19-rc1 + +If a hotplug port is able to send an interrupt, one would naively assume +that it is accessible at that moment. After all, if it wouldn't be +accessible, i.e. if its parent is in D3hot and the link to the hotplug +port is thus down, how should an interrupt come through? + +It turns out that assumption is wrong at least for Thunderbolt: Even +though its parents are in D3hot, a Thunderbolt hotplug port is able to +signal interrupts. Because the port's config space is inaccessible and +resuming the parents may sleep, the hard IRQ handler has to defer +runtime resuming the parents and reading the Slot Status register to the +IRQ thread. + +If the hotplug port uses a level-triggered INTx interrupt, it needs to +be masked until the IRQ thread has cleared the signaled events. For +simplicity, this commit also masks edge-triggered MSI/MSI-X interrupts. +Note that if the interrupt is shared (which can only happen for INTx), +other devices are starved from receiving interrupts until the IRQ thread +is scheduled, has runtime resumed the hotplug port's parents and has +read and cleared the Slot Status register. + +That delay is dominated by the 10 ms D3hot->D0 transition time of each +parent port. The worst case is a Thunderbolt downstream port at the +end of a daisy chain: There may be up to six Thunderbolt controllers +in-between it and the root port, each comprising an upstream and +downstream port, plus its own upstream port. That's 13 x 10 = 130 ms. +Possible mitigations are polling the interrupt while it's disabled or +reducing the d3_delay of Thunderbolt ports if possible. + +Open code masking of the interrupt instead of requesting it with the +IRQF_ONESHOT flag to minimize the period during which it is masked. +(IRQF_ONESHOT unmasks the IRQ only after the IRQ thread has finished.) + +PCIe r4.0 sec 6.7.3.4 states that "If wake generation is required by the +associated form factor specification, a hotplug capable Downstream Port +must support generation of a wakeup event (using the PME mechanism) on +hotplug events that occur when the system is in a sleep state or the +Port is in device state D1, D2, or D3Hot." + +This would seem to imply that PME needs to be enabled on the hotplug +port when it is runtime suspended. pci_enable_wake() currently doesn't +enable PME on bridges, it may be necessary to add an exemption for +hotplug bridges there. On "Light Ridge" Thunderbolt controllers, the +PME_Status bit is not set when an interrupt occurs while the hotplug +port is in D3hot, even if PME is enabled. (I've tested this on a Mac +and we hardcode the OSC_PCI_EXPRESS_PME_CONTROL bit to 0 on Macs in +negotiate_os_control(), modifying it to 1 didn't change the behavior.) + +(Side note: Section 6.7.3.4 also states that "PME and Hot-Plug Event +interrupts (when both are implemented) always share the same MSI or +MSI-X vector". That would only seem to apply to Root Ports, however +the section never mentions Root Ports, only Downstream Ports. This is +explained in the definition of "Downstream Port" in the "Terms and +Acronyms" section of the PCIe Base Spec: "The Ports on a Switch that +are not the Upstream Port are Downstream Ports. All Ports on a Root +Complex are Downstream Ports.") + +Signed-off-by: Lukas Wunner +Signed-off-by: Bjorn Helgaas +Cc: Thomas Gleixner +Cc: Rafael J. Wysocki +Cc: Mika Westerberg +Cc: Ashok Raj +Cc: Keith Busch +Cc: Yinghai Lu +Signed-off-by: Oliver Neukum +--- + drivers/pci/hotplug/pciehp.h | 5 +++++ + drivers/pci/hotplug/pciehp_hpc.c | 45 ++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 48 insertions(+), 2 deletions(-) + +diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h +index 247681963063..811cf83f956d 100644 +--- a/drivers/pci/hotplug/pciehp.h ++++ b/drivers/pci/hotplug/pciehp.h +@@ -156,8 +156,13 @@ struct controller { + * + * %DISABLE_SLOT: Disable the slot in response to a user request via sysfs or + * an Attention Button press after the 5 second delay ++ * %RERUN_ISR: Used by the IRQ handler to inform the IRQ thread that the ++ * hotplug port was inaccessible when the interrupt occurred, requiring ++ * that the IRQ handler is rerun by the IRQ thread after it has made the ++ * hotplug port accessible by runtime resuming its parents to D0 + */ + #define DISABLE_SLOT (1 << 16) ++#define RERUN_ISR (1 << 17) + + #define ATTN_BUTTN(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_ABP) + #define POWER_CTRL(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_PCP) +diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c +index 6313ddf38a51..6e9b4330ad82 100644 +--- a/drivers/pci/hotplug/pciehp_hpc.c ++++ b/drivers/pci/hotplug/pciehp_hpc.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -521,6 +522,7 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) + { + struct controller *ctrl = (struct controller *)dev_id; + struct pci_dev *pdev = ctrl_dev(ctrl); ++ struct device *parent = pdev->dev.parent; + u16 status, events; + + /* +@@ -529,9 +531,26 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) + if (pdev->current_state == PCI_D3cold) + return IRQ_NONE; + ++ /* ++ * Keep the port accessible by holding a runtime PM ref on its parent. ++ * Defer resume of the parent to the IRQ thread if it's suspended. ++ * Mask the interrupt until then. ++ */ ++ if (parent) { ++ pm_runtime_get_noresume(parent); ++ if (!pm_runtime_active(parent)) { ++ pm_runtime_put(parent); ++ disable_irq_nosync(irq); ++ atomic_or(RERUN_ISR, &ctrl->pending_events); ++ return IRQ_WAKE_THREAD; ++ } ++ } ++ + pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &status); + if (status == (u16) ~0) { + ctrl_info(ctrl, "%s: no response from device\n", __func__); ++ if (parent) ++ pm_runtime_put(parent); + return IRQ_NONE; + } + +@@ -550,11 +569,16 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) + if (ctrl->power_fault_detected) + events &= ~PCI_EXP_SLTSTA_PFD; + +- if (!events) ++ if (!events) { ++ if (parent) ++ pm_runtime_put(parent); + return IRQ_NONE; ++ } + + pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, events); + ctrl_dbg(ctrl, "pending interrupts %#06x from Slot Status\n", events); ++ if (parent) ++ pm_runtime_put(parent); + + /* + * Command Completed notifications are not deferred to the +@@ -584,13 +608,29 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) + static irqreturn_t pciehp_ist(int irq, void *dev_id) + { + struct controller *ctrl = (struct controller *)dev_id; ++ struct pci_dev *pdev = ctrl_dev(ctrl); + struct slot *slot = ctrl->slot; ++ irqreturn_t ret; + u32 events; + ++ pci_config_pm_runtime_get(pdev); ++ ++ /* rerun pciehp_isr() if the port was inaccessible on interrupt */ ++ if (atomic_fetch_and(~RERUN_ISR, &ctrl->pending_events) & RERUN_ISR) { ++ ret = pciehp_isr(irq, dev_id); ++ enable_irq(irq); ++ if (ret != IRQ_WAKE_THREAD) { ++ pci_config_pm_runtime_put(pdev); ++ return ret; ++ } ++ } ++ + synchronize_hardirq(irq); + events = atomic_xchg(&ctrl->pending_events, 0); +- if (!events) ++ if (!events) { ++ pci_config_pm_runtime_put(pdev); + return IRQ_NONE; ++ } + + /* Check Attention Button Pressed */ + if (events & PCI_EXP_SLTSTA_ABP) { +@@ -618,6 +658,7 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id) + pciehp_green_led_off(slot); + } + ++ pci_config_pm_runtime_put(pdev); + wake_up(&ctrl->requester); + return IRQ_HANDLED; + } +-- +2.16.4 + diff --git a/patches.suse/PM-Domains-Allow-genpd-users-to-specify-default-acti.patch b/patches.suse/PM-Domains-Allow-genpd-users-to-specify-default-acti.patch new file mode 100644 index 0000000..b9d917b --- /dev/null +++ b/patches.suse/PM-Domains-Allow-genpd-users-to-specify-default-acti.patch @@ -0,0 +1,66 @@ +From 95a20ef6f7e54c6a982715a7d0da2fd81790db28 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Tue, 7 Nov 2017 13:48:11 +0100 +Subject: [PATCH] PM / Domains: Allow genpd users to specify default active + wakeup behavior +Git-commit: 95a20ef6f7e54c6a982715a7d0da2fd81790db28 +References: git-fixes +Patch-mainline: v4.15-rc1 + +It is quite common for PM Domains to require slave devices to be kept +active during system suspend if they are to be used as wakeup sources. +To enable this, currently each PM Domain or driver has to provide its +own gpd_dev_ops.active_wakeup() callback. + +Introduce a new flag GENPD_FLAG_ACTIVE_WAKEUP to consolidate this. +If specified, all slave devices configured as wakeup sources will be +kept active during system suspend. + +PM Domains that need more fine-grained controls, based on the slave +device, can still provide their own callbacks, as before. + +Signed-off-by: Geert Uytterhoeven +Acked-by: Ulf Hansson +Reviewed-by: Kevin Hilman +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Oliver Neukum +--- + drivers/base/power/domain.c | 3 +++ + include/linux/pm_domain.h | 7 ++++--- + 2 files changed, 7 insertions(+), 3 deletions(-) + +--- a/drivers/base/power/domain.c ++++ b/drivers/base/power/domain.c +@@ -124,6 +124,7 @@ static const struct genpd_lock_ops genpd + #define genpd_status_on(genpd) (genpd->status == GPD_STATE_ACTIVE) + #define genpd_is_irq_safe(genpd) (genpd->flags & GENPD_FLAG_IRQ_SAFE) + #define genpd_is_always_on(genpd) (genpd->flags & GENPD_FLAG_ALWAYS_ON) ++#define genpd_is_active_wakeup(genpd) (genpd->flags & GENPD_FLAG_ACTIVE_WAKEUP) + + static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev, + struct generic_pm_domain *genpd) +@@ -741,6 +742,8 @@ static bool pm_genpd_present(const struc + static bool genpd_dev_active_wakeup(struct generic_pm_domain *genpd, + struct device *dev) + { ++ if (genpd_is_active_wakeup(genpd)) ++ return true; + return GENPD_DEV_CALLBACK(genpd, bool, active_wakeup, dev); + } + +--- a/include/linux/pm_domain.h ++++ b/include/linux/pm_domain.h +@@ -18,9 +18,10 @@ + #include + + /* Defines used for the flags field in the struct generic_pm_domain */ +-#define GENPD_FLAG_PM_CLK (1U << 0) /* PM domain uses PM clk */ +-#define GENPD_FLAG_IRQ_SAFE (1U << 1) /* PM domain operates in atomic */ +-#define GENPD_FLAG_ALWAYS_ON (1U << 2) /* PM domain is always powered on */ ++#define GENPD_FLAG_PM_CLK (1U << 0) /* PM domain uses PM clk */ ++#define GENPD_FLAG_IRQ_SAFE (1U << 1) /* PM domain operates in atomic */ ++#define GENPD_FLAG_ALWAYS_ON (1U << 2) /* PM domain is always powered on */ ++#define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3) /* Keep devices active if wakeup */ + + enum gpd_status { + GPD_STATE_ACTIVE = 0, /* PM domain is active */ diff --git a/patches.suse/PM-domains-Don-t-skip-driver-s-suspend-resume_noirq-.patch b/patches.suse/PM-domains-Don-t-skip-driver-s-suspend-resume_noirq-.patch new file mode 100644 index 0000000..d2e707f --- /dev/null +++ b/patches.suse/PM-domains-Don-t-skip-driver-s-suspend-resume_noirq-.patch @@ -0,0 +1,106 @@ +From a935424bb658f9ca37eb5e94119b857998341356 Mon Sep 17 00:00:00 2001 +From: Ulf Hansson +Date: Wed, 10 Jan 2018 21:31:56 +0100 +Subject: [PATCH] PM / domains: Don't skip driver's ->suspend|resume_noirq() + callbacks +Git-commit: a935424bb658f9ca37eb5e94119b857998341356 +References: git-fixes +Patch-mainline: v4.16-rc1 + +Commit 10da65423fdb (PM / Domains: Call driver's noirq callbacks) +started to respect driver's noirq callbacks, but while doing that it +also introduced a few potential problems. + +More precisely, in genpd_finish_suspend() and genpd_resume_noirq() +the noirq callbacks at the driver level should be invoked, no matter +of whether dev->power.wakeup_path is set or not. + +Additionally, the commit in question also made genpd_resume_noirq() +to ignore the return value from pm_runtime_force_resume(). + +Let's fix both these issues! + +Fixes: 10da65423fdb (PM / Domains: Call driver's noirq callbacks) +Signed-off-by: Ulf Hansson +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Oliver Neukum +--- + drivers/base/power/domain.c | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +--- a/drivers/base/power/domain.c ++++ b/drivers/base/power/domain.c +@@ -909,15 +909,12 @@ static int pm_genpd_prepare(struct devic + static int genpd_finish_suspend(struct device *dev, bool poweroff) + { + struct generic_pm_domain *genpd; +- int ret; ++ int ret = 0; + + genpd = dev_to_genpd(dev); + if (IS_ERR(genpd)) + return -EINVAL; + +- if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)) +- return 0; +- + if (poweroff) + ret = pm_generic_poweroff_noirq(dev); + else +@@ -925,10 +922,18 @@ static int genpd_finish_suspend(struct d + if (ret) + return ret; + ++ if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd)) ++ return 0; ++ + if (genpd->dev_ops.stop && genpd->dev_ops.start) { + ret = pm_runtime_force_suspend(dev); +- if (ret) ++ if (ret) { ++ if (poweroff) ++ pm_generic_restore_noirq(dev); ++ else ++ pm_generic_resume_noirq(dev); + return ret; ++ } + } + + genpd_lock(genpd); +@@ -962,7 +967,7 @@ static int pm_genpd_suspend_noirq(struct + static int pm_genpd_resume_noirq(struct device *dev) + { + struct generic_pm_domain *genpd; +- int ret = 0; ++ int ret; + + dev_dbg(dev, "%s()\n", __func__); + +@@ -971,21 +976,20 @@ static int pm_genpd_resume_noirq(struct + return -EINVAL; + + if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)) +- return 0; ++ return pm_generic_resume_noirq(dev); + + genpd_lock(genpd); + genpd_sync_power_on(genpd, true, 0); + genpd->suspended_count--; + genpd_unlock(genpd); + +- if (genpd->dev_ops.stop && genpd->dev_ops.start) ++ if (genpd->dev_ops.stop && genpd->dev_ops.start) { + ret = pm_runtime_force_resume(dev); ++ if (ret) ++ return ret; ++ } + +- ret = pm_generic_resume_noirq(dev); +- if (ret) +- return ret; +- +- return ret; ++ return pm_generic_resume_noirq(dev); + } + + /** diff --git a/patches.suse/Revert-commit-e918e570415c-tpm_tis-Remove-the-HID-IF.patch b/patches.suse/Revert-commit-e918e570415c-tpm_tis-Remove-the-HID-IF.patch new file mode 100644 index 0000000..15856cf --- /dev/null +++ b/patches.suse/Revert-commit-e918e570415c-tpm_tis-Remove-the-HID-IF.patch @@ -0,0 +1,48 @@ +From 786a2aa281f4c4ba424ea8b8ea1e85ab62c4a57c Mon Sep 17 00:00:00 2001 +From: Jarkko Sakkinen +Date: Mon, 6 Jul 2020 23:53:42 +0300 +Subject: [PATCH] Revert commit e918e570415c ("tpm_tis: Remove the HID IFX0102") +Git-commit: 786a2aa281f4c4ba424ea8b8ea1e85ab62c4a57c +Patch-mainline: v5.8-rc5 +References: bsc#1111666 + +Removing IFX0102 from tpm_tis was not a right move because both tpm_tis +and tpm_infineon use the same device ID. Revert the commit and add a +remark about a bug caused by commit 93e1b7d42e1e ("[PATCH] tpm: add HID +module parameter"). + +Fixes: e918e570415c ("tpm_tis: Remove the HID IFX0102") +Reported-by: Peter Huewe +Reviewed-by: Jerry Snitselaar +Signed-off-by: Jarkko Sakkinen +Acked-by: Takashi Iwai + +--- + drivers/char/tpm/tpm_tis.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c +index c58ea10fc92f..0b214963539d 100644 +--- a/drivers/char/tpm/tpm_tis.c ++++ b/drivers/char/tpm/tpm_tis.c +@@ -235,9 +235,17 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev, + return tpm_tis_init(&pnp_dev->dev, &tpm_info); + } + ++/* ++ * There is a known bug caused by 93e1b7d42e1e ("[PATCH] tpm: add HID module ++ * parameter"). This commit added IFX0102 device ID, which is also used by ++ * tpm_infineon but ignored to add quirks to probe which driver ought to be ++ * used. ++ */ ++ + static struct pnp_device_id tpm_pnp_tbl[] = { + {"PNP0C31", 0}, /* TPM */ + {"ATM1200", 0}, /* Atmel */ ++ {"IFX0102", 0}, /* Infineon */ + {"BCM0101", 0}, /* Broadcom */ + {"BCM0102", 0}, /* Broadcom */ + {"NSC1200", 0}, /* National */ +-- +2.16.4 + diff --git a/patches.suse/Revert-ipv6-add-mtu-lock-check-in-__ip6_rt_update_pm.patch b/patches.suse/Revert-ipv6-add-mtu-lock-check-in-__ip6_rt_update_pm.patch new file mode 100644 index 0000000..7d599a8 --- /dev/null +++ b/patches.suse/Revert-ipv6-add-mtu-lock-check-in-__ip6_rt_update_pm.patch @@ -0,0 +1,64 @@ +From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= +Date: Tue, 5 May 2020 11:57:23 -0700 +Subject: Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: 09454fd0a4ce23cb3d8af65066c91a1bf27120dd +Patch-mainline: 5.7-rc6 +References: networking-stable-20_05_16 + +This reverts commit 19bda36c4299ce3d7e5bce10bebe01764a655a6d: + +| ipv6: add mtu lock check in __ip6_rt_update_pmtu +| +| Prior to this patch, ipv6 didn't do mtu lock check in ip6_update_pmtu. +| It leaded to that mtu lock doesn't really work when receiving the pkt +| of ICMPV6_PKT_TOOBIG. +| +| This patch is to add mtu lock check in __ip6_rt_update_pmtu just as ipv4 +| did in __ip_rt_update_pmtu. + +The above reasoning is incorrect. IPv6 *requires* icmp based pmtu to work. +There's already a comment to this effect elsewhere in the kernel: + + $ git grep -p -B1 -A3 'RTAX_MTU lock' + net/ipv6/route.c=4813= + + static int rt6_mtu_change_route(struct fib6_info *f6i, void *p_arg) + ... + /* In IPv6 pmtu discovery is not optional, + so that RTAX_MTU lock cannot disable it. + We still use this lock to block changes + caused by addrconf/ndisc. + */ + +This reverts to the pre-4.9 behaviour. + +Cc: Eric Dumazet +Cc: Willem de Bruijn +Cc: Xin Long +Cc: Hannes Frederic Sowa +Signed-off-by: Maciej Żenczykowski +Fixes: 19bda36c4299 ("ipv6: add mtu lock check in __ip6_rt_update_pmtu") +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/ipv6/route.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -1392,8 +1392,10 @@ static void __ip6_rt_update_pmtu(struct + const struct in6_addr *daddr, *saddr; + struct rt6_info *rt6 = (struct rt6_info *)dst; + +- if (dst_metric_locked(dst, RTAX_MTU)) +- return; ++ /* Note: do *NOT* check dst_metric_locked(dst, RTAX_MTU) ++ * IPv6 pmtu discovery isn't optional, so 'mtu lock' cannot disable it. ++ * [see also comment in rt6_mtu_change_route()] ++ */ + + if (iph) { + daddr = &iph->daddr; diff --git a/patches.suse/Revert-thermal-mediatek-fix-register-index-error.patch b/patches.suse/Revert-thermal-mediatek-fix-register-index-error.patch new file mode 100644 index 0000000..c154cb3 --- /dev/null +++ b/patches.suse/Revert-thermal-mediatek-fix-register-index-error.patch @@ -0,0 +1,125 @@ +From a8f62f183021be389561570ab5f8c701a5e70298 Mon Sep 17 00:00:00 2001 +From: Enric Balletbo i Serra +Date: Tue, 7 Jul 2020 12:34:12 +0200 +Subject: [PATCH] Revert "thermal: mediatek: fix register index error" +Git-commit: a8f62f183021be389561570ab5f8c701a5e70298 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +This reverts commit eb9aecd90d1a39601e91cd08b90d5fee51d321a6 + +The above patch is supposed to fix a register index error on mt2701. It +is not clear if the problem solved is a hang or just an invalid value +returned, my guess is the second. The patch introduces, though, a new +hang on MT8173 device making them unusable. So, seems reasonable, revert +the patch because introduces a worst issue. + +The reason I send a revert instead of trying to fix the issue for MT8173 +is because the information needed to fix the issue is in the datasheet +and is not public. So I am not really able to fix it. + +Fixes the following bug when CONFIG_MTK_THERMAL is set on MT8173 +devices. + +[ 2.222488] Unable to handle kernel paging request at virtual address ffff8000125f5001 +[ 2.230421] Mem abort info: +[ 2.233207] ESR = 0x96000021 +[ 2.236261] EC = 0x25: DABT (current EL), IL = 32 bits +[ 2.241571] SET = 0, FnV = 0 +[ 2.244623] EA = 0, S1PTW = 0 +[ 2.247762] Data abort info: +[ 2.250640] ISV = 0, ISS = 0x00000021 +[ 2.254473] CM = 0, WnR = 0 +[ 2.257544] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000041850000 +[ 2.264251] [ffff8000125f5001] pgd=000000013ffff003, pud=000000013fffe003, pmd=000000013fff9003, pte=006800001100b707 +[ 2.274867] Internal error: Oops: 96000021 [#1] PREEMPT SMP +[ 2.280432] Modules linked in: +[ 2.283483] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.0-rc6+ #162 +[ 2.289914] Hardware name: Google Elm (DT) +[ 2.294003] pstate: 20000005 (nzCv daif -PAN -UAO) +[ 2.298792] pc : mtk_read_temp+0xb8/0x1c8 +[ 2.302793] lr : mtk_read_temp+0x7c/0x1c8 +[ 2.306794] sp : ffff80001003b930 +[ 2.310100] x29: ffff80001003b930 x28: 0000000000000000 +[ 2.315404] x27: 0000000000000002 x26: ffff0000f9550b10 +[ 2.320709] x25: ffff0000f9550a80 x24: 0000000000000090 +[ 2.326014] x23: ffff80001003ba24 x22: 00000000610344c0 +[ 2.331318] x21: 0000000000002710 x20: 00000000000001f4 +[ 2.336622] x19: 0000000000030d40 x18: ffff800011742ec0 +[ 2.341926] x17: 0000000000000001 x16: 0000000000000001 +[ 2.347230] x15: ffffffffffffffff x14: ffffff0000000000 +[ 2.352535] x13: ffffffffffffffff x12: 0000000000000028 +[ 2.357839] x11: 0000000000000003 x10: ffff800011295ec8 +[ 2.363143] x9 : 000000000000291b x8 : 0000000000000002 +[ 2.368447] x7 : 00000000000000a8 x6 : 0000000000000004 +[ 2.373751] x5 : 0000000000000000 x4 : ffff800011295cb0 +[ 2.379055] x3 : 0000000000000002 x2 : ffff8000125f5001 +[ 2.384359] x1 : 0000000000000001 x0 : ffff0000f9550a80 +[ 2.389665] Call trace: +[ 2.392105] mtk_read_temp+0xb8/0x1c8 +[ 2.395760] of_thermal_get_temp+0x2c/0x40 +[ 2.399849] thermal_zone_get_temp+0x78/0x160 +[ 2.404198] thermal_zone_device_update.part.0+0x3c/0x1f8 +[ 2.409589] thermal_zone_device_update+0x34/0x48 +[ 2.414286] of_thermal_set_mode+0x58/0x88 +[ 2.418375] thermal_zone_of_sensor_register+0x1a8/0x1d8 +[ 2.423679] devm_thermal_zone_of_sensor_register+0x64/0xb0 +[ 2.429242] mtk_thermal_probe+0x690/0x7d0 +[ 2.433333] platform_drv_probe+0x5c/0xb0 +[ 2.437335] really_probe+0xe4/0x448 +[ 2.440901] driver_probe_device+0xe8/0x140 +[ 2.445077] device_driver_attach+0x7c/0x88 +[ 2.449252] __driver_attach+0xac/0x178 +[ 2.453082] bus_for_each_dev+0x78/0xc8 +[ 2.456909] driver_attach+0x2c/0x38 +[ 2.460476] bus_add_driver+0x14c/0x230 +[ 2.464304] driver_register+0x6c/0x128 +[ 2.468131] __platform_driver_register+0x50/0x60 +[ 2.472831] mtk_thermal_driver_init+0x24/0x30 +[ 2.477268] do_one_initcall+0x50/0x298 +[ 2.481098] kernel_init_freeable+0x1ec/0x264 +[ 2.485450] kernel_init+0x1c/0x110 +[ 2.488931] ret_from_fork+0x10/0x1c +[ 2.492502] Code: f9401081 f9400402 b8a67821 8b010042 (b9400042) +[ 2.498599] ---[ end trace e43e3105ed27dc99 ]--- +[ 2.503367] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b +[ 2.511020] SMP: stopping secondary CPUs +[ 2.514941] Kernel Offset: disabled +[ 2.518421] CPU features: 0x090002,25006005 +[ 2.522595] Memory Limit: none +[ 2.525644] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]-- + +Cc: Michael Kao +Fixes: eb9aecd90d1a ("thermal: mediatek: fix register index error") +Signed-off-by: Enric Balletbo i Serra +Reviewed-by: Matthias Brugger +Signed-off-by: Daniel Lezcano +Link: https://lore.kernel.org/r/20200707103412.1010823-1-enric.balletbo@collabora.com +Acked-by: Takashi Iwai + +--- + drivers/thermal/mtk_thermal.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/thermal/mtk_thermal.c ++++ b/drivers/thermal/mtk_thermal.c +@@ -348,8 +348,7 @@ static int mtk_thermal_bank_temperature( + u32 raw; + + for (i = 0; i < conf->bank_data[bank->id].num_sensors; i++) { +- raw = readl(mt->thermal_base + +- conf->msr[conf->bank_data[bank->id].sensors[i]]); ++ raw = readl(mt->thermal_base + conf->msr[i]); + + temp = raw_to_mcelsius(mt, + conf->bank_data[bank->id].sensors[i], +@@ -486,8 +485,7 @@ static void mtk_thermal_init_bank(struct + + for (i = 0; i < conf->bank_data[num].num_sensors; i++) + writel(conf->sensor_mux_values[conf->bank_data[num].sensors[i]], +- mt->thermal_base + +- conf->adcpnp[conf->bank_data[num].sensors[i]]); ++ mt->thermal_base + conf->adcpnp[i]); + + writel((1 << conf->bank_data[num].num_sensors) - 1, + mt->thermal_base + TEMP_MONCTL0); diff --git a/patches.suse/USB-c67x00-fix-use-after-free-in-c67x00_giveback_urb.patch b/patches.suse/USB-c67x00-fix-use-after-free-in-c67x00_giveback_urb.patch new file mode 100644 index 0000000..d6df4be --- /dev/null +++ b/patches.suse/USB-c67x00-fix-use-after-free-in-c67x00_giveback_urb.patch @@ -0,0 +1,60 @@ +From 211f08347355cba1f769bbf3355816a12b3ddd55 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Wed, 8 Jul 2020 06:12:43 -0700 +Subject: [PATCH] USB: c67x00: fix use after free in c67x00_giveback_urb +Git-commit: 211f08347355cba1f769bbf3355816a12b3ddd55 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +clang static analysis flags this error + +c67x00-sched.c:489:55: warning: Use of memory after it is freed [unix.Malloc] + usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status); + ^~~~~~~~~~~~ +Problem happens in this block of code + + c67x00_release_urb(c67x00, urb); + usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb); + spin_unlock(&c67x00->lock); + usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status); + +In the call to c67x00_release_urb has this freeing of urbp + + urbp = urb->hcpriv; + urb->hcpriv = NULL; + list_del(&urbp->hep_node); + kfree(urbp); + +And so urbp is freed before usb_hcd_giveback_urb uses it as its 3rd +parameter. + +Since all is required is the status, pass the status directly as is +done in c64x00_urb_dequeue + +Fixes: e9b29ffc519b ("USB: add Cypress c67x00 OTG controller HCD driver") +Signed-off-by: Tom Rix +Cc: stable +Link: https://lore.kernel.org/r/20200708131243.24336-1-trix@redhat.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/c67x00/c67x00-sched.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c +index 633c52de3bb3..9865750bc31e 100644 +--- a/drivers/usb/c67x00/c67x00-sched.c ++++ b/drivers/usb/c67x00/c67x00-sched.c +@@ -486,7 +486,7 @@ c67x00_giveback_urb(struct c67x00_hcd *c67x00, struct urb *urb, int status) + c67x00_release_urb(c67x00, urb); + usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb); + spin_unlock(&c67x00->lock); +- usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status); ++ usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, status); + spin_lock(&c67x00->lock); + } + +-- +2.16.4 + diff --git a/patches.suse/USB-ehci-reopen-solution-for-Synopsys-HC-bug.patch b/patches.suse/USB-ehci-reopen-solution-for-Synopsys-HC-bug.patch new file mode 100644 index 0000000..e416e14 --- /dev/null +++ b/patches.suse/USB-ehci-reopen-solution-for-Synopsys-HC-bug.patch @@ -0,0 +1,62 @@ +From 1ddcb71a3edf0e1682b6e056158e4c4b00325f66 Mon Sep 17 00:00:00 2001 +From: Longfang Liu +Date: Mon, 8 Jun 2020 11:46:59 +0800 +Subject: [PATCH] USB: ehci: reopen solution for Synopsys HC bug +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: 1ddcb71a3edf0e1682b6e056158e4c4b00325f66 +References: git-fixes +Patch-mainline: v5.8-rc3 + +A Synopsys USB2.0 core used in Huawei Kunpeng920 SoC has a bug which +might cause the host controller not issuing ping. + +Bug description: +After indicating an Interrupt on Async Advance, the software uses the +doorbell mechanism to delete the Next Link queue head of the last +executed queue head. At this time, the host controller still references +the removed queue head(the queue head is NULL). NULL reference causes +the host controller to lose the USB device. + +Solution: +After deleting the Next Link queue head, when has_synopsys_hc_bug set +to 1,the software can write one of the valid queue head addresses to +the ASYNCLISTADDR register to allow the host controller to get +the valid queue head. in order to solve that problem, this patch set +the flag for Huawei Kunpeng920 + +There are detailed instructions and solutions in this patch: +commit 2f7ac6c19997 ("USB: ehci: add workaround for Synopsys HC bug") + +Signed-off-by: Longfang Liu +Cc: stable +Acked-by: Alan Stern +Link: https://lore.kernel.org/r/1591588019-44284-1-git-send-email-liulongfang@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/ehci-pci.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c +index 3c3820ad9092..af3c1b9b38b2 100644 +--- a/drivers/usb/host/ehci-pci.c ++++ b/drivers/usb/host/ehci-pci.c +@@ -216,6 +216,13 @@ static int ehci_pci_setup(struct usb_hcd *hcd) + ehci_info(ehci, "applying MosChip frame-index workaround\n"); + ehci->frame_index_bug = 1; + break; ++ case PCI_VENDOR_ID_HUAWEI: ++ /* Synopsys HC bug */ ++ if (pdev->device == 0xa239) { ++ ehci_info(ehci, "applying Synopsys HC workaround\n"); ++ ehci->has_synopsys_hc_bug = 1; ++ } ++ break; + } + + /* optional debug port, normally in the first BAR */ +-- +2.16.4 + diff --git a/patches.suse/USB-ohci-sm501-Add-missed-iounmap-in-remove.patch b/patches.suse/USB-ohci-sm501-Add-missed-iounmap-in-remove.patch new file mode 100644 index 0000000..771ff19 --- /dev/null +++ b/patches.suse/USB-ohci-sm501-Add-missed-iounmap-in-remove.patch @@ -0,0 +1,34 @@ +From 07c112fb09c86c0231f6ff0061a000ffe91c8eb9 Mon Sep 17 00:00:00 2001 +From: Chuhong Yuan +Date: Wed, 10 Jun 2020 10:48:44 +0800 +Subject: [PATCH] USB: ohci-sm501: Add missed iounmap() in remove +Git-commit: 07c112fb09c86c0231f6ff0061a000ffe91c8eb9 +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +This driver misses calling iounmap() in remove to undo the ioremap() +called in probe. +Add the missed call to fix it. + +Fixes: f54aab6ebcec ("usb: ohci-sm501 driver") +Cc: stable +Signed-off-by: Chuhong Yuan +Acked-by: Alan Stern +Link: https://lore.kernel.org/r/20200610024844.3628408-1-hslester96@gmail.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/host/ohci-sm501.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/host/ohci-sm501.c ++++ b/drivers/usb/host/ohci-sm501.c +@@ -196,6 +196,7 @@ static int ohci_hcd_sm501_drv_remove(str + struct resource *mem; + + usb_remove_hcd(hcd); ++ iounmap(hcd->regs); + release_mem_region(hcd->rsrc_start, hcd->rsrc_len); + usb_put_hcd(hcd); + dma_release_declared_memory(&pdev->dev); diff --git a/patches.suse/USB-serial-iuu_phoenix-fix-memory-corruption.patch b/patches.suse/USB-serial-iuu_phoenix-fix-memory-corruption.patch new file mode 100644 index 0000000..3492f83 --- /dev/null +++ b/patches.suse/USB-serial-iuu_phoenix-fix-memory-corruption.patch @@ -0,0 +1,47 @@ +From e7b931bee739e8a77ae216e613d3b99342b6dec0 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Wed, 15 Jul 2020 11:02:45 +0200 +Subject: [PATCH] USB: serial: iuu_phoenix: fix memory corruption +Git-commit: e7b931bee739e8a77ae216e613d3b99342b6dec0 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +The driver would happily overwrite its write buffer with user data in +256 byte increments due to a removed buffer-space sanity check. + +Fixes: 5fcf62b0f1f2 ("tty: iuu_phoenix: fix locking.") +Cc: stable # 2.6.31 +Signed-off-by: Johan Hovold +Acked-by: Takashi Iwai + +--- + drivers/usb/serial/iuu_phoenix.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c +index d5bff69b1769..b8dfeb4fb2ed 100644 +--- a/drivers/usb/serial/iuu_phoenix.c ++++ b/drivers/usb/serial/iuu_phoenix.c +@@ -697,14 +697,16 @@ static int iuu_uart_write(struct tty_struct *tty, struct usb_serial_port *port, + struct iuu_private *priv = usb_get_serial_port_data(port); + unsigned long flags; + +- if (count > 256) +- return -ENOMEM; +- + spin_lock_irqsave(&priv->lock, flags); + ++ count = min(count, 256 - priv->writelen); ++ if (count == 0) ++ goto out; ++ + /* fill the buffer */ + memcpy(priv->writebuf + priv->writelen, buf, count); + priv->writelen += count; ++out: + spin_unlock_irqrestore(&priv->lock, flags); + + return count; +-- +2.16.4 + diff --git a/patches.suse/ath9k-Fix-general-protection-fault-in-ath9k_hif_usb_.patch b/patches.suse/ath9k-Fix-general-protection-fault-in-ath9k_hif_usb_.patch deleted file mode 100644 index 0b03f93..0000000 --- a/patches.suse/ath9k-Fix-general-protection-fault-in-ath9k_hif_usb_.patch +++ /dev/null @@ -1,221 +0,0 @@ -From 2bbcaaee1fcbd83272e29f31e2bb7e70d8c49e05 Mon Sep 17 00:00:00 2001 -From: Qiujun Huang -Date: Sat, 4 Apr 2020 12:18:38 +0800 -Subject: [PATCH] ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb -Git-commit: 2bbcaaee1fcbd83272e29f31e2bb7e70d8c49e05 -Patch-mainline: v5.8-rc1 -References: bsc#1111666 - -In ath9k_hif_usb_rx_cb interface number is assumed to be 0. -usb_ifnum_to_if(urb->dev, 0) -But it isn't always true. - -The case reported by syzbot: -https://lore.kernel.org/linux-usb/000000000000666c9c05a1c05d12@google.com -usb 2-1: new high-speed USB device number 2 using dummy_hcd -usb 2-1: config 1 has an invalid interface number: 2 but max is 0 -usb 2-1: config 1 has no interface number 0 -usb 2-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= -1.08 -usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 -general protection fault, probably for non-canonical address -0xdffffc0000000015: 0000 [#1] SMP KASAN -Kasan: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af] -Cpu: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0 - -Call Trace -__usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 -usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 -dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 -call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 -expire_timers kernel/time/timer.c:1449 [inline] -__run_timers kernel/time/timer.c:1773 [inline] -__run_timers kernel/time/timer.c:1740 [inline] -run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 -__do_softirq+0x21e/0x950 kernel/softirq.c:292 -invoke_softirq kernel/softirq.c:373 [inline] -irq_exit+0x178/0x1a0 kernel/softirq.c:413 -exiting_irq arch/x86/include/asm/apic.h:546 [inline] -smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146 -apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 - -Reported-and-tested-by: syzbot+40d5d2e8a4680952f042@syzkaller.appspotmail.com -Signed-off-by: Qiujun Huang -Signed-off-by: Kalle Valo -Link: https://lore.kernel.org/r/20200404041838.10426-6-hqjagain@gmail.com -Acked-by: Takashi Iwai - ---- - drivers/net/wireless/ath/ath9k/hif_usb.c | 48 ++++++++++++++++++++++++-------- - drivers/net/wireless/ath/ath9k/hif_usb.h | 5 ++++ - 2 files changed, 42 insertions(+), 11 deletions(-) - -diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c -index 6049d3766c64..4ed21dad6a8e 100644 ---- a/drivers/net/wireless/ath/ath9k/hif_usb.c -+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c -@@ -643,9 +643,9 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, - - static void ath9k_hif_usb_rx_cb(struct urb *urb) - { -- struct sk_buff *skb = (struct sk_buff *) urb->context; -- struct hif_device_usb *hif_dev = -- usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); -+ struct rx_buf *rx_buf = (struct rx_buf *)urb->context; -+ struct hif_device_usb *hif_dev = rx_buf->hif_dev; -+ struct sk_buff *skb = rx_buf->skb; - int ret; - - if (!skb) -@@ -685,14 +685,15 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb) - return; - free: - kfree_skb(skb); -+ kfree(rx_buf); - } - - static void ath9k_hif_usb_reg_in_cb(struct urb *urb) - { -- struct sk_buff *skb = (struct sk_buff *) urb->context; -+ struct rx_buf *rx_buf = (struct rx_buf *)urb->context; -+ struct hif_device_usb *hif_dev = rx_buf->hif_dev; -+ struct sk_buff *skb = rx_buf->skb; - struct sk_buff *nskb; -- struct hif_device_usb *hif_dev = -- usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); - int ret; - - if (!skb) -@@ -750,6 +751,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) - return; - free: - kfree_skb(skb); -+ kfree(rx_buf); - urb->context = NULL; - } - -@@ -795,7 +797,7 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev) - init_usb_anchor(&hif_dev->mgmt_submitted); - - for (i = 0; i < MAX_TX_URB_NUM; i++) { -- tx_buf = kzalloc(sizeof(struct tx_buf), GFP_KERNEL); -+ tx_buf = kzalloc(sizeof(*tx_buf), GFP_KERNEL); - if (!tx_buf) - goto err; - -@@ -832,8 +834,9 @@ static void ath9k_hif_usb_dealloc_rx_urbs(struct hif_device_usb *hif_dev) - - static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) - { -- struct urb *urb = NULL; -+ struct rx_buf *rx_buf = NULL; - struct sk_buff *skb = NULL; -+ struct urb *urb = NULL; - int i, ret; - - init_usb_anchor(&hif_dev->rx_submitted); -@@ -841,6 +844,12 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) - - for (i = 0; i < MAX_RX_URB_NUM; i++) { - -+ rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); -+ if (!rx_buf) { -+ ret = -ENOMEM; -+ goto err_rxb; -+ } -+ - /* Allocate URB */ - urb = usb_alloc_urb(0, GFP_KERNEL); - if (urb == NULL) { -@@ -855,11 +864,14 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) - goto err_skb; - } - -+ rx_buf->hif_dev = hif_dev; -+ rx_buf->skb = skb; -+ - usb_fill_bulk_urb(urb, hif_dev->udev, - usb_rcvbulkpipe(hif_dev->udev, - USB_WLAN_RX_PIPE), - skb->data, MAX_RX_BUF_SIZE, -- ath9k_hif_usb_rx_cb, skb); -+ ath9k_hif_usb_rx_cb, rx_buf); - - /* Anchor URB */ - usb_anchor_urb(urb, &hif_dev->rx_submitted); -@@ -885,6 +897,8 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) - err_skb: - usb_free_urb(urb); - err_urb: -+ kfree(rx_buf); -+err_rxb: - ath9k_hif_usb_dealloc_rx_urbs(hif_dev); - return ret; - } -@@ -896,14 +910,21 @@ static void ath9k_hif_usb_dealloc_reg_in_urbs(struct hif_device_usb *hif_dev) - - static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev) - { -- struct urb *urb = NULL; -+ struct rx_buf *rx_buf = NULL; - struct sk_buff *skb = NULL; -+ struct urb *urb = NULL; - int i, ret; - - init_usb_anchor(&hif_dev->reg_in_submitted); - - for (i = 0; i < MAX_REG_IN_URB_NUM; i++) { - -+ rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); -+ if (!rx_buf) { -+ ret = -ENOMEM; -+ goto err_rxb; -+ } -+ - /* Allocate URB */ - urb = usb_alloc_urb(0, GFP_KERNEL); - if (urb == NULL) { -@@ -918,11 +939,14 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev) - goto err_skb; - } - -+ rx_buf->hif_dev = hif_dev; -+ rx_buf->skb = skb; -+ - usb_fill_int_urb(urb, hif_dev->udev, - usb_rcvintpipe(hif_dev->udev, - USB_REG_IN_PIPE), - skb->data, MAX_REG_IN_BUF_SIZE, -- ath9k_hif_usb_reg_in_cb, skb, 1); -+ ath9k_hif_usb_reg_in_cb, rx_buf, 1); - - /* Anchor URB */ - usb_anchor_urb(urb, &hif_dev->reg_in_submitted); -@@ -948,6 +972,8 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev) - err_skb: - usb_free_urb(urb); - err_urb: -+ kfree(rx_buf); -+err_rxb: - ath9k_hif_usb_dealloc_reg_in_urbs(hif_dev); - return ret; - } -diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h -index a94e7e1c86e9..5985aa15ca93 100644 ---- a/drivers/net/wireless/ath/ath9k/hif_usb.h -+++ b/drivers/net/wireless/ath/ath9k/hif_usb.h -@@ -86,6 +86,11 @@ struct tx_buf { - struct list_head list; - }; - -+struct rx_buf { -+ struct sk_buff *skb; -+ struct hif_device_usb *hif_dev; -+}; -+ - #define HIF_USB_TX_STOP BIT(0) - #define HIF_USB_TX_FLUSH BIT(1) - --- -2.16.4 - diff --git a/patches.suse/ax25-fix-setsockopt-SO_BINDTODEVICE.patch b/patches.suse/ax25-fix-setsockopt-SO_BINDTODEVICE.patch new file mode 100644 index 0000000..ed263a1 --- /dev/null +++ b/patches.suse/ax25-fix-setsockopt-SO_BINDTODEVICE.patch @@ -0,0 +1,70 @@ +From: Eric Dumazet +Date: Tue, 19 May 2020 18:24:43 -0700 +Subject: ax25: fix setsockopt(SO_BINDTODEVICE) +Git-commit: 687775cec056b38a4c8f3291e0dd7a9145f7b667 +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +syzbot was able to trigger this trace [1], probably by using +a zero optlen. + +While we are at it, cap optlen to IFNAMSIZ - 1 instead of IFNAMSIZ. + +[1] +BUG: KMSAN: uninit-value in strnlen+0xf9/0x170 lib/string.c:569 +CPU: 0 PID: 8807 Comm: syz-executor483 Not tainted 5.7.0-rc4-syzkaller #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + __dump_stack lib/dump_stack.c:77 [inline] + dump_stack+0x1c9/0x220 lib/dump_stack.c:118 + kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121 + __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215 + strnlen+0xf9/0x170 lib/string.c:569 + dev_name_hash net/core/dev.c:207 [inline] + netdev_name_node_lookup net/core/dev.c:277 [inline] + __dev_get_by_name+0x75/0x2b0 net/core/dev.c:778 + ax25_setsockopt+0xfa3/0x1170 net/ax25/af_ax25.c:654 + __compat_sys_setsockopt+0x4ed/0x910 net/compat.c:403 + __do_compat_sys_setsockopt net/compat.c:413 [inline] + __se_compat_sys_setsockopt+0xdd/0x100 net/compat.c:410 + __ia32_compat_sys_setsockopt+0x62/0x80 net/compat.c:410 + do_syscall_32_irqs_on arch/x86/entry/common.c:339 [inline] + do_fast_syscall_32+0x3bf/0x6d0 arch/x86/entry/common.c:398 + entry_SYSENTER_compat+0x68/0x77 arch/x86/entry/entry_64_compat.S:139 +RIP: 0023:0xf7f57dd9 +Code: 90 e8 0b 00 00 00 f3 90 0f ae e8 eb f9 8d 74 26 00 89 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 +RSP: 002b:00000000ffae8c1c EFLAGS: 00000217 ORIG_RAX: 000000000000016e +RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000000101 +RDX: 0000000000000019 RSI: 0000000020000000 RDI: 0000000000000004 +RBP: 0000000000000012 R08: 0000000000000000 R09: 0000000000000000 +R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 +R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 + +Local variable ----devname@ax25_setsockopt created at: + ax25_setsockopt+0xe6/0x1170 net/ax25/af_ax25.c:536 + ax25_setsockopt+0xe6/0x1170 net/ax25/af_ax25.c:536 + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Eric Dumazet +Reported-by: syzbot +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/ax25/af_ax25.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/net/ax25/af_ax25.c ++++ b/net/ax25/af_ax25.c +@@ -639,8 +639,10 @@ static int ax25_setsockopt(struct socket + break; + + case SO_BINDTODEVICE: +- if (optlen > IFNAMSIZ) +- optlen = IFNAMSIZ; ++ if (optlen > IFNAMSIZ - 1) ++ optlen = IFNAMSIZ - 1; ++ ++ memset(devname, 0, sizeof(devname)); + + if (copy_from_user(devname, optval, optlen)) { + res = -EFAULT; diff --git a/patches.suse/be2net-fix-link-failure-after-ethtool-offline-test.patch b/patches.suse/be2net-fix-link-failure-after-ethtool-offline-test.patch new file mode 100644 index 0000000..ce5e6a7 --- /dev/null +++ b/patches.suse/be2net-fix-link-failure-after-ethtool-offline-test.patch @@ -0,0 +1,76 @@ +From: Petr Oros +Date: Wed, 19 Jun 2019 14:29:42 +0200 +Subject: be2net: fix link failure after ethtool offline test +Patch-mainline: v5.2-rc7 +Git-commit: 2e5db6eb3c23e5dc8171eb8f6af7a97ef9fcf3a9 +References: git-fixes + +Certain cards in conjunction with certain switches need a little more +time for link setup that results in ethtool link test failure after +offline test. Patch adds a loop that waits for a link setup finish. + +Changes in v2: +- added fixes header + +Fixes: 4276e47e2d1c ("be2net: Add link test to list of ethtool self tests.") +Signed-off-by: Petr Oros +Reviewed-by: Ivan Vecera +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/emulex/benet/be_ethtool.c | 28 +++++++++++++++++++------ + 1 file changed, 22 insertions(+), 6 deletions(-) + +--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c ++++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c +@@ -895,7 +895,7 @@ static void be_self_test(struct net_devi + u64 *data) + { + struct be_adapter *adapter = netdev_priv(netdev); +- int status; ++ int status, cnt; + u8 link_status = 0; + + if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) { +@@ -906,6 +906,9 @@ static void be_self_test(struct net_devi + + memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM); + ++ /* check link status before offline tests */ ++ link_status = netif_carrier_ok(netdev); ++ + if (test->flags & ETH_TEST_FL_OFFLINE) { + if (be_loopback_test(adapter, BE_MAC_LOOPBACK, &data[0]) != 0) + test->flags |= ETH_TEST_FL_FAILED; +@@ -926,13 +929,26 @@ static void be_self_test(struct net_devi + test->flags |= ETH_TEST_FL_FAILED; + } + +- status = be_cmd_link_status_query(adapter, NULL, &link_status, 0); +- if (status) { +- test->flags |= ETH_TEST_FL_FAILED; +- data[4] = -1; +- } else if (!link_status) { ++ /* link status was down prior to test */ ++ if (!link_status) { + test->flags |= ETH_TEST_FL_FAILED; + data[4] = 1; ++ return; ++ } ++ ++ for (cnt = 10; cnt; cnt--) { ++ status = be_cmd_link_status_query(adapter, NULL, &link_status, ++ 0); ++ if (status) { ++ test->flags |= ETH_TEST_FL_FAILED; ++ data[4] = -1; ++ break; ++ } ++ ++ if (link_status) ++ break; ++ ++ msleep_interruptible(500); + } + } + diff --git a/patches.suse/block-nr_sects_write-Disable-preemption-on-seqcount-.patch b/patches.suse/block-nr_sects_write-Disable-preemption-on-seqcount-.patch new file mode 100644 index 0000000..22751da --- /dev/null +++ b/patches.suse/block-nr_sects_write-Disable-preemption-on-seqcount-.patch @@ -0,0 +1,43 @@ +From 15b81ce5abdc4b502aa31dff2d415b79d2349d2f Mon Sep 17 00:00:00 2001 +From: "Ahmed S. Darwish" +Date: Wed, 3 Jun 2020 16:49:48 +0200 +Subject: [PATCH] block: nr_sects_write(): Disable preemption on seqcount write +Git-commit: 15b81ce5abdc4b502aa31dff2d415b79d2349d2f +Patch-mainline: v5.8-rc1 +References: bsc#1173818 + +For optimized block readers not holding a mutex, the "number of sectors" +64-bit value is protected from tearing on 32-bit architectures by a +sequence counter. + +Disable preemption before entering that sequence counter's write side +critical section. Otherwise, the read side can preempt the write side +section and spin for the entire scheduler tick. If the reader belongs to +a real-time scheduling class, it can spin forever and the kernel will +livelock. + +Fixes: c83f6bf98dc1 ("block: add partition resize function to blkpg ioctl") +Cc: +Signed-off-by: Ahmed S. Darwish +Reviewed-by: Sebastian Andrzej Siewior +Signed-off-by: Jens Axboe +Acked-by: Jan Kara + +--- + include/linux/genhd.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/linux/genhd.h ++++ b/include/linux/genhd.h +@@ -701,9 +701,11 @@ static inline sector_t part_nr_sects_rea + static inline void part_nr_sects_write(struct hd_struct *part, sector_t size) + { + #if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP) ++ preempt_disable(); + write_seqcount_begin(&part->nr_sects_seq); + part->nr_sects = size; + write_seqcount_end(&part->nr_sects_seq); ++ preempt_enable(); + #elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT) + preempt_disable(); + part->nr_sects = size; diff --git a/patches.suse/bnxt_en-Fix-AER-reset-logic-on-57500-chips.patch b/patches.suse/bnxt_en-Fix-AER-reset-logic-on-57500-chips.patch new file mode 100644 index 0000000..4df09fb --- /dev/null +++ b/patches.suse/bnxt_en-Fix-AER-reset-logic-on-57500-chips.patch @@ -0,0 +1,46 @@ +From: Michael Chan +Date: Sun, 14 Jun 2020 19:57:09 -0400 +Subject: bnxt_en: Fix AER reset logic on 57500 chips. +Git-commit: 6e2f83884c099de0e87b15a820736e522755d074 +Patch-mainline: 5.8-rc2 +References: git-fixes + +AER reset should follow the same steps as suspend/resume. We need to +free context memory during AER reset and allocate new context memory +during recovery by calling bnxt_hwrm_func_qcaps(). We also need +to call bnxt_reenable_sriov() to restore the VFs. + +[js] the context is different in 4.12 esp. due to aa46dffff. + Also the firmware reset path (bnxt_reenable_sriov) does not exist + yet. + +Fixes: bae361c54fb6 ("bnxt_en: Improve AER slot reset.") +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -10816,6 +10816,9 @@ static pci_ers_result_t bnxt_io_error_de + bnxt_close(netdev); + + pci_disable_device(pdev); ++ bnxt_free_ctx_mem(bp); ++ kfree(bp->ctx); ++ bp->ctx = NULL; + rtnl_unlock(); + + /* Request a slot slot reset. */ +@@ -10849,6 +10852,9 @@ static pci_ers_result_t bnxt_io_slot_res + pci_set_master(pdev); + + err = bnxt_hwrm_func_reset(bp); ++ if (!err) ++ err = bnxt_hwrm_func_qcaps(bp); ++ + if (!err && netif_running(netdev)) + err = bnxt_open(netdev); + diff --git a/patches.suse/bnxt_en-Fix-VF-anti-spoof-filter-setup.patch b/patches.suse/bnxt_en-Fix-VF-anti-spoof-filter-setup.patch new file mode 100644 index 0000000..132c273 --- /dev/null +++ b/patches.suse/bnxt_en-Fix-VF-anti-spoof-filter-setup.patch @@ -0,0 +1,86 @@ +From: Michael Chan +Date: Sun, 26 Apr 2020 16:24:38 -0400 +Subject: bnxt_en: Fix VF anti-spoof filter setup. +Git-commit: c71c4e49afe173823a2a85b0cabc9b3f1176ffa2 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +Fix the logic that sets the enable/disable flag for the source MAC +filter according to firmware spec 1.7.1. + +In the original firmware spec. before 1.7.1, the VF spoof check flags +were not latched after making the HWRM_FUNC_CFG call, so there was a +need to keep the func_flags so that subsequent calls would perserve +the VF spoof check setting. A change was made in the 1.7.1 spec +so that the flags became latched. So we now set or clear the anti- +spoof setting directly without retrieving the old settings in the +stored vf->func_flags which are no longer valid. We also remove the +unneeded vf->func_flags. + +Fixes: 8eb992e876a8 ("bnxt_en: Update firmware interface spec to 1.7.6.2.") +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 - + drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 9 ++------- + 2 files changed, 2 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h +@@ -954,7 +954,6 @@ struct bnxt_vf_info { + #define BNXT_VF_LINK_FORCED 0x4 + #define BNXT_VF_LINK_UP 0x8 + #define BNXT_VF_TRUST 0x10 +- u32 func_flags; /* func cfg flags */ + u32 min_tx_rate; + u32 max_tx_rate; + void *hwrm_cmd_req_addr; +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +@@ -99,11 +99,10 @@ int bnxt_set_vf_spoofchk(struct net_devi + if (old_setting == setting) + return 0; + +- func_flags = vf->func_flags; + if (setting) +- func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE; ++ func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE; + else +- func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE; ++ func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE; + /*TODO: if the driver supports VLAN filter on guest VLAN, + * the spoof check should also include vlan anti-spoofing + */ +@@ -112,7 +111,6 @@ int bnxt_set_vf_spoofchk(struct net_devi + req.flags = cpu_to_le32(func_flags); + rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); + if (!rc) { +- vf->func_flags = func_flags; + if (setting) + vf->flags |= BNXT_VF_SPOOFCHK; + else +@@ -197,7 +195,6 @@ int bnxt_set_vf_mac(struct net_device *d + memcpy(vf->mac_addr, mac, ETH_ALEN); + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1); + req.fid = cpu_to_le16(vf->fw_fid); +- req.flags = cpu_to_le32(vf->func_flags); + req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR); + memcpy(req.dflt_mac_addr, mac, ETH_ALEN); + return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); +@@ -235,7 +232,6 @@ int bnxt_set_vf_vlan(struct net_device * + + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1); + req.fid = cpu_to_le16(vf->fw_fid); +- req.flags = cpu_to_le32(vf->func_flags); + req.dflt_vlan = cpu_to_le16(vlan_tag); + req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_VLAN); + rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); +@@ -274,7 +270,6 @@ int bnxt_set_vf_bw(struct net_device *de + return 0; + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1); + req.fid = cpu_to_le16(vf->fw_fid); +- req.flags = cpu_to_le32(vf->func_flags); + req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_MAX_BW); + req.max_bw = cpu_to_le32(max_tx_rate); + req.enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_MIN_BW); diff --git a/patches.suse/bnxt_en-Fix-VLAN-acceleration-handling-in-bnxt_fix_f.patch b/patches.suse/bnxt_en-Fix-VLAN-acceleration-handling-in-bnxt_fix_f.patch new file mode 100644 index 0000000..c37886f --- /dev/null +++ b/patches.suse/bnxt_en-Fix-VLAN-acceleration-handling-in-bnxt_fix_f.patch @@ -0,0 +1,49 @@ +From: Michael Chan +Date: Sun, 26 Apr 2020 16:24:42 -0400 +Subject: bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features(). +Git-commit: c72cb303aa6c2ae7e4184f0081c6d11bf03fb96b +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +The current logic in bnxt_fix_features() will inadvertently turn on both +CTAG and STAG VLAN offload if the user tries to disable both. Fix it +by checking that the user is trying to enable CTAG or STAG before +enabling both. The logic is supposed to enable or disable both CTAG and +STAG together. + +Fixes: 5a9f6b238e59 ("bnxt_en: Enable and disable RX CTAG and RX STAG VLAN acceleration together.") +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -9028,6 +9028,7 @@ static netdev_features_t bnxt_fix_featur + netdev_features_t features) + { + struct bnxt *bp = netdev_priv(dev); ++ netdev_features_t vlan_features; + + if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp)) + features &= ~NETIF_F_NTUPLE; +@@ -9044,12 +9045,14 @@ static netdev_features_t bnxt_fix_featur + /* Both CTAG and STAG VLAN accelaration on the RX side have to be + * turned on or off together. + */ +- if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) != +- (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) { ++ vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX | ++ NETIF_F_HW_VLAN_STAG_RX); ++ if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX | ++ NETIF_F_HW_VLAN_STAG_RX)) { + if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) + features &= ~(NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_STAG_RX); +- else ++ else if (vlan_features) + features |= NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_STAG_RX; + } diff --git a/patches.suse/bnxt_en-Fix-ethtool-selftest-crash-under-error-condi.patch b/patches.suse/bnxt_en-Fix-ethtool-selftest-crash-under-error-condi.patch new file mode 100644 index 0000000..8078023 --- /dev/null +++ b/patches.suse/bnxt_en-Fix-ethtool-selftest-crash-under-error-condi.patch @@ -0,0 +1,44 @@ +From: Michael Chan +Date: Sat, 29 Jun 2019 11:16:45 -0400 +Subject: bnxt_en: Fix ethtool selftest crash under error conditions. +Patch-mainline: v5.3-rc1 +Git-commit: d27e2ca1166aefd54d9c48fb6647dee8115a5dfc +References: git-fixes + +After ethtool loopback packet tests, we re-open the nic for the next +IRQ test. If the open fails, we must not proceed with the IRQ test +or we will crash with NULL pointer dereference. Fix it by checking +the bnxt_open_nic() return code before proceeding. + +Reported-by: Somasundaram Krishnasamy +Fixes: 67fea463fd87 ("bnxt_en: Add interrupt test to ethtool -t selftest.") +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +@@ -2803,7 +2803,7 @@ static void bnxt_self_test(struct net_de + bool offline = false; + u8 test_results = 0; + u8 test_mask = 0; +- int rc, i; ++ int rc = 0, i; + + if (!bp->num_tests || !BNXT_SINGLE_PF(bp)) + return; +@@ -2874,9 +2874,9 @@ static void bnxt_self_test(struct net_de + } + bnxt_hwrm_phy_loopback(bp, false, false); + bnxt_half_close_nic(bp); +- bnxt_open_nic(bp, false, true); ++ rc = bnxt_open_nic(bp, false, true); + } +- if (bnxt_test_irq(bp)) { ++ if (rc || bnxt_test_irq(bp)) { + buf[BNXT_IRQ_TEST_IDX] = 1; + etest->flags |= ETH_TEST_FL_FAILED; + } diff --git a/patches.suse/bnxt_en-Fix-handling-FRAG_ERR-when-NVM_INSTALL_UPDAT.patch b/patches.suse/bnxt_en-Fix-handling-FRAG_ERR-when-NVM_INSTALL_UPDAT.patch new file mode 100644 index 0000000..923d28d --- /dev/null +++ b/patches.suse/bnxt_en-Fix-handling-FRAG_ERR-when-NVM_INSTALL_UPDAT.patch @@ -0,0 +1,50 @@ +From: Vasundhara Volam +Date: Sat, 17 Aug 2019 17:04:49 -0400 +Subject: bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd fails +Patch-mainline: v5.3-rc6 +Git-commit: dd2ebf3404c7c295014bc025dea23960960ceb1a +References: git-fixes + +If FW returns FRAG_ERR in response error code, driver is resending the +command only when HWRM command returns success. Fix the code to resend +NVM_INSTALL_UPDATE command with DEFRAG install flags, if FW returns +FRAG_ERR in its response error code. + +Fixes: cb4d1d626145 ("bnxt_en: Retry failed NVM_INSTALL_UPDATE with defragmentation flag enabled.") +Signed-off-by: Vasundhara Volam +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +@@ -1977,21 +1977,19 @@ static int bnxt_flash_package_from_file( + mutex_lock(&bp->hwrm_cmd_lock); + hwrm_err = _hwrm_send_message(bp, &install, sizeof(install), + INSTALL_PACKAGE_TIMEOUT); +- if (hwrm_err) +- goto flash_pkg_exit; +- +- if (resp->error_code) { ++ if (hwrm_err) { + u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err; + +- if (error_code == NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) { ++ if (resp->error_code && error_code == ++ NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) { + install.flags |= cpu_to_le16( + NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG); + hwrm_err = _hwrm_send_message(bp, &install, + sizeof(install), + INSTALL_PACKAGE_TIMEOUT); +- if (hwrm_err) +- goto flash_pkg_exit; + } ++ if (hwrm_err) ++ goto flash_pkg_exit; + } + + if (resp->result) { diff --git a/patches.suse/bnxt_en-Fix-ipv6-RFS-filter-matching-logic.patch b/patches.suse/bnxt_en-Fix-ipv6-RFS-filter-matching-logic.patch new file mode 100644 index 0000000..84f12a1 --- /dev/null +++ b/patches.suse/bnxt_en-Fix-ipv6-RFS-filter-matching-logic.patch @@ -0,0 +1,50 @@ +From: Michael Chan +Date: Fri, 17 Jan 2020 00:32:46 -0500 +Subject: bnxt_en: Fix ipv6 RFS filter matching logic. +Patch-mainline: v5.5-rc7 +Git-commit: 6fc7caa84e713f7627e171ab1e7c4b5be0dc9b3d +References: git-fixes + +Fix bnxt_fltr_match() to match ipv6 source and destination addresses. +The function currently only checks ipv4 addresses and will not work +corrently on ipv6 filters. + +Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -9752,11 +9752,23 @@ static bool bnxt_fltr_match(struct bnxt_ + struct flow_keys *keys1 = &f1->fkeys; + struct flow_keys *keys2 = &f2->fkeys; + +- if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src && +- keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst && +- keys1->ports.ports == keys2->ports.ports && +- keys1->basic.ip_proto == keys2->basic.ip_proto && +- keys1->basic.n_proto == keys2->basic.n_proto && ++ if (keys1->basic.n_proto != keys2->basic.n_proto || ++ keys1->basic.ip_proto != keys2->basic.ip_proto) ++ return false; ++ ++ if (keys1->basic.n_proto == htons(ETH_P_IP)) { ++ if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src || ++ keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst) ++ return false; ++ } else { ++ if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src, ++ sizeof(keys1->addrs.v6addrs.src)) || ++ memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst, ++ sizeof(keys1->addrs.v6addrs.dst))) ++ return false; ++ } ++ ++ if (keys1->ports.ports == keys2->ports.ports && + keys1->control.flags == keys2->control.flags && + ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) && + ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr)) diff --git a/patches.suse/bnxt_en-Improve-AER-slot-reset.patch b/patches.suse/bnxt_en-Improve-AER-slot-reset.patch new file mode 100644 index 0000000..028c157 --- /dev/null +++ b/patches.suse/bnxt_en-Improve-AER-slot-reset.patch @@ -0,0 +1,44 @@ +From: Michael Chan +Date: Sun, 26 Apr 2020 16:24:40 -0400 +Subject: bnxt_en: Improve AER slot reset. +Git-commit: bae361c54fb6ac6eba3b4762f49ce14beb73ef13 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +Improve the slot reset sequence by disabling the device to prevent bad +DMAs if slot reset fails. Return the proper result instead of always +PCI_ERS_RESULT_RECOVERED to the caller. + +Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.") +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -10855,8 +10855,11 @@ static pci_ers_result_t bnxt_io_slot_res + } + } + +- if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev)) +- dev_close(netdev); ++ if (result != PCI_ERS_RESULT_RECOVERED) { ++ if (netif_running(netdev)) ++ dev_close(netdev); ++ pci_disable_device(pdev); ++ } + + rtnl_unlock(); + +@@ -10867,7 +10870,7 @@ static pci_ers_result_t bnxt_io_slot_res + err); /* non-fatal, continue */ + } + +- return PCI_ERS_RESULT_RECOVERED; ++ return result; + } + + /** diff --git a/patches.suse/bnxt_en-fix-NULL-dereference-in-case-SR-IOV-configur.patch b/patches.suse/bnxt_en-fix-NULL-dereference-in-case-SR-IOV-configur.patch new file mode 100644 index 0000000..b21b4bd --- /dev/null +++ b/patches.suse/bnxt_en-fix-NULL-dereference-in-case-SR-IOV-configur.patch @@ -0,0 +1,86 @@ +From: Davide Caratti +Date: Fri, 10 Jul 2020 12:55:08 +0200 +Subject: bnxt_en: fix NULL dereference in case SR-IOV configuration fails +Patch-mainline: v5.8-rc5 +Git-commit: c8b1d7436045d3599bae56aef1682813ecccaad7 +References: git-fixes + +we need to set 'active_vfs' back to 0, if something goes wrong during the +allocation of SR-IOV resources: otherwise, further VF configurations will +wrongly assume that bp->pf.vf[x] are valid memory locations, and commands +like the ones in the following sequence: + + # echo 2 >/sys/bus/pci/devices/${ADDR}/sriov_numvfs + # ip link set dev ens1f0np0 up + # ip link set dev ens1f0np0 vf 0 trust on + +will cause a kernel crash similar to this: + + bnxt_en 0000:3b:00.0: not enough MMIO resources for SR-IOV + BUG: kernel NULL pointer dereference, address: 0000000000000014 + #PF: supervisor read access in kernel mode + #PF: error_code(0x0000) - not-present page + PGD 0 P4D 0 + Oops: 0000 [#1] SMP PTI + CPU: 43 PID: 2059 Comm: ip Tainted: G I 5.8.0-rc2.upstream+ #871 + Hardware name: Dell Inc. PowerEdge R740/08D89F, BIOS 2.2.11 06/13/2019 + RIP: 0010:bnxt_set_vf_trust+0x5b/0x110 [bnxt_en] + Code: 44 24 58 31 c0 e8 f5 fb ff ff 85 c0 0f 85 b6 00 00 00 48 8d 1c 5b 41 89 c6 b9 0b 00 00 00 48 c1 e3 04 49 03 9c 24 f0 0e 00 00 <8b> 43 14 89 c2 83 c8 10 83 e2 ef 45 84 ed 49 89 e5 0f 44 c2 4c 89 + RSP: 0018:ffffac6246a1f570 EFLAGS: 00010246 + RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000000b + RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff98b28f538900 + RBP: ffff98b28f538900 R08: 0000000000000000 R09: 0000000000000008 + R10: ffffffffb9515be0 R11: ffffac6246a1f678 R12: ffff98b28f538000 + R13: 0000000000000001 R14: 0000000000000000 R15: ffffffffc05451e0 + FS: 00007fde0f688800(0000) GS:ffff98baffd40000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 0000000000000014 CR3: 000000104bb0a003 CR4: 00000000007606e0 + DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 + DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 + PKRU: 55555554 + Call Trace: + do_setlink+0x994/0xfe0 + __rtnl_newlink+0x544/0x8d0 + rtnl_newlink+0x47/0x70 + rtnetlink_rcv_msg+0x29f/0x350 + netlink_rcv_skb+0x4a/0x110 + netlink_unicast+0x21d/0x300 + netlink_sendmsg+0x329/0x450 + sock_sendmsg+0x5b/0x60 + ____sys_sendmsg+0x204/0x280 + ___sys_sendmsg+0x88/0xd0 + __sys_sendmsg+0x5e/0xa0 + do_syscall_64+0x47/0x80 + entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.") +Reported-by: Fei Liu +CC: Jonathan Toppins +CC: Michael Chan +Signed-off-by: Davide Caratti +Reviewed-by: Michael Chan +Acked-by: Jonathan Toppins +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +@@ -365,6 +365,7 @@ static void bnxt_free_vf_resources(struc + } + } + ++ bp->pf.active_vfs = 0; + kfree(bp->pf.vf); + bp->pf.vf = NULL; + } +@@ -758,7 +759,6 @@ void bnxt_sriov_disable(struct bnxt *bp) + + bnxt_free_vf_resources(bp); + +- bp->pf.active_vfs = 0; + /* Reclaim all resources for the PF. */ + rtnl_lock(); + bnxt_restore_pf_fw_resources(bp); diff --git a/patches.suse/brcmfmac-Transform-compatible-string-for-FW-loading.patch b/patches.suse/brcmfmac-Transform-compatible-string-for-FW-loading.patch new file mode 100644 index 0000000..fff34e2 --- /dev/null +++ b/patches.suse/brcmfmac-Transform-compatible-string-for-FW-loading.patch @@ -0,0 +1,63 @@ +From: Matthias Brugger +Date: Wed, 1 Jul 2020 13:22:00 +0200 +Subject: brcmfmac: Transform compatible string for FW loading +Git-commit: 29e354ebeeecaee979e6fe22cd6272682d7552c9 +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git +References: bsc#1169771 + +The driver relies on the compatible string from DT to determine which +FW configuration file it should load. The DTS spec allows for '/' as +part of the compatible string. We change this to '-' so that we will +still be able to load the config file, even when the compatible has a +'/'. This fixes explicitly the firmware loading for +"solidrun,cubox-i/q". + +Signed-off-by: Matthias Brugger +Reviewed-by: Hans deGoede +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20200701112201.6449-1-matthias.bgg@kernel.org +--- + .../wireless/broadcom/brcm80211/brcmfmac/of.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +index b886b56a5e5a..a7554265f95f 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +@@ -17,7 +17,6 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, + { + struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio; + struct device_node *root, *np = dev->of_node; +- struct property *prop; + int irq; + u32 irqf; + u32 val; +@@ -25,8 +24,22 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, + /* Set board-type to the first string of the machine compatible prop */ + root = of_find_node_by_path("/"); + if (root) { +- prop = of_find_property(root, "compatible", NULL); +- settings->board_type = of_prop_next_string(prop, NULL); ++ int i, len; ++ char *board_type; ++ const char *tmp; ++ ++ of_property_read_string_index(root, "compatible", 0, &tmp); ++ ++ /* get rid of '/' in the compatible string to be able to find the FW */ ++ len = strlen(tmp) + 1; ++ board_type = devm_kzalloc(dev, len, GFP_KERNEL); ++ strscpy(board_type, tmp, len); ++ for (i = 0; i < board_type[i]; i++) { ++ if (board_type[i] == '/') ++ board_type[i] = '-'; ++ } ++ settings->board_type = board_type; ++ + of_node_put(root); + } + +-- +2.27.0 + diff --git a/patches.suse/btrfs-qgroup-Fix-a-bug-that-prevents-qgroup-to-be-re.patch b/patches.suse/btrfs-qgroup-Fix-a-bug-that-prevents-qgroup-to-be-re.patch new file mode 100644 index 0000000..bfd46bc --- /dev/null +++ b/patches.suse/btrfs-qgroup-Fix-a-bug-that-prevents-qgroup-to-be-re.patch @@ -0,0 +1,47 @@ +From 7f4d05cbc68a5003367af16c507d243efc8a3025 Mon Sep 17 00:00:00 2001 +From: Qu Wenruo +Date: Tue, 7 Jul 2020 19:17:16 +0800 +Patch-mainline: Never, upstream fixed would interrupt the out-of-tree qgroup resume workaround +References: bsc#1172247 +Subject: [PATCH] btrfs: qgroup: Fix a bug that prevents qgroup to be + re-enabled after disable + +If qgroup get disabled, then re-enabled, rescan can't be kicked it, as +btrfs_run_qgroups() after btrfs_quota_disable() didn't get executed +proper. + +Fix it by setting qgroup flags before checking quota root in +btrfs_run_qgroups(). + +Signed-off-by: Qu Wenruo +--- + fs/btrfs/qgroup.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c +index deffbeb74a0b..25d438724114 100644 +--- a/fs/btrfs/qgroup.c ++++ b/fs/btrfs/qgroup.c +@@ -2054,9 +2054,6 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans, + int ret = 0; + int start_rescan_worker = 0; + +- if (!quota_root) +- goto out; +- + if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) && + test_bit(BTRFS_FS_QUOTA_ENABLING, &fs_info->flags)) + start_rescan_worker = 1; +@@ -2066,6 +2063,9 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans, + if (test_and_clear_bit(BTRFS_FS_QUOTA_DISABLING, &fs_info->flags)) + clear_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags); + ++ if (!quota_root) ++ goto out; ++ + spin_lock(&fs_info->qgroup_lock); + while (!list_empty(&fs_info->dirty_qgroups)) { + struct btrfs_qgroup *qgroup; +-- +2.27.0 + diff --git a/patches.suse/bus-sunxi-rsb-Return-correct-data-when-mixing-16-bit.patch b/patches.suse/bus-sunxi-rsb-Return-correct-data-when-mixing-16-bit.patch new file mode 100644 index 0000000..52321da --- /dev/null +++ b/patches.suse/bus-sunxi-rsb-Return-correct-data-when-mixing-16-bit.patch @@ -0,0 +1,64 @@ +From a43ab30dcd4a1abcdd0d2461bf1cf7c0817f6cd3 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Fri, 21 Feb 2020 21:27:26 +0100 +Subject: [PATCH] bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads +Git-commit: a43ab30dcd4a1abcdd0d2461bf1cf7c0817f6cd3 +Patch-mainline: v5.6 +References: bsc#1111666 + +When doing a 16-bit read that returns data in the MSB byte, the +RSB_DATA register will keep the MSB byte unchanged when doing +the following 8-bit read. sunxi_rsb_read() will then return +a result that contains high byte from 16-bit read mixed with +the 8-bit result. + +The consequence is that after this happens the PMIC's regmap will +look like this: (0x33 is the high byte from the 16-bit read) + +% cat /sys/kernel/debug/regmap/sunxi-rsb-3a3/registers +00: 33 +01: 33 +02: 33 +03: 33 +04: 33 +05: 33 +06: 33 +07: 33 +08: 33 +09: 33 +0a: 33 +0b: 33 +0c: 33 +0d: 33 +0e: 33 +[snip] + +Fix this by masking the result of the read with the correct mask +based on the size of the read. There are no 16-bit users in the +mainline kernel, so this doesn't need to get into the stable tree. + +Signed-off-by: Ondrej Jirman +Acked-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard +Acked-by: Takashi Iwai + +--- + drivers/bus/sunxi-rsb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c +index be79d6c6a4e4..1bb00a959c67 100644 +--- a/drivers/bus/sunxi-rsb.c ++++ b/drivers/bus/sunxi-rsb.c +@@ -345,7 +345,7 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr, + if (ret) + goto unlock; + +- *buf = readl(rsb->regs + RSB_DATA); ++ *buf = readl(rsb->regs + RSB_DATA) & GENMASK(len * 8 - 1, 0); + + unlock: + mutex_unlock(&rsb->lock); +-- +2.16.4 + diff --git a/patches.suse/cgroup-blkcg-Prepare-some-symbols-for-module-and-CON.patch b/patches.suse/cgroup-blkcg-Prepare-some-symbols-for-module-and-CON.patch new file mode 100644 index 0000000..43a5d71 --- /dev/null +++ b/patches.suse/cgroup-blkcg-Prepare-some-symbols-for-module-and-CON.patch @@ -0,0 +1,80 @@ +From 9b0eb69b75bccada2d341d7e7ca342f0cb1c9a6a Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Thu, 27 Jun 2019 13:39:48 -0700 +Subject: [PATCH] cgroup, blkcg: Prepare some symbols for module and + !CONFIG_CGROUP usages +Git-commit: 9b0eb69b75bccada2d341d7e7ca342f0cb1c9a6a +Patch-mainline: v5.3-rc1 +References: bsc#1173857 + +btrfs is going to use css_put() and wbc helpers to improve cgroup +writeback support. Add dummy css_get() definition and export wbc +helpers to prepare for module and !CONFIG_CGROUP builds. + +Reported-by: kbuild test robot +Reviewed-by: Jan Kara +Signed-off-by: Tejun Heo +Signed-off-by: Jens Axboe +Acked-by: Jan Kara + +--- + block/blk-cgroup.c | 1 + + fs/fs-writeback.c | 3 +++ + include/linux/cgroup.h | 1 + + 3 files changed, 5 insertions(+) + +diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c +index 8afa52b0d148..ad7a91dec934 100644 +--- a/block/blk-cgroup.c ++++ b/block/blk-cgroup.c +@@ -48,6 +48,7 @@ struct blkcg blkcg_root; + EXPORT_SYMBOL_GPL(blkcg_root); + + struct cgroup_subsys_state * const blkcg_root_css = &blkcg_root.css; ++EXPORT_SYMBOL_GPL(blkcg_root_css); + + static struct blkcg_policy *blkcg_policy[BLKCG_MAX_POLS]; + +diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c +index 9ebfb1b28430..a8a40bc26c2f 100644 +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -270,6 +270,7 @@ void __inode_attach_wb(struct inode *inode, struct page *page) + if (unlikely(cmpxchg(&inode->i_wb, NULL, wb))) + wb_put(wb); + } ++EXPORT_SYMBOL_GPL(__inode_attach_wb); + + /** + * locked_inode_to_wb_and_lock_list - determine a locked inode's wb and lock it +@@ -582,6 +583,7 @@ void wbc_attach_and_unlock_inode(struct writeback_control *wbc, + if (unlikely(wb_dying(wbc->wb))) + inode_switch_wbs(inode, wbc->wb_id); + } ++EXPORT_SYMBOL_GPL(wbc_attach_and_unlock_inode); + + /** + * wbc_detach_inode - disassociate wbc from inode and perform foreign detection +@@ -701,6 +703,7 @@ void wbc_detach_inode(struct writeback_control *wbc) + wb_put(wbc->wb); + wbc->wb = NULL; + } ++EXPORT_SYMBOL_GPL(wbc_detach_inode); + + /** + * wbc_account_io - account IO issued during writeback +diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h +index 3745ecdad925..852d885df10a 100644 +--- a/include/linux/cgroup.h ++++ b/include/linux/cgroup.h +@@ -699,6 +699,7 @@ void cgroup_path_from_kernfs_id(const union kernfs_node_id *id, + struct cgroup_subsys_state; + struct cgroup; + ++static inline void css_get(struct cgroup_subsys_state *css) {} + static inline void css_put(struct cgroup_subsys_state *css) {} + static inline int cgroup_attach_task_all(struct task_struct *from, + struct task_struct *t) { return 0; } +-- +2.16.4 + diff --git a/patches.suse/cgroup-writeback-don-t-switch-wbs-immediately-on-dea.patch b/patches.suse/cgroup-writeback-don-t-switch-wbs-immediately-on-dea.patch index 4547f5a..9db9ed3 100644 --- a/patches.suse/cgroup-writeback-don-t-switch-wbs-immediately-on-dea.patch +++ b/patches.suse/cgroup-writeback-don-t-switch-wbs-immediately-on-dea.patch @@ -43,7 +43,7 @@ Acked-by: Jan Kara --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c -@@ -552,10 +552,13 @@ void wbc_attach_and_unlock_inode(struct +@@ -553,10 +553,13 @@ void wbc_attach_and_unlock_inode(struct spin_unlock(&inode->i_lock); /* @@ -59,4 +59,4 @@ Acked-by: Jan Kara + if (unlikely(wb_dying(wbc->wb) && !css_is_dying(wbc->wb->memcg_css))) inode_switch_wbs(inode, wbc->wb_id); } - + EXPORT_SYMBOL_GPL(wbc_attach_and_unlock_inode); diff --git a/patches.suse/debugfs-Check-module-state-before-warning-in-full-op.patch b/patches.suse/debugfs-Check-module-state-before-warning-in-full-op.patch new file mode 100644 index 0000000..1ef903e --- /dev/null +++ b/patches.suse/debugfs-Check-module-state-before-warning-in-full-op.patch @@ -0,0 +1,111 @@ +From: Taehee Yoo +Date: Tue, 18 Feb 2020 04:31:50 +0000 +Subject: debugfs: Check module state before warning in + {full/open}_proxy_open() +Patch-mainline: v5.7-rc1 +Git-commit: 275678e7a9be6a0ea9c1bb493e48abf2f4a01be5 +References: bsc#1173746 + +When the module is being removed, the module state is set to +MODULE_STATE_GOING. At this point, try_module_get() fails. +And when {full/open}_proxy_open() is being called, +it calls try_module_get() to try to hold module reference count. +If it fails, it warns about the possibility of debugfs file leak. + +If {full/open}_proxy_open() is called while the module is being removed, +it fails to hold the module. +So, It warns about debugfs file leak. But it is not the debugfs file +leak case. So, this patch just adds module state checking routine +in the {full/open}_proxy_open(). + +Test commands: + #SHELL1 + while : + do + modprobe netdevsim + echo 1 > /sys/bus/netdevsim/new_device + modprobe -rv netdevsim + done + + #SHELL2 + while : + do + cat /sys/kernel/debug/netdevsim/netdevsim1/ports/0/ipsec + done + +Splat looks like: +[ 298.766738][T14664] debugfs file owner did not clean up at exit: ipsec +[ 298.766766][T14664] WARNING: CPU: 2 PID: 14664 at fs/debugfs/file.c:312 full_proxy_open+0x10f/0x650 +[ 298.768595][T14664] Modules linked in: netdevsim(-) openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 n][ 298.771343][T14664] CPU: 2 PID: 14664 Comm: cat Tainted: G W 5.5.0+ #1 +[ 298.772373][T14664] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 +[ 298.773545][T14664] RIP: 0010:full_proxy_open+0x10f/0x650 +[ 298.774247][T14664] Code: 48 c1 ea 03 80 3c 02 00 0f 85 c1 04 00 00 49 8b 3c 24 e8 e4 b5 78 ff 84 c0 75 2d 4c 89 ee 48 +[ 298.776782][T14664] RSP: 0018:ffff88805b7df9b8 EFLAGS: 00010282[ 298.777583][T14664] RAX: dffffc0000000008 RBX: ffff8880511725c0 RCX: 0000000000000000 +[ 298.778610][T14664] RDX: 0000000000000000 RSI: 0000000000000006 RDI: ffff8880540c5c14 +[ 298.779637][T14664] RBP: 0000000000000000 R08: fffffbfff15235ad R09: 0000000000000000 +[ 298.780664][T14664] R10: 0000000000000001 R11: 0000000000000000 R12: ffffffffc06b5000 +[ 298.781702][T14664] R13: ffff88804c234a88 R14: ffff88804c22dd00 R15: ffffffff8a1b5660 +[ 298.782722][T14664] FS: 00007fafa13a8540(0000) GS:ffff88806c800000(0000) knlGS:0000000000000000 +[ 298.783845][T14664] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 298.784672][T14664] CR2: 00007fafa0e9cd10 CR3: 000000004b286005 CR4: 00000000000606e0 +[ 298.785739][T14664] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +[ 298.786769][T14664] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +[ 298.787785][T14664] Call Trace: +[ 298.788237][T14664] do_dentry_open+0x63c/0xf50 +[ 298.788872][T14664] ? open_proxy_open+0x270/0x270 +[ 298.789524][T14664] ? __x64_sys_fchdir+0x180/0x180 +[ 298.790169][T14664] ? inode_permission+0x65/0x390 +[ 298.790832][T14664] path_openat+0xc45/0x2680 +[ 298.791425][T14664] ? save_stack+0x69/0x80 +[ 298.791988][T14664] ? save_stack+0x19/0x80 +[ 298.792544][T14664] ? path_mountpoint+0x2e0/0x2e0 +[ 298.793233][T14664] ? check_chain_key+0x236/0x5d0 +[ 298.793910][T14664] ? sched_clock_cpu+0x18/0x170 +[ 298.794527][T14664] ? find_held_lock+0x39/0x1d0 +[ 298.795153][T14664] do_filp_open+0x16a/0x260 +[ ... ] + +Fixes: 9fd4dcece43a ("debugfs: prevent access to possibly dead file_operations at file open") +Reported-by: kbuild test robot +Signed-off-by: Taehee Yoo +Link: https://lore.kernel.org/r/20200218043150.29447-1-ap420073@gmail.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Thomas Bogendoerfer +--- + fs/debugfs/file.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +--- a/fs/debugfs/file.c ++++ b/fs/debugfs/file.c +@@ -151,8 +151,13 @@ static int open_proxy_open(struct inode + return r == -EIO ? -ENOENT : r; + + real_fops = debugfs_real_fops(filp); +- real_fops = fops_get(real_fops); +- if (!real_fops) { ++ if (!fops_get(real_fops)) { ++#ifdef MODULE ++ if (real_fops->owner && ++ real_fops->owner->state == MODULE_STATE_GOING) ++ goto out; ++#endif ++ + /* Huh? Module did not clean up after itself at exit? */ + WARN(1, "debugfs file owner did not clean up at exit: %pd", + dentry); +@@ -276,8 +281,13 @@ static int full_proxy_open(struct inode + return r == -EIO ? -ENOENT : r; + + real_fops = debugfs_real_fops(filp); +- real_fops = fops_get(real_fops); +- if (!real_fops) { ++ if (!fops_get(real_fops)) { ++#ifdef MODULE ++ if (real_fops->owner && ++ real_fops->owner->state == MODULE_STATE_GOING) ++ goto out; ++#endif ++ + /* Huh? Module did not cleanup after itself at exit? */ + WARN(1, "debugfs file owner did not clean up at exit: %pd", + dentry); diff --git a/patches.suse/dpaa_eth-fix-usage-as-DSA-master-try-3.patch b/patches.suse/dpaa_eth-fix-usage-as-DSA-master-try-3.patch new file mode 100644 index 0000000..e2d5964 --- /dev/null +++ b/patches.suse/dpaa_eth-fix-usage-as-DSA-master-try-3.patch @@ -0,0 +1,71 @@ +From: Vladimir Oltean +Date: Mon, 25 May 2020 00:22:51 +0300 +Subject: dpaa_eth: fix usage as DSA master, try 3 +Git-commit: 5d14c304bfc14b4fd052dc83d5224376b48f52f0 +Patch-mainline: 5.7 +References: networking-stable-20_05_27 + +The dpaa-eth driver probes on compatible string for the MAC node, and +the fman/mac.c driver allocates a dpaa-ethernet platform device that +triggers the probing of the dpaa-eth net device driver. + +All of this is fine, but the problem is that the struct device of the +dpaa_eth net_device is 2 parents away from the MAC which can be +referenced via of_node. So of_find_net_device_by_node can't find it, and +DSA switches won't be able to probe on top of FMan ports. + +It would be a bit silly to modify a core function +(of_find_net_device_by_node) to look for dev->parent->parent->of_node +just for one driver. We're just 1 step away from implementing full +recursion. + +Actually there have already been at least 2 previous attempts to make +this work: +- Commit a1a50c8e4c24 ("fsl/man: Inherit parent device and of_node") +- One or more of the patches in "[v3,0/6] adapt DPAA drivers for DSA": + https://patchwork.ozlabs.org/project/netdev/cover/1508178970-28945-1-git-send-email-madalin.bucur@nxp.com/ + (I couldn't really figure out which one was supposed to solve the + problem and how). + +Point being, it looks like this is still pretty much a problem today. +On T1040, the /sys/class/net/eth0 symlink currently points to + +../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/net/eth0 + +which pretty much illustrates the problem. The closest of_node we've got +is the "fsl,fman-memac" at /soc@ffe000000/fman@400000/ethernet@e6000, +which is what we'd like to be able to reference from DSA as host port. + +For of_find_net_device_by_node to find the eth0 port, we would need the +parent of the eth0 net_device to not be the "dpaa-ethernet" platform +device, but to point 1 level higher, aka the "fsl,fman-memac" node +directly. The new sysfs path would look like this: + +../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0 + +And this is exactly what SET_NETDEV_DEV does. It sets the parent of the +net_device. The new parent has an of_node associated with it, and +of_dev_node_match already checks for the of_node of the device or of its +parent. + +Fixes: a1a50c8e4c24 ("fsl/man: Inherit parent device and of_node") +Fixes: c6e26ea8c893 ("dpaa_eth: change device used") +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c ++++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +@@ -2783,7 +2783,7 @@ static int dpaa_eth_probe(struct platfor + } + + /* Do this here, so we can be verbose early */ +- SET_NETDEV_DEV(net_dev, dev); ++ SET_NETDEV_DEV(net_dev, dev->parent); + dev_set_drvdata(dev, net_dev); + + priv = netdev_priv(net_dev); diff --git a/patches.suse/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch b/patches.suse/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch new file mode 100644 index 0000000..a40e798 --- /dev/null +++ b/patches.suse/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch @@ -0,0 +1,36 @@ +From aa472721c8dbe1713cf510f56ffbc56ae9e14247 Mon Sep 17 00:00:00 2001 +From: Chen Tao +Date: Mon, 8 Jun 2020 09:48:59 +0800 +Subject: [PATCH] drm/msm/dpu: fix error return code in dpu_encoder_init +Git-commit: aa472721c8dbe1713cf510f56ffbc56ae9e14247 +Patch-mainline: v5.8-rc4 +References: bsc#1111666 + +Fix to return negative error code -ENOMEM with the use of +ERR_PTR from dpu_encoder_init. + +Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") +Signed-off-by: Chen Tao +Signed-off-by: Rob Clark +Acked-by: Takashi Iwai + +--- + drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +index 9f8de773ed59..30254741e6ef 100644 +--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c ++++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +@@ -2187,7 +2187,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, + + dpu_enc = devm_kzalloc(dev->dev, sizeof(*dpu_enc), GFP_KERNEL); + if (!dpu_enc) +- return ERR_PTR(ENOMEM); ++ return ERR_PTR(-ENOMEM); + + rc = drm_encoder_init(dev, &dpu_enc->base, &dpu_encoder_funcs, + drm_enc_mode, NULL); +-- +2.16.4 + diff --git a/patches.suse/drm-panel-orientation-quirks-Add-quirk-for-Asus-T101.patch b/patches.suse/drm-panel-orientation-quirks-Add-quirk-for-Asus-T101.patch new file mode 100644 index 0000000..d7a977d --- /dev/null +++ b/patches.suse/drm-panel-orientation-quirks-Add-quirk-for-Asus-T101.patch @@ -0,0 +1,41 @@ +From 6c22bc18a3b93a38018844636557ad02e588e055 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 31 May 2020 11:30:24 +0200 +Subject: [PATCH] drm: panel-orientation-quirks: Add quirk for Asus T101HA panel +Git-commit: 6c22bc18a3b93a38018844636557ad02e588e055 +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +Like the Asus T100HA the Asus T101HA also uses a panel which has been +mounted 90 degrees rotated, albeit in the opposite direction. +Add a quirk for this. + +Reviewed-by: Emil Velikov +Signed-off-by: Hans de Goede +Link: https://patchwork.freedesktop.org/patch/msgid/20200531093025.28050-1-hdegoede@redhat.com +Acked-by: Takashi Iwai + +--- + drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c +index ffd95bfeaa94..d11d83703931 100644 +--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c ++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c +@@ -121,6 +121,12 @@ static const struct dmi_system_id orientation_data[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100HAN"), + }, + .driver_data = (void *)&asus_t100ha, ++ }, { /* Asus T101HA */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T101HA"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, + }, { /* GPD MicroPC (generic strings, also match on bios date) */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), +-- +2.16.4 + diff --git a/patches.suse/drm-panel-orientation-quirks-Use-generic-orientation.patch b/patches.suse/drm-panel-orientation-quirks-Use-generic-orientation.patch new file mode 100644 index 0000000..576e958 --- /dev/null +++ b/patches.suse/drm-panel-orientation-quirks-Use-generic-orientation.patch @@ -0,0 +1,52 @@ +From a05caf9e62a85d12da27e814ac13195f4683f21c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 31 May 2020 11:30:25 +0200 +Subject: [PATCH] drm: panel-orientation-quirks: Use generic orientation-data for Acer S1003 +Git-commit: a05caf9e62a85d12da27e814ac13195f4683f21c +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +The Acer S1003 has proper DMI strings for sys-vendor and product-name, +so we do not need to match by BIOS-date. + +This means that the Acer S1003 can use the generic lcd800x1280_rightside_up +drm_dmi_panel_orientation_data struct which is also used by other quirks. + +Reviewed-by: Emil Velikov +Signed-off-by: Hans de Goede +Link: https://patchwork.freedesktop.org/patch/msgid/20200531093025.28050-2-hdegoede@redhat.com +Acked-by: Takashi Iwai + +--- + drivers/gpu/drm/drm_panel_orientation_quirks.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c +index d11d83703931..d00ea384dcbf 100644 +--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c ++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c +@@ -30,12 +30,6 @@ struct drm_dmi_panel_orientation_data { + int orientation; + }; + +-static const struct drm_dmi_panel_orientation_data acer_s1003 = { +- .width = 800, +- .height = 1280, +- .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, +-}; +- + static const struct drm_dmi_panel_orientation_data asus_t100ha = { + .width = 800, + .height = 1280, +@@ -114,7 +108,7 @@ static const struct dmi_system_id orientation_data[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "One S1003"), + }, +- .driver_data = (void *)&acer_s1003, ++ .driver_data = (void *)&lcd800x1280_rightside_up, + }, { /* Asus T100HA */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), +-- +2.16.4 + diff --git a/patches.suse/drm-tegra-hub-Do-not-enable-orphaned-window-group.patch b/patches.suse/drm-tegra-hub-Do-not-enable-orphaned-window-group.patch new file mode 100644 index 0000000..6825d30 --- /dev/null +++ b/patches.suse/drm-tegra-hub-Do-not-enable-orphaned-window-group.patch @@ -0,0 +1,52 @@ +From ef4e417eb3ec7fe657928f10ac1d2154d8a5fb38 Mon Sep 17 00:00:00 2001 +From: Nicolin Chen +Date: Tue, 19 May 2020 02:03:01 -0700 +Subject: [PATCH] drm/tegra: hub: Do not enable orphaned window group +Git-commit: ef4e417eb3ec7fe657928f10ac1d2154d8a5fb38 +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +Though the unconditional enable/disable code is not a final solution, +we don't want to run into a NULL pointer situation when window group +doesn't link to its DC parent if the DC is disabled in Device Tree. + +So this patch simply adds a check to make sure that window group has +a valid parent before running into tegra_windowgroup_enable/disable. + +Signed-off-by: Nicolin Chen +Signed-off-by: Thierry Reding +Acked-by: Takashi Iwai + +--- + drivers/gpu/drm/tegra/hub.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c +index 8183e617bf6b..a2ef8f218d4e 100644 +--- a/drivers/gpu/drm/tegra/hub.c ++++ b/drivers/gpu/drm/tegra/hub.c +@@ -149,7 +149,9 @@ int tegra_display_hub_prepare(struct tegra_display_hub *hub) + for (i = 0; i < hub->soc->num_wgrps; i++) { + struct tegra_windowgroup *wgrp = &hub->wgrps[i]; + +- tegra_windowgroup_enable(wgrp); ++ /* Skip orphaned window group whose parent DC is disabled */ ++ if (wgrp->parent) ++ tegra_windowgroup_enable(wgrp); + } + + return 0; +@@ -166,7 +168,9 @@ void tegra_display_hub_cleanup(struct tegra_display_hub *hub) + for (i = 0; i < hub->soc->num_wgrps; i++) { + struct tegra_windowgroup *wgrp = &hub->wgrps[i]; + +- tegra_windowgroup_disable(wgrp); ++ /* Skip orphaned window group whose parent DC is disabled */ ++ if (wgrp->parent) ++ tegra_windowgroup_disable(wgrp); + } + } + +-- +2.16.4 + diff --git a/patches.suse/efi-Restrict-efivar_ssdt_load-when-the-kernel-is-loc.patch b/patches.suse/efi-Restrict-efivar_ssdt_load-when-the-kernel-is-loc.patch new file mode 100644 index 0000000..d75bc77 --- /dev/null +++ b/patches.suse/efi-Restrict-efivar_ssdt_load-when-the-kernel-is-loc.patch @@ -0,0 +1,39 @@ +From 1957a85b0032a81e6482ca4aab883643b8dae06e Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Mon, 19 Aug 2019 17:18:04 -0700 +Subject: [PATCH] efi: Restrict efivar_ssdt_load when the kernel is locked down +Git-commit: 1957a85b0032a81e6482ca4aab883643b8dae06e +Patch-mainline: v5.4-rc1 +References: CVE-2019-20908 bsc#1173567 + +efivar_ssdt_load allows the kernel to import arbitrary ACPI code from an +EFI variable, which gives arbitrary code execution in ring 0. Prevent +that when the kernel is locked down. + +Joey Lee: +Modified patch, using kernel_is_locked_down() instead of +security_locked_down() for old SLE kernel. + +Signed-off-by: Matthew Garrett +Acked-by: Ard Biesheuvel +Reviewed-by: Kees Cook +Cc: Ard Biesheuvel +Cc: linux-efi@vger.kernel.org +Signed-off-by: James Morris +Acked-by: Lee, Chun-Yi +--- + drivers/firmware/efi/efi.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/firmware/efi/efi.c ++++ b/drivers/firmware/efi/efi.c +@@ -227,6 +227,9 @@ static void generic_ops_unregister(void) + static char efivar_ssdt[EFIVAR_SSDT_NAME_MAX] __initdata; + static int __init efivar_ssdt_setup(char *str) + { ++ if (kernel_is_locked_down()) ++ return -EPERM; ++ + if (strlen(str) < sizeof(efivar_ssdt)) + memcpy(efivar_ssdt, str, strlen(str)); + else diff --git a/patches.suse/ext4-fix-a-data-race-at-inode-i_blocks.patch b/patches.suse/ext4-fix-a-data-race-at-inode-i_blocks.patch new file mode 100644 index 0000000..b0792a8 --- /dev/null +++ b/patches.suse/ext4-fix-a-data-race-at-inode-i_blocks.patch @@ -0,0 +1,94 @@ +From 28936b62e71e41600bab319f262ea9f9b1027629 Mon Sep 17 00:00:00 2001 +From: Qian Cai +Date: Fri, 21 Feb 2020 23:32:58 -0500 +Subject: [PATCH] ext4: fix a data race at inode->i_blocks +Git-commit: 28936b62e71e41600bab319f262ea9f9b1027629 +Patch-mainline: v5.7-rc1 +References: bsc#1171835 + +inode->i_blocks could be accessed concurrently as noticed by KCSAN, + + BUG: KCSAN: data-race in ext4_do_update_inode [ext4] / inode_add_bytes + + write to 0xffff9a00d4b982d0 of 8 bytes by task 22100 on cpu 118: + inode_add_bytes+0x65/0xf0 + __inode_add_bytes at fs/stat.c:689 + (inlined by) inode_add_bytes at fs/stat.c:702 + ext4_mb_new_blocks+0x418/0xca0 [ext4] + ext4_ext_map_blocks+0x1a6b/0x27b0 [ext4] + ext4_map_blocks+0x1a9/0x950 [ext4] + _ext4_get_block+0xfc/0x270 [ext4] + ext4_get_block_unwritten+0x33/0x50 [ext4] + __block_write_begin_int+0x22e/0xae0 + __block_write_begin+0x39/0x50 + ext4_write_begin+0x388/0xb50 [ext4] + ext4_da_write_begin+0x35f/0x8f0 [ext4] + generic_perform_write+0x15d/0x290 + ext4_buffered_write_iter+0x11f/0x210 [ext4] + ext4_file_write_iter+0xce/0x9e0 [ext4] + new_sync_write+0x29c/0x3b0 + __vfs_write+0x92/0xa0 + vfs_write+0x103/0x260 + ksys_write+0x9d/0x130 + __x64_sys_write+0x4c/0x60 + do_syscall_64+0x91/0xb05 + entry_SYSCALL_64_after_hwframe+0x49/0xbe + + read to 0xffff9a00d4b982d0 of 8 bytes by task 8 on cpu 65: + ext4_do_update_inode+0x4a0/0xf60 [ext4] + ext4_inode_blocks_set at fs/ext4/inode.c:4815 + ext4_mark_iloc_dirty+0xaf/0x160 [ext4] + ext4_mark_inode_dirty+0x129/0x3e0 [ext4] + ext4_convert_unwritten_extents+0x253/0x2d0 [ext4] + ext4_convert_unwritten_io_end_vec+0xc5/0x150 [ext4] + ext4_end_io_rsv_work+0x22c/0x350 [ext4] + process_one_work+0x54f/0xb90 + worker_thread+0x80/0x5f0 + kthread+0x1cd/0x1f0 + ret_from_fork+0x27/0x50 + + 4 locks held by kworker/u256:0/8: + #0: ffff9a025abc4328 ((wq_completion)ext4-rsv-conversion){+.+.}, at: process_one_work+0x443/0xb90 + #1: ffffab5a862dbe20 ((work_completion)(&ei->i_rsv_conversion_work)){+.+.}, at: process_one_work+0x443/0xb90 + #2: ffff9a025a9d0f58 (jbd2_handle){++++}, at: start_this_handle+0x1c1/0x9d0 [jbd2] + #3: ffff9a00d4b985d8 (&(&ei->i_raw_lock)->rlock){+.+.}, at: ext4_do_update_inode+0xaa/0xf60 [ext4] + irq event stamp: 3009267 + hardirqs last enabled at (3009267): [] __find_get_block+0x107/0x790 + hardirqs last disabled at (3009266): [] __find_get_block+0x49/0x790 + softirqs last enabled at (3009230): [] __do_softirq+0x34c/0x57c + softirqs last disabled at (3009223): [] irq_exit+0xa2/0xc0 + + Reported by Kernel Concurrency Sanitizer on: + CPU: 65 PID: 8 Comm: kworker/u256:0 Tainted: G L 5.6.0-rc2-next-20200221+ #7 + Hardware name: HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40 07/10/2019 + Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work [ext4] + +The plain read is outside of inode->i_lock critical section which +results in a data race. Fix it by adding READ_ONCE() there. + +Link: https://lore.kernel.org/r/20200222043258.2279-1-cai@lca.pw +Signed-off-by: Qian Cai +Signed-off-by: Theodore Ts'o +Cc: stable@kernel.org +Acked-by: Jan Kara + +--- + fs/ext4/inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c +index 416aec6d6c65..fa70ae21d032 100644 +--- a/fs/ext4/inode.c ++++ b/fs/ext4/inode.c +@@ -4810,7 +4810,7 @@ static int ext4_inode_blocks_set(handle_t *handle, + struct ext4_inode_info *ei) + { + struct inode *inode = &(ei->vfs_inode); +- u64 i_blocks = inode->i_blocks; ++ u64 i_blocks = READ_ONCE(inode->i_blocks); + struct super_block *sb = inode->i_sb; + + if (i_blocks <= ~0U) { +-- +2.16.4 + diff --git a/patches.suse/ext4-fix-partial-cluster-initialization-when-splitti.patch b/patches.suse/ext4-fix-partial-cluster-initialization-when-splitti.patch new file mode 100644 index 0000000..5b69e7c --- /dev/null +++ b/patches.suse/ext4-fix-partial-cluster-initialization-when-splitti.patch @@ -0,0 +1,118 @@ +From cfb3c85a600c6aa25a2581b3c1c4db3460f14e46 Mon Sep 17 00:00:00 2001 +From: Jeffle Xu +Date: Fri, 22 May 2020 12:18:44 +0800 +Subject: [PATCH] ext4: fix partial cluster initialization when splitting + extent +Git-commit: cfb3c85a600c6aa25a2581b3c1c4db3460f14e46 +Patch-mainline: v5.8-rc2 +References: bsc#1173839 + +Fix the bug when calculating the physical block number of the first +block in the split extent. + +This bug will cause xfstests shared/298 failure on ext4 with bigalloc +enabled occasionally. Ext4 error messages indicate that previously freed +blocks are being freed again, and the following fsck will fail due to +the inconsistency of block bitmap and bg descriptor. + +The following is an example case: + +1. First, Initialize a ext4 filesystem with cluster size '16K', block size +'4K', in which case, one cluster contains four blocks. + +2. Create one file (e.g., xxx.img) on this ext4 filesystem. Now the extent +tree of this file is like: + +... +36864:[0]4:220160 +36868:[0]14332:145408 +51200:[0]2:231424 +... + +3. Then execute PUNCH_HOLE fallocate on this file. The hole range is +Like: + +.. +Ext4_ext_remove_space: dev 254,16 ino 12 since 49506 end 49506 depth 1 +Ext4_ext_remove_space: dev 254,16 ino 12 since 49544 end 49546 depth 1 +Ext4_ext_remove_space: dev 254,16 ino 12 since 49605 end 49607 depth 1 +... + +4. Then the extent tree of this file after punching is like + +... +49507:[0]37:158047 +49547:[0]58:158087 +... + +5. Detailed procedure of punching hole [49544, 49546] + +5.1. The block address space: +``` +lblk ~49505 49506 49507~49543 49544~49546 49547~ + ---------+------+-------------+----------------+-------- + extent | hole | extent | hole | extent + ---------+------+-------------+----------------+-------- +pblk ~158045 158046 158047~158083 158084~158086 158087~ +``` + +5.2. The detailed layout of cluster 39521: +``` + cluster 39521 + <-------------------------------> + + hole extent + <----------------------><-------- + +lblk 49544 49545 49546 49547 + +-------+-------+-------+-------+ + | | | | | + +-------+-------+-------+-------+ +pblk 158084 1580845 158086 158087 +``` + +5.3. The ftrace output when punching hole [49544, 49546]: +- ext4_ext_remove_space (start 49544, end 49546) + - ext4_ext_rm_leaf (start 49544, end 49546, last_extent [49507(158047), 40], partial [pclu 39522 lblk 0 state 2]) + - ext4_remove_blocks (extent [49507(158047), 40], from 49544 to 49546, partial [pclu 39522 lblk 0 state 2] + - ext4_free_blocks: (block 158084 count 4) + - ext4_mballoc_free (extent 1/6753/1) + +5.4. Ext4 error message in dmesg: +EXT4-fs error (device vdb): mb_free_blocks:1457: group 1, block 158084:freeing already freed block (bit 6753); block bitmap corrupt. +EXT4-fs error (device vdb): ext4_mb_generate_buddy:747: group 1, block bitmap and bg descriptor inconsistent: 19550 vs 19551 free clusters + +In this case, the whole cluster 39521 is freed mistakenly when freeing +pblock 158084~158086 (i.e., the first three blocks of this cluster), +although pblock 158087 (the last remaining block of this cluster) has +not been freed yet. + +The root cause of this isuue is that, the pclu of the partial cluster is +calculated mistakenly in ext4_ext_remove_space(). The correct +partial_cluster.pclu (i.e., the cluster number of the first block in the +next extent, that is, lblock 49597 (pblock 158086)) should be 39521 rather +than 39522. + +Fixes: f4226d9ea400 ("ext4: fix partial cluster initialization") +Signed-off-by: Jeffle Xu +Reviewed-by: Eric Whitney +Cc: stable@kernel.org # v3.19+ +Link: https://lore.kernel.org/r/1590121124-37096-1-git-send-email-jefflexu@linux.alibaba.com +Signed-off-by: Theodore Ts'o +Acked-by: Jan Kara + +--- + fs/ext4/extents.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -2916,7 +2916,7 @@ again: + * in use to avoid freeing it when removing blocks. + */ + if (sbi->s_cluster_ratio > 1) { +- pblk = ext4_ext_pblock(ex) + end - ee_block + 2; ++ pblk = ext4_ext_pblock(ex) + end - ee_block + 1; + partial_cluster = + -(long long) EXT4_B2C(sbi, pblk); + } diff --git a/patches.suse/ext4-fix-race-between-ext4_sync_parent-and-rename.patch b/patches.suse/ext4-fix-race-between-ext4_sync_parent-and-rename.patch new file mode 100644 index 0000000..ed2a7d1 --- /dev/null +++ b/patches.suse/ext4-fix-race-between-ext4_sync_parent-and-rename.patch @@ -0,0 +1,113 @@ +From 08adf452e628b0e2ce9a01048cfbec52353703d7 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Wed, 6 May 2020 11:31:40 -0700 +Subject: [PATCH] ext4: fix race between ext4_sync_parent() and rename() +Git-commit: 08adf452e628b0e2ce9a01048cfbec52353703d7 +Patch-mainline: v5.8-rc1 +References: bsc#1173838 + +'igrab(d_inode(dentry->d_parent))' without holding dentry->d_lock is +broken because without d_lock, d_parent can be concurrently changed due +to a rename(). Then if the old directory is immediately deleted, old +d_parent->inode can be NULL. That causes a NULL dereference in igrab(). + +To fix this, use dget_parent() to safely grab a reference to the parent +dentry, which pins the inode. This also eliminates the need to use +d_find_any_alias() other than for the initial inode, as we no longer +throw away the dentry at each step. + +This is an extremely hard race to hit, but it is possible. Adding a +udelay() in between the reads of ->d_parent and its ->d_inode makes it +reproducible on a no-journal filesystem using the following program: + + #include + #include + + int main() + { + if (fork()) { + for (;;) { + mkdir("dir1", 0700); + int fd = open("dir1/file", O_RDWR|O_CREAT|O_SYNC); + write(fd, "X", 1); + close(fd); + } + } else { + mkdir("dir2", 0700); + for (;;) { + rename("dir1/file", "dir2/file"); + rmdir("dir1"); + } + } + } + +Fixes: d59729f4e794 ("ext4: fix races in ext4_sync_parent()") +Cc: stable@vger.kernel.org +Signed-off-by: Eric Biggers +Link: https://lore.kernel.org/r/20200506183140.541194-1-ebiggers@kernel.org +Signed-off-by: Theodore Ts'o +Acked-by: Jan Kara + +--- + fs/ext4/fsync.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c +index e10206e7f4bb..093c359952cd 100644 +--- a/fs/ext4/fsync.c ++++ b/fs/ext4/fsync.c +@@ -44,30 +44,28 @@ + */ + static int ext4_sync_parent(struct inode *inode) + { +- struct dentry *dentry = NULL; +- struct inode *next; ++ struct dentry *dentry, *next; + int ret = 0; + + if (!ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) + return 0; +- inode = igrab(inode); ++ dentry = d_find_any_alias(inode); ++ if (!dentry) ++ return 0; + while (ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) { + ext4_clear_inode_state(inode, EXT4_STATE_NEWENTRY); +- dentry = d_find_any_alias(inode); +- if (!dentry) +- break; +- next = igrab(d_inode(dentry->d_parent)); ++ ++ next = dget_parent(dentry); + dput(dentry); +- if (!next) +- break; +- iput(inode); +- inode = next; ++ dentry = next; ++ inode = dentry->d_inode; ++ + /* + * The directory inode may have gone through rmdir by now. But + * the inode itself and its blocks are still allocated (we hold +- * a reference to the inode so it didn't go through +- * ext4_evict_inode()) and so we are safe to flush metadata +- * blocks and the inode. ++ * a reference to the inode via its dentry), so it didn't go ++ * through ext4_evict_inode()) and so we are safe to flush ++ * metadata blocks and the inode. + */ + ret = sync_mapping_buffers(inode->i_mapping); + if (ret) +@@ -76,7 +74,7 @@ static int ext4_sync_parent(struct inode *inode) + if (ret) + break; + } +- iput(inode); ++ dput(dentry); + return ret; + } + +-- +2.16.4 + diff --git a/patches.suse/ext4-jbd2-ensure-panic-by-fix-a-race-between-jbd2-ab.patch b/patches.suse/ext4-jbd2-ensure-panic-by-fix-a-race-between-jbd2-ab.patch new file mode 100644 index 0000000..c212634 --- /dev/null +++ b/patches.suse/ext4-jbd2-ensure-panic-by-fix-a-race-between-jbd2-ab.patch @@ -0,0 +1,162 @@ +From 7b97d868b7ab2448859668de9222b8af43f76e78 Mon Sep 17 00:00:00 2001 +From: "zhangyi (F)" +Date: Tue, 9 Jun 2020 15:35:40 +0800 +Subject: [PATCH] ext4, jbd2: ensure panic by fix a race between jbd2 abort and + ext4 error handlers +Git-commit: 7b97d868b7ab2448859668de9222b8af43f76e78 +Patch-mainline: v5.8-rc2 +References: bsc#1173833 + +In the ext4 filesystem with errors=panic, if one process is recording +errno in the superblock when invoking jbd2_journal_abort() due to some +error cases, it could be raced by another __ext4_abort() which is +setting the SB_RDONLY flag but missing panic because errno has not been +recorded. + +jbd2_journal_commit_transaction() + jbd2_journal_abort() + journal->j_flags |= JBD2_ABORT; + jbd2_journal_update_sb_errno() + | ext4_journal_check_start() + | __ext4_abort() + | sb->s_flags |= SB_RDONLY; + | if (!JBD2_REC_ERR) + | return; + journal->j_flags |= JBD2_REC_ERR; + +Finally, it will no longer trigger panic because the filesystem has +already been set read-only. Fix this by introduce j_abort_mutex to make +sure journal abort is completed before panic, and remove JBD2_REC_ERR +flag. + +Fixes: 4327ba52afd03 ("ext4, jbd2: ensure entering into panic after recording an error in superblock") +Signed-off-by: zhangyi (F) +Reviewed-by: Jan Kara +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200609073540.3810702-1-yi.zhang@huawei.com +Signed-off-by: Theodore Ts'o +Acked-by: Jan Kara + +--- + fs/ext4/super.c | 16 +++++----------- + fs/jbd2/journal.c | 16 ++++++++++++---- + include/linux/jbd2.h | 6 +++++- + 3 files changed, 22 insertions(+), 16 deletions(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -433,9 +433,6 @@ static void ext4_handle_error(struct sup + smp_wmb(); + sb->s_flags |= MS_RDONLY; + } else if (test_opt(sb, ERRORS_PANIC)) { +- if (EXT4_SB(sb)->s_journal && +- !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR)) +- return; + panic("EXT4-fs (device %s): panic forced after error\n", + sb->s_id); + } +@@ -637,24 +634,21 @@ void __ext4_abort(struct super_block *sb + va_end(args); + + if ((sb->s_flags & MS_RDONLY) == 0) { +- ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only"); + EXT4_SB(sb)->s_mount_flags |= EXT4_MF_FS_ABORTED; ++ if (EXT4_SB(sb)->s_journal) ++ jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO); ++ ++ ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only"); + /* + * Make sure updated value of ->s_mount_flags will be visible + * before ->s_flags update + */ + smp_wmb(); + sb->s_flags |= MS_RDONLY; +- if (EXT4_SB(sb)->s_journal) +- jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO); + save_error_info(sb, function, line); + } +- if (test_opt(sb, ERRORS_PANIC) && !system_going_down()) { +- if (EXT4_SB(sb)->s_journal && +- !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR)) +- return; ++ if (test_opt(sb, ERRORS_PANIC) && !system_going_down()) + panic("EXT4-fs panic from previous error\n"); +- } + } + + void __ext4_msg(struct super_block *sb, +--- a/fs/jbd2/journal.c ++++ b/fs/jbd2/journal.c +@@ -1151,6 +1151,7 @@ static journal_t *journal_init_common(st + init_waitqueue_head(&journal->j_wait_commit); + init_waitqueue_head(&journal->j_wait_updates); + init_waitqueue_head(&journal->j_wait_reserved); ++ mutex_init(&journal->j_abort_mutex); + mutex_init(&journal->j_barrier); + mutex_init(&journal->j_checkpoint_mutex); + spin_lock_init(&journal->j_revoke_lock); +@@ -1405,7 +1406,8 @@ static int jbd2_write_superblock(journal + printk(KERN_ERR "JBD2: Error %d detected when updating " + "journal superblock for %s.\n", ret, + journal->j_devname); +- jbd2_journal_abort(journal, ret); ++ if (!is_journal_aborted(journal)) ++ jbd2_journal_abort(journal, ret); + } + + return ret; +@@ -2127,6 +2129,13 @@ static void __journal_abort_soft (journa + { + int old_errno; + ++ /* ++ * Lock the aborting procedure until everything is done, this avoid ++ * races between filesystem's error handling flow (e.g. ext4_abort()), ++ * ensure panic after the error info is written into journal's ++ * superblock. ++ */ ++ mutex_lock(&journal->j_abort_mutex); + write_lock(&journal->j_state_lock); + old_errno = journal->j_errno; + if (!journal->j_errno || errno == -ESHUTDOWN) +@@ -2136,6 +2145,7 @@ static void __journal_abort_soft (journa + write_unlock(&journal->j_state_lock); + if (old_errno != -ESHUTDOWN && errno == -ESHUTDOWN) + jbd2_journal_update_sb_errno(journal); ++ mutex_unlock(&journal->j_abort_mutex); + return; + } + write_unlock(&journal->j_state_lock); +@@ -2143,9 +2153,7 @@ static void __journal_abort_soft (journa + __jbd2_journal_abort_hard(journal); + + jbd2_journal_update_sb_errno(journal); +- write_lock(&journal->j_state_lock); +- journal->j_flags |= JBD2_REC_ERR; +- write_unlock(&journal->j_state_lock); ++ mutex_unlock(&journal->j_abort_mutex); + } + + /** +--- a/include/linux/jbd2.h ++++ b/include/linux/jbd2.h +@@ -779,6 +779,11 @@ struct journal_s + int j_errno; + + /** ++ * @j_abort_mutex: Lock the whole aborting procedure. ++ */ ++ struct mutex j_abort_mutex; ++ ++ /** + * @j_sb_buffer: The first part of the superblock buffer. + */ + struct buffer_head *j_sb_buffer; +@@ -1253,7 +1258,6 @@ JBD2_FEATURE_INCOMPAT_FUNCS(csum3, CSUM + #define JBD2_ABORT_ON_SYNCDATA_ERR 0x040 /* Abort the journal on file + * data write error in ordered + * mode */ +-#define JBD2_REC_ERR 0x080 /* The errno in the sb has been recorded */ + + /* + * Function declarations for the journaling transaction and buffer diff --git a/patches.suse/fanotify-fix-ignore-mask-logic-for-events-on-child-a.patch b/patches.suse/fanotify-fix-ignore-mask-logic-for-events-on-child-a.patch new file mode 100644 index 0000000..15ca596 --- /dev/null +++ b/patches.suse/fanotify-fix-ignore-mask-logic-for-events-on-child-a.patch @@ -0,0 +1,76 @@ +From 2f02fd3fa13e51713b630164f8a8e5b42de8283b Mon Sep 17 00:00:00 2001 +From: Amir Goldstein +Date: Sun, 24 May 2020 10:24:41 +0300 +Subject: [PATCH] fanotify: fix ignore mask logic for events on child and on + dir +Git-commit: 2f02fd3fa13e51713b630164f8a8e5b42de8283b +Patch-mainline: v5.7-rc1 +References: bsc#1172719 + +The comments in fanotify_group_event_mask() say: + + "If the event is on dir/child and this mark doesn't care about + events on dir/child, don't send it!" + +Specifically, mount and filesystem marks do not care about events +on child, but they can still specify an ignore mask for those events. +For example, a group that has: +- A mount mark with mask 0 and ignore_mask FAN_OPEN +- An inode mark on a directory with mask FAN_OPEN | FAN_OPEN_EXEC + with flag FAN_EVENT_ON_CHILD + +A child file open for exec would be reported to group with the FAN_OPEN +event despite the fact that FAN_OPEN is in ignore mask of mount mark, +because the mark iteration loop skips over non-inode marks for events +on child when calculating the ignore mask. + +Move ignore mask calculation to the top of the iteration loop block +before excluding marks for events on dir/child. + +Link: https://lore.kernel.org/r/20200524072441.18258-1-amir73il@gmail.com +Reported-by: Jan Kara +Link: https://lore.kernel.org/linux-fsdevel/20200521162443.GA26052@quack2.suse.cz/ +Fixes: 55bf882c7f13 "fanotify: fix merging marks masks with FAN_ONDIR" +Fixes: b469e7e47c8a "fanotify: fix handling of events on child..." +Signed-off-by: Amir Goldstein +Signed-off-by: Jan Kara +Signed-off-by: Petr Vorel +--- + fs/notify/fanotify/fanotify.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +--- a/fs/notify/fanotify/fanotify.c ++++ b/fs/notify/fanotify/fanotify.c +@@ -111,11 +111,12 @@ static bool fanotify_should_send_event(s + * If the event is on dir and this mark doesn't care about + * events on dir, don't send it! + */ +- if (inode_mark && +- (!(event_mask & FS_EVENT_ON_CHILD) || +- (inode_mark->mask & FS_EVENT_ON_CHILD)) && +- (!(event_mask & FS_ISDIR) || inode_mark->mask & FS_ISDIR)) { +- marks_mask |= inode_mark->mask; ++ if (inode_mark) { ++ if ((!(event_mask & FS_EVENT_ON_CHILD) || ++ (inode_mark->mask & FS_EVENT_ON_CHILD)) && ++ (!(event_mask & FS_ISDIR) || inode_mark->mask & FS_ISDIR)) ++ marks_mask |= inode_mark->mask; ++ /* Apply ignore mask regardless of ISDIR and ON_CHILD flags */ + marks_ignored_mask |= inode_mark->ignored_mask; + } + +@@ -125,9 +126,11 @@ static bool fanotify_should_send_event(s + * If the event is on dir and this mark doesn't care about + * events on dir, don't send it! + */ +- if (vfsmnt_mark && !(event_mask & FS_EVENT_ON_CHILD) && +- (!(event_mask & FS_ISDIR) || vfsmnt_mark->mask & FS_ISDIR)) { +- marks_mask |= vfsmnt_mark->mask; ++ if (vfsmnt_mark) { ++ if (!(event_mask & FS_EVENT_ON_CHILD) && ++ (!(event_mask & FS_ISDIR) || vfsmnt_mark->mask & FS_ISDIR)) ++ marks_mask |= vfsmnt_mark->mask; ++ /* Apply ignore mask regardless of ISDIR and ON_CHILD flags */ + marks_ignored_mask |= vfsmnt_mark->ignored_mask; + } + diff --git a/patches.suse/fix-multiplication-overflow-in-copy_fdtable.patch b/patches.suse/fix-multiplication-overflow-in-copy_fdtable.patch new file mode 100644 index 0000000..1a9dd0b --- /dev/null +++ b/patches.suse/fix-multiplication-overflow-in-copy_fdtable.patch @@ -0,0 +1,40 @@ +From 4e89b7210403fa4a8acafe7c602b6212b7af6c3b Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Tue, 19 May 2020 17:48:52 -0400 +Subject: [PATCH] fix multiplication overflow in copy_fdtable() +Git-commit: 4e89b7210403fa4a8acafe7c602b6212b7af6c3b +Patch-mainline: v5.7-rc7 +References: bsc#1173825 + +cpy and set really should be size_t; we won't get an overflow on that, +since sysctl_nr_open can't be set above ~(size_t)0 / sizeof(void *), +so nr that would've managed to overflow size_t on that multiplication +won't get anywhere near copy_fdtable() - we'll fail with EMFILE +before that. + +Cc: stable@kernel.org # v2.6.25+ +Fixes: 9cfe015aa424 (get rid of NR_OPEN and introduce a sysctl_nr_open) +Reported-by: Thiago Macieira +Signed-off-by: Al Viro +Acked-by: Jan Kara + +--- + fs/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/file.c b/fs/file.c +index c8a4e4c86e55..abb8b7081d7a 100644 +--- a/fs/file.c ++++ b/fs/file.c +@@ -70,7 +70,7 @@ static void copy_fd_bitmaps(struct fdtable *nfdt, struct fdtable *ofdt, + */ + static void copy_fdtable(struct fdtable *nfdt, struct fdtable *ofdt) + { +- unsigned int cpy, set; ++ size_t cpy, set; + + BUG_ON(nfdt->max_fds < ofdt->max_fds); + +-- +2.16.4 + diff --git a/patches.suse/fq_codel-fix-TCA_FQ_CODEL_DROP_BATCH_SIZE-sanity-che.patch b/patches.suse/fq_codel-fix-TCA_FQ_CODEL_DROP_BATCH_SIZE-sanity-che.patch new file mode 100644 index 0000000..937803c --- /dev/null +++ b/patches.suse/fq_codel-fix-TCA_FQ_CODEL_DROP_BATCH_SIZE-sanity-che.patch @@ -0,0 +1,33 @@ +From: Eric Dumazet +Date: Sat, 25 Apr 2020 12:40:25 -0700 +Subject: fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: 14695212d4cd8b0c997f6121b6df8520038ce076 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +My intent was to not let users set a zero drop_batch_size, +it seems I once again messed with min()/max(). + +Fixes: 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()") +Signed-off-by: Eric Dumazet +Acked-by: Toke Høiland-Jørgensen +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/sched/sch_fq_codel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/sched/sch_fq_codel.c ++++ b/net/sched/sch_fq_codel.c +@@ -429,7 +429,7 @@ static int fq_codel_change(struct Qdisc + q->quantum = max(256U, nla_get_u32(tb[TCA_FQ_CODEL_QUANTUM])); + + if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]) +- q->drop_batch_size = min(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])); ++ q->drop_batch_size = max(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])); + + if (tb[TCA_FQ_CODEL_MEMORY_LIMIT]) + q->memory_limit = min(1U << 31, nla_get_u32(tb[TCA_FQ_CODEL_MEMORY_LIMIT])); diff --git a/patches.suse/gpu-host1x-Detach-driver-on-unregister.patch b/patches.suse/gpu-host1x-Detach-driver-on-unregister.patch new file mode 100644 index 0000000..aab2429 --- /dev/null +++ b/patches.suse/gpu-host1x-Detach-driver-on-unregister.patch @@ -0,0 +1,49 @@ +From d9a0a05bf8c76e6dc79230669a8b5d685b168c30 Mon Sep 17 00:00:00 2001 +From: Thierry Reding +Date: Wed, 8 Apr 2020 19:38:02 +0200 +Subject: [PATCH] gpu: host1x: Detach driver on unregister +Git-commit: d9a0a05bf8c76e6dc79230669a8b5d685b168c30 +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +Currently when a host1x device driver is unregistered, it is not +detached from the host1x controller, which means that the device +will stay around and when the driver is registered again, it may +bind to the old, stale device rather than the new one that was +created from scratch upon driver registration. This in turn can +cause various weird crashes within the driver core because it is +confronted with a device that was already deleted. + +Fix this by detaching the driver from the host1x controller when +it is unregistered. This ensures that the deleted device also is +no longer present in the device list that drivers will bind to. + +Reported-by: Sowjanya Komatineni +Signed-off-by: Thierry Reding +Tested-by: Sowjanya Komatineni +Acked-by: Takashi Iwai + +--- + drivers/gpu/host1x/bus.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/gpu/host1x/bus.c ++++ b/drivers/gpu/host1x/bus.c +@@ -550,8 +550,17 @@ EXPORT_SYMBOL(host1x_driver_register_ful + + void host1x_driver_unregister(struct host1x_driver *driver) + { ++ struct host1x *host1x; ++ + driver_unregister(&driver->driver); + ++ mutex_lock(&devices_lock); ++ ++ list_for_each_entry(host1x, &devices, list) ++ host1x_detach_driver(host1x, driver); ++ ++ mutex_unlock(&devices_lock); ++ + mutex_lock(&drivers_lock); + list_del_init(&driver->list); + mutex_unlock(&drivers_lock); diff --git a/patches.suse/hisi_sas-fix-calls-to-dma_set_mask_and_coherent.patch b/patches.suse/hisi_sas-fix-calls-to-dma_set_mask_and_coherent.patch new file mode 100644 index 0000000..6ba380c --- /dev/null +++ b/patches.suse/hisi_sas-fix-calls-to-dma_set_mask_and_coherent.patch @@ -0,0 +1,74 @@ +From: Hannes Reinecke +Date: Mon, 18 Feb 2019 08:34:25 +0100 +Subject: [PATCH] scsi: hisi_sas: fix calls to dma_set_mask_and_coherent() +Git-commit: d9a00459effc30f6de2cdd887b64f15c6c54ae71 +Patch-Mainline: v5.0 +References: bsc#1174296 + +The change to use dma_set_mask_and_coherent() incorrectly made a second +call with the 32 bit DMA mask value when the call with the 64 bit DMA +mask value succeeded. + +[mkp: fixed commit message] + +Fixes: e4db40e7a1a2 ("scsi: hisi_sas: use dma_set_mask_and_coherent") +Cc: +Suggested-by: Ewan D. Milne +Signed-off-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Signed-off-by: Hannes Reinecke +Signed-off-by: Martin K. Petersen +--- + drivers/scsi/hisi_sas/hisi_sas_main.c | 8 ++++++-- + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 +++++--- + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c +index eed7fc5b3389..bc17fa0d8375 100644 +--- a/drivers/scsi/hisi_sas/hisi_sas_main.c ++++ b/drivers/scsi/hisi_sas/hisi_sas_main.c +@@ -2323,6 +2323,7 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev, + struct Scsi_Host *shost; + struct hisi_hba *hisi_hba; + struct device *dev = &pdev->dev; ++ int error; + + shost = scsi_host_alloc(hw->sht, sizeof(*hisi_hba)); + if (!shost) { +@@ -2343,8 +2344,11 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev, + if (hisi_sas_get_fw_info(hisi_hba) < 0) + goto err_out; + +- if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)) && +- dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) { ++ error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); ++ if (error) ++ error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); ++ ++ if (error) { + dev_err(dev, "No usable DMA addressing method\n"); + goto err_out; + } +diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +index c92b3822c408..e0570fd8466e 100644 +--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c ++++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +@@ -2447,10 +2447,12 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) + if (rc) + goto err_out_disable_device; + +- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || +- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { ++ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ++ if (rc) ++ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ if (rc) { + dev_err(dev, "No usable DMA addressing method\n"); +- rc = -EIO; ++ rc = -ENODEV; + goto err_out_regions; + } + +-- +2.16.4 + diff --git a/patches.suse/hwmon-acpi_power_meter-Fix-potential-memory-leak-in-.patch b/patches.suse/hwmon-acpi_power_meter-Fix-potential-memory-leak-in-.patch new file mode 100644 index 0000000..13010d2 --- /dev/null +++ b/patches.suse/hwmon-acpi_power_meter-Fix-potential-memory-leak-in-.patch @@ -0,0 +1,46 @@ +From 8b97f9922211c44a739c5cbd9502ecbb9f17f6d1 Mon Sep 17 00:00:00 2001 +From: Misono Tomohiro +Date: Thu, 25 Jun 2020 13:32:42 +0900 +Subject: [PATCH] hwmon: (acpi_power_meter) Fix potential memory leak in acpi_power_meter_add() +Git-commit: 8b97f9922211c44a739c5cbd9502ecbb9f17f6d1 +Patch-mainline: v5.8-rc4 +References: bsc#1111666 + +Although it rarely happens, we should call free_capabilities() +if error happens after read_capabilities() to free allocated strings. + +Fixes: de584afa5e188 ("hwmon driver for ACPI 4.0 power meters") +Signed-off-by: Misono Tomohiro +Link: https://lore.kernel.org/r/20200625043242.31175-1-misono.tomohiro@jp.fujitsu.com +Signed-off-by: Guenter Roeck +Acked-by: Takashi Iwai + +--- + drivers/hwmon/acpi_power_meter.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c +index 0db8ef4fd6e1..a270b975e90b 100644 +--- a/drivers/hwmon/acpi_power_meter.c ++++ b/drivers/hwmon/acpi_power_meter.c +@@ -883,7 +883,7 @@ static int acpi_power_meter_add(struct acpi_device *device) + + res = setup_attrs(resource); + if (res) +- goto exit_free; ++ goto exit_free_capability; + + resource->hwmon_dev = hwmon_device_register(&device->dev); + if (IS_ERR(resource->hwmon_dev)) { +@@ -896,6 +896,8 @@ static int acpi_power_meter_add(struct acpi_device *device) + + exit_remove: + remove_attrs(resource); ++exit_free_capability: ++ free_capabilities(resource); + exit_free: + kfree(resource); + exit: +-- +2.16.4 + diff --git a/patches.suse/hwmon-emc2103-fix-unable-to-change-fan-pwm1_enable-a.patch b/patches.suse/hwmon-emc2103-fix-unable-to-change-fan-pwm1_enable-a.patch new file mode 100644 index 0000000..0b49e88 --- /dev/null +++ b/patches.suse/hwmon-emc2103-fix-unable-to-change-fan-pwm1_enable-a.patch @@ -0,0 +1,44 @@ +From 14b0e83dc4f1e52b94acaeb85a18fd7fdd46d2dc Mon Sep 17 00:00:00 2001 +From: Vishwas M +Date: Tue, 7 Jul 2020 19:57:47 +0530 +Subject: [PATCH] hwmon: (emc2103) fix unable to change fan pwm1_enable attribute +Git-commit: 14b0e83dc4f1e52b94acaeb85a18fd7fdd46d2dc +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +This patch fixes a bug which does not let FAN mode to be changed from +sysfs(pwm1_enable). i.e pwm1_enable can not be set to 3, it will always +remain at 0. + +This is caused because the device driver handles the result of +"read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg)" incorrectly. The +driver thinks an error has occurred if the (result != 0). This has been +fixed by changing the condition to (result < 0). + +Signed-off-by: Vishwas M +Link: https://lore.kernel.org/r/20200707142747.118414-1-vishwas.reddy.vr@gmail.com +Fixes: 9df7305b5a86 ("hwmon: Add driver for SMSC EMC2103 temperature monitor and fan controller") +Cc: stable@vger.kernel.org +Signed-off-by: Guenter Roeck +Acked-by: Takashi Iwai + +--- + drivers/hwmon/emc2103.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c +index 491a570e8e50..924c02c1631d 100644 +--- a/drivers/hwmon/emc2103.c ++++ b/drivers/hwmon/emc2103.c +@@ -443,7 +443,7 @@ static ssize_t pwm1_enable_store(struct device *dev, + } + + result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); +- if (result) { ++ if (result < 0) { + count = result; + goto err; + } +-- +2.16.4 + diff --git a/patches.suse/hwmon-max6697-Make-sure-the-OVERT-mask-is-set-correc.patch b/patches.suse/hwmon-max6697-Make-sure-the-OVERT-mask-is-set-correc.patch new file mode 100644 index 0000000..e99932d --- /dev/null +++ b/patches.suse/hwmon-max6697-Make-sure-the-OVERT-mask-is-set-correc.patch @@ -0,0 +1,67 @@ +From 016983d138cbe99a5c0aaae0103ee88f5300beb3 Mon Sep 17 00:00:00 2001 +From: Chu Lin +Date: Tue, 23 Jun 2020 22:13:08 +0000 +Subject: [PATCH] hwmon: (max6697) Make sure the OVERT mask is set correctly +Git-commit: 016983d138cbe99a5c0aaae0103ee88f5300beb3 +Patch-mainline: v5.8-rc4 +References: bsc#1111666 + +Per the datasheet for max6697, OVERT mask and ALERT mask are different. +For example, the 7th bit of OVERT is the local channel but for alert +mask, the 6th bit is the local channel. Therefore, we can't apply the +same mask for both registers. In addition to that, the max6697 driver +is supposed to be compatibale with different models. I manually went over +all the listed chips and made sure all chip types have the same layout. + +Testing; + mask value of 0x9 should map to 0x44 for ALERT and 0x84 for OVERT. + I used iotool to read the reg value back to verify. I only tested this + change on max6581. + +Reference: +https://datasheets.maximintegrated.com/en/ds/MAX6581.pdf +https://datasheets.maximintegrated.com/en/ds/MAX6697.pdf +https://datasheets.maximintegrated.com/en/ds/MAX6699.pdf + +Signed-off-by: Chu Lin +Fixes: 5372d2d71c46e ("hwmon: Driver for Maxim MAX6697 and compatibles") +Signed-off-by: Guenter Roeck +Acked-by: Takashi Iwai + +--- + drivers/hwmon/max6697.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c +index 743752a2467a..64122eb38060 100644 +--- a/drivers/hwmon/max6697.c ++++ b/drivers/hwmon/max6697.c +@@ -38,8 +38,9 @@ static const u8 MAX6697_REG_CRIT[] = { + * Map device tree / platform data register bit map to chip bit map. + * Applies to alert register and over-temperature register. + */ +-#define MAX6697_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \ ++#define MAX6697_ALERT_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \ + (((reg) & 0x01) << 6) | ((reg) & 0x80)) ++#define MAX6697_OVERT_MAP_BITS(reg) (((reg) >> 1) | (((reg) & 0x01) << 7)) + + #define MAX6697_REG_STAT(n) (0x44 + (n)) + +@@ -562,12 +563,12 @@ static int max6697_init_chip(struct max6697_data *data, + return ret; + + ret = i2c_smbus_write_byte_data(client, MAX6697_REG_ALERT_MASK, +- MAX6697_MAP_BITS(pdata->alert_mask)); ++ MAX6697_ALERT_MAP_BITS(pdata->alert_mask)); + if (ret < 0) + return ret; + + ret = i2c_smbus_write_byte_data(client, MAX6697_REG_OVERT_MASK, +- MAX6697_MAP_BITS(pdata->over_temperature_mask)); ++ MAX6697_OVERT_MAP_BITS(pdata->over_temperature_mask)); + if (ret < 0) + return ret; + +-- +2.16.4 + diff --git a/patches.suse/i2c-algo-pca-Add-0x78-as-SCL-stuck-low-status-for-PC.patch b/patches.suse/i2c-algo-pca-Add-0x78-as-SCL-stuck-low-status-for-PC.patch new file mode 100644 index 0000000..637fa7d --- /dev/null +++ b/patches.suse/i2c-algo-pca-Add-0x78-as-SCL-stuck-low-status-for-PC.patch @@ -0,0 +1,43 @@ +From cd217f2300793a106b49c7dfcbfb26e348bc7593 Mon Sep 17 00:00:00 2001 +From: Chris Packham +Date: Thu, 2 Jul 2020 10:39:11 +1200 +Subject: [PATCH] i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665 +Git-commit: cd217f2300793a106b49c7dfcbfb26e348bc7593 +Patch-mainline: v5.8-rc4 +References: bsc#1111666 + +The PCA9665 datasheet says that I2CSTA = 78h indicates that SCL is stuck +low, this differs to the PCA9564 which uses 90h for this indication. +Treat either 0x78 or 0x90 as an indication that the SCL line is stuck. + +Based on looking through the PCA9564 and PCA9665 datasheets this should +be safe for both chips. The PCA9564 should not return 0x78 for any valid +state and the PCA9665 should not return 0x90. + +Fixes: eff9ec95efaa ("i2c-algo-pca: Add PCA9665 support") +Signed-off-by: Chris Packham +Reviewed-by: Andy Shevchenko +Signed-off-by: Wolfram Sang +Acked-by: Takashi Iwai + +--- + drivers/i2c/algos/i2c-algo-pca.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c +index 7f10312d1b88..388978775be0 100644 +--- a/drivers/i2c/algos/i2c-algo-pca.c ++++ b/drivers/i2c/algos/i2c-algo-pca.c +@@ -314,7 +314,8 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, + DEB2("BUS ERROR - SDA Stuck low\n"); + pca_reset(adap); + goto out; +- case 0x90: /* Bus error - SCL stuck low */ ++ case 0x78: /* Bus error - SCL stuck low (PCA9665) */ ++ case 0x90: /* Bus error - SCL stuck low (PCA9564) */ + DEB2("BUS ERROR - SCL Stuck low\n"); + pca_reset(adap); + goto out; +-- +2.16.4 + diff --git a/patches.suse/i2c-mlxcpld-check-correct-size-of-maximum-RECV_LEN-p.patch b/patches.suse/i2c-mlxcpld-check-correct-size-of-maximum-RECV_LEN-p.patch new file mode 100644 index 0000000..e8867d8 --- /dev/null +++ b/patches.suse/i2c-mlxcpld-check-correct-size-of-maximum-RECV_LEN-p.patch @@ -0,0 +1,42 @@ +From 597911287fcd13c3a4b4aa3e0a52b33d431e0a8e Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Sun, 28 Jun 2020 13:52:44 +0200 +Subject: [PATCH] i2c: mlxcpld: check correct size of maximum RECV_LEN packet +Git-commit: 597911287fcd13c3a4b4aa3e0a52b33d431e0a8e +Patch-mainline: v5.8-rc4 +References: bsc#1111666 + +I2C_SMBUS_BLOCK_MAX defines already the maximum number as defined in the +SMBus 2.0 specs. I don't see a reason to add 1 here. Also, fix the errno +to what is suggested for this error. + +Fixes: c9bfdc7c16cb ("i2c: mlxcpld: Add support for smbus block read transaction") +Signed-off-by: Wolfram Sang +Reviewed-by: Michael Shych +Tested-by: Michael Shych +Signed-off-by: Wolfram Sang +Acked-by: Takashi Iwai + +--- + drivers/i2c/busses/i2c-mlxcpld.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c +index 2fd717d8dd30..71d7bae2cbca 100644 +--- a/drivers/i2c/busses/i2c-mlxcpld.c ++++ b/drivers/i2c/busses/i2c-mlxcpld.c +@@ -337,9 +337,9 @@ static int mlxcpld_i2c_wait_for_tc(struct mlxcpld_i2c_priv *priv) + if (priv->smbus_block && (val & MLXCPLD_I2C_SMBUS_BLK_BIT)) { + mlxcpld_i2c_read_comm(priv, MLXCPLD_LPCI2C_NUM_DAT_REG, + &datalen, 1); +- if (unlikely(datalen > (I2C_SMBUS_BLOCK_MAX + 1))) { ++ if (unlikely(datalen > I2C_SMBUS_BLOCK_MAX)) { + dev_err(priv->dev, "Incorrect smbus block read message len\n"); +- return -E2BIG; ++ return -EPROTO; + } + } else { + datalen = priv->xfer.data_len; +-- +2.16.4 + diff --git a/patches.suse/i40e-reduce-stack-usage-in-i40e_set_fc.patch b/patches.suse/i40e-reduce-stack-usage-in-i40e_set_fc.patch new file mode 100644 index 0000000..6575a96 --- /dev/null +++ b/patches.suse/i40e-reduce-stack-usage-in-i40e_set_fc.patch @@ -0,0 +1,159 @@ +From: Arnd Bergmann +Date: Mon, 15 Jul 2019 14:35:07 +0200 +Subject: i40e: reduce stack usage in i40e_set_fc +Patch-mainline: v5.4-rc1 +Git-commit: 33b165684ab70867d4545643f550a5d48d3ddc57 +References: git-fixes + +The functions i40e_aq_get_phy_abilities_resp() and i40e_set_fc() both +have giant structure on the stack, which makes each one use stack frames +larger than 500 bytes. + +As clang decides one function into the other, we get a warning for +exceeding the frame size limit on 32-bit architectures: + +drivers/net/ethernet/intel/i40e/i40e_common.c:1654:23: error: stack frame size of 1116 bytes in function 'i40e_set_fc' [-Werror,-Wframe-larger-than=] + +When building with gcc, the inlining does not happen, but i40e_set_fc() +calls i40e_aq_get_phy_abilities_resp() anyway, so they add up on the +kernel stack just as much. + +The parts that actually use large stacks don't overlap, so make sure +each one is a separate function, and mark them as noinline_for_stack to +prevent the compilers from combining them again. + +Fixes: 0a862b43acc6 ("i40e/i40evf: Add module_types and update_link_info") +Signed-off-by: Arnd Bergmann +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/intel/i40e/i40e_common.c | 91 ++++++++++++++------------ + 1 file changed, 51 insertions(+), 40 deletions(-) + +--- a/drivers/net/ethernet/intel/i40e/i40e_common.c ++++ b/drivers/net/ethernet/intel/i40e/i40e_common.c +@@ -1664,25 +1664,15 @@ enum i40e_status_code i40e_aq_set_phy_co + return status; + } + +-/** +- * i40e_set_fc +- * @hw: pointer to the hw struct +- * @aq_failures: buffer to return AdminQ failure information +- * @atomic_restart: whether to enable atomic link restart +- * +- * Set the requested flow control mode using set_phy_config. +- **/ +-enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures, +- bool atomic_restart) ++static noinline_for_stack enum i40e_status_code ++i40e_set_fc_status(struct i40e_hw *hw, ++ struct i40e_aq_get_phy_abilities_resp *abilities, ++ bool atomic_restart) + { +- enum i40e_fc_mode fc_mode = hw->fc.requested_mode; +- struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; +- enum i40e_status_code status; ++ enum i40e_fc_mode fc_mode = hw->fc.requested_mode; + u8 pause_mask = 0x0; + +- *aq_failures = 0x0; +- + switch (fc_mode) { + case I40E_FC_FULL: + pause_mask |= I40E_AQ_PHY_FLAG_PAUSE_TX; +@@ -1698,6 +1688,48 @@ enum i40e_status_code i40e_set_fc(struct + break; + } + ++ memset(&config, 0, sizeof(struct i40e_aq_set_phy_config)); ++ /* clear the old pause settings */ ++ config.abilities = abilities->abilities & ~(I40E_AQ_PHY_FLAG_PAUSE_TX) & ++ ~(I40E_AQ_PHY_FLAG_PAUSE_RX); ++ /* set the new abilities */ ++ config.abilities |= pause_mask; ++ /* If the abilities have changed, then set the new config */ ++ if (config.abilities == abilities->abilities) ++ return 0; ++ ++ /* Auto restart link so settings take effect */ ++ if (atomic_restart) ++ config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; ++ /* Copy over all the old settings */ ++ config.phy_type = abilities->phy_type; ++ config.phy_type_ext = abilities->phy_type_ext; ++ config.link_speed = abilities->link_speed; ++ config.eee_capability = abilities->eee_capability; ++ config.eeer = abilities->eeer_val; ++ config.low_power_ctrl = abilities->d3_lpan; ++ config.fec_config = abilities->fec_cfg_curr_mod_ext_info & ++ I40E_AQ_PHY_FEC_CONFIG_MASK; ++ ++ return i40e_aq_set_phy_config(hw, &config, NULL); ++} ++ ++/** ++ * i40e_set_fc ++ * @hw: pointer to the hw struct ++ * @aq_failures: buffer to return AdminQ failure information ++ * @atomic_restart: whether to enable atomic link restart ++ * ++ * Set the requested flow control mode using set_phy_config. ++ **/ ++enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures, ++ bool atomic_restart) ++{ ++ struct i40e_aq_get_phy_abilities_resp abilities; ++ enum i40e_status_code status; ++ ++ *aq_failures = 0x0; ++ + /* Get the current phy config */ + status = i40e_aq_get_phy_capabilities(hw, false, false, &abilities, + NULL); +@@ -1706,31 +1738,10 @@ enum i40e_status_code i40e_set_fc(struct + return status; + } + +- memset(&config, 0, sizeof(struct i40e_aq_set_phy_config)); +- /* clear the old pause settings */ +- config.abilities = abilities.abilities & ~(I40E_AQ_PHY_FLAG_PAUSE_TX) & +- ~(I40E_AQ_PHY_FLAG_PAUSE_RX); +- /* set the new abilities */ +- config.abilities |= pause_mask; +- /* If the abilities have changed, then set the new config */ +- if (config.abilities != abilities.abilities) { +- /* Auto restart link so settings take effect */ +- if (atomic_restart) +- config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; +- /* Copy over all the old settings */ +- config.phy_type = abilities.phy_type; +- config.phy_type_ext = abilities.phy_type_ext; +- config.link_speed = abilities.link_speed; +- config.eee_capability = abilities.eee_capability; +- config.eeer = abilities.eeer_val; +- config.low_power_ctrl = abilities.d3_lpan; +- config.fec_config = abilities.fec_cfg_curr_mod_ext_info & +- I40E_AQ_PHY_FEC_CONFIG_MASK; +- status = i40e_aq_set_phy_config(hw, &config, NULL); ++ status = i40e_set_fc_status(hw, &abilities, atomic_restart); ++ if (status) ++ *aq_failures |= I40E_SET_FC_AQ_FAIL_SET; + +- if (status) +- *aq_failures |= I40E_SET_FC_AQ_FAIL_SET; +- } + /* Update the link info */ + status = i40e_update_link_info(hw); + if (status) { +@@ -2559,7 +2570,7 @@ i40e_status i40e_get_link_status(struct + * i40e_updatelink_status - update status of the HW network link + * @hw: pointer to the hw struct + **/ +-i40e_status i40e_update_link_info(struct i40e_hw *hw) ++noinline_for_stack i40e_status i40e_update_link_info(struct i40e_hw *hw) + { + struct i40e_aq_get_phy_abilities_resp abilities; + i40e_status status = 0; diff --git a/patches.suse/iio-health-afe4404-Fix-timestamp-alignment-and-preve.patch b/patches.suse/iio-health-afe4404-Fix-timestamp-alignment-and-preve.patch new file mode 100644 index 0000000..efd5040 --- /dev/null +++ b/patches.suse/iio-health-afe4404-Fix-timestamp-alignment-and-preve.patch @@ -0,0 +1,72 @@ +From f88ecccac4be348bbcc6d056bdbc622a8955c04d Mon Sep 17 00:00:00 2001 +From: Jonathan Cameron +Date: Sun, 17 May 2020 18:29:57 +0100 +Subject: [PATCH] iio:health:afe4404 Fix timestamp alignment and prevent data leak. +Git-commit: f88ecccac4be348bbcc6d056bdbc622a8955c04d +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +One of a class of bugs pointed out by Lars in a recent review. +iio_push_to_buffers_with_timestamp assumes the buffer used is aligned +to the size of the timestamp (8 bytes). This is not guaranteed in +this driver which uses a 40 byte array of smaller elements on the stack. +As Lars also noted this anti pattern can involve a leak of data to +userspace and that indeed can happen here. We close both issues by +moving to a suitable structure in the iio_priv() data with alignment +explicitly requested. This data is allocated with kzalloc so no +data can leak appart from previous readings. + +Fixes: 87aec56e27ef ("iio: health: Add driver for the TI AFE4404 heart monitor") +Reported-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Acked-by: Andrew F. Davis +Acked-by: Takashi Iwai + +--- + drivers/iio/health/afe4404.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c +index e728bbb21ca8..cebb1fd4d0b1 100644 +--- a/drivers/iio/health/afe4404.c ++++ b/drivers/iio/health/afe4404.c +@@ -83,6 +83,7 @@ static const struct reg_field afe4404_reg_fields[] = { + * @regulator: Pointer to the regulator for the IC + * @trig: IIO trigger for this device + * @irq: ADC_RDY line interrupt number ++ * @buffer: Used to construct a scan to push to the iio buffer. + */ + struct afe4404_data { + struct device *dev; +@@ -91,6 +92,7 @@ struct afe4404_data { + struct regulator *regulator; + struct iio_trigger *trig; + int irq; ++ s32 buffer[10] __aligned(8); + }; + + enum afe4404_chan_id { +@@ -328,17 +330,17 @@ static irqreturn_t afe4404_trigger_handler(int irq, void *private) + struct iio_dev *indio_dev = pf->indio_dev; + struct afe4404_data *afe = iio_priv(indio_dev); + int ret, bit, i = 0; +- s32 buffer[10]; + + for_each_set_bit(bit, indio_dev->active_scan_mask, + indio_dev->masklength) { + ret = regmap_read(afe->regmap, afe4404_channel_values[bit], +- &buffer[i++]); ++ &afe->buffer[i++]); + if (ret) + goto err; + } + +- iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp); ++ iio_push_to_buffers_with_timestamp(indio_dev, afe->buffer, ++ pf->timestamp); + err: + iio_trigger_notify_done(indio_dev->trig); + +-- +2.16.4 + diff --git a/patches.suse/iio-humidity-hdc100x-Fix-alignment-and-data-leak-iss.patch b/patches.suse/iio-humidity-hdc100x-Fix-alignment-and-data-leak-iss.patch new file mode 100644 index 0000000..658f13c --- /dev/null +++ b/patches.suse/iio-humidity-hdc100x-Fix-alignment-and-data-leak-iss.patch @@ -0,0 +1,73 @@ +From ea5e7a7bb6205d24371373cd80325db1bc15eded Mon Sep 17 00:00:00 2001 +From: Jonathan Cameron +Date: Sun, 7 Jun 2020 16:53:52 +0100 +Subject: [PATCH] iio:humidity:hdc100x Fix alignment and data leak issues +Git-commit: ea5e7a7bb6205d24371373cd80325db1bc15eded +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +One of a class of bugs pointed out by Lars in a recent review. +iio_push_to_buffers_with_timestamp assumes the buffer used is aligned +to the size of the timestamp (8 bytes). This is not guaranteed in +this driver which uses an array of smaller elements on the stack. +As Lars also noted this anti pattern can involve a leak of data to +userspace and that indeed can happen here. We close both issues by +moving to a suitable structure in the iio_priv() data. +This data is allocated with kzalloc so no data can leak apart +from previous readings. + +Fixes: 16bf793f86b2 ("iio: humidity: hdc100x: add triggered buffer support for HDC100X") +Reported-by: Lars-Peter Clausen +Acked-by: Matt Ranostay +Cc: Alison Schofield +Signed-off-by: Jonathan Cameron +Cc: +Acked-by: Takashi Iwai + +--- + drivers/iio/humidity/hdc100x.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c +index 7ecd2ffa3132..665eb7e38293 100644 +--- a/drivers/iio/humidity/hdc100x.c ++++ b/drivers/iio/humidity/hdc100x.c +@@ -38,6 +38,11 @@ struct hdc100x_data { + + /* integration time of the sensor */ + int adc_int_us[2]; ++ /* Ensure natural alignment of timestamp */ ++ struct { ++ __be16 channels[2]; ++ s64 ts __aligned(8); ++ } scan; + }; + + /* integration time in us */ +@@ -322,7 +327,6 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) + struct i2c_client *client = data->client; + int delay = data->adc_int_us[0] + data->adc_int_us[1]; + int ret; +- s16 buf[8]; /* 2x s16 + padding + 8 byte timestamp */ + + /* dual read starts at temp register */ + mutex_lock(&data->lock); +@@ -333,13 +337,13 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) + } + usleep_range(delay, delay + 1000); + +- ret = i2c_master_recv(client, (u8 *)buf, 4); ++ ret = i2c_master_recv(client, (u8 *)data->scan.channels, 4); + if (ret < 0) { + dev_err(&client->dev, "cannot read sensor data\n"); + goto err; + } + +- iio_push_to_buffers_with_timestamp(indio_dev, buf, ++ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, + iio_get_time_ns(indio_dev)); + err: + mutex_unlock(&data->lock); +-- +2.16.4 + diff --git a/patches.suse/iio-magnetometer-ak8974-Fix-alignment-and-data-leak-.patch b/patches.suse/iio-magnetometer-ak8974-Fix-alignment-and-data-leak-.patch new file mode 100644 index 0000000..2aefbc0 --- /dev/null +++ b/patches.suse/iio-magnetometer-ak8974-Fix-alignment-and-data-leak-.patch @@ -0,0 +1,73 @@ +From 838e00b13bfd4cac8b24df25bfc58e2eb99bcc70 Mon Sep 17 00:00:00 2001 +From: Jonathan Cameron +Date: Sun, 7 Jun 2020 16:53:49 +0100 +Subject: [PATCH] iio:magnetometer:ak8974: Fix alignment and data leak issues +Git-commit: 838e00b13bfd4cac8b24df25bfc58e2eb99bcc70 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +One of a class of bugs pointed out by Lars in a recent review. +iio_push_to_buffers_with_timestamp assumes the buffer used is aligned +to the size of the timestamp (8 bytes). This is not guaranteed in +this driver which uses an array of smaller elements on the stack. +As Lars also noted this anti pattern can involve a leak of data to +userspace and that indeed can happen here. We close both issues by +moving to a suitable structure in the iio_priv() data. + +This data is allocated with kzalloc so no data can leak appart from +previous readings. + +Fixes: 7c94a8b2ee8cf ("iio: magn: add a driver for AK8974") +Reported-by: Lars-Peter Clausen +Reviewed-by: Linus Walleij +Signed-off-by: Jonathan Cameron +Cc: +Acked-by: Takashi Iwai + +--- + drivers/iio/magnetometer/ak8974.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c +index 041c9007bfbe..91c39352fba2 100644 +--- a/drivers/iio/magnetometer/ak8974.c ++++ b/drivers/iio/magnetometer/ak8974.c +@@ -192,6 +192,11 @@ struct ak8974 { + bool drdy_irq; + struct completion drdy_complete; + bool drdy_active_low; ++ /* Ensure timestamp is naturally aligned */ ++ struct { ++ __le16 channels[3]; ++ s64 ts __aligned(8); ++ } scan; + }; + + static const char ak8974_reg_avdd[] = "avdd"; +@@ -657,7 +662,6 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) + { + struct ak8974 *ak8974 = iio_priv(indio_dev); + int ret; +- __le16 hw_values[8]; /* Three axes + 64bit padding */ + + pm_runtime_get_sync(&ak8974->i2c->dev); + mutex_lock(&ak8974->lock); +@@ -667,13 +671,13 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) + dev_err(&ak8974->i2c->dev, "error triggering measure\n"); + goto out_unlock; + } +- ret = ak8974_getresult(ak8974, hw_values); ++ ret = ak8974_getresult(ak8974, ak8974->scan.channels); + if (ret) { + dev_err(&ak8974->i2c->dev, "error getting measures\n"); + goto out_unlock; + } + +- iio_push_to_buffers_with_timestamp(indio_dev, hw_values, ++ iio_push_to_buffers_with_timestamp(indio_dev, &ak8974->scan, + iio_get_time_ns(indio_dev)); + + out_unlock: +-- +2.16.4 + diff --git a/patches.suse/iio-mma8452-Add-missed-iio_device_unregister-call-in.patch b/patches.suse/iio-mma8452-Add-missed-iio_device_unregister-call-in.patch new file mode 100644 index 0000000..b94358c --- /dev/null +++ b/patches.suse/iio-mma8452-Add-missed-iio_device_unregister-call-in.patch @@ -0,0 +1,45 @@ +From d7369ae1f4d7cffa7574d15e1f787dcca184c49d Mon Sep 17 00:00:00 2001 +From: Chuhong Yuan +Date: Thu, 28 May 2020 14:41:21 +0800 +Subject: [PATCH] iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe() +Git-commit: d7369ae1f4d7cffa7574d15e1f787dcca184c49d +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +The function iio_device_register() was called in mma8452_probe(). +But the function iio_device_unregister() was not called after +a call of the function mma8452_set_freefall_mode() failed. +Thus add the missed function call for one error case. + +Fixes: 1a965d405fc6 ("drivers:iio:accel:mma8452: added cleanup provision in case of failure.") +Signed-off-by: Chuhong Yuan +Cc: +Signed-off-by: Jonathan Cameron +Acked-by: Takashi Iwai + +--- + drivers/iio/accel/mma8452.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c +index 00e100fc845a..813bca7cfc3e 100644 +--- a/drivers/iio/accel/mma8452.c ++++ b/drivers/iio/accel/mma8452.c +@@ -1685,10 +1685,13 @@ static int mma8452_probe(struct i2c_client *client, + + ret = mma8452_set_freefall_mode(data, false); + if (ret < 0) +- goto buffer_cleanup; ++ goto unregister_device; + + return 0; + ++unregister_device: ++ iio_device_unregister(indio_dev); ++ + buffer_cleanup: + iio_triggered_buffer_cleanup(indio_dev); + +-- +2.16.4 + diff --git a/patches.suse/iio-pressure-ms5611-Fix-buffer-element-alignment.patch b/patches.suse/iio-pressure-ms5611-Fix-buffer-element-alignment.patch new file mode 100644 index 0000000..6c22811 --- /dev/null +++ b/patches.suse/iio-pressure-ms5611-Fix-buffer-element-alignment.patch @@ -0,0 +1,63 @@ +From 8db4afe163bbdd93dca6fcefbb831ef12ecc6b4d Mon Sep 17 00:00:00 2001 +From: Jonathan Cameron +Date: Sun, 7 Jun 2020 16:53:57 +0100 +Subject: [PATCH] iio:pressure:ms5611 Fix buffer element alignment +Git-commit: 8db4afe163bbdd93dca6fcefbb831ef12ecc6b4d +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +One of a class of bugs pointed out by Lars in a recent review. +iio_push_to_buffers_with_timestamp assumes the buffer used is aligned +to the size of the timestamp (8 bytes). This is not guaranteed in +this driver which uses an array of smaller elements on the stack. +Here there is no data leak possibility so use an explicit structure +on the stack to ensure alignment and nice readable fashion. + +The forced alignment of ts isn't strictly necessary in this driver +as the padding will be correct anyway (there isn't any). However +it is probably less fragile to have it there and it acts as +documentation of the requirement. + +Fixes: 713bbb4efb9dc ("iio: pressure: ms5611: Add triggered buffer support") +Reported-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Acked-by: Tomasz Duszynski +Cc: +Acked-by: Takashi Iwai + +--- + drivers/iio/pressure/ms5611_core.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c +index 2f598ad91621..f5db9fa086f3 100644 +--- a/drivers/iio/pressure/ms5611_core.c ++++ b/drivers/iio/pressure/ms5611_core.c +@@ -212,16 +212,21 @@ static irqreturn_t ms5611_trigger_handler(int irq, void *p) + struct iio_poll_func *pf = p; + struct iio_dev *indio_dev = pf->indio_dev; + struct ms5611_state *st = iio_priv(indio_dev); +- s32 buf[4]; /* s32 (pressure) + s32 (temp) + 2 * s32 (timestamp) */ ++ /* Ensure buffer elements are naturally aligned */ ++ struct { ++ s32 channels[2]; ++ s64 ts __aligned(8); ++ } scan; + int ret; + + mutex_lock(&st->lock); +- ret = ms5611_read_temp_and_pressure(indio_dev, &buf[1], &buf[0]); ++ ret = ms5611_read_temp_and_pressure(indio_dev, &scan.channels[1], ++ &scan.channels[0]); + mutex_unlock(&st->lock); + if (ret < 0) + goto err; + +- iio_push_to_buffers_with_timestamp(indio_dev, buf, ++ iio_push_to_buffers_with_timestamp(indio_dev, &scan, + iio_get_time_ns(indio_dev)); + + err: +-- +2.16.4 + diff --git a/patches.suse/iio-pressure-zpa2326-handle-pm_runtime_get_sync-fail.patch b/patches.suse/iio-pressure-zpa2326-handle-pm_runtime_get_sync-fail.patch new file mode 100644 index 0000000..a33dc4e --- /dev/null +++ b/patches.suse/iio-pressure-zpa2326-handle-pm_runtime_get_sync-fail.patch @@ -0,0 +1,41 @@ +From d88de040e1df38414fc1e4380be9d0e997ab4d58 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Thu, 4 Jun 2020 21:44:44 -0500 +Subject: [PATCH] iio: pressure: zpa2326: handle pm_runtime_get_sync failure +Git-commit: d88de040e1df38414fc1e4380be9d0e997ab4d58 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +Calling pm_runtime_get_sync increments the counter even in case of +failure, causing incorrect ref count. Call pm_runtime_put if +pm_runtime_get_sync fails. + +Signed-off-by: Navid Emamdoost +Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support") +Cc: +Signed-off-by: Jonathan Cameron +Acked-by: Takashi Iwai + +--- + drivers/iio/pressure/zpa2326.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c +index 37fe851f89af..799a8dc3e248 100644 +--- a/drivers/iio/pressure/zpa2326.c ++++ b/drivers/iio/pressure/zpa2326.c +@@ -665,8 +665,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev) + int err; + + err = pm_runtime_get_sync(indio_dev->dev.parent); +- if (err < 0) ++ if (err < 0) { ++ pm_runtime_put(indio_dev->dev.parent); + return err; ++ } + + if (err > 0) { + /* +-- +2.16.4 + diff --git a/patches.suse/intel_idle-Graceful-probe-failure-when-MWAIT-is-disa.patch b/patches.suse/intel_idle-Graceful-probe-failure-when-MWAIT-is-disa.patch new file mode 100644 index 0000000..94fce2a --- /dev/null +++ b/patches.suse/intel_idle-Graceful-probe-failure-when-MWAIT-is-disa.patch @@ -0,0 +1,54 @@ +From a4c447533a18ee86e07232d6344ba12b1f9c5077 Mon Sep 17 00:00:00 2001 +From: Len Brown +Date: Thu, 9 Nov 2017 02:19:39 -0500 +Subject: [PATCH] intel_idle: Graceful probe failure when MWAIT is disabled +Git-commit: a4c447533a18ee86e07232d6344ba12b1f9c5077 +Patch-mainline: v4.15-rc1 +References: bsc#1174115 + +When MWAIT is disabled, intel_idle refuses to probe. +But it may mis-lead the user by blaming this on the model number: + +Intel_idle: does not run on family 6 modesl 79 + +So defer the check for MWAIT until after the model# white-list check succeeds, +and if the MWAIT check fails, tell the user how to fix it: + +Intel_idle: Please enable MWAIT in BIOS SETUP + +Signed-off-by: Len Brown +Signed-off-by: Rafael J. Wysocki +Acked-by: Takashi Iwai + +--- + drivers/idle/intel_idle.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c +index 5db5e3176f6a..9c93abdf635f 100644 +--- a/drivers/idle/intel_idle.c ++++ b/drivers/idle/intel_idle.c +@@ -1066,7 +1066,7 @@ static const struct idle_cpu idle_cpu_dnv = { + }; + + #define ICPU(model, cpu) \ +- { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu } ++ { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&cpu } + + static const struct x86_cpu_id intel_idle_ids[] __initconst = { + ICPU(INTEL_FAM6_NEHALEM_EP, idle_cpu_nehalem), +@@ -1130,6 +1130,11 @@ static int __init intel_idle_probe(void) + return -ENODEV; + } + ++ if (!boot_cpu_has(X86_FEATURE_MWAIT)) { ++ pr_debug("Please enable MWAIT in BIOS SETUP\n"); ++ return -ENODEV; ++ } ++ + if (boot_cpu_data.cpuid_level < CPUID_MWAIT_LEAF) + return -ENODEV; + +-- +2.16.4 + diff --git a/patches.suse/intel_idle-convert-to-new-x86-cpu-match-macros.patch b/patches.suse/intel_idle-convert-to-new-x86-cpu-match-macros.patch index 90b9ca8..04db50f 100644 --- a/patches.suse/intel_idle-convert-to-new-x86-cpu-match-macros.patch +++ b/patches.suse/intel_idle-convert-to-new-x86-cpu-match-macros.patch @@ -25,7 +25,7 @@ Link: https://lkml.kernel.org/r/20200320131510.193755545@linutronix.de }; -#define ICPU(model, cpu) \ -- { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu } +- { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&cpu } - static const struct x86_cpu_id intel_idle_ids[] __initconst = { - ICPU(INTEL_FAM6_NEHALEM_EP, idle_cpu_nehalem), diff --git a/patches.suse/intel_th-Fix-a-NULL-dereference-when-hub-driver-is-n.patch b/patches.suse/intel_th-Fix-a-NULL-dereference-when-hub-driver-is-n.patch new file mode 100644 index 0000000..48087aa --- /dev/null +++ b/patches.suse/intel_th-Fix-a-NULL-dereference-when-hub-driver-is-n.patch @@ -0,0 +1,98 @@ +From e78e1fdb282726beaf88aa75943682217e6ded0e Mon Sep 17 00:00:00 2001 +From: Alexander Shishkin +Date: Mon, 6 Jul 2020 19:13:39 +0300 +Subject: [PATCH] intel_th: Fix a NULL dereference when hub driver is not loaded +Git-commit: e78e1fdb282726beaf88aa75943682217e6ded0e +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +Connecting master to an output port when GTH driver module is not loaded +triggers a NULL dereference: + +> RIP: 0010:intel_th_set_output+0x35/0x70 [intel_th] +> Call Trace: +> ? sth_stm_link+0x12/0x20 [intel_th_sth] +> stm_source_link_store+0x164/0x270 [stm_core] +> dev_attr_store+0x17/0x30 +> sysfs_kf_write+0x3e/0x50 +> kernfs_fop_write+0xda/0x1b0 +> __vfs_write+0x1b/0x40 +> vfs_write+0xb9/0x1a0 +> ksys_write+0x67/0xe0 +> __x64_sys_write+0x1a/0x20 +> do_syscall_64+0x57/0x1d0 +> entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +Make sure the module in question is loaded and return an error if not. + +Signed-off-by: Alexander Shishkin +Fixes: 39f4034693b7c ("intel_th: Add driver infrastructure for Intel(R) Trace Hub devices") +Reviewed-by: Andy Shevchenko +Reported-by: Ammy Yi +Tested-by: Ammy Yi +Cc: stable@vger.kernel.org # v4.4 +Link: https://lore.kernel.org/r/20200706161339.55468-5-alexander.shishkin@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/hwtracing/intel_th/core.c | 21 ++++++++++++++++++--- + drivers/hwtracing/intel_th/sth.c | 4 +--- + 2 files changed, 19 insertions(+), 6 deletions(-) + +diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c +index ca232ec565e8..c9ac3dc65113 100644 +--- a/drivers/hwtracing/intel_th/core.c ++++ b/drivers/hwtracing/intel_th/core.c +@@ -1021,15 +1021,30 @@ int intel_th_set_output(struct intel_th_device *thdev, + { + struct intel_th_device *hub = to_intel_th_hub(thdev); + struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver); ++ int ret; + + /* In host mode, this is up to the external debugger, do nothing. */ + if (hub->host_mode) + return 0; + +- if (!hubdrv->set_output) +- return -ENOTSUPP; ++ /* ++ * hub is instantiated together with the source device that ++ * calls here, so guaranteed to be present. ++ */ ++ hubdrv = to_intel_th_driver(hub->dev.driver); ++ if (!hubdrv || !try_module_get(hubdrv->driver.owner)) ++ return -EINVAL; ++ ++ if (!hubdrv->set_output) { ++ ret = -ENOTSUPP; ++ goto out; ++ } ++ ++ ret = hubdrv->set_output(hub, master); + +- return hubdrv->set_output(hub, master); ++out: ++ module_put(hubdrv->driver.owner); ++ return ret; + } + EXPORT_SYMBOL_GPL(intel_th_set_output); + +diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c +index 3a1f4e650378..a1529f571491 100644 +--- a/drivers/hwtracing/intel_th/sth.c ++++ b/drivers/hwtracing/intel_th/sth.c +@@ -161,9 +161,7 @@ static int sth_stm_link(struct stm_data *stm_data, unsigned int master, + { + struct sth_device *sth = container_of(stm_data, struct sth_device, stm); + +- intel_th_set_output(to_intel_th_device(sth->dev), master); +- +- return 0; ++ return intel_th_set_output(to_intel_th_device(sth->dev), master); + } + + static int intel_th_sw_init(struct sth_device *sth) +-- +2.16.4 + diff --git a/patches.suse/iommu-vt-d-enable-pci-acs-for-platform-opt-in-hint b/patches.suse/iommu-vt-d-enable-pci-acs-for-platform-opt-in-hint new file mode 100644 index 0000000..aa9cbb6 --- /dev/null +++ b/patches.suse/iommu-vt-d-enable-pci-acs-for-platform-opt-in-hint @@ -0,0 +1,50 @@ +From: Lu Baolu +Date: Tue, 23 Jun 2020 07:13:43 +0800 +Subject: iommu/vt-d: Enable PCI ACS for platform opt in hint +Git-commit: 50310600ebda74b9988467e2e6128711c7ba56fc +Patch-mainline: v5.8-rc3 +References: bsc#1174130 + +PCI ACS is disabled if Intel IOMMU is off by default or intel_iommu=off +is used in command line. Unfortunately, Intel IOMMU will be forced on if +there're devices sitting on an external facing PCI port that is marked +as untrusted (for example, thunderbolt peripherals). That means, PCI ACS +is disabled while Intel IOMMU is forced on to isolate those devices. As +the result, the devices of an MFD will be grouped by a single group even +the ACS is supported on device. + +[ 0.691263] pci 0000:00:07.1: Adding to iommu group 3 +[ 0.691277] pci 0000:00:07.2: Adding to iommu group 3 +[ 0.691292] pci 0000:00:07.3: Adding to iommu group 3 + +Fix it by requesting PCI ACS when Intel IOMMU is detected with platform +opt in hint. + +Fixes: 89a6079df791a ("iommu/vt-d: Force IOMMU on for platform opt in hint") +Co-developed-by: Lalithambika Krishnakumar +Signed-off-by: Lalithambika Krishnakumar +Signed-off-by: Lu Baolu +Reviewed-by: Mika Westerberg +Cc: Mika Westerberg +Cc: Ashok Raj +Link: https://lore.kernel.org/r/20200622231345.29722-5-baolu.lu@linux.intel.com +Signed-off-by: Joerg Roedel +--- + drivers/iommu/intel/dmar.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c +index cc46dff98fa0..683b812c5c47 100644 +--- a/drivers/iommu/dmar.c ++++ b/drivers/iommu/dmar.c +@@ -898,7 +898,8 @@ int __init detect_intel_iommu(void) + if (!ret) + ret = dmar_walk_dmar_table((struct acpi_table_dmar *)dmar_tbl, + &validate_drhd_cb); +- if (!ret && !no_iommu && !iommu_detected && !dmar_disabled) { ++ if (!ret && !no_iommu && !iommu_detected && ++ (!dmar_disabled || dmar_platform_optin())) { + iommu_detected = 1; + /* Make sure ACS will be enabled */ + pci_request_acs(); + diff --git a/patches.suse/ipvlan-call-dev_change_flags-when-ipvlan-mode-is-res.patch b/patches.suse/ipvlan-call-dev_change_flags-when-ipvlan-mode-is-res.patch new file mode 100644 index 0000000..a368197 --- /dev/null +++ b/patches.suse/ipvlan-call-dev_change_flags-when-ipvlan-mode-is-res.patch @@ -0,0 +1,118 @@ +From: Hangbin Liu +Date: Sun, 1 Jul 2018 16:21:21 +0800 +Subject: ipvlan: call dev_change_flags when ipvlan mode is reset +Patch-mainline: v4.18-rc4 +Git-commit: 5dc2d3996a8b221c20dd0900bdad45031a572530 +References: git-fixes + +After we change the ipvlan mode from l3 to l2, or vice versa, we only +reset IFF_NOARP flag, but don't flush the ARP table cache, which will +cause eth->h_dest to be equal to eth->h_source in ipvlan_xmit_mode_l2(). +Then the message will not come out of host. + +Here is the reproducer on local host: + +ip link set eth1 up +ip addr add 192.168.1.1/24 dev eth1 +ip link add link eth1 ipvlan1 type ipvlan mode l3 + +ip netns add net1 +ip link set ipvlan1 netns net1 +ip netns exec net1 ip link set ipvlan1 up +ip netns exec net1 ip addr add 192.168.2.1/24 dev ipvlan1 + +ip route add 192.168.2.0/24 via 192.168.1.2 +ping 192.168.2.2 -c 2 + +ip netns exec net1 ip link set ipvlan1 type ipvlan mode l2 +ping 192.168.2.2 -c 2 + +Add the same configuration on remote host. After we set the mode to l2, +we could find that the src/dst MAC addresses are the same on eth1: + +21:26:06.648565 00:b7:13:ad:d3:05 > 00:b7:13:ad:d3:05, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 58356, offset 0, flags [DF], proto ICMP (1), length 84) + 192.168.2.1 > 192.168.2.2: ICMP echo request, id 22686, seq 1, length 64 + +Fix this by calling dev_change_flags(), which will call netdevice notifier +with flag change info. + +v2: +a) As pointed out by Wang Cong, check return value for dev_change_flags() when +change dev flags. +b) As suggested by Stefano and Sabrina, move flags setting before l3mdev_ops. +So we don't need to redo ipvlan_{, un}register_nf_hook() again in err path. + +Reported-by: Jianlin Shi +Reviewed-by: Stefano Brivio +Reviewed-by: Sabrina Dubroca +Fixes: 2ad7bf3638411 ("ipvlan: Initial check-in of the IPVLAN driver.") +Signed-off-by: Hangbin Liu +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ipvlan/ipvlan_main.c | 36 ++++++++++++++++++++++++++++-------- + 1 file changed, 28 insertions(+), 8 deletions(-) + +--- a/drivers/net/ipvlan/ipvlan_main.c ++++ b/drivers/net/ipvlan/ipvlan_main.c +@@ -73,10 +73,23 @@ static int ipvlan_set_port_mode(struct i + { + struct ipvl_dev *ipvlan; + struct net_device *mdev = port->dev; +- int err = 0; ++ unsigned int flags; ++ int err; + + ASSERT_RTNL(); + if (port->mode != nval) { ++ list_for_each_entry(ipvlan, &port->ipvlans, pnode) { ++ flags = ipvlan->dev->flags; ++ if (nval == IPVLAN_MODE_L3 || nval == IPVLAN_MODE_L3S) { ++ err = dev_change_flags(ipvlan->dev, ++ flags | IFF_NOARP); ++ } else { ++ err = dev_change_flags(ipvlan->dev, ++ flags & ~IFF_NOARP); ++ } ++ if (unlikely(err)) ++ goto fail; ++ } + if (nval == IPVLAN_MODE_L3S) { + /* New mode is L3S */ + err = ipvlan_register_nf_hook(read_pnet(&port->pnet)); +@@ -84,21 +97,28 @@ static int ipvlan_set_port_mode(struct i + mdev->l3mdev_ops = &ipvl_l3mdev_ops; + mdev->priv_flags |= IFF_L3MDEV_MASTER; + } else +- return err; ++ goto fail; + } else if (port->mode == IPVLAN_MODE_L3S) { + /* Old mode was L3S */ + mdev->priv_flags &= ~IFF_L3MDEV_MASTER; + ipvlan_unregister_nf_hook(read_pnet(&port->pnet)); + mdev->l3mdev_ops = NULL; + } +- list_for_each_entry(ipvlan, &port->ipvlans, pnode) { +- if (nval == IPVLAN_MODE_L3 || nval == IPVLAN_MODE_L3S) +- ipvlan->dev->flags |= IFF_NOARP; +- else +- ipvlan->dev->flags &= ~IFF_NOARP; +- } + port->mode = nval; + } ++ return 0; ++ ++fail: ++ /* Undo the flags changes that have been done so far. */ ++ list_for_each_entry_continue_reverse(ipvlan, &port->ipvlans, pnode) { ++ flags = ipvlan->dev->flags; ++ if (port->mode == IPVLAN_MODE_L3 || ++ port->mode == IPVLAN_MODE_L3S) ++ dev_change_flags(ipvlan->dev, flags | IFF_NOARP); ++ else ++ dev_change_flags(ipvlan->dev, flags & ~IFF_NOARP); ++ } ++ + return err; + } + diff --git a/patches.suse/ipvlan-l3mdev-fix-broken-l3s-mode-wrt-local-routes.patch b/patches.suse/ipvlan-l3mdev-fix-broken-l3s-mode-wrt-local-routes.patch index d498a28..f285af7 100644 --- a/patches.suse/ipvlan-l3mdev-fix-broken-l3s-mode-wrt-local-routes.patch +++ b/patches.suse/ipvlan-l3mdev-fix-broken-l3s-mode-wrt-local-routes.patch @@ -69,14 +69,14 @@ Signed-off-by: Jiri Slaby --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c -@@ -82,12 +82,12 @@ static int ipvlan_set_port_mode(struct i +@@ -95,12 +95,12 @@ static int ipvlan_set_port_mode(struct i err = ipvlan_register_nf_hook(read_pnet(&port->pnet)); if (!err) { mdev->l3mdev_ops = &ipvl_l3mdev_ops; - mdev->priv_flags |= IFF_L3MDEV_MASTER; + mdev->priv_flags |= IFF_L3MDEV_RX_HANDLER; } else - return err; + goto fail; } else if (port->mode == IPVLAN_MODE_L3S) { /* Old mode was L3S */ - mdev->priv_flags &= ~IFF_L3MDEV_MASTER; @@ -84,7 +84,7 @@ Signed-off-by: Jiri Slaby ipvlan_unregister_nf_hook(read_pnet(&port->pnet)); mdev->l3mdev_ops = NULL; } -@@ -140,7 +140,7 @@ static void ipvlan_port_destroy(struct n +@@ -160,7 +160,7 @@ static void ipvlan_port_destroy(struct n struct sk_buff *skb; if (port->mode == IPVLAN_MODE_L3S) { diff --git a/patches.suse/ixgbevf-Remove-limit-of-10-entries-for-unicast-filte.patch b/patches.suse/ixgbevf-Remove-limit-of-10-entries-for-unicast-filte.patch new file mode 100644 index 0000000..3428ad1 --- /dev/null +++ b/patches.suse/ixgbevf-Remove-limit-of-10-entries-for-unicast-filte.patch @@ -0,0 +1,35 @@ +From: Radoslaw Tyl +Date: Mon, 25 Nov 2019 15:24:52 +0100 +Subject: ixgbevf: Remove limit of 10 entries for unicast filter list +Patch-mainline: v5.5-rc7 +Git-commit: aa604651d523b1493988d0bf6710339f3ee60272 +References: git-fixes + +Currently, though the FDB entry is added to VF, it does not appear in +RAR filters. VF driver only allows to add 10 entries. Attempting to add +another causes an error. This patch removes limitation and allows use of +all free RAR entries for the FDB if needed. + +Fixes: 46ec20ff7d ("ixgbevf: Add macvlan support in the set rx mode op") +Signed-off-by: Radoslaw Tyl +Acked-by: Paul Menzel +Signed-off-by: Jeff Kirsher +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c ++++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +@@ -2100,11 +2100,6 @@ static int ixgbevf_write_uc_addr_list(st + struct ixgbe_hw *hw = &adapter->hw; + int count = 0; + +- if ((netdev_uc_count(netdev)) > 10) { +- pr_err("Too many unicast filters - No Space\n"); +- return -ENOSPC; +- } +- + if (!netdev_uc_empty(netdev)) { + struct netdev_hw_addr *ha; + diff --git a/patches.suse/jbd2-avoid-leaking-transaction-credits-when-unreserv.patch b/patches.suse/jbd2-avoid-leaking-transaction-credits-when-unreserv.patch new file mode 100644 index 0000000..6384530 --- /dev/null +++ b/patches.suse/jbd2-avoid-leaking-transaction-credits-when-unreserv.patch @@ -0,0 +1,92 @@ +From 14ff6286309e2853aed50083c9a83328423fdd8c Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 20 May 2020 15:31:19 +0200 +Subject: [PATCH] jbd2: avoid leaking transaction credits when unreserving + handle +Git-commit: 14ff6286309e2853aed50083c9a83328423fdd8c +Patch-mainline: v5.8-rc1 +References: bsc#1173845 + +When reserved transaction handle is unused, we subtract its reserved +credits in __jbd2_journal_unreserve_handle() called from +jbd2_journal_stop(). However this function forgets to remove reserved +credits from transaction->t_outstanding_credits and thus the transaction +space that was reserved remains effectively leaked. The leaked +transaction space can be quite significant in some cases and leads to +unnecessarily small transactions and thus reducing throughput of the +journalling machinery. E.g. fsmark workload creating lots of 4k files +was observed to have about 20% lower throughput due to this when ext4 is +mounted with dioread_nolock mount option. + +Subtract reserved credits from t_outstanding_credits as well. + +Cc: stable@vger.kernel.org +Fixes: 8f7d89f36829 ("jbd2: transaction reservation support") +Reviewed-by: Andreas Dilger +Signed-off-by: Jan Kara +Link: https://lore.kernel.org/r/20200520133119.1383-3-jack@suse.cz +Signed-off-by: Theodore Ts'o +Acked-by: Jan Kara + +--- + fs/jbd2/transaction.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +--- a/fs/jbd2/transaction.c ++++ b/fs/jbd2/transaction.c +@@ -512,12 +512,24 @@ handle_t *jbd2_journal_start(journal_t * + } + EXPORT_SYMBOL(jbd2_journal_start); + +-void jbd2_journal_free_reserved(handle_t *handle) ++static void __jbd2_journal_unreserve_handle(handle_t *handle, transaction_t *t) + { + journal_t *journal = handle->h_journal; + + WARN_ON(!handle->h_reserved); + sub_reserved_credits(journal, handle->h_buffer_credits); ++ if (t) ++ atomic_sub(handle->h_buffer_credits, &t->t_outstanding_credits); ++} ++ ++void jbd2_journal_free_reserved(handle_t *handle) ++{ ++ journal_t *journal = handle->h_journal; ++ ++ /* Get j_state_lock to pin running transaction if it exists */ ++ read_lock(&journal->j_state_lock); ++ __jbd2_journal_unreserve_handle(handle, journal->j_running_transaction); ++ read_unlock(&journal->j_state_lock); + jbd2_free_handle(handle); + } + EXPORT_SYMBOL(jbd2_journal_free_reserved); +@@ -694,8 +706,8 @@ int jbd2__journal_restart(handle_t *hand + atomic_sub(handle->h_buffer_credits, + &transaction->t_outstanding_credits); + if (handle->h_rsv_handle) { +- sub_reserved_credits(journal, +- handle->h_rsv_handle->h_buffer_credits); ++ __jbd2_journal_unreserve_handle(handle->h_rsv_handle, ++ transaction); + } + if (atomic_dec_and_test(&transaction->t_updates)) + wake_up(&journal->j_wait_updates); +@@ -1802,6 +1814,9 @@ int jbd2_journal_stop(handle_t *handle) + current->journal_info = NULL; + atomic_sub(handle->h_buffer_credits, + &transaction->t_outstanding_credits); ++ if (handle->h_rsv_handle) ++ __jbd2_journal_unreserve_handle(handle->h_rsv_handle, ++ transaction); + + /* + * If the handle is marked SYNC, we need to set another commit +@@ -1849,7 +1864,7 @@ int jbd2_journal_stop(handle_t *handle) + err = jbd2_log_wait_commit(journal, tid); + + if (handle->h_rsv_handle) +- jbd2_journal_free_reserved(handle->h_rsv_handle); ++ jbd2_free_handle(handle->h_rsv_handle); + free_and_exit: + /* + * Scope of the GFP_NOFS context is over here and so we can restore the diff --git a/patches.suse/kernfs-fix-barrier-usage-in-__kernfs_new_node.patch b/patches.suse/kernfs-fix-barrier-usage-in-__kernfs_new_node.patch new file mode 100644 index 0000000..faf91e4 --- /dev/null +++ b/patches.suse/kernfs-fix-barrier-usage-in-__kernfs_new_node.patch @@ -0,0 +1,43 @@ +From 998267900cee901c5d1dfa029a6304d00acbc29f Mon Sep 17 00:00:00 2001 +From: Andrea Parri +Date: Tue, 16 Apr 2019 14:17:11 +0200 +Subject: [PATCH] kernfs: fix barrier usage in __kernfs_new_node() +Git-commit: 998267900cee901c5d1dfa029a6304d00acbc29f +Patch-mainline: v5.2-rc1 +References: bsc#1111666 + +smp_mb__before_atomic() can not be applied to atomic_set(). Remove the +barrier and rely on RELEASE synchronization. + +Fixes: ba16b2846a8c6 ("kernfs: add an API to get kernfs node from inode number") +Cc: stable@vger.kernel.org +Signed-off-by: Andrea Parri +Acked-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + fs/kernfs/dir.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c +index b84d635567d3..1e7a74b8e064 100644 +--- a/fs/kernfs/dir.c ++++ b/fs/kernfs/dir.c +@@ -650,11 +650,10 @@ static struct kernfs_node *__kernfs_new_node(struct kernfs_root *root, + kn->id.generation = gen; + + /* +- * set ino first. This barrier is paired with atomic_inc_not_zero in ++ * set ino first. This RELEASE is paired with atomic_inc_not_zero in + * kernfs_find_and_get_node_by_ino + */ +- smp_mb__before_atomic(); +- atomic_set(&kn->count, 1); ++ atomic_set_release(&kn->count, 1); + atomic_set(&kn->active, KN_DEACTIVATED_BIAS); + RB_CLEAR_NODE(&kn->rb); + +-- +2.16.4 + diff --git a/patches.suse/kvm-x86-fix-apic-page-invalidation-race b/patches.suse/kvm-x86-fix-apic-page-invalidation-race new file mode 100644 index 0000000..0c612c7 --- /dev/null +++ b/patches.suse/kvm-x86-fix-apic-page-invalidation-race @@ -0,0 +1,97 @@ +From: Eiichi Tsukata +Date: Sat, 6 Jun 2020 13:26:27 +0900 +Subject: KVM: x86: Fix APIC page invalidation race +Git-commit: e649b3f0188f8fd34dd0dde8d43fd3312b902fb2 +Patch-mainline: v5.8-rc1 +References: bsc#1174122 + +Commit b1394e745b94 ("KVM: x86: fix APIC page invalidation") tried +to fix inappropriate APIC page invalidation by re-introducing arch +specific kvm_arch_mmu_notifier_invalidate_range() and calling it from +kvm_mmu_notifier_invalidate_range_start. However, the patch left a +possible race where the VMCS APIC address cache is updated *before* +it is unmapped: + + (Invalidator) kvm_mmu_notifier_invalidate_range_start() + (Invalidator) kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD) + (KVM VCPU) vcpu_enter_guest() + (KVM VCPU) kvm_vcpu_reload_apic_access_page() + (Invalidator) actually unmap page + +Because of the above race, there can be a mismatch between the +host physical address stored in the APIC_ACCESS_PAGE VMCS field and +the host physical address stored in the EPT entry for the APIC GPA +(0xfee0000). When this happens, the processor will not trap APIC +accesses, and will instead show the raw contents of the APIC-access page. +Because Windows OS periodically checks for unexpected modifications to +the LAPIC register, this will show up as a BSOD crash with BugCheck +CRITICAL_STRUCTURE_CORRUPTION (109) we are currently seeing in +https://bugzilla.redhat.com/show_bug.cgi?id=1751017. + +The root cause of the issue is that kvm_arch_mmu_notifier_invalidate_range() +cannot guarantee that no additional references are taken to the pages in +the range before kvm_mmu_notifier_invalidate_range_end(). Fortunately, +this case is supported by the MMU notifier API, as documented in +include/linux/mmu_notifier.h: + + * If the subsystem + * can't guarantee that no additional references are taken to + * the pages in the range, it has to implement the + * invalidate_range() notifier to remove any references taken + * after invalidate_range_start(). + +The fix therefore is to reload the APIC-access page field in the VMCS +from kvm_mmu_notifier_invalidate_range() instead of ..._range_start(). + +Cc: stable@vger.kernel.org +Fixes: b1394e745b94 ("KVM: x86: fix APIC page invalidation") +Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=197951 +Signed-off-by: Eiichi Tsukata +Message-Id: <20200606042627.61070-1-eiichi.tsukata@nutanix.com> +Signed-off-by: Paolo Bonzini +Acked-by: Joerg Roedel +--- + arch/x86/kvm/x86.c | 7 ++----- + include/linux/kvm_host.h | 4 ++-- + virt/kvm/kvm_main.c | 26 ++++++++++++++++---------- + 3 files changed, 20 insertions(+), 17 deletions(-) + +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -389,6 +389,18 @@ static void kvm_mmu_notifier_invalidate_ + srcu_read_unlock(&kvm->srcu, idx); + } + ++static void kvm_mmu_notifier_invalidate_range(struct mmu_notifier *mn, ++ struct mm_struct *mm, ++ unsigned long start, unsigned long end) ++{ ++ struct kvm *kvm = mmu_notifier_to_kvm(mn); ++ int idx; ++ ++ idx = srcu_read_lock(&kvm->srcu); ++ kvm_arch_mmu_notifier_invalidate_range(kvm, start, end); ++ srcu_read_unlock(&kvm->srcu, idx); ++} ++ + static void kvm_mmu_notifier_change_pte(struct mmu_notifier *mn, + struct mm_struct *mm, + unsigned long address, +@@ -429,8 +441,6 @@ static void kvm_mmu_notifier_invalidate_ + + spin_unlock(&kvm->mmu_lock); + +- kvm_arch_mmu_notifier_invalidate_range(kvm, start, end); +- + srcu_read_unlock(&kvm->srcu, idx); + } + +@@ -540,6 +550,7 @@ static void kvm_mmu_notifier_release(str + + static const struct mmu_notifier_ops kvm_mmu_notifier_ops = { + .invalidate_page = kvm_mmu_notifier_invalidate_page, ++ .invalidate_range = kvm_mmu_notifier_invalidate_range, + .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start, + .invalidate_range_end = kvm_mmu_notifier_invalidate_range_end, + .clear_flush_young = kvm_mmu_notifier_clear_flush_young, + diff --git a/patches.suse/loop-replace-kill_bdev-with-invalidate_bdev.patch b/patches.suse/loop-replace-kill_bdev-with-invalidate_bdev.patch new file mode 100644 index 0000000..c0fbe4b --- /dev/null +++ b/patches.suse/loop-replace-kill_bdev-with-invalidate_bdev.patch @@ -0,0 +1,74 @@ +From f4bd34b139a3fa2808c4205f12714c65e1548c6c Mon Sep 17 00:00:00 2001 +From: Zheng Bin +Date: Thu, 18 Jun 2020 12:21:37 +0800 +Subject: [PATCH] loop: replace kill_bdev with invalidate_bdev +Git-commit: f4bd34b139a3fa2808c4205f12714c65e1548c6c +Patch-mainline: v5.8-rc2 +References: bsc#1173820 + +When a filesystem is mounted on a loop device and on a loop ioctl +LOOP_SET_STATUS64, because of kill_bdev, buffer_head mappings are getting +destroyed. +kill_bdev + truncate_inode_pages + truncate_inode_pages_range + do_invalidatepage + block_invalidatepage + discard_buffer -->clear BH_Mapped flag + +sb_bread + __bread_gfp + bh = __getblk_gfp + -->discard_buffer clear BH_Mapped flag + __bread_slow + submit_bh + submit_bh_wbc + BUG_ON(!buffer_mapped(bh)) --> hit this BUG_ON + +Fixes: 5db470e229e2 ("loop: drop caches if offset or block_size are changed") +Signed-off-by: Zheng Bin +Reviewed-by: Christoph Hellwig +Reviewed-by: Bart Van Assche +Signed-off-by: Jens Axboe +Acked-by: Jan Kara + +--- + drivers/block/loop.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/block/loop.c ++++ b/drivers/block/loop.c +@@ -1160,7 +1160,7 @@ loop_set_status(struct loop_device *lo, + if (lo->lo_offset != info->lo_offset || + lo->lo_sizelimit != info->lo_sizelimit) { + sync_blockdev(lo->lo_device); +- kill_bdev(lo->lo_device); ++ invalidate_bdev(lo->lo_device); + } + + /* I/O need to be drained during transfer transition */ +@@ -1207,7 +1207,7 @@ loop_set_status(struct loop_device *lo, + + if (lo->lo_offset != info->lo_offset || + lo->lo_sizelimit != info->lo_sizelimit) { +- /* kill_bdev should have truncated all the pages */ ++ /* invalidate_bdev should have truncated all the pages */ + if (lo->lo_device->bd_inode->i_mapping->nrpages) { + err = -EAGAIN; + pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n", +@@ -1407,13 +1407,13 @@ static int loop_set_block_size(struct + + if (lo->lo_queue->limits.logical_block_size != arg) { + sync_blockdev(lo->lo_device); +- kill_bdev(lo->lo_device); ++ invalidate_bdev(lo->lo_device); + } + + blk_mq_freeze_queue(lo->lo_queue); + +- /* kill_bdev should have truncated all the pages */ ++ /* invalidate_bdev should have truncated all the pages */ + if (lo->lo_queue->limits.logical_block_size != arg && + lo->lo_device->bd_inode->i_mapping->nrpages) { + err = -EAGAIN; + pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n", diff --git a/patches.suse/lpfc_debugfs-get-rid-of-pointless-access_ok.patch b/patches.suse/lpfc_debugfs-get-rid-of-pointless-access_ok.patch new file mode 100644 index 0000000..4f59fb9 --- /dev/null +++ b/patches.suse/lpfc_debugfs-get-rid-of-pointless-access_ok.patch @@ -0,0 +1,44 @@ +From: Al Viro +Date: Wed, 22 Apr 2020 23:20:52 -0400 +Subject: lpfc_debugfs: get rid of pointless access_ok() +Patch-mainline: v5.8-rc1 +Git-commit: e6c0433e270ae96fb62fd30cf7c2c7bf57d5391f +References: bsc#1172687 bsc#1171530 + + No, you do NOT need to "protect copy from user" that way. +Incidentally, your userland ABI stinks. I understand that you +wanted to accept "reset" and "reset\n" as equivalent, but I suspect +that accepting "reset this, you !@^!@!" had been an accident. +Nothing to do about that now - it is a userland ABI... + +Signed-off-by: Al Viro +[dwagner: update context] +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_debugfs.c | 8 -------- + 1 file changed, 8 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_debugfs.c ++++ b/drivers/scsi/lpfc/lpfc_debugfs.c +@@ -2166,10 +2166,6 @@ lpfc_debugfs_lockstat_write(struct file + char *pbuf; + int i; + +- /* Protect copy from user */ +- if (!access_ok(VERIFY_READ, buf, nbytes)) +- return -EFAULT; +- + memset(mybuf, 0, sizeof(mybuf)); + + if (copy_from_user(mybuf, buf, nbytes)) +@@ -2787,10 +2783,6 @@ lpfc_debugfs_scsistat_write(struct file + char mybuf[6] = {0}; + int i; + +- /* Protect copy from user */ +- if (!access_ok(VERIFY_READ, buf, nbytes)) +- return -EFAULT; +- + if (copy_from_user(mybuf, buf, (nbytes >= sizeof(mybuf)) ? + (sizeof(mybuf) - 1) : nbytes)) + return -EFAULT; diff --git a/patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-order.patch b/patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-order.patch new file mode 100644 index 0000000..e7de744 --- /dev/null +++ b/patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-order.patch @@ -0,0 +1,75 @@ +From: Ido Schimmel +Date: Wed, 10 Apr 2019 06:58:14 +0000 +Subject: mlxsw: core: Do not use WQ_MEM_RECLAIM for mlxsw ordered workqueue +Patch-mainline: v5.1-rc6 +Git-commit: 4af0699782e2cc7d0d89db9eb6f8844dd3df82dc +References: git-fixes + +The ordered workqueue is used to offload various objects such as routes +and neighbours in the order they are notified. + +It should not be called as part of memory reclaim path, so remove the +WQ_MEM_RECLAIM flag. This can also result in a warning [1], if a worker +tries to flush a non-WQ_MEM_RECLAIM workqueue. + +[1] +[97703.542861] workqueue: WQ_MEM_RECLAIM mlxsw_core_ordered:mlxsw_sp_router_fib6_event_work [mlxsw_spectrum] is flushing !WQ_MEM_RECLAIM events:rht_deferred_worker +[97703.542884] WARNING: CPU: 1 PID: 32492 at kernel/workqueue.c:2605 check_flush_dependency+0xb5/0x130 +... +[97703.542988] Hardware name: Mellanox Technologies Ltd. MSN3700C/VMOD0008, BIOS 5.11 10/10/2018 +[97703.543049] Workqueue: mlxsw_core_ordered mlxsw_sp_router_fib6_event_work [mlxsw_spectrum] +[97703.543061] RIP: 0010:check_flush_dependency+0xb5/0x130 +... +[97703.543071] RSP: 0018:ffffb3f08137bc00 EFLAGS: 00010086 +[97703.543076] RAX: 0000000000000000 RBX: ffff96e07740ae00 RCX: 0000000000000000 +[97703.543080] RDX: 0000000000000094 RSI: ffffffff82dc1934 RDI: 0000000000000046 +[97703.543084] RBP: ffffb3f08137bc20 R08: ffffffff82dc18a0 R09: 00000000000225c0 +[97703.543087] R10: 0000000000000000 R11: 0000000000007eec R12: ffffffff816e4ee0 +[97703.543091] R13: ffff96e06f6a5c00 R14: ffff96e077ba7700 R15: ffffffff812ab0c0 +[97703.543097] FS: 0000000000000000(0000) GS:ffff96e077a80000(0000) knlGS:0000000000000000 +[97703.543101] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[97703.543104] CR2: 00007f8cd135b280 CR3: 00000001e860e003 CR4: 00000000003606e0 +[97703.543109] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +[97703.543112] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +[97703.543115] Call Trace: +[97703.543129] __flush_work+0xbd/0x1e0 +[97703.543137] ? __cancel_work_timer+0x136/0x1b0 +[97703.543145] ? pwq_dec_nr_in_flight+0x49/0xa0 +[97703.543154] __cancel_work_timer+0x136/0x1b0 +[97703.543175] ? mlxsw_reg_trans_bulk_wait+0x145/0x400 [mlxsw_core] +[97703.543184] cancel_work_sync+0x10/0x20 +[97703.543191] rhashtable_free_and_destroy+0x23/0x140 +[97703.543198] rhashtable_destroy+0xd/0x10 +[97703.543254] mlxsw_sp_fib_destroy+0xb1/0xf0 [mlxsw_spectrum] +[97703.543310] mlxsw_sp_vr_put+0xa8/0xc0 [mlxsw_spectrum] +[97703.543364] mlxsw_sp_fib_node_put+0xbf/0x140 [mlxsw_spectrum] +[97703.543418] ? mlxsw_sp_fib6_entry_destroy+0xe8/0x110 [mlxsw_spectrum] +[97703.543475] mlxsw_sp_router_fib6_event_work+0x6cd/0x7f0 [mlxsw_spectrum] +[97703.543484] process_one_work+0x1fd/0x400 +[97703.543493] worker_thread+0x34/0x410 +[97703.543500] kthread+0x121/0x140 +[97703.543507] ? process_one_work+0x400/0x400 +[97703.543512] ? kthread_park+0x90/0x90 +[97703.543523] ret_from_fork+0x35/0x40 + +Fixes: a3832b31898f ("mlxsw: core: Create an ordered workqueue for FIB offload") +Signed-off-by: Ido Schimmel +Reported-by: Semion Lisyansky +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -1878,7 +1878,7 @@ static int __init mlxsw_core_module_init + mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, WQ_MEM_RECLAIM, 0); + if (!mlxsw_wq) + return -ENOMEM; +- mlxsw_owq = alloc_ordered_workqueue("%s_ordered", WQ_MEM_RECLAIM, ++ mlxsw_owq = alloc_ordered_workqueue("%s_ordered", 0, + mlxsw_core_driver_name); + if (!mlxsw_owq) { + err = -ENOMEM; diff --git a/patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-workq.patch b/patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-workq.patch new file mode 100644 index 0000000..dcdee16 --- /dev/null +++ b/patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-workq.patch @@ -0,0 +1,34 @@ +From: Ido Schimmel +Date: Wed, 10 Apr 2019 06:58:15 +0000 +Subject: mlxsw: core: Do not use WQ_MEM_RECLAIM for mlxsw workqueue +Patch-mainline: v5.1-rc6 +Git-commit: b442fed1b724af0de087912a5718ddde1b87acbb +References: git-fixes + +The workqueue is used to periodically update the networking stack about +activity / statistics of various objects such as neighbours and TC +actions. + +It should not be called as part of memory reclaim path, so remove the +WQ_MEM_RECLAIM flag. + +Fixes: 3d5479e92087 ("mlxsw: core: Remove deprecated create_workqueue") +Signed-off-by: Ido Schimmel +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -1875,7 +1875,7 @@ static int __init mlxsw_core_module_init + { + int err; + +- mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, WQ_MEM_RECLAIM, 0); ++ mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, 0, 0); + if (!mlxsw_wq) + return -ENOMEM; + mlxsw_owq = alloc_ordered_workqueue("%s_ordered", 0, diff --git a/patches.suse/mlxsw-pci-Return-error-on-PCI-reset-timeout.patch b/patches.suse/mlxsw-pci-Return-error-on-PCI-reset-timeout.patch new file mode 100644 index 0000000..dc6146e --- /dev/null +++ b/patches.suse/mlxsw-pci-Return-error-on-PCI-reset-timeout.patch @@ -0,0 +1,35 @@ +From: Nir Dotan +Date: Fri, 18 Jan 2019 15:57:57 +0000 +Subject: mlxsw: pci: Return error on PCI reset timeout +Patch-mainline: v5.0-rc3 +Git-commit: 67c14cc9b35055264fc0efed00159a7de1819f1b +References: git-fixes + +Return an appropriate error in the case when the driver timeouts on waiting +for firmware to go out of PCI reset. + +Fixes: 233fa44bd67a ("mlxsw: pci: Implement reset done check") +Signed-off-by: Nir Dotan +Acked-by: Jiri Pirko +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/pci.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c +@@ -1367,10 +1367,10 @@ static int mlxsw_pci_sw_reset(struct mlx + u32 val = mlxsw_pci_read32(mlxsw_pci, FW_READY); + + if ((val & MLXSW_PCI_FW_READY_MASK) == MLXSW_PCI_FW_READY_MAGIC) +- break; ++ return 0; + cond_resched(); + } while (time_before(jiffies, end)); +- return 0; ++ return -EBUSY; + } + + static int mlxsw_pci_alloc_irq_vectors(struct mlxsw_pci *mlxsw_pci) diff --git a/patches.suse/mlxsw-spectrum-Disallow-prio-tagged-packets-when-PVI.patch b/patches.suse/mlxsw-spectrum-Disallow-prio-tagged-packets-when-PVI.patch new file mode 100644 index 0000000..72af773 --- /dev/null +++ b/patches.suse/mlxsw-spectrum-Disallow-prio-tagged-packets-when-PVI.patch @@ -0,0 +1,30 @@ +From: Ido Schimmel +Date: Tue, 11 Jun 2019 10:19:46 +0300 +Subject: mlxsw: spectrum: Disallow prio-tagged packets when PVID is removed +Patch-mainline: v5.2-rc6 +Git-commit: 4b14cc313f076c37b646cee06a85f0db59cf216c +References: git-fixes + +When PVID is removed from a bridge port, the Linux bridge drops both +untagged and prio-tagged packets. Align mlxsw with this behavior. + +Fixes: 148f472da5db ("mlxsw: reg: Add the Switch Port Acceptable Frame Types register") +Acked-by: Jiri Pirko +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -933,7 +933,7 @@ static inline void mlxsw_reg_spaft_pack( + MLXSW_REG_ZERO(spaft, payload); + mlxsw_reg_spaft_local_port_set(payload, local_port); + mlxsw_reg_spaft_allow_untagged_set(payload, allow_untagged); +- mlxsw_reg_spaft_allow_prio_tagged_set(payload, true); ++ mlxsw_reg_spaft_allow_prio_tagged_set(payload, allow_untagged); + mlxsw_reg_spaft_allow_tagged_set(payload, true); + } + diff --git a/patches.suse/mlxsw-spectrum-Prevent-force-of-56G.patch b/patches.suse/mlxsw-spectrum-Prevent-force-of-56G.patch new file mode 100644 index 0000000..41b11d6 --- /dev/null +++ b/patches.suse/mlxsw-spectrum-Prevent-force-of-56G.patch @@ -0,0 +1,36 @@ +From: Amit Cohen +Date: Wed, 29 May 2019 10:59:45 +0300 +Subject: mlxsw: spectrum: Prevent force of 56G +Patch-mainline: v5.2-rc3 +Git-commit: 275e928f19117d22f6d26dee94548baf4041b773 +References: git-fixes + +Force of 56G is not supported by hardware in Ethernet devices. This +configuration fails with a bad parameter error from firmware. + +Add check of this case. Instead of trying to set 56G with autoneg off, +return a meaningful error. + +Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC") +Signed-off-by: Amit Cohen +Acked-by: Jiri Pirko +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +@@ -2492,6 +2492,10 @@ mlxsw_sp_port_set_link_ksettings(struct + mlxsw_reg_ptys_eth_unpack(ptys_pl, ð_proto_cap, NULL, NULL); + + autoneg = cmd->base.autoneg == AUTONEG_ENABLE; ++ if (!autoneg && cmd->base.speed == SPEED_56000) { ++ netdev_err(dev, "56G not supported with autoneg off\n"); ++ return -EINVAL; ++ } + eth_proto_new = autoneg ? + mlxsw_sp_to_ptys_advert_link(cmd) : + mlxsw_sp_to_ptys_speed(cmd->base.speed); diff --git a/patches.suse/mlxsw-spectrum_acl_tcam-Position-vchunk-in-a-vregion.patch b/patches.suse/mlxsw-spectrum_acl_tcam-Position-vchunk-in-a-vregion.patch new file mode 100644 index 0000000..370a931 --- /dev/null +++ b/patches.suse/mlxsw-spectrum_acl_tcam-Position-vchunk-in-a-vregion.patch @@ -0,0 +1,52 @@ +From: Jiri Pirko +Date: Mon, 27 Apr 2020 18:05:47 +0300 +Subject: mlxsw: spectrum_acl_tcam: Position vchunk in a vregion list properly +Git-commit: 6ef4889fc0b3aa6ab928e7565935ac6f762cee6e +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +Vregion helpers to get min and max priority depend on the correct +ordering of vchunks in the vregion list. However, the current code +always adds new chunk to the end of the list, no matter what the +priority is. Fix this by finding the correct place in the list and put +vchunk there. + +[js] no virtual chunks and regions in 4.12, so adapt + +Fixes: 22a677661f56 ("mlxsw: spectrum: Introduce ACL core with simple TCAM implementation") +Signed-off-by: Jiri Pirko +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +@@ -587,7 +587,9 @@ mlxsw_sp_acl_tcam_chunk_assoc(struct mlx + struct mlxsw_afk_element_usage *elusage, + struct mlxsw_sp_acl_tcam_chunk *chunk) + { ++ struct mlxsw_sp_acl_tcam_chunk *chunk2; + struct mlxsw_sp_acl_tcam_region *region; ++ struct list_head *pos; + bool region_created = false; + bool need_split; + int err; +@@ -616,7 +618,14 @@ mlxsw_sp_acl_tcam_chunk_assoc(struct mlx + } + + chunk->region = region; +- list_add_tail(&chunk->list, ®ion->chunk_list); ++ ++ /* Position the chunk inside the list according to priority */ ++ list_for_each(pos, ®ion->chunk_list) { ++ chunk2 = list_entry(pos, typeof(*chunk2), list); ++ if (chunk2->priority > priority) ++ break; ++ } ++ list_add_tail(&chunk->list, pos); + + if (!region_created) + return 0; diff --git a/patches.suse/mlxsw-spectrum_dpipe-Add-missing-error-path.patch b/patches.suse/mlxsw-spectrum_dpipe-Add-missing-error-path.patch new file mode 100644 index 0000000..ad3c852 --- /dev/null +++ b/patches.suse/mlxsw-spectrum_dpipe-Add-missing-error-path.patch @@ -0,0 +1,38 @@ +From: Ido Schimmel +Date: Fri, 7 Feb 2020 19:26:28 +0200 +Subject: mlxsw: spectrum_dpipe: Add missing error path +Patch-mainline: v5.6-rc1 +Git-commit: 3a99cbb6fa7bca1995586ec2dc21b0368aad4937 +References: git-fixes + +In case devlink_dpipe_entry_ctx_prepare() failed, release RTNL that was +previously taken and free the memory allocated by +mlxsw_sp_erif_entry_prepare(). + +Fixes: 2ba5999f009d ("mlxsw: spectrum: Add Support for erif table entries access") +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c +@@ -215,7 +215,7 @@ mlxsw_sp_dpipe_table_erif_entries_dump(v + start_again: + err = devlink_dpipe_entry_ctx_prepare(dump_ctx); + if (err) +- return err; ++ goto err_ctx_prepare; + j = 0; + for (; i < rif_count; i++) { + struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); +@@ -247,6 +247,7 @@ start_again: + return 0; + err_entry_append: + err_entry_get: ++err_ctx_prepare: + rtnl_unlock(); + devlink_dpipe_entry_clear(&entry); + return err; diff --git a/patches.suse/mlxsw-spectrum_router-Refresh-nexthop-neighbour-when.patch b/patches.suse/mlxsw-spectrum_router-Refresh-nexthop-neighbour-when.patch new file mode 100644 index 0000000..932ef54 --- /dev/null +++ b/patches.suse/mlxsw-spectrum_router-Refresh-nexthop-neighbour-when.patch @@ -0,0 +1,135 @@ +From: Ido Schimmel +Date: Tue, 11 Jun 2019 10:19:41 +0300 +Subject: mlxsw: spectrum_router: Refresh nexthop neighbour when it becomes + dead +Patch-mainline: v5.2-rc6 +Git-commit: 83d5782681cc12b3d485a83cb34c46b2445f510c +References: git-fixes + +The driver tries to periodically refresh neighbours that are used to +reach nexthops. This is done by periodically calling neigh_event_send(). + +However, if the neighbour becomes dead, there is nothing we can do to +return it to a connected state and the above function call is basically +a NOP. + +This results in the nexthop never being written to the device's +adjacency table and therefore never used to forward packets. + +Fix this by dropping our reference from the dead neighbour and +associating the nexthop with a new neigbhour which we will try to +refresh. + +Fixes: a7ff87acd995 ("mlxsw: spectrum_router: Implement next-hop routing") +Signed-off-by: Ido Schimmel +Reported-by: Alex Veber +Tested-by: Alex Veber +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 73 +++++++++++++++++- + 1 file changed, 70 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +@@ -2355,7 +2355,7 @@ static void mlxsw_sp_router_probe_unreso + static void + mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_neigh_entry *neigh_entry, +- bool removing); ++ bool removing, bool dead); + + static enum mlxsw_reg_rauht_op mlxsw_sp_rauht_op(bool adding) + { +@@ -2486,7 +2486,8 @@ static void mlxsw_sp_router_neigh_event_ + + memcpy(neigh_entry->ha, ha, ETH_ALEN); + mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, entry_connected); +- mlxsw_sp_nexthop_neigh_update(mlxsw_sp, neigh_entry, !entry_connected); ++ mlxsw_sp_nexthop_neigh_update(mlxsw_sp, neigh_entry, !entry_connected, ++ dead); + + if (!neigh_entry->connected && list_empty(&neigh_entry->nexthop_list)) + mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); +@@ -3431,13 +3432,79 @@ static void __mlxsw_sp_nexthop_neigh_upd + nh->update = 1; + } + ++static int ++mlxsw_sp_nexthop_dead_neigh_replace(struct mlxsw_sp *mlxsw_sp, ++ struct mlxsw_sp_neigh_entry *neigh_entry) ++{ ++ struct neighbour *n, *old_n = neigh_entry->key.n; ++ struct mlxsw_sp_nexthop *nh; ++ bool entry_connected; ++ u8 nud_state, dead; ++ int err; ++ ++ nh = list_first_entry(&neigh_entry->nexthop_list, ++ struct mlxsw_sp_nexthop, neigh_list_node); ++ ++ n = neigh_lookup(nh->nh_grp->neigh_tbl, &nh->gw_addr, nh->rif->dev); ++ if (!n) { ++ n = neigh_create(nh->nh_grp->neigh_tbl, &nh->gw_addr, ++ nh->rif->dev); ++ if (IS_ERR(n)) ++ return PTR_ERR(n); ++ neigh_event_send(n, NULL); ++ } ++ ++ mlxsw_sp_neigh_entry_remove(mlxsw_sp, neigh_entry); ++ neigh_entry->key.n = n; ++ err = mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry); ++ if (err) ++ goto err_neigh_entry_insert; ++ ++ read_lock_bh(&n->lock); ++ nud_state = n->nud_state; ++ dead = n->dead; ++ read_unlock_bh(&n->lock); ++ entry_connected = nud_state & NUD_VALID && !dead; ++ ++ list_for_each_entry(nh, &neigh_entry->nexthop_list, ++ neigh_list_node) { ++ neigh_release(old_n); ++ neigh_clone(n); ++ __mlxsw_sp_nexthop_neigh_update(nh, !entry_connected); ++ mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp); ++ } ++ ++ neigh_release(n); ++ ++ return 0; ++ ++err_neigh_entry_insert: ++ neigh_entry->key.n = old_n; ++ mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry); ++ neigh_release(n); ++ return err; ++} ++ + static void + mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_neigh_entry *neigh_entry, +- bool removing) ++ bool removing, bool dead) + { + struct mlxsw_sp_nexthop *nh; + ++ if (list_empty(&neigh_entry->nexthop_list)) ++ return; ++ ++ if (dead) { ++ int err; ++ ++ err = mlxsw_sp_nexthop_dead_neigh_replace(mlxsw_sp, ++ neigh_entry); ++ if (err) ++ dev_err(mlxsw_sp->bus_info->dev, "Failed to replace dead neigh\n"); ++ return; ++ } ++ + list_for_each_entry(nh, &neigh_entry->nexthop_list, + neigh_list_node) { + __mlxsw_sp_nexthop_neigh_update(nh, removing); diff --git a/patches.suse/mlxsw-spectrum_router-Remove-inappropriate-usage-of-.patch b/patches.suse/mlxsw-spectrum_router-Remove-inappropriate-usage-of-.patch new file mode 100644 index 0000000..76f2689 --- /dev/null +++ b/patches.suse/mlxsw-spectrum_router-Remove-inappropriate-usage-of-.patch @@ -0,0 +1,42 @@ +From: Ido Schimmel +Date: Fri, 10 Jul 2020 16:41:38 +0300 +Subject: mlxsw: spectrum_router: Remove inappropriate usage of WARN_ON() +Patch-mainline: v5.8-rc5 +Git-commit: d9d5420273997664a1c09151ca86ac993f2f89c1 +References: git-fixes + +We should not trigger a warning when a memory allocation fails. Remove +the WARN_ON(). + +The warning is constantly triggered by syzkaller when it is injecting +faults: + +[ 2230.758664] FAULT_INJECTION: forcing a failure. +[ 2230.758664] name failslab, interval 1, probability 0, space 0, times 0 +[ 2230.762329] CPU: 3 PID: 1407 Comm: syz-executor.0 Not tainted 5.8.0-rc2+ #28 +... +[ 2230.898175] WARNING: CPU: 3 PID: 1407 at drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:6265 mlxsw_sp_router_fib_event+0xfad/0x13e0 +[ 2230.898179] Kernel panic - not syncing: panic_on_warn set ... +[ 2230.898183] CPU: 3 PID: 1407 Comm: syz-executor.0 Not tainted 5.8.0-rc2+ #28 +[ 2230.898190] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 + +Fixes: 3057224e014c ("mlxsw: spectrum_router: Implement FIB offload in deferred work") +Signed-off-by: Ido Schimmel +Reviewed-by: Jiri Pirko +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +@@ -6099,7 +6099,7 @@ static int mlxsw_sp_router_fib_event(str + } + + fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC); +- if (WARN_ON(!fib_work)) ++ if (!fib_work) + return NOTIFY_BAD; + + fib_work->mlxsw_sp = router->mlxsw_sp; diff --git a/patches.suse/mlxsw-spectrum_switchdev-Add-MDB-entries-in-prepare-.patch b/patches.suse/mlxsw-spectrum_switchdev-Add-MDB-entries-in-prepare-.patch new file mode 100644 index 0000000..480cba0 --- /dev/null +++ b/patches.suse/mlxsw-spectrum_switchdev-Add-MDB-entries-in-prepare-.patch @@ -0,0 +1,64 @@ +From: Ido Schimmel +Date: Wed, 10 Apr 2019 06:58:12 +0000 +Subject: mlxsw: spectrum_switchdev: Add MDB entries in prepare phase +Patch-mainline: v5.1-rc6 +Git-commit: d4d0e40977ac450f32f2db5e4d8e23c9d2578899 +References: git-fixes + +The driver cannot guarantee in the prepare phase that it will be able to +write an MDB entry to the device. In case the driver returned success +during the prepare phase, but then failed to add the entry in the commit +phase, a WARNING [1] will be generated by the switchdev core. + +Fix this by doing the work in the prepare phase instead. + +[1] +[ 358.544486] swp12s0: Commit of object (id=2) failed. +[ 358.550061] WARNING: CPU: 0 PID: 30 at net/switchdev/switchdev.c:281 switchdev_port_obj_add_now+0x9b/0xe0 +[ 358.560754] CPU: 0 PID: 30 Comm: kworker/0:1 Not tainted 5.0.0-custom-13382-gf2449babf221 #1350 +[ 358.570472] Hardware name: Mellanox Technologies Ltd. MSN2100-CB2FO/SA001017, BIOS 5.6.5 06/07/2016 +[ 358.580582] Workqueue: events switchdev_deferred_process_work +[ 358.587001] RIP: 0010:switchdev_port_obj_add_now+0x9b/0xe0 +... +[ 358.614109] RSP: 0018:ffffa6b900d6fe18 EFLAGS: 00010286 +[ 358.619943] RAX: 0000000000000000 RBX: ffff8b00797ff000 RCX: 0000000000000000 +[ 358.627912] RDX: ffff8b00b7a1d4c0 RSI: ffff8b00b7a152e8 RDI: ffff8b00b7a152e8 +[ 358.635881] RBP: ffff8b005c3f5bc0 R08: 000000000000022b R09: 0000000000000000 +[ 358.643850] R10: 0000000000000000 R11: ffffa6b900d6fcc8 R12: 0000000000000000 +[ 358.651819] R13: dead000000000100 R14: ffff8b00b65a23c0 R15: 0ffff8b00b7a2200 +[ 358.659790] FS: 0000000000000000(0000) GS:ffff8b00b7a00000(0000) knlGS:0000000000000000 +[ 358.668820] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 358.675228] CR2: 00007f00aad90de0 CR3: 00000001ca80d000 CR4: 00000000001006f0 +[ 358.683188] Call Trace: +[ 358.685918] switchdev_port_obj_add_deferred+0x13/0x60 +[ 358.691655] switchdev_deferred_process+0x6b/0xf0 +[ 358.696907] switchdev_deferred_process_work+0xa/0x10 +[ 358.702548] process_one_work+0x1f5/0x3f0 +[ 358.707022] worker_thread+0x28/0x3c0 +[ 358.711099] ? process_one_work+0x3f0/0x3f0 +[ 358.715768] kthread+0x10d/0x130 +[ 358.719369] ? __kthread_create_on_node+0x180/0x180 +[ 358.724815] ret_from_fork+0x35/0x40 + +Fixes: 3a49b4fde2a1 ("mlxsw: Adding layer 2 multicast support") +Signed-off-by: Ido Schimmel +Reported-by: Alex Kushnarov +Tested-by: Alex Kushnarov +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +@@ -1665,7 +1665,7 @@ static int mlxsw_sp_port_mdb_add(struct + u16 fid_index; + int err = 0; + +- if (switchdev_trans_ph_prepare(trans)) ++ if (switchdev_trans_ph_commit(trans)) + return 0; + + bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev); diff --git a/patches.suse/mlxsw-spectrum_switchdev-Do-not-treat-static-FDB-ent.patch b/patches.suse/mlxsw-spectrum_switchdev-Do-not-treat-static-FDB-ent.patch new file mode 100644 index 0000000..22fbf34 --- /dev/null +++ b/patches.suse/mlxsw-spectrum_switchdev-Do-not-treat-static-FDB-ent.patch @@ -0,0 +1,76 @@ +From: Ido Schimmel +Date: Fri, 18 Jan 2019 15:58:01 +0000 +Subject: mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky +Patch-mainline: v5.0-rc3 +Git-commit: 64254a2054611205798e6bde634639bc704573ac +References: git-fixes + +The driver currently treats static FDB entries as both static and +sticky. This is incorrect and prevents such entries from being roamed to +a different port via learning. + +Fix this by configuring static entries with ageing disabled and roaming +enabled. + +In net-next we can add proper support for the newly introduced 'sticky' +flag. + +Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC") +Signed-off-by: Ido Schimmel +Reported-by: Alexander Petrovskiy +Reviewed-by: Petr Machata +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +@@ -1244,7 +1244,7 @@ mlxsw_sp_bridge_port_fdb_flush(struct ml + static enum mlxsw_reg_sfd_rec_policy mlxsw_sp_sfd_rec_policy(bool dynamic) + { + return dynamic ? MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_INGRESS : +- MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY; ++ MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_MLAG; + } + + static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding) +@@ -1301,7 +1301,7 @@ out: + static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, + const char *mac, u16 fid, bool adding, + enum mlxsw_reg_sfd_rec_action action, +- bool dynamic) ++ enum mlxsw_reg_sfd_rec_policy policy) + { + char *sfd_pl; + u8 num_rec; +@@ -1312,8 +1312,7 @@ static int __mlxsw_sp_port_fdb_uc_op(str + return -ENOMEM; + + mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0); +- mlxsw_reg_sfd_uc_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic), +- mac, fid, action, local_port); ++ mlxsw_reg_sfd_uc_pack(sfd_pl, 0, policy, mac, fid, action, local_port); + num_rec = mlxsw_reg_sfd_num_rec_get(sfd_pl); + err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); + if (err) +@@ -1332,7 +1331,8 @@ static int mlxsw_sp_port_fdb_uc_op(struc + bool dynamic) + { + return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, adding, +- MLXSW_REG_SFD_REC_ACTION_NOP, dynamic); ++ MLXSW_REG_SFD_REC_ACTION_NOP, ++ mlxsw_sp_sfd_rec_policy(dynamic)); + } + + int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, +@@ -1340,7 +1340,7 @@ int mlxsw_sp_rif_fdb_op(struct mlxsw_sp + { + return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, 0, mac, fid, adding, + MLXSW_REG_SFD_REC_ACTION_FORWARD_IP_ROUTER, +- false); ++ MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY); + } + + static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id, diff --git a/patches.suse/msft-hv-2106-Drivers-hv-Change-flag-to-write-log-level-in-panic-m.patch b/patches.suse/msft-hv-2106-Drivers-hv-Change-flag-to-write-log-level-in-panic-m.patch new file mode 100644 index 0000000..6cda00e --- /dev/null +++ b/patches.suse/msft-hv-2106-Drivers-hv-Change-flag-to-write-log-level-in-panic-m.patch @@ -0,0 +1,39 @@ +From: Joseph Salisbury +Date: Fri, 26 Jun 2020 15:28:17 -0700 +Patch-mainline: v5.8-rc4 +Subject: Drivers: hv: Change flag to write log level in panic msg to false +Git-commit: 77b48bea2fee47c15a835f6725dd8df0bc38375a +References: bsc#1170617, bsc#1170618 + +When the kernel panics, one page of kmsg data may be collected and sent to +Hyper-V to aid in diagnosing the failure. The collected kmsg data typically + contains 50 to 100 lines, each of which has a log level prefix that isn't +very useful from a diagnostic standpoint. So tell kmsg_dump_get_buffer() +to not include the log level, enabling more information that *is* useful to +fit in the page. + +Requesting in stable kernels, since many kernels running in production are +stable releases. + +Cc: stable@vger.kernel.org +Signed-off-by: Joseph Salisbury +Reviewed-by: Michael Kelley +Link: https://lore.kernel.org/r/1593210497-114310-1-git-send-email-joseph.salisbury@microsoft.com +Signed-off-by: Wei Liu +Acked-by: Olaf Hering +--- + drivers/hv/vmbus_drv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -1368,7 +1368,7 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper, + * Write dump contents to the page. No need to synchronize; panic should + * be single-threaded. + */ +- kmsg_dump_get_buffer(dumper, true, hv_panic_page, PAGE_SIZE, ++ kmsg_dump_get_buffer(dumper, false, hv_panic_page, PAGE_SIZE, + &bytes_written); + if (bytes_written) + hyperv_report_panic_msg(panic_pa, bytes_written); diff --git a/patches.suse/mvpp2-remove-misleading-comment.patch b/patches.suse/mvpp2-remove-misleading-comment.patch new file mode 100644 index 0000000..46889ee --- /dev/null +++ b/patches.suse/mvpp2-remove-misleading-comment.patch @@ -0,0 +1,37 @@ +From: Matteo Croce +Date: Wed, 2 Oct 2019 23:49:04 +0200 +Subject: mvpp2: remove misleading comment +Patch-mainline: v5.5-rc1 +Git-commit: 80f60a911e5ea4de9e25b539bec4f597af7b2ff4 +References: git-fixes + +Recycling in mvpp2 has gone long time ago, but two comment still refers +to it. Remove those two misleading comments as they generate confusion. + +Fixes: 7ef7e1d949cd ("net: mvpp2: drop useless fields in mvpp2_bm_pool and related code") +Signed-off-by: Matteo Croce +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c ++++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +@@ -2619,7 +2619,7 @@ static void mvpp2_rx_csum(struct mvpp2_p + skb->ip_summed = CHECKSUM_NONE; + } + +-/* Reuse skb if possible, or allocate a new skb and add it to BM pool */ ++/* Allocate a new skb and add it to BM pool */ + static int mvpp2_rx_refill(struct mvpp2_port *port, + struct mvpp2_bm_pool *bm_pool, int pool) + { +@@ -2627,7 +2627,6 @@ static int mvpp2_rx_refill(struct mvpp2_ + phys_addr_t phys_addr; + void *buf; + +- /* No recycle or too many buffers are in use, so allocate a new skb */ + buf = mvpp2_buf_alloc(port, bm_pool, &dma_addr, &phys_addr, + GFP_ATOMIC); + if (!buf) diff --git a/patches.suse/net-cxgb4-Check-the-return-from-t4_query_params-prop.patch b/patches.suse/net-cxgb4-Check-the-return-from-t4_query_params-prop.patch new file mode 100644 index 0000000..0fc349c --- /dev/null +++ b/patches.suse/net-cxgb4-Check-the-return-from-t4_query_params-prop.patch @@ -0,0 +1,36 @@ +From: Jason Gunthorpe +Date: Tue, 14 Apr 2020 12:27:08 -0300 +Subject: net/cxgb4: Check the return from t4_query_params properly +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Patch-mainline: v5.7-rc2 +Git-commit: c799fca8baf18d1bbbbad6c3b736eefbde8bdb90 +References: git-fixes + +Positive return values are also failures that don't set val, +although this probably can't happen. Fixes gcc 10 warning: + +drivers/net/ethernet/chelsio/cxgb4/t4_hw.c: In function ‘t4_phy_fw_ver’: +drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:3747:14: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized] + 3747 | *phy_fw_ver = val; + +Fixes: 01b6961410b7 ("cxgb4: Add PHY firmware support for T420-BT cards") +Signed-off-by: Jason Gunthorpe +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +@@ -3748,7 +3748,7 @@ int t4_phy_fw_ver(struct adapter *adap, + FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_VERSION)); + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, + ¶m, &val); +- if (ret < 0) ++ if (ret) + return ret; + *phy_fw_ver = val; + return 0; diff --git a/patches.suse/net-dsa-loop-Add-module-soft-dependency.patch b/patches.suse/net-dsa-loop-Add-module-soft-dependency.patch new file mode 100644 index 0000000..5364430 --- /dev/null +++ b/patches.suse/net-dsa-loop-Add-module-soft-dependency.patch @@ -0,0 +1,30 @@ +From: Florian Fainelli +Date: Sat, 9 May 2020 16:45:44 -0700 +Subject: net: dsa: loop: Add module soft dependency +Git-commit: 3047211ca11bf77b3ecbce045c0aa544d934b945 +Patch-mainline: 5.7-rc6 +References: networking-stable-20_05_16 + +There is a soft dependency against dsa_loop_bdinfo.ko which sets up the +MDIO device registration, since there are no symbols referenced by +dsa_loop.ko, there is no automatic loading of dsa_loop_bdinfo.ko which +is needed. + +Fixes: 98cd1552ea27 ("net: dsa: Mock-up driver") +Signed-off-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +Signed-off-by: Jiri Slaby +--- + drivers/net/dsa/dsa_loop.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/dsa/dsa_loop.c ++++ b/drivers/net/dsa/dsa_loop.c +@@ -326,6 +326,7 @@ static void __exit dsa_loop_exit(void) + } + module_exit(dsa_loop_exit); + ++MODULE_SOFTDEP("pre: dsa_loop_bdinfo"); + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Florian Fainelli"); + MODULE_DESCRIPTION("DSA loopback driver"); diff --git a/patches.suse/net-dsa-mt7530-fix-roaming-from-DSA-user-ports.patch b/patches.suse/net-dsa-mt7530-fix-roaming-from-DSA-user-ports.patch new file mode 100644 index 0000000..69ee6b8 --- /dev/null +++ b/patches.suse/net-dsa-mt7530-fix-roaming-from-DSA-user-ports.patch @@ -0,0 +1,119 @@ +From: DENG Qingfang +Date: Wed, 13 May 2020 23:10:16 +0800 +Subject: net: dsa: mt7530: fix roaming from DSA user ports +Git-commit: 5e5502e012b8129e11be616acb0f9c34bc8f8adb +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +When a client moves from a DSA user port to a software port in a bridge, +it cannot reach any other clients that connected to the DSA user ports. +That is because SA learning on the CPU port is disabled, so the switch +ignores the client's frames from the CPU port and still thinks it is at +the user port. + +Fix it by enabling SA learning on the CPU port. + +To prevent the switch from learning from flooding frames from the CPU +port, set skb->offload_fwd_mark to 1 for unicast and broadcast frames, +and let the switch flood them instead of trapping to the CPU port. +Multicast frames still need to be trapped to the CPU port for snooping, +so set the SA_DIS bit of the MTK tag to 1 when transmitting those frames +to disable SA learning. + +Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") +Signed-off-by: DENG Qingfang +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/dsa/mt7530.c | 9 ++------- + drivers/net/dsa/mt7530.h | 1 + + net/dsa/tag_mtk.c | 16 ++++++++++++++++ + 3 files changed, 19 insertions(+), 7 deletions(-) + +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -640,11 +640,8 @@ mt7530_cpu_port_enable(struct mt7530_pri + /* Setup the MAC by default for the cpu port */ + mt7530_write(priv, MT7530_PMCR_P(port), PMCR_CPUP_LINK); + +- /* Disable auto learning on the cpu port */ +- mt7530_set(priv, MT7530_PSC_P(port), SA_DIS); +- +- /* Unknown unicast frame fordwarding to the cpu port */ +- mt7530_set(priv, MT7530_MFC, UNU_FFP(BIT(port))); ++ /* Unknown multicast frame forwarding to the cpu port */ ++ mt7530_rmw(priv, MT7530_MFC, UNM_FFP_MASK, UNM_FFP(BIT(port))); + + /* CPU port gets connected to all user ports of + * the switch +@@ -981,8 +978,6 @@ mt7530_setup(struct dsa_switch *ds) + /* Enable and reset MIB counters */ + mt7530_mib_reset(ds); + +- mt7530_clear(priv, MT7530_MFC, UNU_FFP_MASK); +- + for (i = 0; i < MT7530_NUM_PORTS; i++) { + /* Disable forwarding by default on all ports */ + mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK, +--- a/drivers/net/dsa/mt7530.h ++++ b/drivers/net/dsa/mt7530.h +@@ -33,6 +33,7 @@ + #define MT7530_MFC 0x10 + #define BC_FFP(x) (((x) & 0xff) << 24) + #define UNM_FFP(x) (((x) & 0xff) << 16) ++#define UNM_FFP_MASK UNM_FFP(~0) + #define UNU_FFP(x) (((x) & 0xff) << 8) + #define UNU_FFP_MASK UNU_FFP(~0) + +--- a/net/dsa/tag_mtk.c ++++ b/net/dsa/tag_mtk.c +@@ -19,12 +19,16 @@ + #define MTK_HDR_LEN 4 + #define MTK_HDR_RECV_SOURCE_PORT_MASK GENMASK(2, 0) + #define MTK_HDR_XMIT_DP_BIT_MASK GENMASK(5, 0) ++#define MTK_HDR_XMIT_SA_DIS BIT(6) + + static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb, + struct net_device *dev) + { + struct dsa_slave_priv *p = netdev_priv(dev); + u8 *mtk_tag; ++ unsigned char *dest = eth_hdr(skb)->h_dest; ++ bool is_multicast_skb = is_multicast_ether_addr(dest) && ++ !is_broadcast_ether_addr(dest); + + if (skb_cow_head(skb, MTK_HDR_LEN) < 0) + goto out_free; +@@ -37,6 +41,11 @@ static struct sk_buff *mtk_tag_xmit(stru + mtk_tag = skb->data + 2 * ETH_ALEN; + mtk_tag[0] = 0; + mtk_tag[1] = (1 << p->dp->index) & MTK_HDR_XMIT_DP_BIT_MASK; ++ ++ /* Disable SA learning for multicast frames */ ++ if (unlikely(is_multicast_skb)) ++ mtk_tag[1] |= MTK_HDR_XMIT_SA_DIS; ++ + mtk_tag[2] = 0; + mtk_tag[3] = 0; + +@@ -55,6 +64,9 @@ static struct sk_buff *mtk_tag_rcv(struc + struct dsa_switch *ds; + int port; + __be16 *phdr, hdr; ++ unsigned char *dest = eth_hdr(skb)->h_dest; ++ bool is_multicast_skb = is_multicast_ether_addr(dest) && ++ !is_broadcast_ether_addr(dest); + + if (unlikely(!pskb_may_pull(skb, MTK_HDR_LEN))) + goto out_drop; +@@ -88,6 +100,10 @@ static struct sk_buff *mtk_tag_rcv(struc + + skb->dev = ds->ports[port].netdev; + ++ /* Only unicast or broadcast frames are offloaded */ ++ if (likely(!is_multicast_skb)) ++ skb->offload_fwd_mark = 1; ++ + return skb; + + out_drop: diff --git a/patches.suse/net-ena-add-intr_moder_rx_interval-to-struct-ena_com.patch b/patches.suse/net-ena-add-intr_moder_rx_interval-to-struct-ena_com.patch new file mode 100644 index 0000000..5d59d19 --- /dev/null +++ b/patches.suse/net-ena-add-intr_moder_rx_interval-to-struct-ena_com.patch @@ -0,0 +1,113 @@ +From: Arthur Kiyanovski +Date: Mon, 16 Sep 2019 14:31:26 +0300 +Subject: net: ena: add intr_moder_rx_interval to struct ena_com_dev and use it +Patch-mainline: v5.4-rc1 +Git-commit: 15619e722b16aaa40f942b93631aa92581a7b393 +References: git-fixes + +Add intr_moder_rx_interval to struct ena_com_dev and use it as the +location where the interrupt moderation rx interval is saved, instead +of the interrupt moderation table. + +This is done as a first step before removing the old interrupt moderation +code. + +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 20 ++++---------------- + drivers/net/ethernet/amazon/ena/ena_com.h | 8 +++++++- + drivers/net/ethernet/amazon/ena/ena_netdev.c | 3 ++- + 3 files changed, 13 insertions(+), 18 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -1297,9 +1297,6 @@ static int ena_com_init_interrupt_modera + static void ena_com_update_intr_delay_resolution(struct ena_com_dev *ena_dev, + u16 intr_delay_resolution) + { +- struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; +- unsigned int i; +- + if (!intr_delay_resolution) { + pr_err("Illegal intr_delay_resolution provided. Going to use default 1 usec resolution\n"); + intr_delay_resolution = 1; +@@ -1307,8 +1304,7 @@ static void ena_com_update_intr_delay_re + ena_dev->intr_delay_resolution = intr_delay_resolution; + + /* update Rx */ +- for (i = 0; i < ENA_INTR_MAX_NUM_OF_LEVELS; i++) +- intr_moder_tbl[i].intr_moder_interval /= intr_delay_resolution; ++ ena_dev->intr_moder_rx_interval /= intr_delay_resolution; + + /* update Tx */ + ena_dev->intr_moder_tx_interval /= intr_delay_resolution; +@@ -2798,11 +2794,8 @@ int ena_com_update_nonadaptive_moderatio + return -EFAULT; + } + +- /* We use LOWEST entry of moderation table for storing +- * nonadaptive interrupt coalescing values +- */ +- ena_dev->intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval = +- rx_coalesce_usecs / ena_dev->intr_delay_resolution; ++ ena_dev->intr_moder_rx_interval = rx_coalesce_usecs / ++ ena_dev->intr_delay_resolution; + + return 0; + } +@@ -2907,12 +2900,7 @@ unsigned int ena_com_get_nonadaptive_mod + + unsigned int ena_com_get_nonadaptive_moderation_interval_rx(struct ena_com_dev *ena_dev) + { +- struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; +- +- if (intr_moder_tbl) +- return intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval; +- +- return 0; ++ return ena_dev->intr_moder_rx_interval; + } + + void ena_com_init_intr_moderation_entry(struct ena_com_dev *ena_dev, +--- a/drivers/net/ethernet/amazon/ena/ena_com.h ++++ b/drivers/net/ethernet/amazon/ena/ena_com.h +@@ -93,7 +93,7 @@ + #define ENA_INTR_HIGHEST_BYTES (192 * 1024) + + #define ENA_INTR_INITIAL_TX_INTERVAL_USECS 196 +-#define ENA_INTR_INITIAL_RX_INTERVAL_USECS 4 ++#define ENA_INTR_INITIAL_RX_INTERVAL_USECS 0 + #define ENA_INTR_DELAY_OLD_VALUE_WEIGHT 6 + #define ENA_INTR_DELAY_NEW_VALUE_WEIGHT 4 + #define ENA_INTR_MODER_LEVEL_STRIDE 2 +@@ -376,7 +376,13 @@ struct ena_com_dev { + struct ena_host_attribute host_attr; + bool adaptive_coalescing; + u16 intr_delay_resolution; ++ ++ /* interrupt moderation intervals are in usec divided by ++ * intr_delay_resolution, which is supplied by the device. ++ */ + u32 intr_moder_tx_interval; ++ u32 intr_moder_rx_interval; ++ + struct ena_intr_moder_entry *intr_moder_tbl; + + struct ena_com_llq_info llq_info; +--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c ++++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c +@@ -3487,10 +3487,11 @@ static int ena_probe(struct pci_dev *pde + calc_queue_ctx.get_feat_ctx = &get_feat_ctx; + calc_queue_ctx.pdev = pdev; + +- /* initial Tx interrupt delay, Assumes 1 usec granularity. ++ /* Initial Tx and RX interrupt delay. Assumes 1 usec granularity. + * Updated during device initialization with the real granularity + */ + ena_dev->intr_moder_tx_interval = ENA_INTR_INITIAL_TX_INTERVAL_USECS; ++ ena_dev->intr_moder_rx_interval = ENA_INTR_INITIAL_RX_INTERVAL_USECS; + io_queue_num = ena_calc_io_queue_num(pdev, ena_dev, &get_feat_ctx); + rc = ena_calc_queue_size(&calc_queue_ctx); + if (rc || io_queue_num <= 0) { diff --git a/patches.suse/net-ena-add-missing-ethtool-TX-timestamping-indicati.patch b/patches.suse/net-ena-add-missing-ethtool-TX-timestamping-indicati.patch new file mode 100644 index 0000000..950d96d --- /dev/null +++ b/patches.suse/net-ena-add-missing-ethtool-TX-timestamping-indicati.patch @@ -0,0 +1,38 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:42 +0000 +Subject: net: ena: add missing ethtool TX timestamping indication +Patch-mainline: v5.6-rc2 +Git-commit: cf6d17fde93bdda23c9b02dd5906a12bf8c55209 +References: git-fixes + +Current implementation of the driver calls skb_tx_timestamp()to add a +software tx timestamp to the skb, however the software-transmit capability +is not reported in ethtool -T. + +This commit updates the ethtool structure to report the software-transmit +capability in ethtool -T using the standard ethtool_op_get_ts_info(). +This function reports all software timestamping capabilities (tx and rx), +as well as setting phc_index = -1. phc_index is the index of the PTP +hardware clock device that will be used for hardware timestamps. Since we +don't have such a device in ENA, using the default -1 value is the correct +setting. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Ezequiel Lara Gomez +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -805,6 +805,7 @@ static const struct ethtool_ops ena_etht + .get_channels = ena_get_channels, + .get_tunable = ena_get_tunable, + .set_tunable = ena_set_tunable, ++ .get_ts_info = ethtool_op_get_ts_info, + }; + + void ena_set_ethtool_ops(struct net_device *netdev) diff --git a/patches.suse/net-ena-avoid-memory-access-violation-by-validating-.patch b/patches.suse/net-ena-avoid-memory-access-violation-by-validating-.patch new file mode 100644 index 0000000..08eec5d --- /dev/null +++ b/patches.suse/net-ena-avoid-memory-access-violation-by-validating-.patch @@ -0,0 +1,67 @@ +From: Arthur Kiyanovski +Date: Tue, 17 Mar 2020 09:06:41 +0200 +Subject: net: ena: avoid memory access violation by validating req_id properly +Patch-mainline: v5.6 +Git-commit: 30623e1ed116bcd1785217d0a98eec643687e091 +References: git-fixes + +Rx req_id is an index in struct ena_eth_io_rx_cdesc_base. +The driver should validate that the Rx req_id it received from +the device is in range [0, ring_size -1]. Failure to do so could +yield to potential memory access violoation. +The validation was mistakenly done when refilling +the Rx submission queue and not in Rx completion queue. + +Fixes: ad974baef2a1 ("net: ena: add support for out of order rx buffers refill") +Signed-off-by: Noam Dagan +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_netdev.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c ++++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c +@@ -533,13 +533,9 @@ static int ena_refill_rx_bufs(struct ena + struct ena_rx_buffer *rx_info; + + req_id = rx_ring->free_ids[next_to_use]; +- rc = validate_rx_req_id(rx_ring, req_id); +- if (unlikely(rc < 0)) +- break; + + rx_info = &rx_ring->rx_buffer_info[req_id]; + +- + rc = ena_alloc_rx_page(rx_ring, rx_info, + GFP_ATOMIC | __GFP_COMP); + if (unlikely(rc < 0)) { +@@ -871,9 +867,15 @@ static struct sk_buff *ena_rx_skb(struct + struct ena_rx_buffer *rx_info; + u16 len, req_id, buf = 0; + void *va; ++ int rc; + + len = ena_bufs[buf].len; + req_id = ena_bufs[buf].req_id; ++ ++ rc = validate_rx_req_id(rx_ring, req_id); ++ if (unlikely(rc < 0)) ++ return NULL; ++ + rx_info = &rx_ring->rx_buffer_info[req_id]; + + if (unlikely(!rx_info->page)) { +@@ -946,6 +948,11 @@ static struct sk_buff *ena_rx_skb(struct + buf++; + len = ena_bufs[buf].len; + req_id = ena_bufs[buf].req_id; ++ ++ rc = validate_rx_req_id(rx_ring, req_id); ++ if (unlikely(rc < 0)) ++ return NULL; ++ + rx_info = &rx_ring->rx_buffer_info[req_id]; + } while (1); + diff --git a/patches.suse/net-ena-don-t-wake-up-tx-queue-when-down.patch b/patches.suse/net-ena-don-t-wake-up-tx-queue-when-down.patch new file mode 100644 index 0000000..b5108a6 --- /dev/null +++ b/patches.suse/net-ena-don-t-wake-up-tx-queue-when-down.patch @@ -0,0 +1,49 @@ +From: Sameeh Jubran +Date: Sun, 15 Sep 2019 17:29:44 +0300 +Subject: net: ena: don't wake up tx queue when down +Patch-mainline: v5.4-rc1 +Git-commit: a53651ec93a8d7ab5b26c5390e0c389048b4b4b6 +References: git-fixes + +There is a race condition that can occur when calling ena_down(). +The ena_clean_tx_irq() - which is a part of the napi handler - +function might wake up the tx queue when the queue is supposed +to be down (during recovery or changing the size of the queues +for example) This causes the ena_start_xmit() function to trigger +and possibly try to access the destroyed queues. + +The race is illustrated below: + +Flow A: Flow B(napi handler) +ena_down() + netif_carrier_off() + netif_tx_disable() + ena_clean_tx_irq() + netif_tx_wake_queue() + ena_napi_disable_all() + ena_destroy_all_io_queues() + +After these flows the tx queue is active and ena_start_xmit() accesses +the destroyed queue which leads to a kernel panic. + +fixes: 1738cd3ed342 (net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)) + +Signed-off-by: Sameeh Jubran +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_netdev.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c ++++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c +@@ -824,7 +824,8 @@ static int ena_clean_tx_irq(struct ena_r + above_thresh = + ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, + ENA_TX_WAKEUP_THRESH); +- if (netif_tx_queue_stopped(txq) && above_thresh) { ++ if (netif_tx_queue_stopped(txq) && above_thresh && ++ test_bit(ENA_FLAG_DEV_UP, &tx_ring->adapter->flags)) { + netif_tx_wake_queue(txq); + u64_stats_update_begin(&tx_ring->syncp); + tx_ring->tx_stats.queue_wakeup++; diff --git a/patches.suse/net-ena-ena-com.c-prevent-NULL-pointer-dereference.patch b/patches.suse/net-ena-ena-com.c-prevent-NULL-pointer-dereference.patch new file mode 100644 index 0000000..21253d2 --- /dev/null +++ b/patches.suse/net-ena-ena-com.c-prevent-NULL-pointer-dereference.patch @@ -0,0 +1,45 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:51 +0000 +Subject: net: ena: ena-com.c: prevent NULL pointer dereference +Patch-mainline: v5.6-rc2 +Git-commit: c207979f5ae10ed70aff1bb13f39f0736973de99 +References: git-fixes + +comp_ctx can be NULL in a very rare case when an admin command is executed +during the execution of ena_remove(). + +The bug scenario is as follows: + +* ena_destroy_device() sets the comp_ctx to be NULL +* An admin command is executed before executing unregister_netdev(), + this can still happen because our device can still receive callbacks + from the netdev infrastructure such as ethtool commands. +* When attempting to access the comp_ctx, the bug occurs since it's set + to NULL + +Fix: +Added a check that comp_ctx is not NULL + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -200,6 +200,11 @@ static void comp_ctxt_release(struct ena + static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *queue, + u16 command_id, bool capture) + { ++ if (unlikely(!queue->comp_ctx)) { ++ pr_err("Completion context is NULL\n"); ++ return NULL; ++ } ++ + if (unlikely(command_id >= queue->q_depth)) { + pr_err("command id is larger than the queue size. cmd_id: %u queue size %d\n", + command_id, queue->q_depth); diff --git a/patches.suse/net-ena-ethtool-use-correct-value-for-crc32-hash.patch b/patches.suse/net-ena-ethtool-use-correct-value-for-crc32-hash.patch new file mode 100644 index 0000000..efe07ef --- /dev/null +++ b/patches.suse/net-ena-ethtool-use-correct-value-for-crc32-hash.patch @@ -0,0 +1,38 @@ +From: Sameeh Jubran +Date: Tue, 11 Feb 2020 15:17:50 +0000 +Subject: net: ena: ethtool: use correct value for crc32 hash +Patch-mainline: v5.6-rc2 +Git-commit: 886d2089276e40d460731765083a741c5c762461 +References: git-fixes + +Up till kernel 4.11 there was no enum defined for crc32 hash in ethtool, +thus the xor enum was used for supporting crc32. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -693,7 +693,7 @@ static int ena_get_rxfh(struct net_devic + func = ETH_RSS_HASH_TOP; + break; + case ENA_ADMIN_CRC32: +- func = ETH_RSS_HASH_XOR; ++ func = ETH_RSS_HASH_CRC32; + break; + default: + netif_err(adapter, drv, netdev, +@@ -742,7 +742,7 @@ static int ena_set_rxfh(struct net_devic + case ETH_RSS_HASH_TOP: + func = ENA_ADMIN_TOEPLITZ; + break; +- case ETH_RSS_HASH_XOR: ++ case ETH_RSS_HASH_CRC32: + func = ENA_ADMIN_CRC32; + break; + default: diff --git a/patches.suse/net-ena-fix-continuous-keep-alive-resets.patch b/patches.suse/net-ena-fix-continuous-keep-alive-resets.patch new file mode 100644 index 0000000..f5a6dc1 --- /dev/null +++ b/patches.suse/net-ena-fix-continuous-keep-alive-resets.patch @@ -0,0 +1,39 @@ +From: Arthur Kiyanovski +Date: Tue, 17 Mar 2020 09:06:42 +0200 +Subject: net: ena: fix continuous keep-alive resets +Patch-mainline: v5.6 +Git-commit: dfdde1345bc124816f0fd42fa91b8748051e758e +References: git-fixes + +last_keep_alive_jiffies is updated in probe and when a keep-alive +event is received. In case the driver times-out on a keep-alive event, +it has high chances of continuously timing-out on keep-alive events. +This is because when the driver recovers from the keep-alive-timeout reset +the value of last_keep_alive_jiffies is very old, and if a keep-alive +event is not received before the next timer expires, the value of +last_keep_alive_jiffies will cause another keep-alive-timeout reset +and so forth in a loop. + +Solution: +Update last_keep_alive_jiffies whenever the device is restored after +reset. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Noam Dagan +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c ++++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c +@@ -2807,6 +2807,7 @@ static int ena_restore_device(struct ena + netif_carrier_on(adapter->netdev); + + mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); ++ adapter->last_keep_alive_jiffies = jiffies; + dev_err(&pdev->dev, + "Device reset completed successfully, Driver info: %s\n", + version); diff --git a/patches.suse/net-ena-fix-corruption-of-dev_idx_to_host_tbl.patch b/patches.suse/net-ena-fix-corruption-of-dev_idx_to_host_tbl.patch new file mode 100644 index 0000000..4e26b4f --- /dev/null +++ b/patches.suse/net-ena-fix-corruption-of-dev_idx_to_host_tbl.patch @@ -0,0 +1,76 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:48 +0000 +Subject: net: ena: fix corruption of dev_idx_to_host_tbl +Patch-mainline: v5.6-rc2 +Git-commit: e3f89f91e98ce07dc0f121a3b70d21aca749ba39 +References: git-fixes + +The function ena_com_ind_tbl_convert_from_device() has an overflow +bug as explained below. Either way, this function is not needed at +all since we don't retrieve the indirection table from the device +at any point which means that this conversion is not needed. + +The bug: +The for loop iterates over all io_sq_queues, when passing the actual +number of used queues the io_sq_queues[i].idx equals 0 since they are +uninitialized which results in the following code to be executed till +the end of the loop: + +dev_idx_to_host_tbl[0] = i; + +This results dev_idx_to_host_tbl[0] in being equal to +ENA_TOTAL_NUM_QUEUES - 1. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 28 ---------------------------- + 1 file changed, 28 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -1281,30 +1281,6 @@ static int ena_com_ind_tbl_convert_to_de + return 0; + } + +-static int ena_com_ind_tbl_convert_from_device(struct ena_com_dev *ena_dev) +-{ +- u16 dev_idx_to_host_tbl[ENA_TOTAL_NUM_QUEUES] = { (u16)-1 }; +- struct ena_rss *rss = &ena_dev->rss; +- u8 idx; +- u16 i; +- +- for (i = 0; i < ENA_TOTAL_NUM_QUEUES; i++) +- dev_idx_to_host_tbl[ena_dev->io_sq_queues[i].idx] = i; +- +- for (i = 0; i < 1 << rss->tbl_log_size; i++) { +- if (rss->rss_ind_tbl[i].cq_idx > ENA_TOTAL_NUM_QUEUES) +- return -EINVAL; +- idx = (u8)rss->rss_ind_tbl[i].cq_idx; +- +- if (dev_idx_to_host_tbl[idx] > ENA_TOTAL_NUM_QUEUES) +- return -EINVAL; +- +- rss->host_rss_ind_tbl[i] = dev_idx_to_host_tbl[idx]; +- } +- +- return 0; +-} +- + static int ena_com_init_interrupt_moderation_table(struct ena_com_dev *ena_dev) + { + size_t size; +@@ -2642,10 +2618,6 @@ int ena_com_indirect_table_get(struct en + if (!ind_tbl) + return 0; + +- rc = ena_com_ind_tbl_convert_from_device(ena_dev); +- if (unlikely(rc)) +- return rc; +- + for (i = 0; i < (1 << rss->tbl_log_size); i++) + ind_tbl[i] = rss->host_rss_ind_tbl[i]; + diff --git a/patches.suse/net-ena-fix-default-tx-interrupt-moderation-interval.patch b/patches.suse/net-ena-fix-default-tx-interrupt-moderation-interval.patch new file mode 100644 index 0000000..854a3b5 --- /dev/null +++ b/patches.suse/net-ena-fix-default-tx-interrupt-moderation-interval.patch @@ -0,0 +1,38 @@ +From: Arthur Kiyanovski +Date: Thu, 19 Dec 2019 17:40:55 +0200 +Subject: net: ena: fix default tx interrupt moderation interval +Patch-mainline: v5.5-rc3 +Git-commit: 05785adf6e570a068adf0502b61fe2b521d7f0ca +References: git-fixes + +Current default non-adaptive tx interrupt moderation interval is 196 us. +This value is too high and might cause the tx queue to fill up. + +In this commit we set the default non-adaptive tx interrupt moderation +interval to 64 us in order to: +1. Reduce the probability of the queue filling-up (when compared to the + current default value of 196 us). +2. Reduce unnecessary tx interrupt overhead (which happens if we set the + default tx interval to 0). + We determined experimentally that 64 us is an optimal value that + reduces interrupt rate by more than 20% without affecting performance. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.h ++++ b/drivers/net/ethernet/amazon/ena/ena_com.h +@@ -92,7 +92,7 @@ + #define ENA_INTR_HIGHEST_PKTS (128) + #define ENA_INTR_HIGHEST_BYTES (192 * 1024) + +-#define ENA_INTR_INITIAL_TX_INTERVAL_USECS 196 ++#define ENA_INTR_INITIAL_TX_INTERVAL_USECS 64 + #define ENA_INTR_INITIAL_RX_INTERVAL_USECS 0 + #define ENA_INTR_DELAY_OLD_VALUE_WEIGHT 6 + #define ENA_INTR_DELAY_NEW_VALUE_WEIGHT 4 diff --git a/patches.suse/net-ena-fix-incorrect-default-RSS-key.patch b/patches.suse/net-ena-fix-incorrect-default-RSS-key.patch new file mode 100644 index 0000000..95bab6e --- /dev/null +++ b/patches.suse/net-ena-fix-incorrect-default-RSS-key.patch @@ -0,0 +1,74 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:43 +0000 +Subject: net: ena: fix incorrect default RSS key +Patch-mainline: v5.6-rc2 +Git-commit: 0d1c3de7b8c78a5e44b74b62ede4a63629f5d811 +References: git-fixes + +Bug description: +When running "ethtool -x " the key shows up as all zeros. + +When we use "ethtool -X hfunc toeplitz hkey " to +set the key and then try to retrieve it using "ethtool -x " then +we return the correct key because we return the one we saved. + +Bug cause: +We don't fetch the key from the device but instead return the key +that we have saved internally which is by default set to zero upon +allocation. + +Fix: +This commit fixes the issue by initializing the key to a random value +using netdev_rss_key_fill(). + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 15 +++++++++++++++ + drivers/net/ethernet/amazon/ena/ena_com.h | 1 + + 2 files changed, 16 insertions(+) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -1041,6 +1041,19 @@ static int ena_com_get_feature(struct en + feature_ver); + } + ++static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev) ++{ ++ struct ena_admin_feature_rss_flow_hash_control *hash_key = ++ (ena_dev->rss).hash_key; ++ ++ netdev_rss_key_fill(&hash_key->key, sizeof(hash_key->key)); ++ /* The key is stored in the device in u32 array ++ * as well as the API requires the key to be passed in this ++ * format. Thus the size of our array should be divided by 4 ++ */ ++ hash_key->keys_num = sizeof(hash_key->key) / sizeof(u32); ++} ++ + static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) + { + struct ena_rss *rss = &ena_dev->rss; +@@ -2635,6 +2648,8 @@ int ena_com_rss_init(struct ena_com_dev + if (unlikely(rc)) + goto err_hash_key; + ++ ena_com_hash_key_fill_default_key(ena_dev); ++ + rc = ena_com_hash_ctrl_init(ena_dev); + if (unlikely(rc)) + goto err_hash_ctrl; +--- a/drivers/net/ethernet/amazon/ena/ena_com.h ++++ b/drivers/net/ethernet/amazon/ena/ena_com.h +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + + #include "ena_common_defs.h" + #include "ena_admin_defs.h" diff --git a/patches.suse/net-ena-fix-incorrectly-saving-queue-numbers-when-se.patch b/patches.suse/net-ena-fix-incorrectly-saving-queue-numbers-when-se.patch new file mode 100644 index 0000000..74049a7 --- /dev/null +++ b/patches.suse/net-ena-fix-incorrectly-saving-queue-numbers-when-se.patch @@ -0,0 +1,88 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:47 +0000 +Subject: net: ena: fix incorrectly saving queue numbers when setting RSS + indirection table +Patch-mainline: v5.6-rc2 +Git-commit: 92569fd27f5cb0ccbdf7c7d70044b690e89a0277 +References: git-fixes + +The indirection table has the indices of the Rx queues. When we store it +during set indirection operation, we convert the indices to our internal +representation of the indices. + +Our internal representation of the indices is: even indices for Tx and +uneven indices for Rx, where every Tx/Rx pair are in a consecutive order +starting from 0. For example if the driver has 3 queues (3 for Tx and 3 +for Rx) then the indices are as follows: +0 1 2 3 4 5 +Tx Rx Tx Rx Tx Rx + +The BUG: +The issue is that when we satisfy a get request for the indirection +table, we don't convert the indices back to the original representation. + +The FIX: +Simply apply the inverse function for the indices of the indirection +table after we set it. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 24 +++++++++++++++++++++++- + drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 ++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -636,6 +636,28 @@ static u32 ena_get_rxfh_key_size(struct + return ENA_HASH_KEY_SIZE; + } + ++static int ena_indirection_table_get(struct ena_adapter *adapter, u32 *indir) ++{ ++ struct ena_com_dev *ena_dev = adapter->ena_dev; ++ int i, rc; ++ ++ if (!indir) ++ return 0; ++ ++ rc = ena_com_indirect_table_get(ena_dev, indir); ++ if (rc) ++ return rc; ++ ++ /* Our internal representation of the indices is: even indices ++ * for Tx and uneven indices for Rx. We need to convert the Rx ++ * indices to be consecutive ++ */ ++ for (i = 0; i < ENA_RX_RSS_TABLE_SIZE; i++) ++ indir[i] = ENA_IO_RXQ_IDX_TO_COMBINED_IDX(indir[i]); ++ ++ return rc; ++} ++ + static int ena_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, + u8 *hfunc) + { +@@ -644,7 +666,7 @@ static int ena_get_rxfh(struct net_devic + u8 func; + int rc; + +- rc = ena_com_indirect_table_get(adapter->ena_dev, indir); ++ rc = ena_indirection_table_get(adapter, indir); + if (rc) + return rc; + +--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h ++++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h +@@ -126,6 +126,8 @@ + + #define ENA_IO_TXQ_IDX(q) (2 * (q)) + #define ENA_IO_RXQ_IDX(q) (2 * (q) + 1) ++#define ENA_IO_TXQ_IDX_TO_COMBINED_IDX(q) ((q) / 2) ++#define ENA_IO_RXQ_IDX_TO_COMBINED_IDX(q) (((q) - 1) / 2) + + #define ENA_MGMNT_IRQ_IDX 0 + #define ENA_IO_IRQ_FIRST_IDX 1 diff --git a/patches.suse/net-ena-fix-issues-in-setting-interrupt-moderation-p.patch b/patches.suse/net-ena-fix-issues-in-setting-interrupt-moderation-p.patch new file mode 100644 index 0000000..16c4acc --- /dev/null +++ b/patches.suse/net-ena-fix-issues-in-setting-interrupt-moderation-p.patch @@ -0,0 +1,113 @@ +From: Arthur Kiyanovski +Date: Thu, 19 Dec 2019 17:40:56 +0200 +Subject: net: ena: fix issues in setting interrupt moderation params in + ethtool +Patch-mainline: v5.5-rc3 +Git-commit: 41c53caa5a61ebc9221b71cc37f4a90549f1121d +References: git-fixes + +Issue 1: +-------- +Reproduction steps: +1. sudo ethtool -C eth0 rx-usecs 128 +2. sudo ethtool -C eth0 adaptive-rx on +3. sudo ethtool -C eth0 adaptive-rx off +4. ethtool -c eth0 + +expected output: rx-usecs 128 +actual output: rx-usecs 0 + +Reason for issue: +In stage 3, ethtool userspace calls first the ena_get_coalesce() handler +to get the current value of all properties, and then the ena_set_coalesce() +handler. When ena_get_coalesce() is called the adaptive interrupt +moderation is still on. There is an if in the code that returns the +rx_coalesce_usecs only if the adaptive interrupt moderation is off. +And since it is still on, rx_coalesce_usecs is not set, meaning it +stays 0. + +Solution to issue: +Remove this if static interrupt moderation intervals have nothing to do +with dynamic ones. + +Issue 2: +-------- +Reproduction steps: +1. sudo ethtool -C eth0 adaptive-rx on +2. sudo ethtool -C eth0 rx-usecs 128 +3. ethtool -c eth0 + +expected output: rx-usecs 128 +actual output: rx-usecs 0 + +Reason for issue: +In stage 2, when ena_set_coalesce() is called, the handler tests if +rx adaptive interrupt moderation is on, and if it is, it returns before +getting to the part in the function that sets the rx non-adaptive +interrupt moderation interval. + +Solution to issue: +Remove the return from the function when rx adaptive interrupt moderation +is on. + +Also cleaned up the fixed code in ena_set_coalesce by grouping together +adaptive interrupt moderation toggling, and using && instead of nested +ifs. + +Fixes: b3db86dc4b82 ("net: ena: reimplement set/get_coalesce()") +Fixes: 0eda847953d8 ("net: ena: fix retrieval of nonadaptive interrupt moderation intervals") +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 24 ++++++++++-------------- + 1 file changed, 10 insertions(+), 14 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -315,10 +315,9 @@ static int ena_get_coalesce(struct net_d + ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) * + ena_dev->intr_delay_resolution; + +- if (!ena_com_get_adaptive_moderation_enabled(ena_dev)) +- coalesce->rx_coalesce_usecs = +- ena_com_get_nonadaptive_moderation_interval_rx(ena_dev) +- * ena_dev->intr_delay_resolution; ++ coalesce->rx_coalesce_usecs = ++ ena_com_get_nonadaptive_moderation_interval_rx(ena_dev) ++ * ena_dev->intr_delay_resolution; + + coalesce->use_adaptive_rx_coalesce = + ena_com_get_adaptive_moderation_enabled(ena_dev); +@@ -367,12 +366,6 @@ static int ena_set_coalesce(struct net_d + + ena_update_tx_rings_intr_moderation(adapter); + +- if (coalesce->use_adaptive_rx_coalesce) { +- if (!ena_com_get_adaptive_moderation_enabled(ena_dev)) +- ena_com_enable_adaptive_moderation(ena_dev); +- return 0; +- } +- + rc = ena_com_update_nonadaptive_moderation_interval_rx(ena_dev, + coalesce->rx_coalesce_usecs); + if (rc) +@@ -380,10 +373,13 @@ static int ena_set_coalesce(struct net_d + + ena_update_rx_rings_intr_moderation(adapter); + +- if (!coalesce->use_adaptive_rx_coalesce) { +- if (ena_com_get_adaptive_moderation_enabled(ena_dev)) +- ena_com_disable_adaptive_moderation(ena_dev); +- } ++ if (coalesce->use_adaptive_rx_coalesce && ++ !ena_com_get_adaptive_moderation_enabled(ena_dev)) ++ ena_com_enable_adaptive_moderation(ena_dev); ++ ++ if (!coalesce->use_adaptive_rx_coalesce && ++ ena_com_get_adaptive_moderation_enabled(ena_dev)) ++ ena_com_disable_adaptive_moderation(ena_dev); + + return 0; + } diff --git a/patches.suse/net-ena-fix-potential-crash-when-rxfh-key-is-NULL.patch b/patches.suse/net-ena-fix-potential-crash-when-rxfh-key-is-NULL.patch new file mode 100644 index 0000000..b2e78ab --- /dev/null +++ b/patches.suse/net-ena-fix-potential-crash-when-rxfh-key-is-NULL.patch @@ -0,0 +1,48 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:40 +0000 +Subject: net: ena: fix potential crash when rxfh key is NULL +Patch-mainline: v5.6-rc2 +Git-commit: 91a65b7d3ed8450f31ab717a65dcb5f9ceb5ab02 +References: git-fixes + +When ethtool -X is called without an hkey, ena_com_fill_hash_function() +is called with key=NULL, which is passed to memcpy causing a crash. + +This commit fixes this issue by checking key is not NULL. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -2301,15 +2301,16 @@ int ena_com_fill_hash_function(struct en + + switch (func) { + case ENA_ADMIN_TOEPLITZ: +- if (key_len > sizeof(hash_key->key)) { +- pr_err("key len (%hu) is bigger than the max supported (%zu)\n", +- key_len, sizeof(hash_key->key)); +- return -EINVAL; ++ if (key) { ++ if (key_len != sizeof(hash_key->key)) { ++ pr_err("key len (%hu) doesn't equal the supported size (%zu)\n", ++ key_len, sizeof(hash_key->key)); ++ return -EINVAL; ++ } ++ memcpy(hash_key->key, key, key_len); ++ rss->hash_init_val = init_val; ++ hash_key->keys_num = key_len >> 2; + } +- +- memcpy(hash_key->key, key, key_len); +- rss->hash_init_val = init_val; +- hash_key->keys_num = key_len >> 2; + break; + case ENA_ADMIN_CRC32: + rss->hash_init_val = init_val; diff --git a/patches.suse/net-ena-fix-retrieval-of-nonadaptive-interrupt-moder.patch b/patches.suse/net-ena-fix-retrieval-of-nonadaptive-interrupt-moder.patch new file mode 100644 index 0000000..e248ae2 --- /dev/null +++ b/patches.suse/net-ena-fix-retrieval-of-nonadaptive-interrupt-moder.patch @@ -0,0 +1,44 @@ +From: Arthur Kiyanovski +Date: Mon, 16 Sep 2019 14:31:35 +0300 +Subject: net: ena: fix retrieval of nonadaptive interrupt moderation intervals +Patch-mainline: v5.4-rc1 +Git-commit: 0eda847953d8dfb4b713ea62420f66157e230e13 +References: git-fixes + +Nonadaptive interrupt moderation intervals are assigned the value set +by the user in ethtool -C divided by ena_dev->intr_delay_resolution. + +Therefore when the user tries to get the nonadaptive interrupt moderation +intervals with ethtool -c the code needs to multiply the saved value +by ena_dev->intr_delay_resolution. + +The current code erroneously divides instead of multiplying in ethtool -c. +This patch fixes this. + +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -310,14 +310,15 @@ static int ena_get_coalesce(struct net_d + /* the devie doesn't support interrupt moderation */ + return -EOPNOTSUPP; + } ++ + coalesce->tx_coalesce_usecs = +- ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) / ++ ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) * + ena_dev->intr_delay_resolution; + + if (!ena_com_get_adaptive_moderation_enabled(ena_dev)) + coalesce->rx_coalesce_usecs = + ena_com_get_nonadaptive_moderation_interval_rx(ena_dev) +- / ena_dev->intr_delay_resolution; ++ * ena_dev->intr_delay_resolution; + + coalesce->use_adaptive_rx_coalesce = + ena_com_get_adaptive_moderation_enabled(ena_dev); diff --git a/patches.suse/net-ena-fix-uses-of-round_jiffies.patch b/patches.suse/net-ena-fix-uses-of-round_jiffies.patch new file mode 100644 index 0000000..d1d299b --- /dev/null +++ b/patches.suse/net-ena-fix-uses-of-round_jiffies.patch @@ -0,0 +1,68 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:41 +0000 +Subject: net: ena: fix uses of round_jiffies() +Patch-mainline: v5.6-rc2 +Git-commit: 2a6e5fa2f4c25b66c763428a3e65363214946931 +References: git-fixes + +>From the documentation of round_jiffies(): +"Rounds a time delta in the future (in jiffies) up or down to +(approximately) full seconds. This is useful for timers for which +the exact time they fire does not matter too much, as long as +they fire approximately every X seconds. +By rounding these timers to whole seconds, all such timers will fire +at the same time, rather than at various times spread out. The goal +of this is to have the CPU wake up less, which saves power." + +There are 2 parts to this patch: +================================ +Part 1: +------- +In our case we need timer_service to be called approximately every +X=1 seconds, and the exact time does not matter, so using round_jiffies() +is the right way to go. + +Therefore we add round_jiffies() to the mod_timer() in ena_timer_service(). + +Part 2: +------- +round_jiffies() is used in check_for_missing_keep_alive() when +getting the jiffies of the expiration of the keep_alive timeout. Here it +is actually a mistake to use round_jiffies() because we want the exact +time when keep_alive should expire and not an approximate rounded time, +which can cause early, false positive, timeouts. + +Therefore we remove round_jiffies() in the calculation of +keep_alive_expired() in check_for_missing_keep_alive(). + +Fixes: 82ef30f13be0 ("net: ena: add hardware hints capability to the driver") +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c ++++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c +@@ -3027,8 +3027,8 @@ static void check_for_missing_keep_alive + if (adapter->keep_alive_timeout == ENA_HW_HINTS_NO_TIMEOUT) + return; + +- keep_alive_expired = round_jiffies(adapter->last_keep_alive_jiffies + +- adapter->keep_alive_timeout); ++ keep_alive_expired = adapter->last_keep_alive_jiffies + ++ adapter->keep_alive_timeout; + if (unlikely(time_is_before_jiffies(keep_alive_expired))) { + netif_err(adapter, drv, adapter->netdev, + "Keep alive watchdog timeout.\n"); +@@ -3130,7 +3130,7 @@ static void ena_timer_service(unsigned l + } + + /* Reset the timer */ +- mod_timer(&adapter->timer_service, jiffies + HZ); ++ mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); + } + + static int ena_calc_io_queue_num(struct pci_dev *pdev, diff --git a/patches.suse/net-ena-make-ena-rxfh-support-ETH_RSS_HASH_NO_CHANGE.patch b/patches.suse/net-ena-make-ena-rxfh-support-ETH_RSS_HASH_NO_CHANGE.patch new file mode 100644 index 0000000..5648d35 --- /dev/null +++ b/patches.suse/net-ena-make-ena-rxfh-support-ETH_RSS_HASH_NO_CHANGE.patch @@ -0,0 +1,69 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:49 +0000 +Subject: net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE +Patch-mainline: v5.6-rc2 +Git-commit: 470793a78ce344bd53d31e0c2d537f71ba957547 +References: git-fixes + +As the name suggests ETH_RSS_HASH_NO_CHANGE is received upon changing +the key or indirection table using ethtool while keeping the same hash +function. + +Also add a function for retrieving the current hash function from +the ena-com layer. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: Saeed Bshara +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 5 +++++ + drivers/net/ethernet/amazon/ena/ena_com.h | 8 ++++++++ + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 3 +++ + 3 files changed, 16 insertions(+) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -1041,6 +1041,11 @@ static int ena_com_get_feature(struct en + feature_ver); + } + ++int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev) ++{ ++ return ena_dev->rss.hash_func; ++} ++ + static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev) + { + struct ena_admin_feature_rss_flow_hash_control *hash_key = +--- a/drivers/net/ethernet/amazon/ena/ena_com.h ++++ b/drivers/net/ethernet/amazon/ena/ena_com.h +@@ -694,6 +694,14 @@ int ena_com_rss_init(struct ena_com_dev + */ + void ena_com_rss_destroy(struct ena_com_dev *ena_dev); + ++/* ena_com_get_current_hash_function - Get RSS hash function ++ * @ena_dev: ENA communication layer struct ++ * ++ * Return the current hash function. ++ * @return: 0 or one of the ena_admin_hash_functions values. ++ */ ++int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev); ++ + /* ena_com_fill_hash_function - Fill RSS hash function + * @ena_dev: ENA communication layer struct + * @func: The hash function (Toeplitz or crc) +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -736,6 +736,9 @@ static int ena_set_rxfh(struct net_devic + } + + switch (hfunc) { ++ case ETH_RSS_HASH_NO_CHANGE: ++ func = ena_com_get_current_hash_function(ena_dev); ++ break; + case ETH_RSS_HASH_TOP: + func = ENA_ADMIN_TOEPLITZ; + break; diff --git a/patches.suse/net-ena-reimplement-set-get_coalesce.patch b/patches.suse/net-ena-reimplement-set-get_coalesce.patch new file mode 100644 index 0000000..f99716d --- /dev/null +++ b/patches.suse/net-ena-reimplement-set-get_coalesce.patch @@ -0,0 +1,158 @@ +From: Arthur Kiyanovski +Date: Mon, 16 Sep 2019 14:31:28 +0300 +Subject: net: ena: reimplement set/get_coalesce() +Patch-mainline: v5.4-rc1 +Git-commit: b3db86dc4b82ffc63e33c78dafc09d5c78ac4fe4 +References: git-fixes + +1. Remove old adaptive interrupt moderation code from set/get_coalesce() +2. Add ena_update_rx_rings_intr_moderation() function for updating + nonadaptive interrupt moderation intervals similarly to + ena_update_tx_rings_intr_moderation(). +3. Remove checks of multiple unsupported received interrupt coalescing + parameters. This makes code cleaner and cancels the need to update + it every time a new coalescing parameter is invented. + +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 88 ++++++++------------------ + 1 file changed, 28 insertions(+), 60 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -305,7 +305,6 @@ static int ena_get_coalesce(struct net_d + { + struct ena_adapter *adapter = netdev_priv(net_dev); + struct ena_com_dev *ena_dev = adapter->ena_dev; +- struct ena_intr_moder_entry intr_moder_entry; + + if (!ena_com_interrupt_moderation_supported(ena_dev)) { + /* the devie doesn't support interrupt moderation */ +@@ -314,23 +313,12 @@ static int ena_get_coalesce(struct net_d + coalesce->tx_coalesce_usecs = + ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) / + ena_dev->intr_delay_resolution; +- if (!ena_com_get_adaptive_moderation_enabled(ena_dev)) { ++ ++ if (!ena_com_get_adaptive_moderation_enabled(ena_dev)) + coalesce->rx_coalesce_usecs = + ena_com_get_nonadaptive_moderation_interval_rx(ena_dev) + / ena_dev->intr_delay_resolution; +- } else { +- ena_com_get_intr_moderation_entry(adapter->ena_dev, ENA_INTR_MODER_LOWEST, &intr_moder_entry); +- coalesce->rx_coalesce_usecs_low = intr_moder_entry.intr_moder_interval; +- coalesce->rx_max_coalesced_frames_low = intr_moder_entry.pkts_per_interval; +- +- ena_com_get_intr_moderation_entry(adapter->ena_dev, ENA_INTR_MODER_MID, &intr_moder_entry); +- coalesce->rx_coalesce_usecs = intr_moder_entry.intr_moder_interval; +- coalesce->rx_max_coalesced_frames = intr_moder_entry.pkts_per_interval; +- +- ena_com_get_intr_moderation_entry(adapter->ena_dev, ENA_INTR_MODER_HIGHEST, &intr_moder_entry); +- coalesce->rx_coalesce_usecs_high = intr_moder_entry.intr_moder_interval; +- coalesce->rx_max_coalesced_frames_high = intr_moder_entry.pkts_per_interval; +- } ++ + coalesce->use_adaptive_rx_coalesce = + ena_com_get_adaptive_moderation_enabled(ena_dev); + +@@ -348,12 +336,22 @@ static void ena_update_tx_rings_intr_mod + adapter->tx_ring[i].smoothed_interval = val; + } + ++static void ena_update_rx_rings_intr_moderation(struct ena_adapter *adapter) ++{ ++ unsigned int val; ++ int i; ++ ++ val = ena_com_get_nonadaptive_moderation_interval_rx(adapter->ena_dev); ++ ++ for (i = 0; i < adapter->num_queues; i++) ++ adapter->rx_ring[i].smoothed_interval = val; ++} ++ + static int ena_set_coalesce(struct net_device *net_dev, + struct ethtool_coalesce *coalesce) + { + struct ena_adapter *adapter = netdev_priv(net_dev); + struct ena_com_dev *ena_dev = adapter->ena_dev; +- struct ena_intr_moder_entry intr_moder_entry; + int rc; + + if (!ena_com_interrupt_moderation_supported(ena_dev)) { +@@ -361,22 +359,6 @@ static int ena_set_coalesce(struct net_d + return -EOPNOTSUPP; + } + +- if (coalesce->rx_coalesce_usecs_irq || +- coalesce->rx_max_coalesced_frames_irq || +- coalesce->tx_coalesce_usecs_irq || +- coalesce->tx_max_coalesced_frames || +- coalesce->tx_max_coalesced_frames_irq || +- coalesce->stats_block_coalesce_usecs || +- coalesce->use_adaptive_tx_coalesce || +- coalesce->pkt_rate_low || +- coalesce->tx_coalesce_usecs_low || +- coalesce->tx_max_coalesced_frames_low || +- coalesce->pkt_rate_high || +- coalesce->tx_coalesce_usecs_high || +- coalesce->tx_max_coalesced_frames_high || +- coalesce->rate_sample_interval) +- return -EINVAL; +- + rc = ena_com_update_nonadaptive_moderation_interval_tx(ena_dev, + coalesce->tx_coalesce_usecs); + if (rc) +@@ -384,37 +366,23 @@ static int ena_set_coalesce(struct net_d + + ena_update_tx_rings_intr_moderation(adapter); + +- if (ena_com_get_adaptive_moderation_enabled(ena_dev)) { +- if (!coalesce->use_adaptive_rx_coalesce) { +- ena_com_disable_adaptive_moderation(ena_dev); +- rc = ena_com_update_nonadaptive_moderation_interval_rx(ena_dev, +- coalesce->rx_coalesce_usecs); +- return rc; +- } +- } else { /* was in non-adaptive mode */ +- if (coalesce->use_adaptive_rx_coalesce) { ++ if (coalesce->use_adaptive_rx_coalesce) { ++ if (!ena_com_get_adaptive_moderation_enabled(ena_dev)) + ena_com_enable_adaptive_moderation(ena_dev); +- } else { +- rc = ena_com_update_nonadaptive_moderation_interval_rx(ena_dev, +- coalesce->rx_coalesce_usecs); +- return rc; +- } ++ return 0; + } + +- intr_moder_entry.intr_moder_interval = coalesce->rx_coalesce_usecs_low; +- intr_moder_entry.pkts_per_interval = coalesce->rx_max_coalesced_frames_low; +- intr_moder_entry.bytes_per_interval = ENA_INTR_BYTE_COUNT_NOT_SUPPORTED; +- ena_com_init_intr_moderation_entry(adapter->ena_dev, ENA_INTR_MODER_LOWEST, &intr_moder_entry); +- +- intr_moder_entry.intr_moder_interval = coalesce->rx_coalesce_usecs; +- intr_moder_entry.pkts_per_interval = coalesce->rx_max_coalesced_frames; +- intr_moder_entry.bytes_per_interval = ENA_INTR_BYTE_COUNT_NOT_SUPPORTED; +- ena_com_init_intr_moderation_entry(adapter->ena_dev, ENA_INTR_MODER_MID, &intr_moder_entry); +- +- intr_moder_entry.intr_moder_interval = coalesce->rx_coalesce_usecs_high; +- intr_moder_entry.pkts_per_interval = coalesce->rx_max_coalesced_frames_high; +- intr_moder_entry.bytes_per_interval = ENA_INTR_BYTE_COUNT_NOT_SUPPORTED; +- ena_com_init_intr_moderation_entry(adapter->ena_dev, ENA_INTR_MODER_HIGHEST, &intr_moder_entry); ++ rc = ena_com_update_nonadaptive_moderation_interval_rx(ena_dev, ++ coalesce->rx_coalesce_usecs); ++ if (rc) ++ return rc; ++ ++ ena_update_rx_rings_intr_moderation(adapter); ++ ++ if (!coalesce->use_adaptive_rx_coalesce) { ++ if (ena_com_get_adaptive_moderation_enabled(ena_dev)) ++ ena_com_disable_adaptive_moderation(ena_dev); ++ } + + return 0; + } diff --git a/patches.suse/net-ena-rss-do-not-allocate-key-when-not-supported.patch b/patches.suse/net-ena-rss-do-not-allocate-key-when-not-supported.patch new file mode 100644 index 0000000..e788ffd --- /dev/null +++ b/patches.suse/net-ena-rss-do-not-allocate-key-when-not-supported.patch @@ -0,0 +1,61 @@ +From: Sameeh Jubran +Date: Tue, 11 Feb 2020 15:17:44 +0000 +Subject: net: ena: rss: do not allocate key when not supported +Patch-mainline: v5.6-rc2 +Git-commit: 6a4f7dc82d1e3abd3feb0c60b5041056fcd9880c +References: git-fixes + +Currently we allocate the key whether the device supports setting the +key or not. This commit adds a check to the allocation function and +handles the error accordingly. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 24 +++++++++++++++++++++--- + 1 file changed, 21 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -1057,6 +1057,20 @@ static void ena_com_hash_key_fill_defaul + static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) + { + struct ena_rss *rss = &ena_dev->rss; ++ struct ena_admin_feature_rss_flow_hash_control *hash_key; ++ struct ena_admin_get_feat_resp get_resp; ++ int rc; ++ ++ hash_key = (ena_dev->rss).hash_key; ++ ++ rc = ena_com_get_feature_ex(ena_dev, &get_resp, ++ ENA_ADMIN_RSS_HASH_FUNCTION, ++ ena_dev->rss.hash_key_dma_addr, ++ sizeof(ena_dev->rss.hash_key), 0); ++ if (unlikely(rc)) { ++ hash_key = NULL; ++ return -EOPNOTSUPP; ++ } + + rss->hash_key = + dma_zalloc_coherent(ena_dev->dmadev, sizeof(*rss->hash_key), +@@ -2644,11 +2658,15 @@ int ena_com_rss_init(struct ena_com_dev + if (unlikely(rc)) + goto err_indr_tbl; + ++ /* The following function might return unsupported in case the ++ * device doesn't support setting the key / hash function. We can safely ++ * ignore this error and have indirection table support only. ++ */ + rc = ena_com_hash_key_allocate(ena_dev); +- if (unlikely(rc)) ++ if (unlikely(rc) && rc != -EOPNOTSUPP) + goto err_hash_key; +- +- ena_com_hash_key_fill_default_key(ena_dev); ++ else if (rc != -EOPNOTSUPP) ++ ena_com_hash_key_fill_default_key(ena_dev); + + rc = ena_com_hash_ctrl_init(ena_dev); + if (unlikely(rc)) diff --git a/patches.suse/net-ena-rss-fix-failure-to-get-indirection-table.patch b/patches.suse/net-ena-rss-fix-failure-to-get-indirection-table.patch new file mode 100644 index 0000000..e9a3fba --- /dev/null +++ b/patches.suse/net-ena-rss-fix-failure-to-get-indirection-table.patch @@ -0,0 +1,45 @@ +From: Sameeh Jubran +Date: Tue, 11 Feb 2020 15:17:45 +0000 +Subject: net: ena: rss: fix failure to get indirection table +Patch-mainline: v5.6-rc2 +Git-commit: 0c8923c0a64fb5d14bebb9a9065d2dc25ac5e600 +References: git-fixes + +On old hardware, getting / setting the hash function is not supported while +gettting / setting the indirection table is. + +This commit enables us to still show the indirection table on older +hardwares by setting the hash function and key to NULL. + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c ++++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c +@@ -648,7 +648,21 @@ static int ena_get_rxfh(struct net_devic + if (rc) + return rc; + ++ /* We call this function in order to check if the device ++ * supports getting/setting the hash function. ++ */ + rc = ena_com_get_hash_function(adapter->ena_dev, &ena_func, key); ++ ++ if (rc) { ++ if (rc == -EOPNOTSUPP) { ++ key = NULL; ++ hfunc = NULL; ++ rc = 0; ++ } ++ ++ return rc; ++ } ++ + if (rc) + return rc; + diff --git a/patches.suse/net-ena-rss-store-hash-function-as-values-and-not-bi.patch b/patches.suse/net-ena-rss-store-hash-function-as-values-and-not-bi.patch new file mode 100644 index 0000000..d9a2ad5 --- /dev/null +++ b/patches.suse/net-ena-rss-store-hash-function-as-values-and-not-bi.patch @@ -0,0 +1,49 @@ +From: Arthur Kiyanovski +Date: Tue, 11 Feb 2020 15:17:46 +0000 +Subject: net: ena: rss: store hash function as values and not bits +Patch-mainline: v5.6-rc2 +Git-commit: 4844470d472d660c26149ad764da2406adb13423 +References: git-fixes + +The device receives, stores and retrieves the hash function value as bits +and not as their enum value. + +The bug: +* In ena_com_set_hash_function() we set + cmd.u.flow_hash_func.selected_func to the bit value of rss->hash_func. + (1 << rss->hash_func) +* In ena_com_get_hash_function() we retrieve the hash function and store + it's bit value in rss->hash_func. (Now the bit value of rss->hash_func + is stored in rss->hash_func instead of it's enum value) + +The fix: +This commit fixes the issue by converting the retrieved hash function +values from the device to the matching enum value of the set bit using +ffs(). ffs() finds the first set bit's index in a word. Since the function +returns 1 for the LSB's index, we need to subtract 1 from the returned +value (note that BIT(0) is 1). + +Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") +Signed-off-by: Sameeh Jubran +Signed-off-by: Arthur Kiyanovski +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/amazon/ena/ena_com.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/amazon/ena/ena_com.c ++++ b/drivers/net/ethernet/amazon/ena/ena_com.c +@@ -2374,7 +2374,11 @@ int ena_com_get_hash_function(struct ena + if (unlikely(rc)) + return rc; + +- rss->hash_func = get_resp.u.flow_hash_func.selected_func; ++ /* ffs() returns 1 in case the lsb is set */ ++ rss->hash_func = ffs(get_resp.u.flow_hash_func.selected_func); ++ if (rss->hash_func) ++ rss->hash_func--; ++ + if (func) + *func = rss->hash_func; + diff --git a/patches.suse/net-fix-a-potential-recursive-NETDEV_FEAT_CHANGE.patch b/patches.suse/net-fix-a-potential-recursive-NETDEV_FEAT_CHANGE.patch new file mode 100644 index 0000000..e390e0b --- /dev/null +++ b/patches.suse/net-fix-a-potential-recursive-NETDEV_FEAT_CHANGE.patch @@ -0,0 +1,64 @@ +From: Cong Wang +Date: Thu, 7 May 2020 12:19:03 -0700 +Subject: net: fix a potential recursive NETDEV_FEAT_CHANGE +Git-commit: dd912306ff008891c82cd9f63e8181e47a9cb2fb +Patch-mainline: 5.7-rc6 +References: networking-stable-20_05_16 + +syzbot managed to trigger a recursive NETDEV_FEAT_CHANGE event +between bonding master and slave. I managed to find a reproducer +for this: + + ip li set bond0 up + ifenslave bond0 eth0 + brctl addbr br0 + ethtool -K eth0 lro off + brctl addif br0 bond0 + ip li set br0 up + +When a NETDEV_FEAT_CHANGE event is triggered on a bonding slave, +it captures this and calls bond_compute_features() to fixup its +master's and other slaves' features. However, when syncing with +its lower devices by netdev_sync_lower_features() this event is +triggered again on slaves when the LRO feature fails to change, +so it goes back and forth recursively until the kernel stack is +exhausted. + +Commit 17b85d29e82c intentionally lets __netdev_update_features() +return -1 for such a failure case, so we have to just rely on +the existing check inside netdev_sync_lower_features() and skip +NETDEV_FEAT_CHANGE event only for this specific failure case. + +Fixes: fd867d51f889 ("net/core: generic support for disabling netdev features down stack") +Reported-by: syzbot+e73ceacfd8560cc8a3ca@syzkaller.appspotmail.com +Reported-by: syzbot+c2fb6f9ddcea95ba49b5@syzkaller.appspotmail.com +Cc: Jarod Wilson +Cc: Nikolay Aleksandrov +Cc: Josh Poimboeuf +Cc: Jann Horn +Reviewed-by: Jay Vosburgh +Signed-off-by: Cong Wang +Acked-by: Nikolay Aleksandrov +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/core/dev.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -8017,11 +8017,13 @@ static void netdev_sync_lower_features(s + netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n", + &feature, lower->name); + lower->wanted_features &= ~feature; +- netdev_update_features(lower); ++ __netdev_update_features(lower); + + if (unlikely(lower->features & feature)) + netdev_WARN(upper, "failed to disable %pNF on %s!\n", + &feature, lower->name); ++ else ++ netdev_features_change(lower); + } + } + } diff --git a/patches.suse/net-inet_csk-Fix-so_reuseport-bind-address-cache-in-.patch b/patches.suse/net-inet_csk-Fix-so_reuseport-bind-address-cache-in-.patch new file mode 100644 index 0000000..8e84d35 --- /dev/null +++ b/patches.suse/net-inet_csk-Fix-so_reuseport-bind-address-cache-in-.patch @@ -0,0 +1,161 @@ +From: Martin KaFai Lau +Date: Mon, 18 May 2020 17:13:34 -0700 +Subject: net: inet_csk: Fix so_reuseport bind-address cache in tb->fast* +Git-commit: 88d7fcfa3b1fe670f0412b95be785aafca63352b +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +The commit 637bc8bbe6c0 ("inet: reset tb->fastreuseport when adding a reuseport sk") +added a bind-address cache in tb->fast*. The tb->fast* caches the address +of a sk which has successfully been binded with SO_REUSEPORT ON. The idea +is to avoid the expensive conflict search in inet_csk_bind_conflict(). + +There is an issue with wildcard matching where sk_reuseport_match() should +have returned false but it is currently returning true. It ends up +hiding bind conflict. For example, + +bind("[::1]:443"); /* without SO_REUSEPORT. Succeed. */ +bind("[::2]:443"); /* with SO_REUSEPORT. Succeed. */ +bind("[::]:443"); /* with SO_REUSEPORT. Still Succeed where it shouldn't */ + +The last bind("[::]:443") with SO_REUSEPORT on should have failed because +it should have a conflict with the very first bind("[::1]:443") which +has SO_REUSEPORT off. However, the address "[::2]" is cached in +tb->fast* in the second bind. In the last bind, the sk_reuseport_match() +returns true because the binding sk's wildcard addr "[::]" matches with +the "[::2]" cached in tb->fast*. + +The correct bind conflict is reported by removing the second +bind such that tb->fast* cache is not involved and forces the +bind("[::]:443") to go through the inet_csk_bind_conflict(): + +bind("[::1]:443"); /* without SO_REUSEPORT. Succeed. */ +bind("[::]:443"); /* with SO_REUSEPORT. -EADDRINUSE */ + +The expected behavior for sk_reuseport_match() is, it should only allow +the "cached" tb->fast* address to be used as a wildcard match but not +the address of the binding sk. To do that, the current +"bool match_wildcard" arg is split into +"bool match_sk1_wildcard" and "bool match_sk2_wildcard". + +This change only affects the sk_reuseport_match() which is only +used by inet_csk (e.g. TCP). +The other use cases are calling inet_rcv_saddr_equal() and +this patch makes it pass the same "match_wildcard" arg twice to +the "ipv[46]_rcv_saddr_equal(..., match_wildcard, match_wildcard)". + +Cc: Josef Bacik +Fixes: 637bc8bbe6c0 ("inet: reset tb->fastreuseport when adding a reuseport sk") +Signed-off-by: Martin KaFai Lau +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/ipv4/inet_connection_sock.c | 43 ++++++++++++++++++++++------------------ + 1 file changed, 24 insertions(+), 19 deletions(-) + +--- a/net/ipv4/inet_connection_sock.c ++++ b/net/ipv4/inet_connection_sock.c +@@ -32,17 +32,19 @@ EXPORT_SYMBOL(inet_csk_timer_bug_msg); + #endif + + #if IS_ENABLED(CONFIG_IPV6) +-/* match_wildcard == true: IPV6_ADDR_ANY equals to any IPv6 addresses if IPv6 +- * only, and any IPv4 addresses if not IPv6 only +- * match_wildcard == false: addresses must be exactly the same, i.e. +- * IPV6_ADDR_ANY only equals to IPV6_ADDR_ANY, +- * and 0.0.0.0 equals to 0.0.0.0 only ++/* match_sk*_wildcard == true: IPV6_ADDR_ANY equals to any IPv6 addresses ++ * if IPv6 only, and any IPv4 addresses ++ * if not IPv6 only ++ * match_sk*_wildcard == false: addresses must be exactly the same, i.e. ++ * IPV6_ADDR_ANY only equals to IPV6_ADDR_ANY, ++ * and 0.0.0.0 equals to 0.0.0.0 only + */ + static int ipv6_rcv_saddr_equal(const struct in6_addr *sk1_rcv_saddr6, + const struct in6_addr *sk2_rcv_saddr6, + __be32 sk1_rcv_saddr, __be32 sk2_rcv_saddr, + bool sk1_ipv6only, bool sk2_ipv6only, +- bool match_wildcard) ++ bool match_sk1_wildcard, ++ bool match_sk2_wildcard) + { + int addr_type = ipv6_addr_type(sk1_rcv_saddr6); + int addr_type2 = sk2_rcv_saddr6 ? ipv6_addr_type(sk2_rcv_saddr6) : IPV6_ADDR_MAPPED; +@@ -52,8 +54,8 @@ static int ipv6_rcv_saddr_equal(const st + if (!sk2_ipv6only) { + if (sk1_rcv_saddr == sk2_rcv_saddr) + return 1; +- if (!sk1_rcv_saddr || !sk2_rcv_saddr) +- return match_wildcard; ++ return (match_sk1_wildcard && !sk1_rcv_saddr) || ++ (match_sk2_wildcard && !sk2_rcv_saddr); + } + return 0; + } +@@ -61,11 +63,11 @@ static int ipv6_rcv_saddr_equal(const st + if (addr_type == IPV6_ADDR_ANY && addr_type2 == IPV6_ADDR_ANY) + return 1; + +- if (addr_type2 == IPV6_ADDR_ANY && match_wildcard && ++ if (addr_type2 == IPV6_ADDR_ANY && match_sk2_wildcard && + !(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED)) + return 1; + +- if (addr_type == IPV6_ADDR_ANY && match_wildcard && ++ if (addr_type == IPV6_ADDR_ANY && match_sk1_wildcard && + !(sk1_ipv6only && addr_type2 == IPV6_ADDR_MAPPED)) + return 1; + +@@ -77,18 +79,19 @@ static int ipv6_rcv_saddr_equal(const st + } + #endif + +-/* match_wildcard == true: 0.0.0.0 equals to any IPv4 addresses +- * match_wildcard == false: addresses must be exactly the same, i.e. +- * 0.0.0.0 only equals to 0.0.0.0 ++/* match_sk*_wildcard == true: 0.0.0.0 equals to any IPv4 addresses ++ * match_sk*_wildcard == false: addresses must be exactly the same, i.e. ++ * 0.0.0.0 only equals to 0.0.0.0 + */ + static int ipv4_rcv_saddr_equal(__be32 sk1_rcv_saddr, __be32 sk2_rcv_saddr, +- bool sk2_ipv6only, bool match_wildcard) ++ bool sk2_ipv6only, bool match_sk1_wildcard, ++ bool match_sk2_wildcard) + { + if (!sk2_ipv6only) { + if (sk1_rcv_saddr == sk2_rcv_saddr) + return 1; +- if (!sk1_rcv_saddr || !sk2_rcv_saddr) +- return match_wildcard; ++ return (match_sk1_wildcard && !sk1_rcv_saddr) || ++ (match_sk2_wildcard && !sk2_rcv_saddr); + } + return 0; + } +@@ -104,10 +107,12 @@ int inet_rcv_saddr_equal(const struct so + sk2->sk_rcv_saddr, + ipv6_only_sock(sk), + ipv6_only_sock(sk2), ++ match_wildcard, + match_wildcard); + #endif + return ipv4_rcv_saddr_equal(sk->sk_rcv_saddr, sk2->sk_rcv_saddr, +- ipv6_only_sock(sk2), match_wildcard); ++ ipv6_only_sock(sk2), match_wildcard, ++ match_wildcard); + } + EXPORT_SYMBOL(inet_rcv_saddr_equal); + +@@ -269,10 +274,10 @@ static inline int sk_reuseport_match(str + tb->fast_rcv_saddr, + sk->sk_rcv_saddr, + tb->fast_ipv6_only, +- ipv6_only_sock(sk), true); ++ ipv6_only_sock(sk), true, false); + #endif + return ipv4_rcv_saddr_equal(tb->fast_rcv_saddr, sk->sk_rcv_saddr, +- ipv6_only_sock(sk), true); ++ ipv6_only_sock(sk), true, false); + } + + /* Obtain a reference to a local port for the given sock, diff --git a/patches.suse/net-ipip-fix-wrong-address-family-in-init-error-path.patch b/patches.suse/net-ipip-fix-wrong-address-family-in-init-error-path.patch new file mode 100644 index 0000000..5f12dab --- /dev/null +++ b/patches.suse/net-ipip-fix-wrong-address-family-in-init-error-path.patch @@ -0,0 +1,29 @@ +From: Vadim Fedorenko +Date: Wed, 20 May 2020 11:50:48 +0300 +Subject: net: ipip: fix wrong address family in init error path +Git-commit: 57ebc8f08504f176eb0f25b3e0fde517dec61a4f +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +In case of error with MPLS support the code is misusing AF_INET +instead of AF_MPLS. + +Fixes: 1b69e7e6c4da ("ipip: support MPLS over IPv4") +Signed-off-by: Vadim Fedorenko +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/ipv4/ipip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ipv4/ipip.c ++++ b/net/ipv4/ipip.c +@@ -704,7 +704,7 @@ out: + + rtnl_link_failed: + #if IS_ENABLED(CONFIG_MPLS) +- xfrm4_tunnel_deregister(&mplsip_handler, AF_INET); ++ xfrm4_tunnel_deregister(&mplsip_handler, AF_MPLS); + xfrm_tunnel_mplsip_failed: + + #endif diff --git a/patches.suse/net-ipvlan-Fix-ipvlan-device-tso-disabled-while-NETI.patch b/patches.suse/net-ipvlan-Fix-ipvlan-device-tso-disabled-while-NETI.patch new file mode 100644 index 0000000..018cf86 --- /dev/null +++ b/patches.suse/net-ipvlan-Fix-ipvlan-device-tso-disabled-while-NETI.patch @@ -0,0 +1,40 @@ +From: Miaohe Lin +Date: Tue, 4 Jun 2019 06:07:34 +0000 +Subject: net: ipvlan: Fix ipvlan device tso disabled while NETIF_F_IP_CSUM is + set +Patch-mainline: v5.2-rc4 +Git-commit: ceae266bf0ae6564ac16d086bf749a096fa90ded +References: git-fixes + +There's some NICs, such as hinic, with NETIF_F_IP_CSUM and NETIF_F_TSO +on but NETIF_F_HW_CSUM off. And ipvlan device features will be +NETIF_F_TSO on with NETIF_F_IP_CSUM and NETIF_F_IP_CSUM both off as +IPVLAN_FEATURES only care about NETIF_F_HW_CSUM. So TSO will be +disabled in netdev_fix_features. +For example: +Features for enp129s0f0: +rx-checksumming: on +tx-checksumming: on + tx-checksum-ipv4: on + tx-checksum-ip-generic: off [fixed] + tx-checksum-ipv6: on + +Fixes: a188222b6ed2 ("net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK") +Signed-off-by: Miaohe Lin +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ipvlan/ipvlan_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ipvlan/ipvlan_main.c ++++ b/drivers/net/ipvlan/ipvlan_main.c +@@ -176,7 +176,7 @@ static void ipvlan_port_destroy(struct n + } + + #define IPVLAN_FEATURES \ +- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ ++ (NETIF_F_SG | NETIF_F_CSUM_MASK | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ + NETIF_F_GSO | NETIF_F_TSO | NETIF_F_GSO_ROBUST | \ + NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \ + NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER) diff --git a/patches.suse/net-macsec-preserve-ingress-frame-ordering.patch b/patches.suse/net-macsec-preserve-ingress-frame-ordering.patch new file mode 100644 index 0000000..e51be94 --- /dev/null +++ b/patches.suse/net-macsec-preserve-ingress-frame-ordering.patch @@ -0,0 +1,73 @@ +From: Scott Dial +Date: Fri, 24 Apr 2020 18:51:08 -0400 +Subject: net: macsec: preserve ingress frame ordering +Git-commit: ab046a5d4be4c90a3952a0eae75617b49c0cb01b +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +MACsec decryption always occurs in a softirq context. Since +the FPU may not be usable in the softirq context, the call to +decrypt may be scheduled on the cryptd work queue. The cryptd +work queue does not provide ordering guarantees. Therefore, +preserving order requires masking out ASYNC implementations +of gcm(aes). + +For instance, an Intel CPU with AES-NI makes available the +generic-gcm-aesni driver from the aesni_intel module to +implement gcm(aes). However, this implementation requires +the FPU, so it is not always available to use from a softirq +context, and will fallback to the cryptd work queue, which +does not preserve frame ordering. With this change, such a +system would select gcm_base(ctr(aes-aesni),ghash-generic). +While the aes-aesni implementation prefers to use the FPU, it +will fallback to the aes-asm implementation if unavailable. + +By using a synchronous version of gcm(aes), the decryption +will complete before returning from crypto_aead_decrypt(). +Therefore, the macsec_decrypt_done() callback will be called +before returning from macsec_decrypt(). Thus, the order of +calls to macsec_post_decrypt() for the frames is preserved. + +While it's presumable that the pure AES-NI version of gcm(aes) +is more performant, the hybrid solution is capable of gigabit +speeds on modest hardware. Regardless, preserving the order +of frames is paramount for many network protocols (e.g., +triggering TCP retries). Within the MACsec driver itself, the +replay protection is tripped by the out-of-order frames, and +can cause frames to be dropped. + +This bug has been present in this code since it was added in +v4.6, however it may not have been noticed since not all CPUs +have FPU offload available. Additionally, the bug manifests +as occasional out-of-order packets that are easily +misattributed to other network phenomena. + +When this code was added in v4.6, the crypto/gcm.c code did +not restrict selection of the ghash function based on the +ASYNC flag. For instance, x86 CPUs with PCLMULQDQ would +select the ghash-clmulni driver instead of ghash-generic, +which submits to the cryptd work queue if the FPU is busy. +However, this bug was was corrected in v4.8 by commit +b30bdfa86431afbafe15284a3ad5ac19b49b88e3, and was backported +all the way back to the v3.14 stable branch, so this patch +should be applicable back to the v4.6 stable branch. + +Signed-off-by: Scott Dial +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/macsec.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/macsec.c ++++ b/drivers/net/macsec.c +@@ -1312,7 +1312,8 @@ static struct crypto_aead *macsec_alloc_ + struct crypto_aead *tfm; + int ret; + +- tfm = crypto_alloc_aead("gcm(aes)", 0, 0); ++ /* Pick a sync gcm(aes) cipher to ensure order is preserved. */ ++ tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); + + if (IS_ERR(tfm)) + return tfm; diff --git a/patches.suse/net-mlx4_core-Fix-use-of-ENOSPC-around-mlx4_counter_.patch b/patches.suse/net-mlx4_core-Fix-use-of-ENOSPC-around-mlx4_counter_.patch new file mode 100644 index 0000000..f8ccb88 --- /dev/null +++ b/patches.suse/net-mlx4_core-Fix-use-of-ENOSPC-around-mlx4_counter_.patch @@ -0,0 +1,47 @@ +From: Tariq Toukan +Date: Mon, 4 May 2020 11:36:02 +0300 +Subject: net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc() +Git-commit: 40e473071dbad04316ddc3613c3a3d1c75458299 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +When ENOSPC is set the idx is still valid and gets set to the global +MLX4_SINK_COUNTER_INDEX. However gcc's static analysis cannot tell that +ENOSPC is impossible from mlx4_cmd_imm() and gives this warning: + +drivers/net/ethernet/mellanox/mlx4/main.c:2552:28: warning: 'idx' may be +used uninitialized in this function [-Wmaybe-uninitialized] + 2552 | priv->def_counter[port] = idx; + +Also, when ENOSPC is returned mlx4_allocate_default_counters should not +fail. + +Fixes: 6de5f7f6a1fa ("net/mlx4_core: Allocate default counter per port") +Signed-off-by: Jason Gunthorpe +Signed-off-by: Tariq Toukan +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/mellanox/mlx4/main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlx4/main.c ++++ b/drivers/net/ethernet/mellanox/mlx4/main.c +@@ -2540,6 +2540,7 @@ static int mlx4_allocate_default_counter + + if (!err || err == -ENOSPC) { + priv->def_counter[port] = idx; ++ err = 0; + } else if (err == -ENOENT) { + err = 0; + continue; +@@ -2590,7 +2591,8 @@ int mlx4_counter_alloc(struct mlx4_dev * + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); + if (!err) + *idx = get_param_l(&out_param); +- ++ if (WARN_ON(err == -ENOSPC)) ++ err = -EINVAL; + return err; + } + return __mlx4_counter_alloc(dev, idx); diff --git a/patches.suse/net-mlx4_core-drop-useless-LIST_HEAD.patch b/patches.suse/net-mlx4_core-drop-useless-LIST_HEAD.patch new file mode 100644 index 0000000..5b2e30b --- /dev/null +++ b/patches.suse/net-mlx4_core-drop-useless-LIST_HEAD.patch @@ -0,0 +1,71 @@ +From: Julia Lawall +Date: Sun, 23 Dec 2018 09:57:14 +0100 +Subject: net/mlx4_core: drop useless LIST_HEAD +Patch-mainline: v5.0-rc1 +Git-commit: 61988bd281c9b08e0cc084f0b2da3b109c4c39c8 +References: git-fixes + +Drop LIST_HEAD where the variable it declares has never +been used. + +The semantic patch that fixes this problem is as follows: +(http://coccinelle.lip6.fr/) + +// +@@ +identifier x; +@@ +- LIST_HEAD(x); + ... when != x +// + +Fixes: c82e9aa0a8bc ("mlx4_core: resource tracking for HCA resources used by guests") +Signed-off-by: Julia Lawall +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c ++++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +@@ -4727,7 +4727,6 @@ static void rem_slave_srqs(struct mlx4_d + struct res_srq *tmp; + int state; + u64 in_param; +- LIST_HEAD(tlist); + int srqn; + int err; + +@@ -4793,7 +4792,6 @@ static void rem_slave_cqs(struct mlx4_de + struct res_cq *tmp; + int state; + u64 in_param; +- LIST_HEAD(tlist); + int cqn; + int err; + +@@ -4856,7 +4854,6 @@ static void rem_slave_mrs(struct mlx4_de + struct res_mpt *tmp; + int state; + u64 in_param; +- LIST_HEAD(tlist); + int mptn; + int err; + +@@ -4924,7 +4921,6 @@ static void rem_slave_mtts(struct mlx4_d + struct res_mtt *mtt; + struct res_mtt *tmp; + int state; +- LIST_HEAD(tlist); + int base; + int err; + +@@ -5113,7 +5109,6 @@ static void rem_slave_eqs(struct mlx4_de + struct res_eq *tmp; + int err; + int state; +- LIST_HEAD(tlist); + int eqn; + + err = move_all_busy(dev, slave, RES_EQ); diff --git a/patches.suse/net-mlx4_core-fix-a-memory-leak-bug.patch b/patches.suse/net-mlx4_core-fix-a-memory-leak-bug.patch new file mode 100644 index 0000000..516c28a --- /dev/null +++ b/patches.suse/net-mlx4_core-fix-a-memory-leak-bug.patch @@ -0,0 +1,31 @@ +From: Qiushi Wu +Date: Fri, 22 May 2020 14:07:15 -0500 +Subject: net/mlx4_core: fix a memory leak bug. +Patch-mainline: v5.7-rc7 +Git-commit: febfd9d3c7f74063e8e630b15413ca91b567f963 +References: git-fixes + +In function mlx4_opreq_action(), pointer "mailbox" is not released, +when mlx4_cmd_box() return and error, causing a memory leak bug. +Fix this issue by going to "out" label, mlx4_free_cmd_mailbox() can +free this pointer. + +Fixes: fe6f700d6cbb ("net/mlx4_core: Respond to operation request by firmware") +Signed-off-by: Qiushi Wu +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlx4/fw.c ++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c +@@ -2731,7 +2731,7 @@ void mlx4_opreq_action(struct work_struc + if (err) { + mlx4_err(dev, "Failed to retrieve required operation: %d\n", + err); +- return; ++ goto out; + } + MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET); + MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET); diff --git a/patches.suse/net-mlx5-Add-command-entry-handling-completion.patch b/patches.suse/net-mlx5-Add-command-entry-handling-completion.patch new file mode 100644 index 0000000..3cbc6ff --- /dev/null +++ b/patches.suse/net-mlx5-Add-command-entry-handling-completion.patch @@ -0,0 +1,94 @@ +From: Moshe Shemesh +Date: Fri, 27 Dec 2019 07:01:53 +0200 +Subject: net/mlx5: Add command entry handling completion +Git-commit: 17d00e839d3b592da9659c1977d45f85b77f986a +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +When FW response to commands is very slow and all command entries in +use are waiting for completion we can have a race where commands can get +timeout before they get out of the queue and handled. Timeout +completion on uninitialized command will cause releasing command's +buffers before accessing it for initialization and then we will get NULL +pointer exception while trying access it. It may also cause releasing +buffers of another command since we may have timeout completion before +even allocating entry index for this command. +Add entry handling completion to avoid this race. + +Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") +Signed-off-by: Moshe Shemesh +Signed-off-by: Eran Ben Elisha +Signed-off-by: Saeed Mahameed +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 14 ++++++++++++++ + include/linux/mlx5/driver.h | 1 + + 2 files changed, 15 insertions(+) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +@@ -847,6 +847,7 @@ static void cmd_work_handler(struct work + int alloc_ret; + int cmd_mode; + ++ complete(&ent->handling); + sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem; + down(sem); + if (!ent->page_queue) { +@@ -965,6 +966,11 @@ static int wait_func(struct mlx5_core_de + struct mlx5_cmd *cmd = &dev->cmd; + int err; + ++ if (!wait_for_completion_timeout(&ent->handling, timeout) && ++ cancel_work_sync(&ent->work)) { ++ ent->ret = -ECANCELED; ++ goto out_err; ++ } + if (cmd->mode == CMD_MODE_POLLING || ent->polling) { + wait_for_completion(&ent->done); + } else if (!wait_for_completion_timeout(&ent->done, timeout)) { +@@ -972,12 +978,17 @@ static int wait_func(struct mlx5_core_de + mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true); + } + ++out_err: + err = ent->ret; + + if (err == -ETIMEDOUT) { + mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n", + mlx5_command_str(msg_to_opcode(ent->in)), + msg_to_opcode(ent->in)); ++ } else if (err == -ECANCELED) { ++ mlx5_core_warn(dev, "%s(0x%x) canceled on out of queue timeout.\n", ++ mlx5_command_str(msg_to_opcode(ent->in)), ++ msg_to_opcode(ent->in)); + } + mlx5_core_dbg(dev, "err %d, delivery status %s(%d)\n", + err, deliv_status_to_str(ent->status), ent->status); +@@ -1013,6 +1024,7 @@ static int mlx5_cmd_invoke(struct mlx5_c + ent->token = token; + ent->polling = force_polling; + ++ init_completion(&ent->handling); + if (!callback) + init_completion(&ent->done); + +@@ -1032,6 +1044,8 @@ static int mlx5_cmd_invoke(struct mlx5_c + err = wait_func(dev, ent); + if (err == -ETIMEDOUT) + goto out; ++ if (err == -ECANCELED) ++ goto out_free; + + ds = ent->ts2 - ent->ts1; + op = MLX5_GET(mbox_in, in->first.data, opcode); +--- a/include/linux/mlx5/driver.h ++++ b/include/linux/mlx5/driver.h +@@ -905,6 +905,7 @@ struct mlx5_cmd_work_ent { + struct delayed_work cb_timeout_work; + void *context; + int idx; ++ struct completion handling; + struct completion done; + struct mlx5_cmd *cmd; + struct work_struct work; diff --git a/patches.suse/net-mlx5-Avoid-panic-when-setting-vport-rate.patch b/patches.suse/net-mlx5-Avoid-panic-when-setting-vport-rate.patch new file mode 100644 index 0000000..c588d06 --- /dev/null +++ b/patches.suse/net-mlx5-Avoid-panic-when-setting-vport-rate.patch @@ -0,0 +1,76 @@ +From: Tonghao Zhang +Date: Mon, 4 Mar 2019 00:27:16 -0800 +Subject: net/mlx5: Avoid panic when setting vport rate +Patch-mainline: v5.1-rc1 +Git-commit: 24319258660a84dd77f4be026a55b10a12524919 +References: git-fixes + +If we try to set VFs rate on a VF (not PF) net device, the kernel +will be crash. The commands are show as below: + +$ echo 2 > /sys/class/net/$MLX_PF0/device/sriov_numvfs +$ ip link set $MLX_VF0 vf 0 max_tx_rate 2 min_tx_rate 1 + +If not applied the first patch ("net/mlx5: Avoid panic when setting +vport mac, getting vport config"), the command: + +$ ip link set $MLX_VF0 vf 0 rate 100 + +can also crash the kernel. + +[ 1650.006388] RIP: 0010:mlx5_eswitch_set_vport_rate+0x1f/0x260 [mlx5_core] +[ 1650.007092] do_setlink+0x982/0xd20 +[ 1650.007129] __rtnl_newlink+0x528/0x7d0 +[ 1650.007374] rtnl_newlink+0x43/0x60 +[ 1650.007407] rtnetlink_rcv_msg+0x2a2/0x320 +[ 1650.007484] netlink_rcv_skb+0xcb/0x100 +[ 1650.007519] netlink_unicast+0x17f/0x230 +[ 1650.007554] netlink_sendmsg+0x2d2/0x3d0 +[ 1650.007592] sock_sendmsg+0x36/0x50 +[ 1650.007625] ___sys_sendmsg+0x280/0x2a0 +[ 1650.007963] __sys_sendmsg+0x58/0xa0 +[ 1650.007998] do_syscall_64+0x5b/0x180 +[ 1650.009438] entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +Fixes: c9497c98901c ("net/mlx5: Add support for setting VF min rate") +Cc: Mohamad Haj Yahia +Signed-off-by: Tonghao Zhang +Reviewed-by: Roi Dayan +Acked-by: Saeed Mahameed +Signed-off-by: Saeed Mahameed +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +@@ -2044,19 +2044,24 @@ static int normalize_vports_min_rate(str + int mlx5_eswitch_set_vport_rate(struct mlx5_eswitch *esw, int vport, + u32 max_rate, u32 min_rate) + { +- u32 fw_max_bw_share = MLX5_CAP_QOS(esw->dev, max_tsar_bw_share); +- bool min_rate_supported = MLX5_CAP_QOS(esw->dev, esw_bw_share) && +- fw_max_bw_share >= MLX5_MIN_BW_SHARE; +- bool max_rate_supported = MLX5_CAP_QOS(esw->dev, esw_rate_limit); + struct mlx5_vport *evport; ++ u32 fw_max_bw_share; + u32 previous_min_rate; + u32 divider; ++ bool min_rate_supported; ++ bool max_rate_supported; + int err = 0; + + if (!ESW_ALLOWED(esw)) + return -EPERM; + if (!LEGAL_VPORT(esw, vport)) + return -EINVAL; ++ ++ fw_max_bw_share = MLX5_CAP_QOS(esw->dev, max_tsar_bw_share); ++ min_rate_supported = MLX5_CAP_QOS(esw->dev, esw_bw_share) && ++ fw_max_bw_share >= MLX5_MIN_BW_SHARE; ++ max_rate_supported = MLX5_CAP_QOS(esw->dev, esw_rate_limit); ++ + if ((min_rate && !min_rate_supported) || (max_rate && !max_rate_supported)) + return -EOPNOTSUPP; + diff --git a/patches.suse/net-mlx5-Continue-driver-initialization-despite-debu.patch b/patches.suse/net-mlx5-Continue-driver-initialization-despite-debu.patch new file mode 100644 index 0000000..11ba4d4 --- /dev/null +++ b/patches.suse/net-mlx5-Continue-driver-initialization-despite-debu.patch @@ -0,0 +1,37 @@ +From: Leon Romanovsky +Date: Thu, 13 Dec 2018 13:15:11 +0200 +Subject: net/mlx5: Continue driver initialization despite debugfs failure +Patch-mainline: v5.0-rc1 +Git-commit: 199fa087dc6b503baad06712716fac645a983e8a +References: git-fixes + +The failure to create debugfs entry is unpleasant event, but not enough +to abort drier initialization. Align the mlx5_core code to debugfs design +and continue execution whenever debugfs_create_dir() successes or not. + +Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") +Reviewed-by: Saeed Mahameed +Signed-off-by: Leon Romanovsky +Signed-off-by: Saeed Mahameed +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c +@@ -877,11 +877,9 @@ static int mlx5_pci_init(struct mlx5_cor + + priv->numa_node = dev_to_node(&dev->pdev->dev); + +- priv->dbg_root = debugfs_create_dir(dev_name(&pdev->dev), mlx5_debugfs_root); +- if (!priv->dbg_root) { +- dev_err(&pdev->dev, "Cannot create debugfs dir, aborting\n"); +- return -ENOMEM; +- } ++ if (mlx5_debugfs_root) ++ priv->dbg_root = ++ debugfs_create_dir(pci_name(pdev), mlx5_debugfs_root); + + err = mlx5_pci_enable_device(dev); + if (err) { diff --git a/patches.suse/net-mlx5-Fix-command-entry-leak-in-Internal-Error-St.patch b/patches.suse/net-mlx5-Fix-command-entry-leak-in-Internal-Error-St.patch new file mode 100644 index 0000000..3211be3 --- /dev/null +++ b/patches.suse/net-mlx5-Fix-command-entry-leak-in-Internal-Error-St.patch @@ -0,0 +1,34 @@ +From: Moshe Shemesh +Date: Sun, 23 Feb 2020 03:27:41 +0200 +Subject: net/mlx5: Fix command entry leak in Internal Error State +Git-commit: cece6f432cca9f18900463ed01b97a152a03600a +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +Processing commands by cmd_work_handler() while already in Internal +Error State will result in entry leak, since the handler process force +completion without doorbell. Forced completion doesn't release the entry +and event completion will never arrive, so entry should be released. + +Fixes: 73dd3a4839c1 ("net/mlx5: Avoid using pending command interface slots") +Signed-off-by: Moshe Shemesh +Signed-off-by: Eran Ben Elisha +Signed-off-by: Saeed Mahameed +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +@@ -908,6 +908,10 @@ static void cmd_work_handler(struct work + MLX5_SET(mbox_out, ent->out, syndrome, drv_synd); + + mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true); ++ /* no doorbell, no need to keep the entry */ ++ free_ent(cmd, ent->idx); ++ if (ent->callback) ++ free_cmd(ent); + return; + } + diff --git a/patches.suse/net-mlx5-Fix-forced-completion-access-non-initialize.patch b/patches.suse/net-mlx5-Fix-forced-completion-access-non-initialize.patch new file mode 100644 index 0000000..fa79ed8 --- /dev/null +++ b/patches.suse/net-mlx5-Fix-forced-completion-access-non-initialize.patch @@ -0,0 +1,44 @@ +From: Moshe Shemesh +Date: Sun, 21 Jul 2019 08:40:13 +0300 +Subject: net/mlx5: Fix forced completion access non initialized command entry +Git-commit: f3cb3cebe26ed4c8036adbd9448b372129d3c371 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +mlx5_cmd_flush() will trigger forced completions to all valid command +entries. Triggered by an asynch event such as fast teardown it can +happen at any stage of the command, including command initialization. +It will trigger forced completion and that can lead to completion on an +uninitialized command entry. + +Setting MLX5_CMD_ENT_STATE_PENDING_COMP only after command entry is +initialized will ensure force completion is treated only if command +entry is initialized. + +Fixes: 73dd3a4839c1 ("net/mlx5: Avoid using pending command interface slots") +Signed-off-by: Moshe Shemesh +Signed-off-by: Eran Ben Elisha +Signed-off-by: Saeed Mahameed +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +@@ -874,7 +874,6 @@ static void cmd_work_handler(struct work + } + + cmd->ent_arr[ent->idx] = ent; +- set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state); + lay = get_inst(cmd, ent->idx); + ent->lay = lay; + memset(lay, 0, sizeof(*lay)); +@@ -896,6 +895,7 @@ static void cmd_work_handler(struct work + + if (ent->callback) + schedule_delayed_work(&ent->cb_timeout_work, cb_timeout); ++ set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state); + + /* Skip sending command to fw if internal error */ + if (pci_channel_offline(dev->pdev) || diff --git a/patches.suse/net-mlx5e-Fix-traffic-duplication-in-ethtool-steerin.patch b/patches.suse/net-mlx5e-Fix-traffic-duplication-in-ethtool-steerin.patch new file mode 100644 index 0000000..b571c81 --- /dev/null +++ b/patches.suse/net-mlx5e-Fix-traffic-duplication-in-ethtool-steerin.patch @@ -0,0 +1,39 @@ +From: Saeed Mahameed +Date: Wed, 11 Sep 2019 07:50:13 -0700 +Subject: net/mlx5e: Fix traffic duplication in ethtool steering +Patch-mainline: v5.4-rc1 +Git-commit: d22fcc806b84b9818de08b32e494f3c05dd236c7 +References: git-fixes + +Before this patch, when adding multiple ethtool steering rules with +identical classification, the driver used to append the new destination +to the already existing hw rule, which caused the hw to forward the +traffic to all destinations (rx queues). + +Here we avoid this by setting the "no append" mlx5 fs core flag when +adding a new ethtool rule. + +Fixes: 6dc6071cfcde ("net/mlx5e: Add ethtool flow steering support") +Signed-off-by: Saeed Mahameed +Reviewed-by: Maor Gottlieb +Signed-off-by: Saeed Mahameed +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +@@ -397,10 +397,10 @@ add_ethtool_flow_rule(struct mlx5e_priv + struct mlx5_flow_table *ft, + struct ethtool_rx_flow_spec *fs) + { ++ struct mlx5_flow_act flow_act = { .flags = FLOW_ACT_NO_APPEND }; + struct mlx5_flow_destination *dst = NULL; +- struct mlx5_flow_act flow_act = {0}; +- struct mlx5_flow_spec *spec; + struct mlx5_flow_handle *rule; ++ struct mlx5_flow_spec *spec; + int err = 0; + + spec = kvzalloc(sizeof(*spec), GFP_KERNEL); diff --git a/patches.suse/net-mlx5e-Remove-unnecessary-clear_bit-s.patch b/patches.suse/net-mlx5e-Remove-unnecessary-clear_bit-s.patch new file mode 100644 index 0000000..054c979 --- /dev/null +++ b/patches.suse/net-mlx5e-Remove-unnecessary-clear_bit-s.patch @@ -0,0 +1,37 @@ +From: Maxim Mikityanskiy +Date: Mon, 12 Aug 2019 14:32:37 +0300 +Subject: net/mlx5e: Remove unnecessary clear_bit()s +Patch-mainline: v5.4-rc1 +Git-commit: 7f7edefda122b43ab2cd40b5efe43a10fd4a5894 +References: git-fixes + +Don't clear MLX5E_SQ_STATE_ENABLED on error in mlx5e_open_txqsq and +mlx5e_open_icosq, because it's not set there, and is 0 by default. + +Fixes: acc6c5953af1 ("net/mlx5e: Split open/close channels to stages") +Fixes: 9d18b5144a0a ("net/mlx5e: Split open/close ICOSQ into stages") +Signed-off-by: Maxim Mikityanskiy +Signed-off-by: Saeed Mahameed +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +@@ -1343,7 +1343,6 @@ static int mlx5e_open_txqsq(struct mlx5e + return 0; + + err_free_txqsq: +- clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); + mlx5e_free_txqsq(sq); + + return err; +@@ -1537,7 +1536,6 @@ static int mlx5e_open_icosq(struct mlx5e + return 0; + + err_free_icosq: +- clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); + mlx5e_free_icosq(sq); + + return err; diff --git a/patches.suse/net-mlx5e-Update-netdev-txq-on-completions-during-cl.patch b/patches.suse/net-mlx5e-Update-netdev-txq-on-completions-during-cl.patch new file mode 100644 index 0000000..c09d9ff --- /dev/null +++ b/patches.suse/net-mlx5e-Update-netdev-txq-on-completions-during-cl.patch @@ -0,0 +1,46 @@ +From: Moshe Shemesh +Date: Tue, 7 Apr 2020 17:38:28 +0300 +Subject: net/mlx5e: Update netdev txq on completions during closure +Git-commit: 5e911e2c06bd8c17df29147a5e2d4b17fafda024 +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +On sq closure when we free its descriptors, we should also update netdev +txq on completions which would not arrive. Otherwise if we reopen sqs +and attach them back, for example on fw fatal recovery flow, we may get +tx timeout. + +Fixes: 29429f3300a3 ("net/mlx5e: Timeout if SQ doesn't flush during close") +Signed-off-by: Moshe Shemesh +Reviewed-by: Tariq Toukan +Signed-off-by: Saeed Mahameed +Signed-off-by: Jiri Slaby +--- + drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +@@ -593,7 +593,8 @@ void mlx5e_free_txqsq_descs(struct mlx5e + { + struct mlx5e_tx_wqe_info *wi; + struct sk_buff *skb; +- u16 ci; ++ u32 nbytes = 0; ++ u16 ci, npkts = 0; + int i; + + while (sq->cc != sq->pc) { +@@ -614,8 +615,12 @@ void mlx5e_free_txqsq_descs(struct mlx5e + } + + dev_kfree_skb_any(skb); ++ npkts++; ++ nbytes += wi->num_bytes; + sq->cc += wi->num_wqebbs; + } ++ ++ netdev_tx_completed_queue(sq->txq, npkts, nbytes); + } + + #ifdef CONFIG_MLX5_CORE_IPOIB diff --git a/patches.suse/net-mlx5e-ethtool-Fix-a-typo-in-WOL-function-names.patch b/patches.suse/net-mlx5e-ethtool-Fix-a-typo-in-WOL-function-names.patch new file mode 100644 index 0000000..ad274b2 --- /dev/null +++ b/patches.suse/net-mlx5e-ethtool-Fix-a-typo-in-WOL-function-names.patch @@ -0,0 +1,57 @@ +From: Erez Alfasi +Date: Wed, 7 Aug 2019 17:56:02 +0300 +Subject: net/mlx5e: ethtool, Fix a typo in WOL function names +Patch-mainline: v5.4-rc1 +Git-commit: d5e1c0ef550e4fa4577e6567f829a460a7f4ab6e +References: git-fixes + +Fix a typo in 'mlx5e_refomrat_wol_mode_mlx5_to_linux' and +'mlx5e_refomrat_wol_mode_linux_to_mlx5' function names: +"refomrat" -> "reformat". + +Fixes: 928cfe8745a6 ("net/mlx5e: Wake On LAN support") +Signed-off-by: Erez Alfasi +Signed-off-by: Saeed Mahameed +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +@@ -1252,7 +1252,7 @@ static __u32 mlx5e_get_wol_supported(str + return ret; + } + +-static __u32 mlx5e_refomrat_wol_mode_mlx5_to_linux(u8 mode) ++static __u32 mlx5e_reformat_wol_mode_mlx5_to_linux(u8 mode) + { + __u32 ret = 0; + +@@ -1280,7 +1280,7 @@ static __u32 mlx5e_refomrat_wol_mode_mlx + return ret; + } + +-static u8 mlx5e_refomrat_wol_mode_linux_to_mlx5(__u32 mode) ++static u8 mlx5e_reformat_wol_mode_linux_to_mlx5(__u32 mode) + { + u8 ret = 0; + +@@ -1326,7 +1326,7 @@ static void mlx5e_get_wol(struct net_dev + if (err) + return; + +- wol->wolopts = mlx5e_refomrat_wol_mode_mlx5_to_linux(mlx5_wol_mode); ++ wol->wolopts = mlx5e_reformat_wol_mode_mlx5_to_linux(mlx5_wol_mode); + } + + static int mlx5e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) +@@ -1342,7 +1342,7 @@ static int mlx5e_set_wol(struct net_devi + if (wol->wolopts & ~wol_supported) + return -EINVAL; + +- mlx5_wol_mode = mlx5e_refomrat_wol_mode_linux_to_mlx5(wol->wolopts); ++ mlx5_wol_mode = mlx5e_reformat_wol_mode_linux_to_mlx5(wol->wolopts); + + return mlx5_set_port_wol(mdev, mlx5_wol_mode); + } diff --git a/patches.suse/net-mvmdio-allow-up-to-four-clocks-to-be-specified-f.patch b/patches.suse/net-mvmdio-allow-up-to-four-clocks-to-be-specified-f.patch new file mode 100644 index 0000000..fa6896e --- /dev/null +++ b/patches.suse/net-mvmdio-allow-up-to-four-clocks-to-be-specified-f.patch @@ -0,0 +1,36 @@ +From: Josua Mayer +Date: Tue, 9 Jul 2019 15:00:59 +0200 +Subject: net: mvmdio: allow up to four clocks to be specified for orion-mdio +Patch-mainline: v5.3-rc1 +Git-commit: 4aabed699c400810981d3dda170f05fa4d782905 +References: git-fixes + +Allow up to four clocks to be specified and enabled for the orion-mdio +interface, which are required by the Armada 8k and defined in +armada-cp110.dtsi. + +Fixes a hang in probing the mvmdio driver that was encountered on the +Clearfog GT 8K with all drivers built as modules, but also affects other +boards such as the MacchiatoBIN. + +Cc: stable@vger.kernel.org +Fixes: 96cb43423822 ("net: mvmdio: allow up to three clocks to be specified for orion-mdio") +Reviewed-by: Andrew Lunn +Signed-off-by: Josua Mayer +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/marvell/mvmdio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/marvell/mvmdio.c ++++ b/drivers/net/ethernet/marvell/mvmdio.c +@@ -64,7 +64,7 @@ + + struct orion_mdio_dev { + void __iomem *regs; +- struct clk *clk[3]; ++ struct clk *clk[4]; + /* + * If we have access to the error interrupt pin (which is + * somewhat misnamed as it not only reflects internal errors diff --git a/patches.suse/net-mvpp2-prs-Don-t-override-the-sign-bit-in-SRAM-pa.patch b/patches.suse/net-mvpp2-prs-Don-t-override-the-sign-bit-in-SRAM-pa.patch new file mode 100644 index 0000000..166b906 --- /dev/null +++ b/patches.suse/net-mvpp2-prs-Don-t-override-the-sign-bit-in-SRAM-pa.patch @@ -0,0 +1,41 @@ +From: Maxime Chevallier +Date: Thu, 20 Jun 2019 11:42:45 +0200 +Subject: net: mvpp2: prs: Don't override the sign bit in SRAM parser shift +Patch-mainline: v5.3-rc1 +Git-commit: 8ec3ede559956f8ad58db7b57d25ac724bab69e9 +References: git-fixes + +The Header Parser allows identifying various fields in the packet +headers, used for various kind of filtering and classification +steps. + +This is a re-entrant process, where the offset in the packet header +depends on the previous lookup results. This offset is represented in +the SRAM results of the TCAM, as a shift to be operated. + +This shift can be negative in some cases, such as in IPv6 parsing. + +This commit prevents overriding the sign bit when setting the shift +value, which could cause instabilities when parsing IPv6 flows. + +Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit") +Suggested-by: Alan Winkowski +Signed-off-by: Maxime Chevallier +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c ++++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c +@@ -312,7 +312,8 @@ static void mvpp2_prs_sram_shift_set(str + } + + /* Set value */ +- pe->sram[MVPP2_BIT_TO_WORD(MVPP2_PRS_SRAM_SHIFT_OFFS)] = shift & MVPP2_PRS_SRAM_SHIFT_MASK; ++ pe->sram[MVPP2_BIT_TO_WORD(MVPP2_PRS_SRAM_SHIFT_OFFS)] |= ++ shift & MVPP2_PRS_SRAM_SHIFT_MASK; + + /* Reset and set operation */ + mvpp2_prs_sram_bits_clear(pe, MVPP2_PRS_SRAM_OP_SEL_SHIFT_OFFS, diff --git a/patches.suse/net-phy-fix-aneg-restart-in-phy_ethtool_set_eee.patch b/patches.suse/net-phy-fix-aneg-restart-in-phy_ethtool_set_eee.patch new file mode 100644 index 0000000..1f48300 --- /dev/null +++ b/patches.suse/net-phy-fix-aneg-restart-in-phy_ethtool_set_eee.patch @@ -0,0 +1,37 @@ +From: Heiner Kallweit +Date: Tue, 12 May 2020 21:45:53 +0200 +Subject: net: phy: fix aneg restart in phy_ethtool_set_eee +Git-commit: 9de5d235b60a7cdfcdd5461e70c5663e713fde87 +Patch-mainline: 5.7-rc6 +References: networking-stable-20_05_16 + +phy_restart_aneg() enables aneg in the PHY. That's not what we want +if phydev->autoneg is disabled. In this case still update EEE +advertisement register, but don't enable aneg and don't trigger an +aneg restart. + +Fixes: f75abeb8338e ("net: phy: restart phy autonegotiation after EEE advertisment change") +Signed-off-by: Heiner Kallweit +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/phy/phy.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/net/phy/phy.c ++++ b/drivers/net/phy/phy.c +@@ -1267,9 +1267,11 @@ int phy_ethtool_set_eee(struct phy_devic + /* Restart autonegotiation so the new modes get sent to the + * link partner. + */ +- ret = phy_restart_aneg(phydev); +- if (ret < 0) +- return ret; ++ if (phydev->autoneg == AUTONEG_ENABLE) { ++ ret = phy_restart_aneg(phydev); ++ if (ret < 0) ++ return ret; ++ } + } + + return 0; diff --git a/patches.suse/net-qed-fix-NVMe-login-fails-over-VFs.patch b/patches.suse/net-qed-fix-NVMe-login-fails-over-VFs.patch new file mode 100644 index 0000000..c0ffcb2 --- /dev/null +++ b/patches.suse/net-qed-fix-NVMe-login-fails-over-VFs.patch @@ -0,0 +1,73 @@ +From: Alexander Lobakin +Date: Tue, 23 Jun 2020 16:51:32 +0300 +Subject: net: qed: fix NVMe login fails over VFs +Patch-mainline: v5.8-rc3 +Git-commit: ccd7c7ce167a21dbf2b698ffcf00f11d96d44f9b +References: git-fixes + +25ms sleep cycles in waiting for PF response are excessive and may lead +to different timeout failures. + +Start to wait with short udelays, and in most cases polling will end +here. If the time was not sufficient, switch to msleeps. +usleep_range() may go far beyond 100us depending on platform and tick +configuration, hence atomic udelays for consistency. + +Also add explicit DMA barriers since 'done' always comes from a shared +request-response DMA pool, and note that in the comment nearby. + +Fixes: 1408cc1fa48c ("qed: Introduce VFs") +Signed-off-by: Alexander Lobakin +Signed-off-by: Igor Russkikh +Signed-off-by: Michal Kalderon +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/qlogic/qed/qed_vf.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/qlogic/qed/qed_vf.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c +@@ -81,12 +81,17 @@ static void qed_vf_pf_req_end(struct qed + mutex_unlock(&(p_hwfn->vf_iov_info->mutex)); + } + ++#define QED_VF_CHANNEL_USLEEP_ITERATIONS 90 ++#define QED_VF_CHANNEL_USLEEP_DELAY 100 ++#define QED_VF_CHANNEL_MSLEEP_ITERATIONS 10 ++#define QED_VF_CHANNEL_MSLEEP_DELAY 25 ++ + static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size) + { + union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request; + struct ustorm_trigger_vf_zone trigger; + struct ustorm_vf_zone *zone_data; +- int rc = 0, time = 100; ++ int iter, rc = 0; + + zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B; + +@@ -126,11 +131,19 @@ static int qed_send_msg2pf(struct qed_hw + REG_WR(p_hwfn, (uintptr_t)&zone_data->trigger, *((u32 *)&trigger)); + + /* When PF would be done with the response, it would write back to the +- * `done' address. Poll until then. ++ * `done' address from a coherent DMA zone. Poll until then. + */ +- while ((!*done) && time) { +- msleep(25); +- time--; ++ ++ iter = QED_VF_CHANNEL_USLEEP_ITERATIONS; ++ while (!*done && iter--) { ++ udelay(QED_VF_CHANNEL_USLEEP_DELAY); ++ dma_rmb(); ++ } ++ ++ iter = QED_VF_CHANNEL_MSLEEP_ITERATIONS; ++ while (!*done && iter--) { ++ msleep(QED_VF_CHANNEL_MSLEEP_DELAY); ++ dma_rmb(); + } + + if (!*done) { diff --git a/patches.suse/net-qed-fix-excessive-QM-ILT-lines-consumption.patch b/patches.suse/net-qed-fix-excessive-QM-ILT-lines-consumption.patch new file mode 100644 index 0000000..2e839e5 --- /dev/null +++ b/patches.suse/net-qed-fix-excessive-QM-ILT-lines-consumption.patch @@ -0,0 +1,33 @@ +From: Alexander Lobakin +Date: Tue, 23 Jun 2020 16:51:33 +0300 +Subject: net: qed: fix excessive QM ILT lines consumption +Patch-mainline: v5.8-rc3 +Git-commit: d434d02f7e7c24c721365fd594ed781acb18e0da +References: git-fixes + +This is likely a copy'n'paste mistake. The amount of ILT lines to +reserve for a single VF was being multiplied by the total VFs count. +This led to a huge redundancy in reservation and potential lines +drainouts. + +Fixes: 1408cc1fa48c ("qed: Introduce VFs") +Signed-off-by: Alexander Lobakin +Signed-off-by: Igor Russkikh +Signed-off-by: Michal Kalderon +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/qlogic/qed/qed_cxt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c +@@ -396,7 +396,7 @@ static void qed_cxt_qm_iids(struct qed_h + vf_tids += segs[NUM_TASK_PF_SEGMENTS].count; + } + +- iids->vf_cids += vf_cids * p_mngr->vf_count; ++ iids->vf_cids = vf_cids; + iids->tids += vf_tids * p_mngr->vf_count; + + DP_VERBOSE(p_hwfn, QED_MSG_ILT, diff --git a/patches.suse/net-qede-stop-adding-events-on-an-already-destroyed-.patch b/patches.suse/net-qede-stop-adding-events-on-an-already-destroyed-.patch new file mode 100644 index 0000000..0f5ce58 --- /dev/null +++ b/patches.suse/net-qede-stop-adding-events-on-an-already-destroyed-.patch @@ -0,0 +1,39 @@ +From: Alexander Lobakin +Date: Tue, 23 Jun 2020 16:51:31 +0300 +Subject: net: qede: stop adding events on an already destroyed workqueue +Patch-mainline: v5.8-rc3 +Git-commit: 4079c7f7a2a00ab403c177ce723b560de59139c3 +References: git-fixes + +Set rdma_wq pointer to NULL after destroying the workqueue and check +for it when adding new events to fix crashes on driver unload. + +Fixes: cee9fbd8e2e9 ("qede: Add qedr framework") +Signed-off-by: Alexander Lobakin +Signed-off-by: Igor Russkikh +Signed-off-by: Michal Kalderon +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/qlogic/qede/qede_rdma.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/qlogic/qede/qede_rdma.c ++++ b/drivers/net/ethernet/qlogic/qede/qede_rdma.c +@@ -105,6 +105,7 @@ static void qede_rdma_destroy_wq(struct + + qede_rdma_cleanup_event(edev); + destroy_workqueue(edev->rdma_info.rdma_wq); ++ edev->rdma_info.rdma_wq = NULL; + } + + int qede_rdma_dev_add(struct qede_dev *edev, bool recovery) +@@ -325,7 +326,7 @@ static void qede_rdma_add_event(struct q + if (edev->rdma_info.exp_recovery) + return; + +- if (!edev->rdma_info.qedr_dev) ++ if (!edev->rdma_info.qedr_dev || !edev->rdma_info.rdma_wq) + return; + + /* We don't want the cleanup flow to start while we're allocating and diff --git a/patches.suse/net-qrtr-Fix-passing-invalid-reference-to-qrtr_local.patch b/patches.suse/net-qrtr-Fix-passing-invalid-reference-to-qrtr_local.patch new file mode 100644 index 0000000..667aa8e --- /dev/null +++ b/patches.suse/net-qrtr-Fix-passing-invalid-reference-to-qrtr_local.patch @@ -0,0 +1,36 @@ +From: Manivannan Sadhasivam +Date: Tue, 19 May 2020 23:44:16 +0530 +Subject: net: qrtr: Fix passing invalid reference to qrtr_local_enqueue() +Git-commit: d28ea1fbbf437054ef339afec241019f2c4e2bb6 +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +Once the traversal of the list is completed with list_for_each_entry(), +the iterator (node) will point to an invalid object. So passing this to +qrtr_local_enqueue() which is outside of the iterator block is erroneous +eventhough the object is not used. + +So fix this by passing NULL to qrtr_local_enqueue(). + +Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") +Reported-by: kbuild test robot +Reported-by: Julia Lawall +Signed-off-by: Manivannan Sadhasivam +Reviewed-by: Bjorn Andersson +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/qrtr/qrtr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/qrtr/qrtr.c ++++ b/net/qrtr/qrtr.c +@@ -661,7 +661,7 @@ static int qrtr_bcast_enqueue(struct qrt + } + mutex_unlock(&qrtr_node_lock); + +- qrtr_local_enqueue(node, skb); ++ qrtr_local_enqueue(NULL, skb); + + return 0; + } diff --git a/patches.suse/net-revert-net-get-rid-of-an-signed-integer-overflow.patch b/patches.suse/net-revert-net-get-rid-of-an-signed-integer-overflow.patch new file mode 100644 index 0000000..6a3b0d1 --- /dev/null +++ b/patches.suse/net-revert-net-get-rid-of-an-signed-integer-overflow.patch @@ -0,0 +1,65 @@ +From: Yuqi Jin +Date: Sat, 16 May 2020 11:46:49 +0800 +Subject: net: revert "net: get rid of an signed integer overflow in + ip_idents_reserve()" +Git-commit: a6211caa634da39d861a47437ffcda8b38ef421b +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +Commit adb03115f459 ("net: get rid of an signed integer overflow in ip_idents_reserve()") +used atomic_cmpxchg to replace "atomic_add_return" inside the function +"ip_idents_reserve". The reason was to avoid UBSAN warning. +However, this change has caused performance degrade and in GCC-8, +fno-strict-overflow is now mapped to -fwrapv -fwrapv-pointer +and signed integer overflow is now undefined by default at all +optimization levels[1]. Moreover, it was a bug in UBSAN vs -fwrapv +/-fno-strict-overflow, so Let's revert it safely. + +[1] https://gcc.gnu.org/gcc-8/changes.html + +Suggested-by: Peter Zijlstra +Suggested-by: Eric Dumazet +Cc: "David S. Miller" +Cc: Alexey Kuznetsov +Cc: Hideaki YOSHIFUJI +Cc: Jakub Kicinski +Cc: Jiri Pirko +Cc: Arvind Sankar +Cc: Peter Zijlstra +Cc: Eric Dumazet +Cc: Jiong Wang +Signed-off-by: Yuqi Jin +Signed-off-by: Shaokun Zhang +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/ipv4/route.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -496,18 +496,16 @@ u32 ip_idents_reserve(u32 hash, int segs + atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ; + u32 old = READ_ONCE(*p_tstamp); + u32 now = (u32)jiffies; +- u32 new, delta = 0; ++ u32 delta = 0; + + if (old != now && cmpxchg(p_tstamp, old, now) == old) + delta = prandom_u32_max(now - old); + +- /* Do not use atomic_add_return() as it makes UBSAN unhappy */ +- do { +- old = (u32)atomic_read(p_id); +- new = old + delta + segs; +- } while (atomic_cmpxchg(p_id, old, new) != old); +- +- return new - segs; ++ /* If UBSAN reports an error there, please make sure your compiler ++ * supports -fno-strict-overflow before reporting it that was a bug ++ * in UBSAN, and it has been fixed in GCC-8. ++ */ ++ return atomic_add_return(segs + delta, p_id) - segs; + } + EXPORT_SYMBOL(ip_idents_reserve); + diff --git a/patches.suse/net-sched-fix-reporting-the-first-time-use-timestamp.patch b/patches.suse/net-sched-fix-reporting-the-first-time-use-timestamp.patch new file mode 100644 index 0000000..d9dc3b2 --- /dev/null +++ b/patches.suse/net-sched-fix-reporting-the-first-time-use-timestamp.patch @@ -0,0 +1,35 @@ +From: Roman Mashak +Date: Sun, 17 May 2020 08:46:31 -0400 +Subject: net sched: fix reporting the first-time use timestamp +Git-commit: b15e62631c5f19fea9895f7632dae9c1b27fe0cd +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +When a new action is installed, firstuse field of 'tcf_t' is explicitly set +to 0. Value of zero means "new action, not yet used"; as a packet hits the +action, 'firstuse' is stamped with the current jiffies value. + +tcf_tm_dump() should return 0 for firstuse if action has not yet been hit. + +Fixes: 48d8ee1694dd ("net sched actions: aggregate dumping of actions timeinfo") +Cc: Jamal Hadi Salim +Signed-off-by: Roman Mashak +Acked-by: Jamal Hadi Salim +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + include/net/act_api.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/include/net/act_api.h ++++ b/include/net/act_api.h +@@ -69,7 +69,8 @@ static inline void tcf_tm_dump(struct tc + { + dtm->install = jiffies_to_clock_t(jiffies - stm->install); + dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse); +- dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse); ++ dtm->firstuse = stm->firstuse ? ++ jiffies_to_clock_t(jiffies - stm->firstuse) : 0; + dtm->expires = jiffies_to_clock_t(stm->expires); + } + diff --git a/patches.suse/net-stricter-validation-of-untrusted-gso-packets.patch b/patches.suse/net-stricter-validation-of-untrusted-gso-packets.patch new file mode 100644 index 0000000..89de785 --- /dev/null +++ b/patches.suse/net-stricter-validation-of-untrusted-gso-packets.patch @@ -0,0 +1,105 @@ +From: Willem de Bruijn +Date: Mon, 4 May 2020 12:48:54 -0400 +Subject: net: stricter validation of untrusted gso packets +Git-commit: 9274124f023b5c56dc4326637d4f787968b03607 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +Syzkaller again found a path to a kernel crash through bad gso input: +a packet with transport header extending beyond skb_headlen(skb). + +Tighten validation at kernel entry: + +- Verify that the transport header lies within the linear section. + + To avoid pulling linux/tcp.h, verify just sizeof tcphdr. + tcp_gso_segment will call pskb_may_pull (th->doff * 4) before use. + +- Match the gso_type against the ip_proto found by the flow dissector. + +[js] no namespaces for skb_flow_dissect_flow_keys_basic in 4.12 yet + +Fixes: bfd5f4a3d605 ("packet: Add GSO/csum offload support.") +Reported-by: syzbot +Signed-off-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + include/linux/virtio_net.h | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +--- a/include/linux/virtio_net.h ++++ b/include/linux/virtio_net.h +@@ -2,6 +2,8 @@ + #define _LINUX_VIRTIO_NET_H + + #include ++#include ++#include + #include + + static inline int virtio_net_hdr_set_proto(struct sk_buff *skb, +@@ -27,17 +29,25 @@ static inline int virtio_net_hdr_to_skb( + bool little_endian) + { + unsigned int gso_type = 0; ++ unsigned int thlen = 0; ++ unsigned int ip_proto; + + if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { + switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { + case VIRTIO_NET_HDR_GSO_TCPV4: + gso_type = SKB_GSO_TCPV4; ++ ip_proto = IPPROTO_TCP; ++ thlen = sizeof(struct tcphdr); + break; + case VIRTIO_NET_HDR_GSO_TCPV6: + gso_type = SKB_GSO_TCPV6; ++ ip_proto = IPPROTO_TCP; ++ thlen = sizeof(struct tcphdr); + break; + case VIRTIO_NET_HDR_GSO_UDP: + gso_type = SKB_GSO_UDP; ++ ip_proto = IPPROTO_UDP; ++ thlen = sizeof(struct udphdr); + break; + default: + return -EINVAL; +@@ -56,16 +66,22 @@ static inline int virtio_net_hdr_to_skb( + + if (!skb_partial_csum_set(skb, start, off)) + return -EINVAL; ++ ++ if (skb_transport_offset(skb) + thlen > skb_headlen(skb)) ++ return -EINVAL; + } else { + /* gso packets without NEEDS_CSUM do not set transport_offset. + * probe and drop if does not match one of the above types. + */ + if (gso_type && skb->network_header) { ++ struct flow_keys_basic keys; ++ + if (!skb->protocol) + virtio_net_hdr_set_proto(skb, hdr); + retry: +- skb_probe_transport_header(skb, -1); +- if (!skb_transport_header_was_set(skb)) { ++ if (!skb_flow_dissect_flow_keys_basic(skb, &keys, ++ NULL, 0, 0, 0, ++ 0)) { + /* UFO does not specify ipv4 or 6: try both */ + if (gso_type & SKB_GSO_UDP && + skb->protocol == htons(ETH_P_IP)) { +@@ -74,6 +90,12 @@ retry: + } + return -EINVAL; + } ++ ++ if (keys.control.thoff + thlen > skb_headlen(skb) || ++ keys.basic.ip_proto != ip_proto) ++ return -EINVAL; ++ ++ skb_set_transport_header(skb, keys.control.thoff); + } + } + diff --git a/patches.suse/net-tls-Fix-sk_psock-refcnt-leak-in-bpf_exec_tx_verd.patch b/patches.suse/net-tls-Fix-sk_psock-refcnt-leak-in-bpf_exec_tx_verd.patch new file mode 100644 index 0000000..1d03717 --- /dev/null +++ b/patches.suse/net-tls-Fix-sk_psock-refcnt-leak-in-bpf_exec_tx_verd.patch @@ -0,0 +1,40 @@ +From: Xiyu Yang +Date: Sat, 25 Apr 2020 20:54:37 +0800 +Subject: net/tls: Fix sk_psock refcnt leak in bpf_exec_tx_verdict() +Git-commit: 095f5614bfe16e5b3e191b34ea41b10d6fdd4ced +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +bpf_exec_tx_verdict() invokes sk_psock_get(), which returns a reference +of the specified sk_psock object to "psock" with increased refcnt. + +When bpf_exec_tx_verdict() returns, local variable "psock" becomes +invalid, so the refcount should be decreased to keep refcount balanced. + +The reference counting issue happens in one exception handling path of +bpf_exec_tx_verdict(). When "policy" equals to NULL but "psock" is not +NULL, the function forgets to decrease the refcnt increased by +sk_psock_get(), causing a refcnt leak. + +Fix this issue by calling sk_psock_put() on this error path before +bpf_exec_tx_verdict() returns. + +Signed-off-by: Xiyu Yang +Signed-off-by: Xin Tan +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/tls/tls_sw.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/net/tls/tls_sw.c ++++ b/net/tls/tls_sw.c +@@ -699,6 +699,8 @@ static int bpf_exec_tx_verdict(struct sk + *copied -= sk_msg_free(sk, msg); + tls_free_open_rec(sk); + } ++ if (psock) ++ sk_psock_put(sk, psock); + return err; + } + more_data: diff --git a/patches.suse/net-tls-Fix-sk_psock-refcnt-leak-when-in-tls_data_re.patch b/patches.suse/net-tls-Fix-sk_psock-refcnt-leak-when-in-tls_data_re.patch new file mode 100644 index 0000000..ffd04ff --- /dev/null +++ b/patches.suse/net-tls-Fix-sk_psock-refcnt-leak-when-in-tls_data_re.patch @@ -0,0 +1,43 @@ +From: Xiyu Yang +Date: Sat, 25 Apr 2020 21:10:23 +0800 +Subject: net/tls: Fix sk_psock refcnt leak when in tls_data_ready() +Git-commit: 62b4011fa7bef9fa00a6aeec26e69685dc1cc21e +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +tls_data_ready() invokes sk_psock_get(), which returns a reference of +the specified sk_psock object to "psock" with increased refcnt. + +When tls_data_ready() returns, local variable "psock" becomes invalid, +so the refcount should be decreased to keep refcount balanced. + +The reference counting issue happens in one exception handling path of +tls_data_ready(). When "psock->ingress_msg" is empty but "psock" is not +NULL, the function forgets to decrease the refcnt increased by +sk_psock_get(), causing a refcnt leak. + +Fix this issue by calling sk_psock_put() on all paths when "psock" is +not NULL. + +Signed-off-by: Xiyu Yang +Signed-off-by: Xin Tan +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/tls/tls_sw.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/net/tls/tls_sw.c ++++ b/net/tls/tls_sw.c +@@ -1780,8 +1780,9 @@ static void tls_data_ready(struct sock * + strp_data_ready(&ctx->strp); + + psock = sk_psock_get(sk); +- if (psock && !list_empty(&psock->ingress_msg)) { +- ctx->saved_data_ready(sk); ++ if (psock) { ++ if (!list_empty(&psock->ingress_msg)) ++ ctx->saved_data_ready(sk); + sk_psock_put(sk, psock); + } + } diff --git a/patches.suse/net-usb-qmi_wwan-add-support-for-DW5816e.patch b/patches.suse/net-usb-qmi_wwan-add-support-for-DW5816e.patch new file mode 100644 index 0000000..213e3a9 --- /dev/null +++ b/patches.suse/net-usb-qmi_wwan-add-support-for-DW5816e.patch @@ -0,0 +1,30 @@ +From: Matt Jolly +Date: Sun, 3 May 2020 01:52:28 +1000 +Subject: net: usb: qmi_wwan: add support for DW5816e +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: 57c7f2bd758eed867295c81d3527fff4fab1ed74 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +Add support for Dell Wireless 5816e to drivers/net/usb/qmi_wwan.c + +Signed-off-by: Matt Jolly +Acked-by: Bjørn Mork +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1346,6 +1346,7 @@ static const struct usb_device_id produc + {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ + {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ + {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ ++ {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ + {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ + {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ + {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/ diff --git a/patches.suse/netprio_cgroup-Fix-unlimited-memory-leak-of-v2-cgrou.patch b/patches.suse/netprio_cgroup-Fix-unlimited-memory-leak-of-v2-cgrou.patch new file mode 100644 index 0000000..ceaba4f --- /dev/null +++ b/patches.suse/netprio_cgroup-Fix-unlimited-memory-leak-of-v2-cgrou.patch @@ -0,0 +1,48 @@ +From: Zefan Li +Date: Sat, 9 May 2020 11:32:10 +0800 +Subject: netprio_cgroup: Fix unlimited memory leak of v2 cgroups +Git-commit: 090e28b229af92dc5b40786ca673999d59e73056 +Patch-mainline: 5.7-rc6 +References: networking-stable-20_05_16 + +If systemd is configured to use hybrid mode which enables the use of +both cgroup v1 and v2, systemd will create new cgroup on both the default +root (v2) and netprio_cgroup hierarchy (v1) for a new session and attach +task to the two cgroups. If the task does some network thing then the v2 +cgroup can never be freed after the session exited. + +One of our machines ran into OOM due to this memory leak. + +In the scenario described above when sk_alloc() is called +cgroup_sk_alloc() thought it's in v2 mode, so it stores +the cgroup pointer in sk->sk_cgrp_data and increments +the cgroup refcnt, but then sock_update_netprioidx() +thought it's in v1 mode, so it stores netprioidx value +in sk->sk_cgrp_data, so the cgroup refcnt will never be freed. + +Currently we do the mode switch when someone writes to the ifpriomap +cgroup control file. The easiest fix is to also do the switch when +a task is attached to a new cgroup. + +Fixes: bd1060a1d671 ("sock, cgroup: add sock->sk_cgroup") +Reported-by: Yang Yingliang +Tested-by: Yang Yingliang +Signed-off-by: Zefan Li +Acked-by: Tejun Heo +Signed-off-by: Jakub Kicinski +Signed-off-by: Jiri Slaby +--- + net/core/netprio_cgroup.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/net/core/netprio_cgroup.c ++++ b/net/core/netprio_cgroup.c +@@ -241,6 +241,8 @@ static void net_prio_attach(struct cgrou + struct task_struct *p; + struct cgroup_subsys_state *css; + ++ cgroup_sk_alloc_disable(); ++ + cgroup_taskset_for_each(p, css, tset) { + void *v = (void *)(unsigned long)css->cgroup->id; + diff --git a/patches.suse/nfp-bpf-fix-code-gen-bug-on-BPF_ALU-BPF_XOR-BPF_K.patch b/patches.suse/nfp-bpf-fix-code-gen-bug-on-BPF_ALU-BPF_XOR-BPF_K.patch new file mode 100644 index 0000000..4957359 --- /dev/null +++ b/patches.suse/nfp-bpf-fix-code-gen-bug-on-BPF_ALU-BPF_XOR-BPF_K.patch @@ -0,0 +1,29 @@ +From: Jiong Wang +Date: Fri, 22 Feb 2019 22:36:03 +0000 +Subject: nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K +Patch-mainline: v5.0-rc8 +Git-commit: 71c190249f0ced5b26377ea6bf829ab3af77a40c +References: git-fixes + +The intended optimization should be A ^ 0 = A, not A ^ -1 = A. + +Fixes: cd7df56ed3e6 ("nfp: add BPF to NFP code translator") +Reviewed-by: Jakub Kicinski +Signed-off-by: Jiong Wang +Signed-off-by: Daniel Borkmann +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/netronome/nfp/bpf/jit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/netronome/nfp/bpf/jit.c ++++ b/drivers/net/ethernet/netronome/nfp/bpf/jit.c +@@ -2309,7 +2309,7 @@ static int xor_reg(struct nfp_prog *nfp_ + + static int xor_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) + { +- return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !~meta->insn.imm); ++ return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !meta->insn.imm); + } + + static int and_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) diff --git a/patches.suse/nilfs2-fix-null-pointer-dereference-at-nilfs_segctor.patch b/patches.suse/nilfs2-fix-null-pointer-dereference-at-nilfs_segctor.patch new file mode 100644 index 0000000..fcbc996 --- /dev/null +++ b/patches.suse/nilfs2-fix-null-pointer-dereference-at-nilfs_segctor.patch @@ -0,0 +1,72 @@ +From 8301c719a2bd131436438e49130ee381d30933f5 Mon Sep 17 00:00:00 2001 +From: Ryusuke Konishi +Date: Wed, 10 Jun 2020 18:41:35 -0700 +Subject: [PATCH] nilfs2: fix null pointer dereference at + nilfs_segctor_do_construct() +Git-commit: 8301c719a2bd131436438e49130ee381d30933f5 +Patch-mainline: v5.8-rc1 +References: bsc#1173857 + +After commit c3aab9a0bd91 ("mm/filemap.c: don't initiate writeback if +mapping has no dirty pages"), the following null pointer dereference has +been reported on nilfs2: + + BUG: kernel NULL pointer dereference, address: 00000000000000a8 + #PF: supervisor read access in kernel mode + #PF: error_code(0x0000) - not-present page + PGD 0 P4D 0 + Oops: 0000 [#1] SMP PTI + ... + RIP: 0010:percpu_counter_add_batch+0xa/0x60 + ... + Call Trace: + __test_set_page_writeback+0x2d3/0x330 + nilfs_segctor_do_construct+0x10d3/0x2110 [nilfs2] + nilfs_segctor_construct+0x168/0x260 [nilfs2] + nilfs_segctor_thread+0x127/0x3b0 [nilfs2] + kthread+0xf8/0x130 + ... + +This crash turned out to be caused by set_page_writeback() call for +segment summary buffers at nilfs_segctor_prepare_write(). + +set_page_writeback() can call inc_wb_stat(inode_to_wb(inode), +WB_WRITEBACK) where inode_to_wb(inode) is NULL if the inode of +underlying block device does not have an associated wb. + +This fixes the issue by calling inode_attach_wb() in advance to ensure +to associate the bdev inode with its wb. + +Fixes: c3aab9a0bd91 ("mm/filemap.c: don't initiate writeback if mapping has no dirty pages") +Reported-by: Walton Hoops +Reported-by: Tomas Hlavaty +Reported-by: ARAI Shun-ichi +Reported-by: Hideki EIRAKU +Signed-off-by: Ryusuke Konishi +Signed-off-by: Andrew Morton +Tested-by: Ryusuke Konishi +Cc: [5.4+] +Link: http://lkml.kernel.org/r/20200608.011819.1399059588922299158.konishi.ryusuke@gmail.com +Signed-off-by: Linus Torvalds +Acked-by: Jan Kara + +--- + fs/nilfs2/segment.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c +index 445eef41bfaf..91b58c897f92 100644 +--- a/fs/nilfs2/segment.c ++++ b/fs/nilfs2/segment.c +@@ -2780,6 +2780,8 @@ int nilfs_attach_log_writer(struct super_block *sb, struct nilfs_root *root) + if (!nilfs->ns_writer) + return -ENOMEM; + ++ inode_attach_wb(nilfs->ns_bdev->bd_inode, NULL); ++ + err = nilfs_segctor_start_thread(nilfs->ns_writer); + if (err) { + kfree(nilfs->ns_writer); +-- +2.16.4 + diff --git a/patches.suse/ocfs2-no-need-try-to-truncate-file-beyond-i_size.patch b/patches.suse/ocfs2-no-need-try-to-truncate-file-beyond-i_size.patch new file mode 100644 index 0000000..de8e7c2 --- /dev/null +++ b/patches.suse/ocfs2-no-need-try-to-truncate-file-beyond-i_size.patch @@ -0,0 +1,63 @@ +From 783fda856e1034dee90a873f7654c418212d12d7 Mon Sep 17 00:00:00 2001 +From: Changwei Ge +Date: Fri, 10 Apr 2020 14:32:38 -0700 +Subject: [PATCH] ocfs2: no need try to truncate file beyond i_size +Git-commit: 783fda856e1034dee90a873f7654c418212d12d7 +Patch-mainline: v5.7-rc1 +References: bsc#1171841 + +Linux fallocate(2) with FALLOC_FL_PUNCH_HOLE mode set, its offset can +exceed the inode size. Ocfs2 now doesn't allow that offset beyond inode +size. This restriction is not necessary and violates fallocate(2) +semantics. + +If fallocate(2) offset is beyond inode size, just return success and do +nothing further. + +Otherwise, ocfs2 will crash the kernel. + + kernel BUG at fs/ocfs2//alloc.c:7264! + ocfs2_truncate_inline+0x20f/0x360 [ocfs2] + ocfs2_remove_inode_range+0x23c/0xcb0 [ocfs2] + __ocfs2_change_file_space+0x4a5/0x650 [ocfs2] + ocfs2_fallocate+0x83/0xa0 [ocfs2] + vfs_fallocate+0x148/0x230 + SyS_fallocate+0x48/0x80 + do_syscall_64+0x79/0x170 + +Signed-off-by: Changwei Ge +Signed-off-by: Andrew Morton +Reviewed-by: Joseph Qi +Cc: Mark Fasheh +Cc: Joel Becker +Cc: Junxiao Bi +Cc: Changwei Ge +Cc: Gang He +Cc: Jun Piao +Cc: +Link: http://lkml.kernel.org/r/20200407082754.17565-1-chge@linux.alibaba.com +Signed-off-by: Linus Torvalds +Acked-by: Jan Kara + +--- + fs/ocfs2/alloc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c +index 65b3abbcce4e..2f834add165b 100644 +--- a/fs/ocfs2/alloc.c ++++ b/fs/ocfs2/alloc.c +@@ -7402,6 +7402,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, + struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; + struct ocfs2_inline_data *idata = &di->id2.i_data; + ++ /* No need to punch hole beyond i_size. */ ++ if (start >= i_size_read(inode)) ++ return 0; ++ + if (end > i_size_read(inode)) + end = i_size_read(inode); + +-- +2.16.4 + diff --git a/patches.suse/padata-ensure-the-reorder-timer-callback-runs-on-the.patch b/patches.suse/padata-ensure-the-reorder-timer-callback-runs-on-the.patch new file mode 100644 index 0000000..d5197ab --- /dev/null +++ b/patches.suse/padata-ensure-the-reorder-timer-callback-runs-on-the.patch @@ -0,0 +1,115 @@ +From cf5868c8a22dc2854b96e9569064bb92365549ca Mon Sep 17 00:00:00 2001 +From: Mathias Krause +Date: Fri, 8 Sep 2017 20:57:10 +0200 +Subject: [PATCH] padata: ensure the reorder timer callback runs on the correct + CPU +Git-commit: cf5868c8a22dc2854b96e9569064bb92365549ca +References: git-fixes +Patch-mainline: v4.15-rc1 + +The reorder timer function runs on the CPU where the timer interrupt was +handled which is not necessarily one of the CPUs of the 'pcpu' CPU mask +set. + +Ensure the padata_reorder() callback runs on the correct CPU, which is +one in the 'pcpu' CPU mask set and, preferrably, the next expected one. +Do so by comparing the current CPU with the expected target CPU. If they +match, call padata_reorder() right away. If they differ, schedule a work +item on the target CPU that does the padata_reorder() call for us. + +Signed-off-by: Mathias Krause +Signed-off-by: Herbert Xu +Signed-off-by: Oliver Neukum +--- + include/linux/padata.h | 2 ++ + kernel/padata.c | 43 ++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 44 insertions(+), 1 deletion(-) + +diff --git a/include/linux/padata.h b/include/linux/padata.h +index 2f9c1f93b1ce..5c0175bbc179 100644 +--- a/include/linux/padata.h ++++ b/include/linux/padata.h +@@ -85,6 +85,7 @@ struct padata_serial_queue { + * @swork: work struct for serialization. + * @pd: Backpointer to the internal control structure. + * @work: work struct for parallelization. ++ * @reorder_work: work struct for reordering. + * @num_obj: Number of objects that are processed by this cpu. + * @cpu_index: Index of the cpu. + */ +@@ -93,6 +94,7 @@ struct padata_parallel_queue { + struct padata_list reorder; + struct parallel_data *pd; + struct work_struct work; ++ struct work_struct reorder_work; + atomic_t num_obj; + int cpu_index; + }; +diff --git a/kernel/padata.c b/kernel/padata.c +index 1b9b4bac4a9b..b4066147bce4 100644 +--- a/kernel/padata.c ++++ b/kernel/padata.c +@@ -275,11 +275,51 @@ static void padata_reorder(struct parallel_data *pd) + return; + } + ++static void invoke_padata_reorder(struct work_struct *work) ++{ ++ struct padata_parallel_queue *pqueue; ++ struct parallel_data *pd; ++ ++ local_bh_disable(); ++ pqueue = container_of(work, struct padata_parallel_queue, reorder_work); ++ pd = pqueue->pd; ++ padata_reorder(pd); ++ local_bh_enable(); ++} ++ + static void padata_reorder_timer(unsigned long arg) + { + struct parallel_data *pd = (struct parallel_data *)arg; ++ unsigned int weight; ++ int target_cpu, cpu; + +- padata_reorder(pd); ++ cpu = get_cpu(); ++ ++ /* We don't lock pd here to not interfere with parallel processing ++ * padata_reorder() calls on other CPUs. We just need any CPU out of ++ * the cpumask.pcpu set. It would be nice if it's the right one but ++ * it doesn't matter if we're off to the next one by using an outdated ++ * pd->processed value. ++ */ ++ weight = cpumask_weight(pd->cpumask.pcpu); ++ target_cpu = padata_index_to_cpu(pd, pd->processed % weight); ++ ++ /* ensure to call the reorder callback on the correct CPU */ ++ if (cpu != target_cpu) { ++ struct padata_parallel_queue *pqueue; ++ struct padata_instance *pinst; ++ ++ /* The timer function is serialized wrt itself -- no locking ++ * needed. ++ */ ++ pinst = pd->pinst; ++ pqueue = per_cpu_ptr(pd->pqueue, target_cpu); ++ queue_work_on(target_cpu, pinst->wq, &pqueue->reorder_work); ++ } else { ++ padata_reorder(pd); ++ } ++ ++ put_cpu(); + } + + static void padata_serial_worker(struct work_struct *serial_work) +@@ -399,6 +439,7 @@ static void padata_init_pqueues(struct parallel_data *pd) + __padata_list_init(&pqueue->reorder); + __padata_list_init(&pqueue->parallel); + INIT_WORK(&pqueue->work, padata_parallel_worker); ++ INIT_WORK(&pqueue->reorder_work, invoke_padata_reorder); + atomic_set(&pqueue->num_obj, 0); + } + } +-- +2.16.4 + diff --git a/patches.suse/pci-pciehp-fix-msi-interrupt-race b/patches.suse/pci-pciehp-fix-msi-interrupt-race index bc20101..93ea077 100644 --- a/patches.suse/pci-pciehp-fix-msi-interrupt-race +++ b/patches.suse/pci-pciehp-fix-msi-interrupt-race @@ -41,36 +41,36 @@ Signed-off-by: Bjorn Helgaas Reviewed-by: Joerg Roedel Acked-by: Joerg Roedel --- - drivers/pci/hotplug/pciehp_hpc.c | 26 ++++++++++++++++++++------ + drivers/pci/hotplug/pciehp_hpc.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c -@@ -565,7 +565,7 @@ static irqreturn_t pciehp_isr(int irq, v - { +@@ -550,7 +550,7 @@ static irqreturn_t pciehp_isr(int irq, v struct controller *ctrl = (struct controller *)dev_id; struct pci_dev *pdev = ctrl_dev(ctrl); + struct device *parent = pdev->dev.parent; - u16 status, events; + u16 status, events = 0; /* * Interrupts only occur in D3hot or shallower and only if enabled -@@ -573,6 +573,7 @@ static irqreturn_t pciehp_isr(int irq, v - (!(ctrl->slot_ctrl & PCI_EXP_SLTCTL_HPIE) && !pciehp_poll_mode)) - return IRQ_NONE; +@@ -575,6 +575,7 @@ static irqreturn_t pciehp_isr(int irq, v + } + } +read_status: pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &status); if (status == (u16) ~0) { ctrl_info(ctrl, "%s: no response from device\n", __func__); -@@ -583,21 +584,34 @@ static irqreturn_t pciehp_isr(int irq, v +@@ -587,24 +588,37 @@ static irqreturn_t pciehp_isr(int irq, v * Slot Status contains plain status bits as well as event * notification bits; right now we only want the event bits. */ - events = status & (PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD | - PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_CC | - PCI_EXP_SLTSTA_DLLSC); -+ status &= PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD | ++ events &= PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD | + PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_CC | + PCI_EXP_SLTSTA_DLLSC; @@ -83,8 +83,11 @@ Acked-by: Joerg Roedel + status &= ~PCI_EXP_SLTSTA_PFD; + events |= status; - if (!events) + if (!events) { + if (parent) + pm_runtime_put(parent); return IRQ_NONE; + } - pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, events); + if (status) { @@ -101,5 +104,5 @@ Acked-by: Joerg Roedel + } + ctrl_dbg(ctrl, "pending interrupts %#06x from Slot Status\n", events); - - /* + if (parent) + pm_runtime_put(parent); diff --git a/patches.suse/power-vexpress-add-suppress_bind_attrs-to-true.patch b/patches.suse/power-vexpress-add-suppress_bind_attrs-to-true.patch new file mode 100644 index 0000000..4dbfe26 --- /dev/null +++ b/patches.suse/power-vexpress-add-suppress_bind_attrs-to-true.patch @@ -0,0 +1,38 @@ +From 73174acc9c75960af2daa7dcbdb9781fc0d135cb Mon Sep 17 00:00:00 2001 +From: Anders Roxell +Date: Wed, 27 May 2020 13:26:04 +0200 +Subject: [PATCH] power: vexpress: add suppress_bind_attrs to true +Git-commit: 73174acc9c75960af2daa7dcbdb9781fc0d135cb +Patch-mainline: v5.8-rc1 +References: bsc#1111666 + +Make sure that the POWER_RESET_VEXPRESS driver won't have bind/unbind +attributes available via the sysfs, so lets be explicit here and use +".suppress_bind_attrs = true" to prevent userspace from doing something +silly. + +Link: https://lore.kernel.org/r/20200527112608.3886105-2-anders.roxell@linaro.org +Cc: stable@vger.kernel.org +Signed-off-by: Anders Roxell +Signed-off-by: Arnd Bergmann +Acked-by: Takashi Iwai + +--- + drivers/power/reset/vexpress-poweroff.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/power/reset/vexpress-poweroff.c b/drivers/power/reset/vexpress-poweroff.c +index 90cbaa8341e3..0bf9ab8653ae 100644 +--- a/drivers/power/reset/vexpress-poweroff.c ++++ b/drivers/power/reset/vexpress-poweroff.c +@@ -143,6 +143,7 @@ static struct platform_driver vexpress_reset_driver = { + .driver = { + .name = "vexpress-reset", + .of_match_table = vexpress_reset_of_match, ++ .suppress_bind_attrs = true, + }, + }; + +-- +2.16.4 + diff --git a/patches.suse/powerpc-book3s64-pkeys-Fix-pkey_access_permitted-for.patch b/patches.suse/powerpc-book3s64-pkeys-Fix-pkey_access_permitted-for.patch new file mode 100644 index 0000000..b062b45 --- /dev/null +++ b/patches.suse/powerpc-book3s64-pkeys-Fix-pkey_access_permitted-for.patch @@ -0,0 +1,155 @@ +From 192b6a780598976feb7321ff007754f8511a4129 Mon Sep 17 00:00:00 2001 +From: "Aneesh Kumar K.V" +Date: Sun, 12 Jul 2020 18:50:47 +0530 +Subject: [PATCH] powerpc/book3s64/pkeys: Fix pkey_access_permitted() for + execute disable pkey + +References: bsc#1065729 +Patch-mainline: v5.8-rc6 +Git-commit: 192b6a780598976feb7321ff007754f8511a4129 + +Even if the IAMR value denies execute access, the current code returns +true from pkey_access_permitted() for an execute permission check, if +the AMR read pkey bit is cleared. + +This results in repeated page fault loop with a test like below: + + #define _GNU_SOURCE + #include + #include + #include + #include + #include + + #include + #include + #include + #include + #include + + #ifdef SYS_pkey_mprotect + #undef SYS_pkey_mprotect + #endif + + #ifdef SYS_pkey_alloc + #undef SYS_pkey_alloc + #endif + + #ifdef SYS_pkey_free + #undef SYS_pkey_free + #endif + + #undef PKEY_DISABLE_EXECUTE + #define PKEY_DISABLE_EXECUTE 0x4 + + #define SYS_pkey_mprotect 386 + #define SYS_pkey_alloc 384 + #define SYS_pkey_free 385 + + #define PPC_INST_NOP 0x60000000 + #define PPC_INST_BLR 0x4e800020 + #define PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC) + + static int sys_pkey_mprotect(void *addr, size_t len, int prot, int pkey) + { + return syscall(SYS_pkey_mprotect, addr, len, prot, pkey); + } + + static int sys_pkey_alloc(unsigned long flags, unsigned long access_rights) + { + return syscall(SYS_pkey_alloc, flags, access_rights); + } + + static int sys_pkey_free(int pkey) + { + return syscall(SYS_pkey_free, pkey); + } + + static void do_execute(void *region) + { + /* jump to region */ + asm volatile( + "mtctr %0;" + "bctrl" + : : "r"(region) : "ctr", "lr"); + } + + static void do_protect(void *region) + { + size_t pgsize; + int i, pkey; + + pgsize = getpagesize(); + + pkey = sys_pkey_alloc(0, PKEY_DISABLE_EXECUTE); + assert (pkey > 0); + + /* perform mprotect */ + assert(!sys_pkey_mprotect(region, pgsize, PROT_RWX, pkey)); + do_execute(region); + + /* free pkey */ + assert(!sys_pkey_free(pkey)); + + } + + int main(int argc, char **argv) + { + size_t pgsize, numinsns; + unsigned int *region; + int i; + + /* allocate memory region to protect */ + pgsize = getpagesize(); + region = memalign(pgsize, pgsize); + assert(region != NULL); + assert(!mprotect(region, pgsize, PROT_RWX)); + + /* fill page with NOPs with a BLR at the end */ + numinsns = pgsize / sizeof(region[0]); + for (i = 0; i < numinsns - 1; i++) + region[i] = PPC_INST_NOP; + region[i] = PPC_INST_BLR; + + do_protect(region); + + return EXIT_SUCCESS; + } + +The fix is to only check the IAMR for an execute check, the AMR value +is not relevant. + +Fixes: f2407ef3ba22 ("powerpc: helper to validate key-access permissions of a pte") +Cc: stable@vger.kernel.org # v4.16+ +Reported-by: Sandipan Das +Signed-off-by: Aneesh Kumar K.V +[mpe: Add detail to change log, tweak wording & formatting] +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200712132047.1038594-1-aneesh.kumar@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/pkeys.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- a/arch/powerpc/mm/pkeys.c ++++ b/arch/powerpc/mm/pkeys.c +@@ -355,12 +355,14 @@ static bool pkey_access_permitted(int pk + return true; + + pkey_shift = pkeyshift(pkey); +- if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift))) +- return true; ++ if (execute) ++ return !(read_iamr() & (IAMR_EX_BIT << pkey_shift)); ++ ++ amr = read_amr(); ++ if (write) ++ return !(amr & (AMR_WR_BIT << pkey_shift)); + +- amr = read_amr(); /* Delay reading amr until absolutely needed */ +- return ((!write && !(amr & (AMR_RD_BIT << pkey_shift))) || +- (write && !(amr & (AMR_WR_BIT << pkey_shift)))); ++ return !(amr & (AMR_RD_BIT << pkey_shift)); + } + + bool arch_pte_access_permitted(u64 pte, bool write, bool execute) diff --git a/patches.suse/powerpc-fadump-fix-race-between-pstore-write-and-fad.patch b/patches.suse/powerpc-fadump-fix-race-between-pstore-write-and-fad.patch new file mode 100644 index 0000000..377ea22 --- /dev/null +++ b/patches.suse/powerpc-fadump-fix-race-between-pstore-write-and-fad.patch @@ -0,0 +1,146 @@ +From ba608c4fa12cfd0cab0e153249c29441f4dd3312 Mon Sep 17 00:00:00 2001 +From: Sourabh Jain +Date: Mon, 13 Jul 2020 10:54:35 +0530 +Subject: [PATCH] powerpc/fadump: fix race between pstore write and fadump + crash trigger + +References: bsc#1168959 ltc#185010 +Patch-mainline: queued +Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux +Git-commit: ba608c4fa12cfd0cab0e153249c29441f4dd3312 + +When we enter into fadump crash path via system reset we fail to update +the pstore. + +On the system reset path we first update the pstore then we go for fadump +crash. But the problem here is when all the CPUs try to get the pstore +lock to initiate the pstore write, only one CPUs will acquire the lock +and proceed with the pstore write. Since it in NMI context CPUs that fail +to get lock do not wait for their turn to write to the pstore and simply +proceed with the next operation which is fadump crash. One of the CPU who +proceeded with fadump crash path triggers the crash and does not wait for +the CPU who gets the pstore lock to complete the pstore update. + +Timeline diagram to depicts the sequence of events that leads to an +unsuccessful pstore update when we hit fadump crash path via system reset. + + 1 2 3 ... n CPU Threads + | | | | + | | | | + Reached to -->|--->|---->| ----------->| + system reset | | | | + path | | | | + | | | | + Try to -->|--->|---->|------------>| + acquire the | | | | + pstore lock | | | | + | | | | + | | | | + Got the -->| +->| | |<-+ + pstore lock | | | | | |--> Didn't get the + | --------------------------+ lock and moving + | | | | ahead on fadump + | | | | crash path + | | | | + Begins the -->| | | | + process to | | | |<-- Got the chance to + update the | | | | trigger the crash + pstore | -> | | ... <- | + | | | | | | + | | | | | |<-- Triggers the + | | | | | | crash + | | | | | | ^ + | | | | | | | + Writing to -->| | | | | | | + pstore | | | | | | | + | | | + ^ |__________________| | + | CPU Relax | + | | + +-----------------------------------------+ + | + v + Race: crash triggered before pstore + update completes + +To avoid this race condition a barrier is added on crash_fadump path, it +prevents the CPU to trigger the crash until all the online CPUs completes +their task. + +A barrier is added to make sure all the secondary CPUs hit the +crash_fadump function before we initiates the crash. A timeout is kept to +ensure the primary CPU (one who initiates the crash) do not wait for +secondary CPUs indefinitely. + +Signed-off-by: Sourabh Jain +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200713052435.183750-1-sourabhjain@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/kernel/fadump.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +--- a/arch/powerpc/kernel/fadump.c ++++ b/arch/powerpc/kernel/fadump.c +@@ -44,6 +44,14 @@ + #include + #include + ++/* ++ * The CPU who acquired the lock to trigger the fadump crash should ++ * wait for other CPUs to enter. ++ * ++ * The timeout is in milliseconds. ++ */ ++#define CRASH_TIMEOUT 500 ++ + static struct fw_dump fw_dump; + static struct fadump_mem_struct fdm; + static const struct fadump_mem_struct *fdm_active; +@@ -51,6 +59,8 @@ static const struct fadump_mem_struct *f + static struct cma *fadump_cma; + #endif + ++static atomic_t cpus_in_fadump; ++ + static DEFINE_MUTEX(fadump_mutex); + struct fad_crash_memory_ranges *crash_memory_ranges; + int crash_memory_ranges_size; +@@ -665,8 +675,11 @@ static int register_fw_dump(struct fadum + + void crash_fadump(struct pt_regs *regs, const char *str) + { ++ unsigned int msecs; + struct fadump_crash_info_header *fdh = NULL; + int old_cpu, this_cpu; ++ /* Do not include first CPU */ ++ unsigned int ncpus = num_online_cpus() - 1; + + if (!should_fadump_crash()) + return; +@@ -682,6 +695,8 @@ void crash_fadump(struct pt_regs *regs, + old_cpu = cmpxchg(&crashing_cpu, -1, this_cpu); + + if (old_cpu != -1) { ++ atomic_inc(&cpus_in_fadump); ++ + /* + * We can't loop here indefinitely. Wait as long as fadump + * is in force. If we race with fadump un-registration this +@@ -705,6 +720,16 @@ void crash_fadump(struct pt_regs *regs, + + fdh->online_mask = *cpu_online_mask; + ++ /* ++ * If we came in via system reset, wait a while for the secondary ++ * CPUs to enter. ++ */ ++ if (TRAP(&(fdh->regs)) == 0x100) { ++ msecs = CRASH_TIMEOUT; ++ while ((atomic_read(&cpus_in_fadump) < ncpus) && (--msecs > 0)) ++ mdelay(1); ++ } ++ + /* Call ibm,os-term rtas call to trigger firmware assisted dump */ + rtas_os_term((char *)str); + } diff --git a/patches.suse/powerpc-xmon-Reset-RCU-and-soft-lockup-watchdogs.patch b/patches.suse/powerpc-xmon-Reset-RCU-and-soft-lockup-watchdogs.patch new file mode 100644 index 0000000..deefcab --- /dev/null +++ b/patches.suse/powerpc-xmon-Reset-RCU-and-soft-lockup-watchdogs.patch @@ -0,0 +1,52 @@ +From 5c699396f5f6cf6d67055af7b82c270d31fd831a Mon Sep 17 00:00:00 2001 +From: Anton Blanchard +Date: Tue, 30 Jun 2020 10:02:18 +1000 +Subject: [PATCH] powerpc/xmon: Reset RCU and soft lockup watchdogs + +References: bsc#1065729 +Patch-mainline: queued +Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux +Git-commit: 5c699396f5f6cf6d67055af7b82c270d31fd831a + +I'm seeing RCU warnings when exiting xmon. xmon resets the NMI +watchdog, but does nothing with the RCU stall or soft lockup +watchdogs. Add a helper function that handles all three. + +Signed-off-by: Anton Blanchard +Acked-by: Nicholas Piggin +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200630100218.62a3c3fb@kryten.localdomain +Acked-by: Michal Suchanek +--- + arch/powerpc/xmon/xmon.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c +--- a/arch/powerpc/xmon/xmon.c ++++ b/arch/powerpc/xmon/xmon.c +@@ -447,6 +447,13 @@ static inline int unrecoverable_excp(str + #endif + } + ++static void xmon_touch_watchdogs(void) ++{ ++ touch_softlockup_watchdog_sync(); ++ rcu_cpu_stall_reset(); ++ touch_nmi_watchdog(); ++} ++ + static int xmon_core(struct pt_regs *regs, int fromipi) + { + int cmd = 0; +@@ -664,7 +671,7 @@ static int xmon_core(struct pt_regs *reg + #endif + insert_cpu_bpts(); + +- touch_nmi_watchdog(); ++ xmon_touch_watchdogs(); + local_irq_restore(flags); + + return cmd != 'X' && cmd != EOF; +-- +2.26.2 + diff --git a/patches.suse/pppoe-only-process-PADT-targeted-at-local-interfaces.patch b/patches.suse/pppoe-only-process-PADT-targeted-at-local-interfaces.patch new file mode 100644 index 0000000..11ccea7 --- /dev/null +++ b/patches.suse/pppoe-only-process-PADT-targeted-at-local-interfaces.patch @@ -0,0 +1,36 @@ +From: Guillaume Nault +Date: Thu, 14 May 2020 12:15:39 +0200 +Subject: pppoe: only process PADT targeted at local interfaces +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: b8c158395119be62294da73646a3953c29ac974b +Patch-mainline: 5.7-rc6 +References: networking-stable-20_05_16 + +We don't want to disconnect a session because of a stray PADT arriving +while the interface is in promiscuous mode. +Furthermore, multicast and broadcast packets make no sense here, so +only PACKET_HOST is accepted. + +Reported-by: David Balažic +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Guillaume Nault +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/ppp/pppoe.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/ppp/pppoe.c ++++ b/drivers/net/ppp/pppoe.c +@@ -497,6 +497,9 @@ static int pppoe_disc_rcv(struct sk_buff + if (!skb) + goto out; + ++ if (skb->pkt_type != PACKET_HOST) ++ goto abort; ++ + if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) + goto abort; + diff --git a/patches.suse/qed-reduce-maximum-stack-frame-size.patch b/patches.suse/qed-reduce-maximum-stack-frame-size.patch new file mode 100644 index 0000000..393caaa --- /dev/null +++ b/patches.suse/qed-reduce-maximum-stack-frame-size.patch @@ -0,0 +1,96 @@ +From: Arnd Bergmann +Date: Mon, 22 Jul 2019 17:01:23 +0200 +Subject: qed: reduce maximum stack frame size +Patch-mainline: v5.4-rc1 +Git-commit: 7c116e02a4a7575c8c62bfd2106e3e3ec8fb99dc +References: git-fixes + +clang warns about an overly large stack frame in one function +when it decides to inline all __qed_get_vport_*() functions into +__qed_get_vport_stats(): + +drivers/net/ethernet/qlogic/qed/qed_l2.c:1889:13: error: stack frame size of 1128 bytes in function '_qed_get_vport_stats' [-Werror,-Wframe-larger-than=] + +Use a noinline_for_stack annotation to prevent clang from inlining +these, which keeps the maximum stack usage at around half of that +in the worst case, similar to what we get with gcc. + +Fixes: 86622ee75312 ("qed: Move statistics to L2 code") +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/qlogic/qed/qed_l2.c | 34 +++++++++++++------------------ + 1 file changed, 15 insertions(+), 19 deletions(-) + +--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c +@@ -1631,10 +1631,9 @@ static void __qed_get_vport_pstats_addrl + } + } + +-static void __qed_get_vport_pstats(struct qed_hwfn *p_hwfn, +- struct qed_ptt *p_ptt, +- struct qed_eth_stats *p_stats, +- u16 statistics_bin) ++static noinline_for_stack void ++__qed_get_vport_pstats(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ++ struct qed_eth_stats *p_stats, u16 statistics_bin) + { + struct eth_pstorm_per_queue_stat pstats; + u32 pstats_addr = 0, pstats_len = 0; +@@ -1661,10 +1660,9 @@ static void __qed_get_vport_pstats(struc + HILO_64_REGPAIR(pstats.error_drop_pkts); + } + +-static void __qed_get_vport_tstats(struct qed_hwfn *p_hwfn, +- struct qed_ptt *p_ptt, +- struct qed_eth_stats *p_stats, +- u16 statistics_bin) ++static noinline_for_stack void ++__qed_get_vport_tstats(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ++ struct qed_eth_stats *p_stats, u16 statistics_bin) + { + struct tstorm_per_port_stat tstats; + u32 tstats_addr, tstats_len; +@@ -1709,10 +1707,9 @@ static void __qed_get_vport_ustats_addrl + } + } + +-static void __qed_get_vport_ustats(struct qed_hwfn *p_hwfn, +- struct qed_ptt *p_ptt, +- struct qed_eth_stats *p_stats, +- u16 statistics_bin) ++static noinline_for_stack ++void __qed_get_vport_ustats(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ++ struct qed_eth_stats *p_stats, u16 statistics_bin) + { + struct eth_ustorm_per_queue_stat ustats; + u32 ustats_addr = 0, ustats_len = 0; +@@ -1751,10 +1748,9 @@ static void __qed_get_vport_mstats_addrl + } + } + +-static void __qed_get_vport_mstats(struct qed_hwfn *p_hwfn, +- struct qed_ptt *p_ptt, +- struct qed_eth_stats *p_stats, +- u16 statistics_bin) ++static noinline_for_stack void ++__qed_get_vport_mstats(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ++ struct qed_eth_stats *p_stats, u16 statistics_bin) + { + struct eth_mstorm_per_queue_stat mstats; + u32 mstats_addr = 0, mstats_len = 0; +@@ -1780,9 +1776,9 @@ static void __qed_get_vport_mstats(struc + HILO_64_REGPAIR(mstats.tpa_coalesced_bytes); + } + +-static void __qed_get_vport_port_stats(struct qed_hwfn *p_hwfn, +- struct qed_ptt *p_ptt, +- struct qed_eth_stats *p_stats) ++static noinline_for_stack void ++__qed_get_vport_port_stats(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ++ struct qed_eth_stats *p_stats) + { + struct qed_eth_stats_common *p_common = &p_stats->common; + struct port_stats port_stats; diff --git a/patches.suse/qlcnic-fix-missing-release-in-qlcnic_83xx_interrupt_.patch b/patches.suse/qlcnic-fix-missing-release-in-qlcnic_83xx_interrupt_.patch new file mode 100644 index 0000000..46647fd --- /dev/null +++ b/patches.suse/qlcnic-fix-missing-release-in-qlcnic_83xx_interrupt_.patch @@ -0,0 +1,42 @@ +From: Qiushi Wu +Date: Mon, 25 May 2020 03:24:39 -0500 +Subject: qlcnic: fix missing release in qlcnic_83xx_interrupt_test. +Patch-mainline: v5.7 +Git-commit: 15c973858903009e995b2037683de29dfe968621 +References: git-fixes + +In function qlcnic_83xx_interrupt_test(), function +qlcnic_83xx_diag_alloc_res() is not handled by function +qlcnic_83xx_diag_free_res() after a call of the function +qlcnic_alloc_mbx_args() failed. Fix this issue by adding +a jump target "fail_mbx_args", and jump to this new target +when qlcnic_alloc_mbx_args() failed. + +Fixes: b6b4316c8b2f ("qlcnic: Handle qlcnic_alloc_mbx_args() failure") +Signed-off-by: Qiushi Wu +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +@@ -3650,7 +3650,7 @@ int qlcnic_83xx_interrupt_test(struct ne + ahw->diag_cnt = 0; + ret = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST); + if (ret) +- goto fail_diag_irq; ++ goto fail_mbx_args; + + if (adapter->flags & QLCNIC_MSIX_ENABLED) + intrpt_id = ahw->intr_tbl[0].id; +@@ -3680,6 +3680,8 @@ int qlcnic_83xx_interrupt_test(struct ne + + done: + qlcnic_free_mbx_args(&cmd); ++ ++fail_mbx_args: + qlcnic_83xx_diag_free_res(netdev, drv_sds_rings); + + fail_diag_irq: diff --git a/patches.suse/r8152-support-additional-Microsoft-Surface-Ethernet-.patch b/patches.suse/r8152-support-additional-Microsoft-Surface-Ethernet-.patch new file mode 100644 index 0000000..cd62446 --- /dev/null +++ b/patches.suse/r8152-support-additional-Microsoft-Surface-Ethernet-.patch @@ -0,0 +1,58 @@ +From: Marc Payne +Date: Tue, 19 May 2020 19:01:46 +0100 +Subject: r8152: support additional Microsoft Surface Ethernet Adapter variant +Git-commit: c27a204383616efba5a4194075e90819961ff66a +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +Device id 0927 is the RTL8153B-based component of the 'Surface USB-C to +Ethernet and USB Adapter' and may be used as a component of other devices +in future. Tested and working with the r8152 driver. + +Update the cdc_ether blacklist due to the RTL8153 'network jam on suspend' +issue which this device will cause (personally confirmed). + +Signed-off-by: Marc Payne +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + drivers/net/usb/cdc_ether.c | 11 +++++++++-- + drivers/net/usb/r8152.c | 1 + + 2 files changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -811,14 +811,21 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Microsoft Surface 3 dock (based on Realtek RTL8153) */ ++/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */ + { + USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), + .driver_info = 0, + }, + +- /* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ ++/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */ ++{ ++ USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), ++ .driver_info = 0, ++}, ++ ++/* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ + { + USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -5348,6 +5348,7 @@ static const struct usb_device_id rtl815 + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)}, + {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)}, + {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)}, ++ {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)}, + {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)}, diff --git a/patches.suse/regmap-debugfs-Don-t-sleep-while-atomic-for-fast_io-.patch b/patches.suse/regmap-debugfs-Don-t-sleep-while-atomic-for-fast_io-.patch new file mode 100644 index 0000000..9e74cd6 --- /dev/null +++ b/patches.suse/regmap-debugfs-Don-t-sleep-while-atomic-for-fast_io-.patch @@ -0,0 +1,137 @@ +From 299632e54b2e692d2830af84be51172480dc1e26 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Wed, 15 Jul 2020 16:46:15 -0700 +Subject: [PATCH] regmap: debugfs: Don't sleep while atomic for fast_io regmaps +Git-commit: 299632e54b2e692d2830af84be51172480dc1e26 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +If a regmap has "fast_io" set then its lock function uses a spinlock. +That doesn't work so well with the functions: +* regmap_cache_only_write_file() +* regmap_cache_bypass_write_file() + +Both of the above functions have the pattern: +1. Lock the regmap. +2. Call: + debugfs_write_file_bool() + copy_from_user() + __might_fault() + __might_sleep() + +Let's reorder things a bit so that we do all of our sleepable +functions before we grab the lock. + +Fixes: d3dc5430d68f ("regmap: debugfs: Allow writes to cache state settings") +Signed-off-by: Douglas Anderson +Link: https://lore.kernel.org/r/20200715164611.1.I35b3533e8a80efde0cec1cc70f71e1e74b2fa0da@changeid +Signed-off-by: Mark Brown +Acked-by: Takashi Iwai + +--- + drivers/base/regmap/regmap-debugfs.c | 52 ++++++++++++++++++++---------------- + 1 file changed, 29 insertions(+), 23 deletions(-) + +diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c +index e72843fe41df..e16afa27700d 100644 +--- a/drivers/base/regmap/regmap-debugfs.c ++++ b/drivers/base/regmap/regmap-debugfs.c +@@ -457,29 +457,31 @@ static ssize_t regmap_cache_only_write_file(struct file *file, + { + struct regmap *map = container_of(file->private_data, + struct regmap, cache_only); +- ssize_t result; +- bool was_enabled, require_sync = false; ++ bool new_val, require_sync = false; + int err; + +- map->lock(map->lock_arg); ++ err = kstrtobool_from_user(user_buf, count, &new_val); ++ /* Ignore malforned data like debugfs_write_file_bool() */ ++ if (err) ++ return count; + +- was_enabled = map->cache_only; ++ err = debugfs_file_get(file->f_path.dentry); ++ if (err) ++ return err; + +- result = debugfs_write_file_bool(file, user_buf, count, ppos); +- if (result < 0) { +- map->unlock(map->lock_arg); +- return result; +- } ++ map->lock(map->lock_arg); + +- if (map->cache_only && !was_enabled) { ++ if (new_val && !map->cache_only) { + dev_warn(map->dev, "debugfs cache_only=Y forced\n"); + add_taint(TAINT_USER, LOCKDEP_STILL_OK); +- } else if (!map->cache_only && was_enabled) { ++ } else if (!new_val && map->cache_only) { + dev_warn(map->dev, "debugfs cache_only=N forced: syncing cache\n"); + require_sync = true; + } ++ map->cache_only = new_val; + + map->unlock(map->lock_arg); ++ debugfs_file_put(file->f_path.dentry); + + if (require_sync) { + err = regcache_sync(map); +@@ -487,7 +489,7 @@ static ssize_t regmap_cache_only_write_file(struct file *file, + dev_err(map->dev, "Failed to sync cache %d\n", err); + } + +- return result; ++ return count; + } + + static const struct file_operations regmap_cache_only_fops = { +@@ -502,28 +504,32 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file, + { + struct regmap *map = container_of(file->private_data, + struct regmap, cache_bypass); +- ssize_t result; +- bool was_enabled; ++ bool new_val; ++ int err; + +- map->lock(map->lock_arg); ++ err = kstrtobool_from_user(user_buf, count, &new_val); ++ /* Ignore malforned data like debugfs_write_file_bool() */ ++ if (err) ++ return count; + +- was_enabled = map->cache_bypass; ++ err = debugfs_file_get(file->f_path.dentry); ++ if (err) ++ return err; + +- result = debugfs_write_file_bool(file, user_buf, count, ppos); +- if (result < 0) +- goto out; ++ map->lock(map->lock_arg); + +- if (map->cache_bypass && !was_enabled) { ++ if (new_val && !map->cache_bypass) { + dev_warn(map->dev, "debugfs cache_bypass=Y forced\n"); + add_taint(TAINT_USER, LOCKDEP_STILL_OK); +- } else if (!map->cache_bypass && was_enabled) { ++ } else if (!new_val && map->cache_bypass) { + dev_warn(map->dev, "debugfs cache_bypass=N forced\n"); + } ++ map->cache_bypass = new_val; + +-out: + map->unlock(map->lock_arg); ++ debugfs_file_put(file->f_path.dentry); + +- return result; ++ return count; + } + + static const struct file_operations regmap_cache_bypass_fops = { +-- +2.16.4 + diff --git a/patches.suse/revert-zram-convert-remaining-class_attr-to-class_attr_ro b/patches.suse/revert-zram-convert-remaining-class_attr-to-class_attr_ro new file mode 100644 index 0000000..2158c3d --- /dev/null +++ b/patches.suse/revert-zram-convert-remaining-class_attr-to-class_attr_ro @@ -0,0 +1,40 @@ +From: Wade Mealing +Date: Wed, 17 Jun 2020 13:49:47 +0200 +Subject: Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()" +Patch-mainline: v5.8-rc6 +Git-commit: 853eab68afc80f59f36bbdeb715e5c88c501e680 +References: bsc#1173074 CVE-2020-10781 + +Turns out that the permissions for 0400 really are what we want here, +otherwise any user can read from this file. + +[fixed formatting, added changelog, and made attribute static - gregkh] + +Reported-by: Wade Mealing +Cc: stable +Fixes: f40609d1591f ("zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()") +Link: https://bugzilla.redhat.com/show_bug.cgi?id=1847832 +Reviewed-by: Steffen Maier +Acked-by: Minchan Kim +Link: https://lore.kernel.org/r/20200617114946.GA2131650@kroah.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Lee Duncan +--- + drivers/block/zram/zram_drv.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index 6e2ad90b17a3..270dd810be54 100644 +--- a/drivers/block/zram/zram_drv.c ++++ b/drivers/block/zram/zram_drv.c +@@ -2021,7 +2021,8 @@ static ssize_t hot_add_show(struct class *class, + return ret; + return scnprintf(buf, PAGE_SIZE, "%d\n", ret); + } +-static CLASS_ATTR_RO(hot_add); ++static struct class_attribute class_attr_hot_add = ++ __ATTR(hot_add, 0400, hot_add_show, NULL); + + static ssize_t hot_remove_store(struct class *class, + struct class_attribute *attr, + diff --git a/patches.suse/sch_choke-avoid-potential-panic-in-choke_reset.patch b/patches.suse/sch_choke-avoid-potential-panic-in-choke_reset.patch new file mode 100644 index 0000000..0dfba66 --- /dev/null +++ b/patches.suse/sch_choke-avoid-potential-panic-in-choke_reset.patch @@ -0,0 +1,67 @@ +From: Eric Dumazet +Date: Sat, 25 Apr 2020 15:19:51 -0700 +Subject: sch_choke: avoid potential panic in choke_reset() +Git-commit: 8738c85c72b3108c9b9a369a39868ba5f8e10ae0 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +If choke_init() could not allocate q->tab, we would crash later +in choke_reset(). + +BUG: KASAN: null-ptr-deref in memset include/linux/string.h:366 [inline] +BUG: KASAN: null-ptr-deref in choke_reset+0x208/0x340 net/sched/sch_choke.c:326 +Write of size 8 at addr 0000000000000000 by task syz-executor822/7022 + +CPU: 1 PID: 7022 Comm: syz-executor822 Not tainted 5.7.0-rc1-syzkaller #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + __dump_stack lib/dump_stack.c:77 [inline] + dump_stack+0x188/0x20d lib/dump_stack.c:118 + __kasan_report.cold+0x5/0x4d mm/kasan/report.c:515 + kasan_report+0x33/0x50 mm/kasan/common.c:625 + check_memory_region_inline mm/kasan/generic.c:187 [inline] + check_memory_region+0x141/0x190 mm/kasan/generic.c:193 + memset+0x20/0x40 mm/kasan/common.c:85 + memset include/linux/string.h:366 [inline] + choke_reset+0x208/0x340 net/sched/sch_choke.c:326 + qdisc_reset+0x6b/0x520 net/sched/sch_generic.c:910 + dev_deactivate_queue.constprop.0+0x13c/0x240 net/sched/sch_generic.c:1138 + netdev_for_each_tx_queue include/linux/netdevice.h:2197 [inline] + dev_deactivate_many+0xe2/0xba0 net/sched/sch_generic.c:1195 + dev_deactivate+0xf8/0x1c0 net/sched/sch_generic.c:1233 + qdisc_graft+0xd25/0x1120 net/sched/sch_api.c:1051 + tc_modify_qdisc+0xbab/0x1a00 net/sched/sch_api.c:1670 + rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5454 + netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2469 + netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] + netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329 + netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918 + sock_sendmsg_nosec net/socket.c:652 [inline] + sock_sendmsg+0xcf/0x120 net/socket.c:672 + ____sys_sendmsg+0x6bf/0x7e0 net/socket.c:2362 + ___sys_sendmsg+0x100/0x170 net/socket.c:2416 + __sys_sendmsg+0xec/0x1b0 net/socket.c:2449 + do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 + +Fixes: 77e62da6e60c ("sch_choke: drop all packets in queue during reset") +Signed-off-by: Eric Dumazet +Reported-by: syzbot +Cc: Cong Wang +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/sched/sch_choke.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/sched/sch_choke.c ++++ b/net/sched/sch_choke.c +@@ -327,7 +327,8 @@ static void choke_reset(struct Qdisc *sc + + sch->q.qlen = 0; + sch->qstats.backlog = 0; +- memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *)); ++ if (q->tab) ++ memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *)); + q->head = q->tail = 0; + red_restart(&q->vars); + } diff --git a/patches.suse/sch_sfq-validate-silly-quantum-values.patch b/patches.suse/sch_sfq-validate-silly-quantum-values.patch new file mode 100644 index 0000000..53c1fb0 --- /dev/null +++ b/patches.suse/sch_sfq-validate-silly-quantum-values.patch @@ -0,0 +1,45 @@ +From: Eric Dumazet +Date: Sun, 26 Apr 2020 18:19:07 -0700 +Subject: sch_sfq: validate silly quantum values +Git-commit: df4953e4e997e273501339f607b77953772e3559 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +syzbot managed to set up sfq so that q->scaled_quantum was zero, +triggering an infinite loop in sfq_dequeue() + +More generally, we must only accept quantum between 1 and 2^18 - 7, +meaning scaled_quantum must be in [1, 0x7FFF] range. + +Otherwise, we also could have a loop in sfq_dequeue() +if scaled_quantum happens to be 0x8000, since slot->allot +could indefinitely switch between 0 and 0x8000. + +Fixes: eeaeb068f139 ("sch_sfq: allow big packets and be fair") +Signed-off-by: Eric Dumazet +Reported-by: syzbot+0251e883fe39e7a0cb0a@syzkaller.appspotmail.com +Cc: Jason A. Donenfeld +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/sched/sch_sfq.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/sched/sch_sfq.c ++++ b/net/sched/sch_sfq.c +@@ -638,6 +638,15 @@ static int sfq_change(struct Qdisc *sch, + if (ctl->divisor && + (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536)) + return -EINVAL; ++ ++ /* slot->allot is a short, make sure quantum is not too big. */ ++ if (ctl->quantum) { ++ unsigned int scaled = SFQ_ALLOT_SIZE(ctl->quantum); ++ ++ if (scaled <= 0 || scaled > SHRT_MAX) ++ return -EINVAL; ++ } ++ + if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max, + ctl_v1->Wlog)) + return -EINVAL; diff --git a/patches.suse/scsi-aacraid-fix-a-signedness-bug.patch b/patches.suse/scsi-aacraid-fix-a-signedness-bug.patch new file mode 100644 index 0000000..20d125f --- /dev/null +++ b/patches.suse/scsi-aacraid-fix-a-signedness-bug.patch @@ -0,0 +1,37 @@ +From: Dan Carpenter +Date: Mon, 27 Aug 2018 12:23:01 +0300 +Subject: [PATCH] scsi: aacraid: fix a signedness bug +Git-commit: b9eb3b14f1dbf16bf27b6c1ffe6b8c00ec945c9b +Patch-Mainline: v4.19-rc3 +References: bsc#1174296 + +The problem is that ->reset_state is a u8 but it can be set to -1 or -2 in +aac_tmf_callback() and the error handling in aac_eh_target_reset() relies +on it to be signed. + +[mkp: fixed typo] + +Fixes: 0d643ff3c353 ("scsi: aacraid: use aac_tmf_callback for reset fib") +Signed-off-by: Dan Carpenter +Signed-off-by: Martin K. Petersen +Acked-by: Hannes Reinecke +--- + drivers/scsi/aacraid/aacraid.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h +index 29bf1e60f542..39eb415987fc 100644 +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -1346,7 +1346,7 @@ struct fib { + struct aac_hba_map_info { + __le32 rmw_nexus; /* nexus for native HBA devices */ + u8 devtype; /* device type */ +- u8 reset_state; /* 0 - no reset, 1..x - */ ++ s8 reset_state; /* 0 - no reset, 1..x - */ + /* after xth TM LUN reset */ + u16 qd_limit; + u32 scan_counter; +-- +2.16.4 + diff --git a/patches.suse/scsi-lpfc-Add-an-internal-trace-log-buffer.patch b/patches.suse/scsi-lpfc-Add-an-internal-trace-log-buffer.patch new file mode 100644 index 0000000..3a7a7e3 --- /dev/null +++ b/patches.suse/scsi-lpfc-Add-an-internal-trace-log-buffer.patch @@ -0,0 +1,5978 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:50:00 -0700 +Subject: scsi: lpfc: Add an internal trace log buffer +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 372c187b8a705c0b52c230653ac7bc38ef62182f +References: bsc#1172687 bsc#1171530 + +The current logging methods typically end up requesting a reproduction with +a different logging level set to figure out what happened. This was mainly +by design to not clutter the kernel log messages with things that were +typically not interesting and the messages themselves could cause other +issues. + +When looking to make a better system, it was seen that in many cases when +more data was wanted was when another message, usually at KERN_ERR level, +was logged. And in most cases, what the additional logging that was then +enabled was typically. Most of these areas fell into the discovery machine. + +Based on this summary, the following design has been put in place: The +driver will maintain an internal log (256 elements of 256 bytes). The +"additional logging" messages that are usually enabled in a reproduction +will be changed to now log all the time to the internal log. A new logging +level is defined - LOG_TRACE_EVENT. When this level is set (it is not by +default) and a message marked as KERN_ERR is logged, all the messages in +the internal log will be dumped to the kernel log before the KERN_ERR +message is logged. + +There is a timestamp on each message added to the internal log. However, +this timestamp is not converted to wall time when logged. The value of the +timestamp is solely to give a crude time reference for the messages. + +Link: https://lore.kernel.org/r/20200630215001.70793-14-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +[dwagner: updated context] +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc.h | 12 + drivers/scsi/lpfc/lpfc_crtn.h | 2 + drivers/scsi/lpfc/lpfc_ct.c | 16 - + drivers/scsi/lpfc/lpfc_els.c | 131 ++++---- + drivers/scsi/lpfc/lpfc_hbadisc.c | 216 +++++++------- + drivers/scsi/lpfc/lpfc_init.c | 561 +++++++++++++++++++++---------------- + drivers/scsi/lpfc/lpfc_logmsg.h | 24 + + drivers/scsi/lpfc/lpfc_nportdisc.c | 51 +-- + drivers/scsi/lpfc/lpfc_nvme.c | 43 +- + drivers/scsi/lpfc/lpfc_nvmet.c | 54 +-- + drivers/scsi/lpfc/lpfc_scsi.c | 125 ++++---- + drivers/scsi/lpfc/lpfc_sli.c | 351 +++++++++++------------ + drivers/scsi/lpfc/lpfc_vport.c | 60 ++- + 13 files changed, 896 insertions(+), 750 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc.h ++++ b/drivers/scsi/lpfc/lpfc.h +@@ -627,6 +627,14 @@ struct lpfc_ras_fwlog { + enum ras_state state; /* RAS logging running state */ + }; + ++#define DBG_LOG_STR_SZ 256 ++#define DBG_LOG_SZ 256 ++ ++struct dbg_log_ent { ++ char log[DBG_LOG_STR_SZ]; ++ u64 t_ns; ++}; ++ + enum lpfc_irq_chann_mode { + /* Assign IRQs to all possible cpus that have hardware queues */ + NORMAL_MODE, +@@ -1239,6 +1247,10 @@ struct lpfc_hba { + struct scsi_host_template port_template; + /* SCSI host template information - for all vports */ + struct scsi_host_template vport_template; ++ atomic_t dbg_log_idx; ++ atomic_t dbg_log_cnt; ++ atomic_t dbg_log_dmping; ++ struct dbg_log_ent dbg_log[DBG_LOG_SZ]; + }; + + static inline struct Scsi_Host * +--- a/drivers/scsi/lpfc/lpfc_crtn.h ++++ b/drivers/scsi/lpfc/lpfc_crtn.h +@@ -387,7 +387,7 @@ void lpfc_rq_buf_free(struct lpfc_hba *p + int lpfc_link_reset(struct lpfc_vport *vport); + + /* Function prototypes. */ +-int lpfc_check_pci_resettable(const struct lpfc_hba *phba); ++int lpfc_check_pci_resettable(struct lpfc_hba *phba); + const char* lpfc_info(struct Scsi_Host *); + int lpfc_scan_finished(struct Scsi_Host *, unsigned long); + +--- a/drivers/scsi/lpfc/lpfc_ct.c ++++ b/drivers/scsi/lpfc/lpfc_ct.c +@@ -751,7 +751,7 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba + if (vport->fc_flag & FC_RSCN_MODE) + lpfc_els_flush_rscn(vport); + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0257 GID_FT Query error: 0x%x 0x%x\n", + irsp->ulpStatus, vport->fc_ns_retry); + } else { +@@ -812,7 +812,7 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba + + } else { + /* NameServer Rsp Error */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0241 NameServer Rsp Error " + "Data: x%x x%x x%x x%x\n", + CTrsp->CommandResponse.bits.CmdRsp, +@@ -952,7 +952,7 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba + if (vport->fc_flag & FC_RSCN_MODE) + lpfc_els_flush_rscn(vport); + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "4103 GID_FT Query error: 0x%x 0x%x\n", + irsp->ulpStatus, vport->fc_ns_retry); + } else { +@@ -1013,7 +1013,7 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba + } + } else { + /* NameServer Rsp Error */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "4109 NameServer Rsp Error " + "Data: x%x x%x x%x x%x\n", + CTrsp->CommandResponse.bits.CmdRsp, +@@ -1144,7 +1144,7 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba + } + } + } +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0267 NameServer GFF Rsp " + "x%x Error (%d %d) Data: x%x x%x\n", + did, irsp->ulpStatus, irsp->un.ulpWord[4], +@@ -1272,7 +1272,7 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba + } + } + } else +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "3065 GFT_ID failed x%08x\n", irsp->ulpStatus); + + lpfc_ct_free_iocb(phba, cmdiocb); +@@ -1321,7 +1321,7 @@ lpfc_cmpl_ct(struct lpfc_hba *phba, stru + irsp->ulpStatus, irsp->un.ulpWord[4], cmdcode); + + if (irsp->ulpStatus) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0268 NS cmd x%x Error (x%x x%x)\n", + cmdcode, irsp->ulpStatus, irsp->un.ulpWord[4]); + +@@ -1844,7 +1844,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, in + ns_cmd_free_mp: + kfree(mp); + ns_cmd_exit: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0266 Issue NameServer Req x%x err %d Data: x%x x%x\n", + cmdcode, rc, vport->fc_flag, vport->fc_rscn_id_cnt); + return 1; +--- a/drivers/scsi/lpfc/lpfc_els.c ++++ b/drivers/scsi/lpfc/lpfc_els.c +@@ -100,7 +100,7 @@ lpfc_els_chk_latt(struct lpfc_vport *vpo + return 0; + + /* Pending Link Event during Discovery */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0237 Pending Link Event during " + "Discovery: State x%x\n", + phba->pport->port_state); +@@ -440,8 +440,9 @@ lpfc_issue_fabric_reglogin(struct lpfc_v + + fail: + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, +- "0249 Cannot issue Register Fabric login: Err %d\n", err); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "0249 Cannot issue Register Fabric login: Err %d\n", ++ err); + return -ENXIO; + } + +@@ -524,8 +525,8 @@ lpfc_issue_reg_vfi(struct lpfc_vport *vp + } + + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, +- "0289 Issue Register VFI failed: Err %d\n", rc); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "0289 Issue Register VFI failed: Err %d\n", rc); + return rc; + } + +@@ -550,7 +551,7 @@ lpfc_issue_unreg_vfi(struct lpfc_vport * + + mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2556 UNREG_VFI mbox allocation failed" + "HBA state x%x\n", phba->pport->port_state); + return -ENOMEM; +@@ -562,7 +563,7 @@ lpfc_issue_unreg_vfi(struct lpfc_vport * + + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2557 UNREG_VFI issue mbox failed rc x%x " + "HBA state x%x\n", + rc, phba->pport->port_state); +@@ -1041,18 +1042,18 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phb + if (!(irsp->ulpStatus == IOSTAT_LOCAL_REJECT && + ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) == + IOERR_LOOP_OPEN_FAILURE))) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, +- "2858 FLOGI failure Status:x%x/x%x " +- "TMO:x%x Data x%x x%x\n", +- irsp->ulpStatus, irsp->un.ulpWord[4], +- irsp->ulpTimeout, phba->hba_flag, +- phba->fcf.fcf_flag); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2858 FLOGI failure Status:x%x/x%x TMO" ++ ":x%x Data x%x x%x\n", ++ irsp->ulpStatus, irsp->un.ulpWord[4], ++ irsp->ulpTimeout, phba->hba_flag, ++ phba->fcf.fcf_flag); + + /* Check for retry */ + if (lpfc_els_retry(phba, cmdiocb, rspiocb)) + goto out; + +- lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_WARNING, LOG_TRACE_EVENT, + "0150 FLOGI failure Status:x%x/x%x " + "xri x%x TMO:x%x\n", + irsp->ulpStatus, irsp->un.ulpWord[4], +@@ -1132,8 +1133,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phb + else if (!(phba->hba_flag & HBA_FCOE_MODE)) + rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp); + else { +- lpfc_printf_vlog(vport, KERN_ERR, +- LOG_FIP | LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2831 FLOGI response with cleared Fabric " + "bit fcf_index 0x%x " + "Switch Name %02x%02x%02x%02x%02x%02x%02x%02x " +@@ -1934,7 +1934,7 @@ lpfc_cmpl_els_rrq(struct lpfc_hba *phba, + + ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID); + if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) || ndlp != rrq->ndlp) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2882 RRQ completes to NPort x%x " + "with no ndlp. Data: x%x x%x x%x\n", + irsp->un.elsreq64.remoteID, +@@ -1957,10 +1957,11 @@ lpfc_cmpl_els_rrq(struct lpfc_hba *phba, + (((irsp->un.ulpWord[4]) >> 16 != LSRJT_INVALID_CMD) && + ((irsp->un.ulpWord[4]) >> 16 != LSRJT_UNABLE_TPC)) || + (phba)->pport->cfg_log_verbose & LOG_ELS) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, +- "2881 RRQ failure DID:%06X Status:x%x/x%x\n", +- ndlp->nlp_DID, irsp->ulpStatus, +- irsp->un.ulpWord[4]); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2881 RRQ failure DID:%06X Status:" ++ "x%x/x%x\n", ++ ndlp->nlp_DID, irsp->ulpStatus, ++ irsp->un.ulpWord[4]); + } + out: + if (rrq) +@@ -2010,7 +2011,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phb + + ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID); + if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0136 PLOGI completes to NPort x%x " + "with no ndlp. Data: x%x x%x x%x\n", + irsp->un.elsreq64.remoteID, +@@ -2059,7 +2060,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phb + (((irsp->un.ulpWord[4]) >> 16 != LSRJT_INVALID_CMD) && + ((irsp->un.ulpWord[4]) >> 16 != LSRJT_UNABLE_TPC)) || + (phba)->pport->cfg_log_verbose & LOG_ELS) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2753 PLOGI failure DID:%06X Status:x%x/x%x\n", + ndlp->nlp_DID, irsp->ulpStatus, + irsp->un.ulpWord[4]); +@@ -2237,6 +2238,7 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba + IOCB_t *irsp; + struct lpfc_nodelist *ndlp; + char *mode; ++ u32 loglevel; + + /* we pass cmdiocb to state machine which needs rspiocb as well */ + cmdiocb->context_un.rsp_iocb = rspiocb; +@@ -2278,13 +2280,16 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba + * could be expected. + */ + if ((vport->fc_flag & FC_FABRIC) || +- (vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH)) ++ (vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH)) { + mode = KERN_ERR; +- else ++ loglevel = LOG_TRACE_EVENT; ++ } else { + mode = KERN_INFO; ++ loglevel = LOG_ELS; ++ } + + /* PRLI failed */ +- lpfc_printf_vlog(vport, mode, LOG_ELS, ++ lpfc_printf_vlog(vport, mode, loglevel, + "2754 PRLI failure DID:%06X Status:x%x/x%x, " + "data: x%x\n", + ndlp->nlp_DID, irsp->ulpStatus, +@@ -2695,7 +2700,7 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phb + goto out; + } + /* ADISC failed */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2755 ADISC failure DID:%06X Status:x%x/x%x\n", + ndlp->nlp_DID, irsp->ulpStatus, + irsp->un.ulpWord[4]); +@@ -2853,7 +2858,7 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba + */ + if (irsp->ulpStatus) { + /* LOGO failed */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2756 LOGO failure, No Retry DID:%06X Status:x%x/x%x\n", + ndlp->nlp_DID, irsp->ulpStatus, + irsp->un.ulpWord[4]); +@@ -3734,7 +3739,7 @@ lpfc_link_reset(struct lpfc_vport *vport + "2851 Attempt link reset\n"); + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2852 Failed to allocate mbox memory"); + return 1; + } +@@ -3756,7 +3761,7 @@ lpfc_link_reset(struct lpfc_vport *vport + mbox->vport = vport; + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2853 Failed to issue INIT_LINK " + "mbox command, rc:x%x\n", rc); + mempool_free(mbox, phba->mbox_mem_pool); +@@ -3860,7 +3865,7 @@ lpfc_els_retry(struct lpfc_hba *phba, st + break; + + case IOERR_ILLEGAL_COMMAND: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0124 Retry illegal cmd x%x " + "retry:x%x delay:x%x\n", + cmd, cmdiocb->retry, delay); +@@ -3970,7 +3975,8 @@ lpfc_els_retry(struct lpfc_hba *phba, st + if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) && + (cmd == ELS_CMD_FDISC) && + (stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0125 FDISC Failed (x%x). " + "Fabric out of resources\n", + stat.un.lsRjtError); +@@ -4009,7 +4015,8 @@ lpfc_els_retry(struct lpfc_hba *phba, st + LSEXP_NOTHING_MORE) { + vport->fc_sparam.cmn.bbRcvSizeMsb &= 0xf; + retry = 1; +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0820 FLOGI Failed (x%x). " + "BBCredit Not Supported\n", + stat.un.lsRjtError); +@@ -4022,7 +4029,8 @@ lpfc_els_retry(struct lpfc_hba *phba, st + ((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) || + (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID)) + ) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0122 FDISC Failed (x%x). " + "Fabric Detected Bad WWN\n", + stat.un.lsRjtError); +@@ -4200,7 +4208,7 @@ lpfc_els_retry(struct lpfc_hba *phba, st + } + /* No retry ELS command to remote NPORT */ + if (logerr) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0137 No retry ELS command x%x to remote " + "NPORT x%x: Out of Resources: Error:x%x/%x\n", + cmd, did, irsp->ulpStatus, +@@ -4499,7 +4507,7 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, + irsp = &rspiocb->iocb; + + if (!vport) { +- lpfc_printf_log(phba, KERN_ERR, LOG_ELS, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3177 ELS response failed\n"); + goto out; + } +@@ -4605,7 +4613,7 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, + ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; + + /* ELS rsp: Cannot issue reg_login for */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0138 ELS rsp: Cannot issue reg_login for x%x " + "Data: x%x x%x x%x\n", + ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, +@@ -6411,8 +6419,8 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vpor + lcb_context->rx_id = cmdiocb->iocb.ulpContext; + lcb_context->ndlp = lpfc_nlp_get(ndlp); + if (lpfc_sli4_set_beacon(vport, lcb_context, state)) { +- lpfc_printf_vlog(ndlp->vport, KERN_ERR, +- LOG_ELS, "0193 failed to send mail box"); ++ lpfc_printf_vlog(ndlp->vport, KERN_ERR, LOG_TRACE_EVENT, ++ "0193 failed to send mail box"); + kfree(lcb_context); + lpfc_nlp_put(ndlp); + rjt_err = LSRJT_UNABLE_TPC; +@@ -6621,7 +6629,7 @@ lpfc_send_rscn_event(struct lpfc_vport * + rscn_event_data = kmalloc(sizeof(struct lpfc_rscn_event_header) + + payload_len, GFP_KERNEL); + if (!rscn_event_data) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0147 Failed to allocate memory for RSCN event\n"); + return; + } +@@ -6998,7 +7006,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vp + + /* An FLOGI ELS command was received from DID in + Loop Mode */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0113 An FLOGI ELS command x%x was " + "received from DID x%x in Loop Mode\n", + cmd, did); +@@ -7988,7 +7996,7 @@ lpfc_els_timeout_handler(struct lpfc_vpo + + list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) { + cmd = &piocb->iocb; +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0127 ELS timeout Data: x%x x%x x%x " + "x%x\n", els_command, + remote_ID, cmd->ulpCommand, cmd->ulpIoTag); +@@ -8098,7 +8106,7 @@ lpfc_els_flush_cmd(struct lpfc_vport *vp + spin_unlock_irqrestore(&phba->hbalock, iflags); + } + if (!list_empty(&abort_list)) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "3387 abort list for txq not empty\n"); + INIT_LIST_HEAD(&abort_list); + +@@ -8269,7 +8277,7 @@ lpfc_send_els_event(struct lpfc_vport *v + if (*payload == ELS_CMD_LOGO) { + logo_data = kmalloc(sizeof(struct lpfc_logo_event), GFP_KERNEL); + if (!logo_data) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0148 Failed to allocate memory " + "for LOGO event\n"); + return; +@@ -8279,7 +8287,7 @@ lpfc_send_els_event(struct lpfc_vport *v + els_data = kmalloc(sizeof(struct lpfc_els_event_header), + GFP_KERNEL); + if (!els_data) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0149 Failed to allocate memory " + "for ELS event\n"); + return; +@@ -8396,7 +8404,7 @@ lpfc_els_rcv_fpin(struct lpfc_vport *vpo + break; + default: + dtag_nm = lpfc_get_tlv_dtag_nm(dtag); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "4678 skipped FPIN descriptor[%d]: " + "tag x%x (%s)\n", + desc_cnt, dtag, dtag_nm); +@@ -8811,7 +8819,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *p + rjt_exp = LSEXP_NOTHING_MORE; + + /* Unknown ELS command received from NPORT */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0115 Unknown ELS command x%x " + "received from NPORT x%x\n", cmd, did); + if (newnode) +@@ -8856,7 +8864,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *p + + dropit: + if (vport && !(vport->load_flag & FC_UNLOADING)) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0111 Dropping received ELS cmd " + "Data: x%x x%x x%x\n", + icmd->ulpStatus, icmd->un.ulpWord[4], icmd->ulpTimeout); +@@ -9006,7 +9014,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *ph + spin_lock_irq(shost->host_lock); + if (vport->fc_flag & FC_DISC_DELAYED) { + spin_unlock_irq(shost->host_lock); +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3334 Delay fc port discovery for %d seconds\n", + phba->fc_ratov); + mod_timer(&vport->delayed_disc_tmo, +@@ -9024,7 +9032,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *ph + return; + } + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0251 NameServer login: no memory\n"); + return; + } +@@ -9036,7 +9044,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *ph + return; + } + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0348 NameServer login: node freed\n"); + return; + } +@@ -9047,7 +9055,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *ph + + if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) { + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0252 Cannot issue NameServer login\n"); + return; + } +@@ -9084,7 +9092,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba + spin_unlock_irq(shost->host_lock); + + if (mb->mbxStatus) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0915 Register VPI failed : Status: x%x" + " upd bit: x%x \n", mb->mbxStatus, + mb->un.varRegVpi.upd); +@@ -9114,8 +9122,8 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba + rc = lpfc_sli_issue_mbox(phba, pmb, + MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_vlog(vport, +- KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "2732 Failed to issue INIT_VPI" + " mailbox command\n"); + } else { +@@ -9203,12 +9211,12 @@ lpfc_register_new_vport(struct lpfc_hba + lpfc_nlp_put(ndlp); + mempool_free(mbox, phba->mbox_mem_pool); + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0253 Register VPI: Can't send mbox\n"); + goto mbox_err_exit; + } + } else { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0254 Register VPI: no memory\n"); + goto mbox_err_exit; + } +@@ -9370,7 +9378,7 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phb + if (lpfc_els_retry(phba, cmdiocb, rspiocb)) + goto out; + /* FDISC failed */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0126 FDISC failed. (x%x/x%x)\n", + irsp->ulpStatus, irsp->un.ulpWord[4]); + goto fdisc_failed; +@@ -9492,7 +9500,7 @@ lpfc_issue_els_fdisc(struct lpfc_vport * + ELS_CMD_FDISC); + if (!elsiocb) { + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0255 Issue FDISC: no IOCB\n"); + return 1; + } +@@ -9546,7 +9554,7 @@ lpfc_issue_els_fdisc(struct lpfc_vport * + if (rc == IOCB_ERROR) { + lpfc_els_free_iocb(phba, elsiocb); + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0256 Issue FDISC: Cannot send IOCB\n"); + return 1; + } +@@ -10127,8 +10135,7 @@ lpfc_sli_abts_recover_port(struct lpfc_v + "rport in state 0x%x\n", ndlp->nlp_state); + return; + } +- lpfc_printf_log(phba, KERN_ERR, +- LOG_ELS | LOG_FCP_ERROR | LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3094 Start rport recovery on shost id 0x%x " + "fc_id 0x%06x vpi 0x%x rpi 0x%x state 0x%x " + "flags 0x%x\n", +--- a/drivers/scsi/lpfc/lpfc_hbadisc.c ++++ b/drivers/scsi/lpfc/lpfc_hbadisc.c +@@ -157,17 +157,17 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport + return; + + if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn)) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, +- "6789 rport name %llx != node port name %llx", +- rport->port_name, +- wwn_to_u64(ndlp->nlp_portname.u.wwn)); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "6789 rport name %llx != node port name %llx", ++ rport->port_name, ++ wwn_to_u64(ndlp->nlp_portname.u.wwn)); + + evtp = &ndlp->dev_loss_evt; + + if (!list_empty(&evtp->evt_listp)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, +- "6790 rport name %llx dev_loss_evt pending", +- rport->port_name); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "6790 rport name %llx dev_loss_evt pending", ++ rport->port_name); + return; + } + +@@ -297,7 +297,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_no + } + + if (warn_on) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0203 Devloss timeout on " + "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " + "NPort x%06x Data: x%x x%x x%x\n", +@@ -306,7 +306,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_no + ndlp->nlp_DID, ndlp->nlp_flag, + ndlp->nlp_state, ndlp->nlp_rpi); + } else { +- lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT, + "0204 Devloss timeout on " + "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " + "NPort x%06x Data: x%x x%x x%x\n", +@@ -757,7 +757,7 @@ lpfc_do_work(void *p) + || kthread_should_stop())); + /* Signal wakeup shall terminate the worker thread */ + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_ELS, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0433 Wakeup on signal: rc=x%x\n", rc); + break; + } +@@ -1088,7 +1088,7 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba * + /* Check for error */ + if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) { + /* CLEAR_LA mbox error state */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0320 CLEAR_LA mbxStatus error x%x hba " + "state x%x\n", + mb->mbxStatus, vport->port_state); +@@ -1176,7 +1176,7 @@ lpfc_mbx_cmpl_local_config_link(struct l + return; + + out: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0306 CONFIG_LINK mbxStatus error x%x " + "HBA state x%x\n", + pmb->u.mb.mbxStatus, vport->port_state); +@@ -1184,7 +1184,7 @@ lpfc_mbx_cmpl_local_config_link(struct l + + lpfc_linkdown(phba); + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0200 CONFIG_LINK bad hba state x%x\n", + vport->port_state); + +@@ -1220,10 +1220,10 @@ lpfc_mbx_cmpl_reg_fcfi(struct lpfc_hba * + struct lpfc_vport *vport = mboxq->vport; + + if (mboxq->u.mb.mbxStatus) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, +- "2017 REG_FCFI mbxStatus error x%x " +- "HBA state x%x\n", +- mboxq->u.mb.mbxStatus, vport->port_state); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2017 REG_FCFI mbxStatus error x%x " ++ "HBA state x%x\n", mboxq->u.mb.mbxStatus, ++ vport->port_state); + goto fail_out; + } + +@@ -1844,7 +1844,7 @@ lpfc_sli4_fcf_rec_mbox_parse(struct lpfc + */ + lpfc_sli4_mbx_sge_get(mboxq, 0, &sge); + if (unlikely(!mboxq->sge_array)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2524 Failed to get the non-embedded SGE " + "virtual address\n"); + return NULL; +@@ -1860,11 +1860,12 @@ lpfc_sli4_fcf_rec_mbox_parse(struct lpfc + if (shdr_status || shdr_add_status) { + if (shdr_status == STATUS_FCF_TABLE_EMPTY || + if_type == LPFC_SLI_INTF_IF_TYPE_2) +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "2726 READ_FCF_RECORD Indicates empty " + "FCF table.\n"); + else +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2521 READ_FCF_RECORD mailbox failed " + "with status x%x add_status x%x, " + "mbx\n", shdr_status, shdr_add_status); +@@ -2242,7 +2243,7 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(stru + new_fcf_record = lpfc_sli4_fcf_rec_mbox_parse(phba, mboxq, + &next_fcf_index); + if (!new_fcf_record) { +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2765 Mailbox command READ_FCF_RECORD " + "failed to retrieve a FCF record.\n"); + /* Let next new FCF event trigger fast failover */ +@@ -2286,7 +2287,8 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(stru + new_fcf_record, LPFC_FCOE_IGNORE_VID)) { + if (bf_get(lpfc_fcf_record_fcf_index, new_fcf_record) != + phba->fcf.current_rec.fcf_indx) { +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "2862 FCF (x%x) matches property " + "of in-use FCF (x%x)\n", + bf_get(lpfc_fcf_record_fcf_index, +@@ -2356,7 +2358,7 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(stru + phba->pport->fc_flag); + goto out; + } else +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2863 New FCF (x%x) matches " + "property of in-use FCF (x%x)\n", + bf_get(lpfc_fcf_record_fcf_index, +@@ -2770,10 +2772,9 @@ lpfc_init_vfi_cmpl(struct lpfc_hba *phba + (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != + LPFC_SLI_INTF_IF_TYPE_0) && + mboxq->u.mb.mbxStatus != MBX_VFI_IN_USE) { +- lpfc_printf_vlog(vport, KERN_ERR, +- LOG_MBOX, +- "2891 Init VFI mailbox failed 0x%x\n", +- mboxq->u.mb.mbxStatus); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2891 Init VFI mailbox failed 0x%x\n", ++ mboxq->u.mb.mbxStatus); + mempool_free(mboxq, phba->mbox_mem_pool); + lpfc_vport_set_state(vport, FC_VPORT_FAILED); + return; +@@ -2801,7 +2802,7 @@ lpfc_issue_init_vfi(struct lpfc_vport *v + mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { + lpfc_printf_vlog(vport, KERN_ERR, +- LOG_MBOX, "2892 Failed to allocate " ++ LOG_TRACE_EVENT, "2892 Failed to allocate " + "init_vfi mailbox\n"); + return; + } +@@ -2809,8 +2810,8 @@ lpfc_issue_init_vfi(struct lpfc_vport *v + mboxq->mbox_cmpl = lpfc_init_vfi_cmpl; + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_vlog(vport, KERN_ERR, +- LOG_MBOX, "2893 Failed to issue init_vfi mailbox\n"); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2893 Failed to issue init_vfi mailbox\n"); + mempool_free(mboxq, vport->phba->mbox_mem_pool); + } + } +@@ -2830,10 +2831,9 @@ lpfc_init_vpi_cmpl(struct lpfc_hba *phba + struct Scsi_Host *shost = lpfc_shost_from_vport(vport); + + if (mboxq->u.mb.mbxStatus) { +- lpfc_printf_vlog(vport, KERN_ERR, +- LOG_MBOX, +- "2609 Init VPI mailbox failed 0x%x\n", +- mboxq->u.mb.mbxStatus); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2609 Init VPI mailbox failed 0x%x\n", ++ mboxq->u.mb.mbxStatus); + mempool_free(mboxq, phba->mbox_mem_pool); + lpfc_vport_set_state(vport, FC_VPORT_FAILED); + return; +@@ -2847,7 +2847,7 @@ lpfc_init_vpi_cmpl(struct lpfc_hba *phba + ndlp = lpfc_findnode_did(vport, Fabric_DID); + if (!ndlp) + lpfc_printf_vlog(vport, KERN_ERR, +- LOG_DISCOVERY, ++ LOG_TRACE_EVENT, + "2731 Cannot find fabric " + "controller node\n"); + else +@@ -2860,7 +2860,7 @@ lpfc_init_vpi_cmpl(struct lpfc_hba *phba + lpfc_initial_fdisc(vport); + else { + lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2606 No NPIV Fabric support\n"); + } + mempool_free(mboxq, phba->mbox_mem_pool); +@@ -2883,8 +2883,7 @@ lpfc_issue_init_vpi(struct lpfc_vport *v + if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) { + vpi = lpfc_alloc_vpi(vport->phba); + if (!vpi) { +- lpfc_printf_vlog(vport, KERN_ERR, +- LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "3303 Failed to obtain vport vpi\n"); + lpfc_vport_set_state(vport, FC_VPORT_FAILED); + return; +@@ -2895,7 +2894,7 @@ lpfc_issue_init_vpi(struct lpfc_vport *v + mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { + lpfc_printf_vlog(vport, KERN_ERR, +- LOG_MBOX, "2607 Failed to allocate " ++ LOG_TRACE_EVENT, "2607 Failed to allocate " + "init_vpi mailbox\n"); + return; + } +@@ -2904,8 +2903,8 @@ lpfc_issue_init_vpi(struct lpfc_vport *v + mboxq->mbox_cmpl = lpfc_init_vpi_cmpl; + rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_vlog(vport, KERN_ERR, +- LOG_MBOX, "2608 Failed to issue init_vpi mailbox\n"); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2608 Failed to issue init_vpi mailbox\n"); + mempool_free(mboxq, vport->phba->mbox_mem_pool); + } + } +@@ -2949,7 +2948,7 @@ lpfc_start_fdiscs(struct lpfc_hba *phba) + lpfc_vport_set_state(vports[i], + FC_VPORT_NO_FABRIC_SUPP); + lpfc_printf_vlog(vports[i], KERN_ERR, +- LOG_ELS, ++ LOG_TRACE_EVENT, + "0259 No NPIV " + "Fabric support\n"); + } +@@ -2973,10 +2972,10 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *p + (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != + LPFC_SLI_INTF_IF_TYPE_0) && + mboxq->u.mb.mbxStatus != MBX_VFI_IN_USE) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, +- "2018 REG_VFI mbxStatus error x%x " +- "HBA state x%x\n", +- mboxq->u.mb.mbxStatus, vport->port_state); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2018 REG_VFI mbxStatus error x%x " ++ "HBA state x%x\n", ++ mboxq->u.mb.mbxStatus, vport->port_state); + if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { + /* FLOGI failed, use loop map to make discovery list */ + lpfc_disc_list_loopmap(vport); +@@ -3063,7 +3062,7 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hb + /* Check for error */ + if (mb->mbxStatus) { + /* READ_SPARAM mbox error state */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0319 READ_SPARAM mbxStatus error x%x " + "hba state x%x>\n", + mb->mbxStatus, vport->port_state); +@@ -3282,7 +3281,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba + GFP_KERNEL); + if (unlikely(!fcf_record)) { + lpfc_printf_log(phba, KERN_ERR, +- LOG_MBOX | LOG_SLI, ++ LOG_TRACE_EVENT, + "2554 Could not allocate memory for " + "fcf record\n"); + rc = -ENODEV; +@@ -3294,7 +3293,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba + rc = lpfc_sli4_add_fcf_record(phba, fcf_record); + if (unlikely(rc)) { + lpfc_printf_log(phba, KERN_ERR, +- LOG_MBOX | LOG_SLI, ++ LOG_TRACE_EVENT, + "2013 Could not manually add FCF " + "record 0, status %d\n", rc); + rc = -ENODEV; +@@ -3340,7 +3339,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba + return; + out: + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0263 Discovery Mailbox error: state: 0x%x : x%px x%px\n", + vport->port_state, sparam_mbox, cfglink_mbox); + lpfc_issue_clear_la(phba, vport); +@@ -3613,7 +3612,7 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba + break; + /* If VPI is busy, reset the HBA */ + case 0x9700: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2798 Unreg_vpi failed vpi 0x%x, mb status = 0x%x\n", + vport->vpi, mb->mbxStatus); + if (!(phba->pport->load_flag & FC_UNLOADING)) +@@ -3651,7 +3650,7 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vp + mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi; + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1800 Could not issue unreg_vpi\n"); + mempool_free(mbox, phba->mbox_mem_pool); + vport->unreg_vpi_cmpl = VPORT_ERROR; +@@ -3738,7 +3737,7 @@ lpfc_create_static_vport(struct lpfc_hba + + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!pmb) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0542 lpfc_create_static_vport failed to" + " allocate mailbox memory\n"); + return; +@@ -3748,7 +3747,7 @@ lpfc_create_static_vport(struct lpfc_hba + + vport_info = kzalloc(sizeof(struct static_vport_info), GFP_KERNEL); + if (!vport_info) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0543 lpfc_create_static_vport failed to" + " allocate vport_info\n"); + mempool_free(pmb, phba->mbox_mem_pool); +@@ -3809,11 +3808,12 @@ lpfc_create_static_vport(struct lpfc_hba + if ((le32_to_cpu(vport_info->signature) != VPORT_INFO_SIG) || + ((le32_to_cpu(vport_info->rev) & VPORT_INFO_REV_MASK) + != VPORT_INFO_REV)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "0545 lpfc_create_static_vport bad" +- " information header 0x%x 0x%x\n", +- le32_to_cpu(vport_info->signature), +- le32_to_cpu(vport_info->rev) & VPORT_INFO_REV_MASK); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0545 lpfc_create_static_vport bad" ++ " information header 0x%x 0x%x\n", ++ le32_to_cpu(vport_info->signature), ++ le32_to_cpu(vport_info->rev) & ++ VPORT_INFO_REV_MASK); + + goto out; + } +@@ -3877,7 +3877,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lp + pmb->ctx_buf = NULL; + + if (mb->mbxStatus) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0258 Register Fabric login error: 0x%x\n", + mb->mbxStatus); + lpfc_mbuf_free(phba, mp->virt, mp->phys); +@@ -3950,7 +3950,8 @@ lpfc_issue_gidft(struct lpfc_vport *vpor + /* Cannot issue NameServer FCP Query, so finish up + * discovery + */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0604 %s FC TYPE %x %s\n", + "Failed to issue GID_FT to ", + FC_TYPE_FCP, +@@ -3966,7 +3967,8 @@ lpfc_issue_gidft(struct lpfc_vport *vpor + /* Cannot issue NameServer NVME Query, so finish up + * discovery + */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0605 %s FC_TYPE %x %s %d\n", + "Failed to issue GID_FT to ", + FC_TYPE_NVME, +@@ -3998,7 +4000,7 @@ lpfc_issue_gidpt(struct lpfc_vport *vpor + /* Cannot issue NameServer FCP Query, so finish up + * discovery + */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0606 %s Port TYPE %x %s\n", + "Failed to issue GID_PT to ", + GID_PT_N_PORT, +@@ -4028,7 +4030,7 @@ lpfc_mbx_cmpl_ns_reg_login(struct lpfc_h + vport->gidft_inp = 0; + + if (mb->mbxStatus) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0260 Register NameServer error: 0x%x\n", + mb->mbxStatus); + +@@ -4340,7 +4342,7 @@ lpfc_nlp_state_cleanup(struct lpfc_vport + GFP_KERNEL); + + if (!ndlp->lat_data) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0286 lpfc_nlp_state_cleanup failed to " + "allocate statistical data buffer DID " + "0x%x\n", ndlp->nlp_DID); +@@ -5009,8 +5011,8 @@ lpfc_unreg_hba_rpis(struct lpfc_hba *phb + + vports = lpfc_create_vport_work_array(phba); + if (!vports) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, +- "2884 Vport array allocation failed \n"); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2884 Vport array allocation failed \n"); + return; + } + for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { +@@ -5053,9 +5055,10 @@ lpfc_unreg_all_rpis(struct lpfc_vport *v + mempool_free(mbox, phba->mbox_mem_pool); + + if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED)) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, +- "1836 Could not issue " +- "unreg_login(all_rpis) status %d\n", rc); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "1836 Could not issue " ++ "unreg_login(all_rpis) status %d\n", ++ rc); + } + } + +@@ -5082,7 +5085,7 @@ lpfc_unreg_default_rpis(struct lpfc_vpor + mempool_free(mbox, phba->mbox_mem_pool); + + if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED)) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1815 Could not issue " + "unreg_did (default rpis) status %d\n", + rc); +@@ -5903,7 +5906,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + case LPFC_FLOGI: + /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */ + /* Initial FLOGI timeout */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0222 Initial %s timeout\n", + vport->vpi ? "FDISC" : "FLOGI"); + +@@ -5921,7 +5925,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + case LPFC_FABRIC_CFG_LINK: + /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for + NameServer login */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0223 Timeout while waiting for " + "NameServer login\n"); + /* Next look for NameServer ndlp */ +@@ -5934,7 +5939,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + + case LPFC_NS_QRY: + /* Check for wait for NameServer Rsp timeout */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0224 NameServer Query timeout " + "Data: x%x x%x\n", + vport->fc_ns_retry, LPFC_MAX_NS_RETRY); +@@ -5967,7 +5973,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + /* Setup and issue mailbox INITIALIZE LINK command */ + initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!initlinkmbox) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0206 Device Discovery " + "completion error\n"); + phba->link_state = LPFC_HBA_ERROR; +@@ -5989,7 +5996,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + + case LPFC_DISC_AUTH: + /* Node Authentication timeout */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0227 Node Authentication timeout\n"); + lpfc_disc_flush_list(vport); + +@@ -6009,7 +6017,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + + case LPFC_VPORT_READY: + if (vport->fc_flag & FC_RSCN_MODE) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0231 RSCN timeout Data: x%x " + "x%x\n", + vport->fc_ns_retry, LPFC_MAX_NS_RETRY); +@@ -6023,7 +6032,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + break; + + default: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0273 Unexpected discovery timeout, " + "vport State x%x\n", vport->port_state); + break; +@@ -6032,7 +6042,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + switch (phba->link_state) { + case LPFC_CLEAR_LA: + /* CLEAR LA timeout */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0228 CLEAR LA timeout\n"); + clrlaerr = 1; + break; +@@ -6046,7 +6057,8 @@ lpfc_disc_timeout_handler(struct lpfc_vp + case LPFC_INIT_MBX_CMDS: + case LPFC_LINK_DOWN: + case LPFC_HBA_ERROR: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0230 Unexpected timeout, hba link " + "state x%x\n", phba->link_state); + clrlaerr = 1; +@@ -6236,9 +6248,9 @@ lpfc_find_vport_by_vpid(struct lpfc_hba + } + + if (i >= phba->max_vpi) { +- lpfc_printf_log(phba, KERN_ERR, LOG_ELS, +- "2936 Could not find Vport mapped " +- "to vpi %d\n", vpi); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2936 Could not find Vport mapped " ++ "to vpi %d\n", vpi); + return NULL; + } + } +@@ -6542,10 +6554,10 @@ lpfc_unregister_vfi_cmpl(struct lpfc_hba + struct Scsi_Host *shost = lpfc_shost_from_vport(vport); + + if (mboxq->u.mb.mbxStatus) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, +- "2555 UNREG_VFI mbxStatus error x%x " +- "HBA state x%x\n", +- mboxq->u.mb.mbxStatus, vport->port_state); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2555 UNREG_VFI mbxStatus error x%x " ++ "HBA state x%x\n", ++ mboxq->u.mb.mbxStatus, vport->port_state); + } + spin_lock_irq(shost->host_lock); + phba->pport->fc_flag &= ~FC_VFI_REGISTERED; +@@ -6567,10 +6579,10 @@ lpfc_unregister_fcfi_cmpl(struct lpfc_hb + struct lpfc_vport *vport = mboxq->vport; + + if (mboxq->u.mb.mbxStatus) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, +- "2550 UNREG_FCFI mbxStatus error x%x " +- "HBA state x%x\n", +- mboxq->u.mb.mbxStatus, vport->port_state); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2550 UNREG_FCFI mbxStatus error x%x " ++ "HBA state x%x\n", ++ mboxq->u.mb.mbxStatus, vport->port_state); + } + mempool_free(mboxq, phba->mbox_mem_pool); + return; +@@ -6659,7 +6671,7 @@ lpfc_sli4_unregister_fcf(struct lpfc_hba + + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2551 UNREG_FCFI mbox allocation failed" + "HBA state x%x\n", phba->pport->port_state); + return -ENOMEM; +@@ -6670,7 +6682,7 @@ lpfc_sli4_unregister_fcf(struct lpfc_hba + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2552 Unregister FCFI command failed rc x%x " + "HBA state x%x\n", + rc, phba->pport->port_state); +@@ -6694,7 +6706,7 @@ lpfc_unregister_fcf_rescan(struct lpfc_h + /* Preparation for unregistering fcf */ + rc = lpfc_unregister_fcf_prep(phba); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2748 Failed to prepare for unregistering " + "HBA's FCF record: rc=%d\n", rc); + return; +@@ -6730,7 +6742,7 @@ lpfc_unregister_fcf_rescan(struct lpfc_h + spin_lock_irq(&phba->hbalock); + phba->fcf.fcf_flag &= ~FCF_INIT_DISC; + spin_unlock_irq(&phba->hbalock); +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2553 lpfc_unregister_unused_fcf failed " + "to read FCF record HBA state x%x\n", + phba->pport->port_state); +@@ -6752,7 +6764,7 @@ lpfc_unregister_fcf(struct lpfc_hba *phb + /* Preparation for unregistering fcf */ + rc = lpfc_unregister_fcf_prep(phba); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2749 Failed to prepare for unregistering " + "HBA's FCF record: rc=%d\n", rc); + return; +@@ -6839,9 +6851,9 @@ lpfc_read_fcf_conn_tbl(struct lpfc_hba * + conn_entry = kzalloc(sizeof(struct lpfc_fcf_conn_entry), + GFP_KERNEL); + if (!conn_entry) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "2566 Failed to allocate connection" +- " table entry\n"); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2566 Failed to allocate connection" ++ " table entry\n"); + return; + } + +@@ -6985,7 +6997,7 @@ lpfc_parse_fcoe_conf(struct lpfc_hba *ph + + /* Check the region signature first */ + if (memcmp(buff, LPFC_REGION23_SIGNATURE, 4)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2567 Config region 23 has bad signature\n"); + return; + } +@@ -6994,8 +7006,8 @@ lpfc_parse_fcoe_conf(struct lpfc_hba *ph + + /* Check the data structure version */ + if (buff[offset] != LPFC_REGION23_VERSION) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "2568 Config region 23 has bad version\n"); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2568 Config region 23 has bad version\n"); + return; + } + offset += 4; +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -156,7 +156,7 @@ lpfc_config_port_prep(struct lpfc_hba *p + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); + + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0324 Config Port initialization " + "error, mbxCmd x%x READ_NVPARM, " + "mbxStatus x%x\n", +@@ -180,7 +180,7 @@ lpfc_config_port_prep(struct lpfc_hba *p + lpfc_read_rev(phba, pmb); + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0439 Adapter failed to init, mbxCmd x%x " + "READ_REV, mbxStatus x%x\n", + mb->mbxCommand, mb->mbxStatus); +@@ -195,7 +195,7 @@ lpfc_config_port_prep(struct lpfc_hba *p + */ + if (mb->un.varRdRev.rr == 0) { + vp->rev.rBit = 0; +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0440 Adapter failed to init, READ_REV has " + "missing revision information.\n"); + mempool_free(pmb, phba->mbox_mem_pool); +@@ -447,7 +447,7 @@ lpfc_config_port_post(struct lpfc_hba *p + + pmb->vport = vport; + if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0448 Adapter failed init, mbxCmd x%x " + "READ_SPARM mbxStatus x%x\n", + mb->mbxCommand, mb->mbxStatus); +@@ -501,7 +501,7 @@ lpfc_config_port_post(struct lpfc_hba *p + lpfc_read_config(phba, pmb); + pmb->vport = vport; + if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0453 Adapter failed to init, mbxCmd x%x " + "READ_CONFIG, mbxStatus x%x\n", + mb->mbxCommand, mb->mbxStatus); +@@ -550,7 +550,7 @@ lpfc_config_port_post(struct lpfc_hba *p + } + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0352 Config MSI mailbox command " + "failed, mbxCmd x%x, mbxStatus x%x\n", + pmb->u.mb.mbxCommand, +@@ -601,17 +601,15 @@ lpfc_config_port_post(struct lpfc_hba *p + jiffies + msecs_to_jiffies(1000 * phba->eratt_poll_interval)); + + if (phba->hba_flag & LINK_DISABLED) { +- lpfc_printf_log(phba, +- KERN_ERR, LOG_INIT, +- "2598 Adapter Link is disabled.\n"); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2598 Adapter Link is disabled.\n"); + lpfc_down_link(phba, pmb); + pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); + if ((rc != MBX_SUCCESS) && (rc != MBX_BUSY)) { +- lpfc_printf_log(phba, +- KERN_ERR, LOG_INIT, +- "2599 Adapter failed to issue DOWN_LINK" +- " mbox command rc 0x%x\n", rc); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2599 Adapter failed to issue DOWN_LINK" ++ " mbox command rc 0x%x\n", rc); + + mempool_free(pmb, phba->mbox_mem_pool); + return -EIO; +@@ -635,9 +633,7 @@ lpfc_config_port_post(struct lpfc_hba *p + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); + + if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) { +- lpfc_printf_log(phba, +- KERN_ERR, +- LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0456 Adapter failed to issue " + "ASYNCEVT_ENABLE mbox status x%x\n", + rc); +@@ -657,7 +653,8 @@ lpfc_config_port_post(struct lpfc_hba *p + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); + + if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "0435 Adapter failed " ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0435 Adapter failed " + "to get Option ROM version status x%x\n", rc); + mempool_free(pmb, phba->mbox_mem_pool); + } +@@ -735,10 +732,10 @@ lpfc_hba_init_link_fc_topology(struct lp + ((phba->cfg_link_speed == LPFC_USER_LINK_SPEED_64G) && + !(phba->lmt & LMT_64Gb))) { + /* Reset link speed to auto */ +- lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, +- "1302 Invalid speed for this board:%d " +- "Reset link speed to auto.\n", +- phba->cfg_link_speed); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "1302 Invalid speed for this board:%d " ++ "Reset link speed to auto.\n", ++ phba->cfg_link_speed); + phba->cfg_link_speed = LPFC_USER_LINK_SPEED_AUTO; + } + lpfc_init_link(phba, pmb, fc_topology, phba->cfg_link_speed); +@@ -747,10 +744,10 @@ lpfc_hba_init_link_fc_topology(struct lp + lpfc_set_loopback_flag(phba); + rc = lpfc_sli_issue_mbox(phba, pmb, flag); + if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "0498 Adapter failed to init, mbxCmd x%x " +- "INIT_LINK, mbxStatus x%x\n", +- mb->mbxCommand, mb->mbxStatus); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0498 Adapter failed to init, mbxCmd x%x " ++ "INIT_LINK, mbxStatus x%x\n", ++ mb->mbxCommand, mb->mbxStatus); + if (phba->sli_rev <= LPFC_SLI_REV3) { + /* Clear all interrupt enable conditions */ + writel(0, phba->HCregaddr); +@@ -796,17 +793,15 @@ lpfc_hba_down_link(struct lpfc_hba *phba + return -ENOMEM; + } + +- lpfc_printf_log(phba, +- KERN_ERR, LOG_INIT, +- "0491 Adapter Link is disabled.\n"); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0491 Adapter Link is disabled.\n"); + lpfc_down_link(phba, pmb); + pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + rc = lpfc_sli_issue_mbox(phba, pmb, flag); + if ((rc != MBX_SUCCESS) && (rc != MBX_BUSY)) { +- lpfc_printf_log(phba, +- KERN_ERR, LOG_INIT, +- "2522 Adapter failed to issue DOWN_LINK" +- " mbox command rc 0x%x\n", rc); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2522 Adapter failed to issue DOWN_LINK" ++ " mbox command rc 0x%x\n", rc); + + mempool_free(pmb, phba->mbox_mem_pool); + return -EIO; +@@ -1612,11 +1607,11 @@ lpfc_handle_deferred_eratt(struct lpfc_h + return; + } + +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "0479 Deferred Adapter Hardware Error " +- "Data: x%x x%x x%x\n", +- phba->work_hs, +- phba->work_status[0], phba->work_status[1]); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0479 Deferred Adapter Hardware Error " ++ "Data: x%x x%x x%x\n", ++ phba->work_hs, phba->work_status[0], ++ phba->work_status[1]); + + spin_lock_irq(&phba->hbalock); + psli->sli_flag &= ~LPFC_SLI_ACTIVE; +@@ -1767,7 +1762,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *ph + temp_event_data.event_code = LPFC_CRIT_TEMP; + temp_event_data.data = (uint32_t)temperature; + +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0406 Adapter maximum temperature exceeded " + "(%ld), taking this port offline " + "Data: x%x x%x x%x\n", +@@ -1791,7 +1786,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *ph + * failure is a value other than FFER6. Do not call the offline + * twice. This is the adapter hardware error path. + */ +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0457 Adapter Hardware Error " + "Data: x%x x%x x%x\n", + phba->work_hs, +@@ -1839,7 +1834,7 @@ lpfc_sli4_port_sta_fn_reset(struct lpfc_ + + /* need reset: attempt for port recovery */ + if (en_rn_msg) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2887 Reset Needed: Attempting Port " + "Recovery...\n"); + lpfc_offline_prep(phba, mbx_action); +@@ -1849,14 +1844,14 @@ lpfc_sli4_port_sta_fn_reset(struct lpfc_ + lpfc_sli4_disable_intr(phba); + rc = lpfc_sli_brdrestart(phba); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6309 Failed to restart board\n"); + return rc; + } + /* request and enable interrupt */ + intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode); + if (intr_mode == LPFC_INTR_ERROR) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3175 Failed to enable interrupt\n"); + return -EIO; + } +@@ -1895,7 +1890,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + * we cannot communicate with the pci card anyway. + */ + if (pci_channel_offline(phba->pcidev)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3166 pci channel is offline\n"); + lpfc_sli4_offline_eratt(phba); + return; +@@ -1918,7 +1913,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + lpfc_sli4_offline_eratt(phba); + return; + } +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "7623 Checking UE recoverable"); + + for (i = 0; i < phba->sli4_hba.ue_to_sr / 1000; i++) { +@@ -1935,7 +1930,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + msleep(1000); + } + +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "4827 smphr_port_status x%x : Waited %dSec", + smphr_port_status, i); + +@@ -1953,14 +1948,14 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + LPFC_MBX_NO_WAIT, en_rn_msg); + if (rc == 0) + return; +- lpfc_printf_log(phba, +- KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "4215 Failed to recover UE"); + break; + } + } + } +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "7624 Firmware not ready: Failing UE recovery," + " waited %dSec", i); + phba->link_state = LPFC_HBA_ERROR; +@@ -1973,7 +1968,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + &portstat_reg.word0); + /* consider PCI bus read error as pci_channel_offline */ + if (pci_rd_rc1 == -EIO) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3151 PCI bus read access failure: x%x\n", + readl(phba->sli4_hba.u.if_type2.STATUSregaddr)); + lpfc_sli4_offline_eratt(phba); +@@ -1982,10 +1977,10 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + reg_err1 = readl(phba->sli4_hba.u.if_type2.ERR1regaddr); + reg_err2 = readl(phba->sli4_hba.u.if_type2.ERR2regaddr); + if (bf_get(lpfc_sliport_status_oti, &portstat_reg)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "2889 Port Overtemperature event, " +- "taking port offline Data: x%x x%x\n", +- reg_err1, reg_err2); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2889 Port Overtemperature event, " ++ "taking port offline Data: x%x x%x\n", ++ reg_err1, reg_err2); + + phba->sfp_alarm |= LPFC_TRANSGRESSION_HIGH_TEMPERATURE; + temp_event_data.event_type = FC_REG_TEMPERATURE_EVENT; +@@ -2007,17 +2002,17 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + } + if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 && + reg_err2 == SLIPORT_ERR2_REG_FW_RESTART) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3143 Port Down: Firmware Update " + "Detected\n"); + en_rn_msg = false; + } else if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 && + reg_err2 == SLIPORT_ERR2_REG_FORCED_DUMP) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3144 Port Down: Debug Dump\n"); + else if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 && + reg_err2 == SLIPORT_ERR2_REG_FUNC_PROVISON) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3145 Port Down: Provisioning\n"); + + /* If resets are disabled then leave the HBA alone and return */ +@@ -2036,7 +2031,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + break; + } + /* fall through for not able to recover */ +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3152 Unrecoverable error\n"); + phba->link_state = LPFC_HBA_ERROR; + break; +@@ -2154,8 +2149,8 @@ lpfc_handle_latt(struct lpfc_hba *phba) + lpfc_linkdown(phba); + phba->link_state = LPFC_HBA_ERROR; + +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, +- "0300 LATT: Cannot issue READ_LA: Data:%d\n", rc); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0300 LATT: Cannot issue READ_LA: Data:%d\n", rc); + + return; + } +@@ -2904,12 +2899,13 @@ lpfc_cleanup(struct lpfc_vport *vport) + */ + while (!list_empty(&vport->fc_nodes)) { + if (i++ > 3000) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0233 Nodelist not empty\n"); + list_for_each_entry_safe(ndlp, next_ndlp, + &vport->fc_nodes, nlp_listp) { + lpfc_printf_vlog(ndlp->vport, KERN_ERR, +- LOG_NODE, ++ LOG_TRACE_EVENT, + "0282 did:x%x ndlp:x%px " + "usgmap:x%x refcnt:%d\n", + ndlp->nlp_DID, (void *)ndlp, +@@ -3017,7 +3013,7 @@ lpfc_stop_hba_timers(struct lpfc_hba *ph + lpfc_sli4_stop_fcf_redisc_wait_timer(phba); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0297 Invalid device group (x%x)\n", + phba->pci_dev_grp); + break; +@@ -3064,10 +3060,10 @@ lpfc_block_mgmt_io(struct lpfc_hba *phba + /* Check active mailbox complete status every 2ms */ + msleep(2); + if (time_after(jiffies, timeout)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "2813 Mgmt IO is Blocked %x " +- "- mbox cmd %x still active\n", +- phba->sli.sli_flag, actcmd); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2813 Mgmt IO is Blocked %x " ++ "- mbox cmd %x still active\n", ++ phba->sli.sli_flag, actcmd); + break; + } + } +@@ -3412,7 +3408,7 @@ lpfc_online(struct lpfc_hba *phba) + !phba->nvmet_support) { + error = lpfc_nvme_create_localport(phba->pport); + if (error) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6132 NVME restore reg failed " + "on nvmei error x%x\n", error); + } +@@ -3752,7 +3748,8 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba + sglq_entry = kzalloc(sizeof(struct lpfc_sglq), + GFP_KERNEL); + if (sglq_entry == NULL) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "2562 Failure to allocate an " + "ELS sgl entry:%d\n", i); + rc = -ENOMEM; +@@ -3763,7 +3760,8 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba + &sglq_entry->phys); + if (sglq_entry->virt == NULL) { + kfree(sglq_entry); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "2563 Failure to allocate an " + "ELS mbuf:%d\n", i); + rc = -ENOMEM; +@@ -3818,7 +3816,8 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba + &phba->sli4_hba.lpfc_els_sgl_list, list) { + lxri = lpfc_sli4_next_xritag(phba); + if (lxri == NO_XRI) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "2400 Failed to allocate xri for " + "ELS sgl\n"); + rc = -ENOMEM; +@@ -3873,7 +3872,8 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_h + sglq_entry = kzalloc(sizeof(struct lpfc_sglq), + GFP_KERNEL); + if (sglq_entry == NULL) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6303 Failure to allocate an " + "NVMET sgl entry:%d\n", i); + rc = -ENOMEM; +@@ -3884,7 +3884,8 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_h + &sglq_entry->phys); + if (sglq_entry->virt == NULL) { + kfree(sglq_entry); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6304 Failure to allocate an " + "NVMET buf:%d\n", i); + rc = -ENOMEM; +@@ -3940,7 +3941,8 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_h + &phba->sli4_hba.lpfc_nvmet_sgl_list, list) { + lxri = lpfc_sli4_next_xritag(phba); + if (lxri == NO_XRI) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6307 Failed to allocate xri for " + "NVMET sgl\n"); + rc = -ENOMEM; +@@ -4114,7 +4116,8 @@ lpfc_sli4_io_sgl_update(struct lpfc_hba + &io_sgl_list, list) { + lxri = lpfc_sli4_next_xritag(phba); + if (lxri == NO_XRI) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6075 Failed to allocate xri for " + "nvme buffer\n"); + rc = -ENOMEM; +@@ -4185,7 +4188,8 @@ lpfc_new_io_buf(struct lpfc_hba *phba, i + if ((phba->sli3_options & LPFC_SLI3_BG_ENABLED) && + (((unsigned long)(lpfc_ncmd->data) & + (unsigned long)(SLI4_PAGE_SIZE - 1)) != 0)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "3369 Memory alignment err: " + "addr=%lx\n", + (unsigned long)lpfc_ncmd->data); +@@ -4214,7 +4218,7 @@ lpfc_new_io_buf(struct lpfc_hba *phba, i + dma_pool_free(phba->lpfc_sg_dma_buf_pool, + lpfc_ncmd->data, lpfc_ncmd->dma_handle); + kfree(lpfc_ncmd); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6121 Failed to allocate IOTAG for" + " XRI:0x%x\n", lxri); + lpfc_sli4_free_xri(phba, lxri); +@@ -4265,7 +4269,7 @@ lpfc_get_wwpn(struct lpfc_hba *phba) + lpfc_read_nv(phba, mboxq); + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6019 Mailbox failed , mbxCmd x%x " + "READ_NV, mbxStatus x%x\n", + bf_get(lpfc_mqe_command, &mboxq->u.mqe), +@@ -4325,7 +4329,8 @@ lpfc_create_port(struct lpfc_hba *phba, + + for (i = 0; i < lpfc_no_hba_reset_cnt; i++) { + if (wwn == lpfc_no_hba_reset[i]) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6020 Setting use_no_reset port=%llx\n", + wwn); + use_no_reset_hba = true; +@@ -4770,7 +4775,7 @@ lpfc_sli4_parse_latt_fault(struct lpfc_h + case LPFC_ASYNC_LINK_FAULT_LR_LRR: + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0398 Unknown link fault code: x%x\n", + bf_get(lpfc_acqe_link_fault, acqe_link)); + break; +@@ -4806,7 +4811,7 @@ lpfc_sli4_parse_latt_type(struct lpfc_hb + att_type = LPFC_ATT_LINK_UP; + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0399 Invalid link attention type: x%x\n", + bf_get(lpfc_acqe_link_status, acqe_link)); + att_type = LPFC_ATT_RESERVED; +@@ -4978,19 +4983,19 @@ lpfc_sli4_async_link_evt(struct lpfc_hba + phba->fcoe_eventtag = acqe_link->event_tag; + pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!pmb) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0395 The mboxq allocation failed\n"); + return; + } + mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + if (!mp) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0396 The lpfc_dmabuf allocation failed\n"); + goto out_free_pmb; + } + mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys); + if (!mp->virt) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0397 The mbuf allocation failed\n"); + goto out_free_dmabuf; + } +@@ -5191,7 +5196,7 @@ lpfc_update_trunk_link_status(struct lpf + phba->trunk_link.link3.fault = port_fault & 0x8 ? err : 0; + } + +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2910 Async FC Trunking Event - Speed:%d\n" + "\tLogical speed:%d " + "port0: %s port1: %s port2: %s port3: %s\n", +@@ -5201,7 +5206,7 @@ lpfc_update_trunk_link_status(struct lpf + trunk_link_status(2), trunk_link_status(3)); + + if (port_fault) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3202 trunk error:0x%x (%s) seen on port0:%s " + /* + * SLI-4: We have only 0xA error codes +@@ -5235,7 +5240,7 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba * + + if (bf_get(lpfc_trailer_type, acqe_fc) != + LPFC_FC_LA_EVENT_TYPE_FC_LINK) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2895 Non FC link Event detected.(%d)\n", + bf_get(lpfc_trailer_type, acqe_fc)); + return; +@@ -5283,19 +5288,19 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba * + phba->sli4_hba.link_state.fault); + pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!pmb) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2897 The mboxq allocation failed\n"); + return; + } + mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + if (!mp) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2898 The lpfc_dmabuf allocation failed\n"); + goto out_free_pmb; + } + mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys); + if (!mp->virt) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2899 The mbuf allocation failed\n"); + goto out_free_dmabuf; + } +@@ -5462,7 +5467,7 @@ lpfc_sli4_async_sli_evt(struct lpfc_hba + &misconfigured->theEvent); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3296 " + "LPFC_SLI_EVENT_TYPE_MISCONFIGURED " + "event: Invalid link %d", +@@ -5514,7 +5519,8 @@ lpfc_sli4_async_sli_evt(struct lpfc_hba + rc = lpfc_sli4_read_config(phba); + if (rc) { + phba->lmt = 0; +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "3194 Unable to retrieve supported " + "speeds, rc = 0x%x\n", rc); + } +@@ -5666,8 +5672,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba + case LPFC_FIP_EVENT_TYPE_NEW_FCF: + case LPFC_FIP_EVENT_TYPE_FCF_PARAM_MOD: + if (event_type == LPFC_FIP_EVENT_TYPE_NEW_FCF) +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP | +- LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2546 New FCF event, evt_tag:x%x, " + "index:x%x\n", + acqe_fip->event_tag, +@@ -5720,23 +5725,24 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba + rc = lpfc_sli4_fcf_scan_read_fcf_rec(phba, + LPFC_FCOE_FCF_GET_FIRST); + if (rc) +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2547 Issue FCF scan read FCF mailbox " + "command failed (x%x)\n", rc); + break; + + case LPFC_FIP_EVENT_TYPE_FCF_TABLE_FULL: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "2548 FCF Table full count 0x%x tag 0x%x\n", +- bf_get(lpfc_acqe_fip_fcf_count, acqe_fip), +- acqe_fip->event_tag); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2548 FCF Table full count 0x%x tag 0x%x\n", ++ bf_get(lpfc_acqe_fip_fcf_count, acqe_fip), ++ acqe_fip->event_tag); + break; + + case LPFC_FIP_EVENT_TYPE_FCF_DEAD: + phba->fcoe_cvl_eventtag = acqe_fip->event_tag; +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, +- "2549 FCF (x%x) disconnected from network, " +- "tag:x%x\n", acqe_fip->index, acqe_fip->event_tag); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2549 FCF (x%x) disconnected from network, " ++ "tag:x%x\n", acqe_fip->index, ++ acqe_fip->event_tag); + /* + * If we are in the middle of FCF failover process, clear + * the corresponding FCF bit in the roundrobin bitmap. +@@ -5773,7 +5779,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba + rc = lpfc_sli4_redisc_fcf_table(phba); + if (rc) { + lpfc_printf_log(phba, KERN_ERR, LOG_FIP | +- LOG_DISCOVERY, ++ LOG_TRACE_EVENT, + "2772 Issue FCF rediscover mailbox " + "command failed, fail through to FCF " + "dead event\n"); +@@ -5797,7 +5803,8 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba + break; + case LPFC_FIP_EVENT_TYPE_CVL: + phba->fcoe_cvl_eventtag = acqe_fip->event_tag; +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "2718 Clear Virtual Link Received for VPI 0x%x" + " tag 0x%x\n", acqe_fip->index, acqe_fip->event_tag); + +@@ -5864,7 +5871,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba + rc = lpfc_sli4_redisc_fcf_table(phba); + if (rc) { + lpfc_printf_log(phba, KERN_ERR, LOG_FIP | +- LOG_DISCOVERY, ++ LOG_TRACE_EVENT, + "2774 Issue FCF rediscover " + "mailbox command failed, " + "through to CVL event\n"); +@@ -5885,9 +5892,9 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba + } + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "0288 Unknown FCoE event type 0x%x event tag " +- "0x%x\n", event_type, acqe_fip->event_tag); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0288 Unknown FCoE event type 0x%x event tag " ++ "0x%x\n", event_type, acqe_fip->event_tag); + break; + } + } +@@ -5904,7 +5911,7 @@ lpfc_sli4_async_dcbx_evt(struct lpfc_hba + struct lpfc_acqe_dcbx *acqe_dcbx) + { + phba->fc_eventTag = acqe_dcbx->event_tag; +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0290 The SLI4 DCBX asynchronous event is not " + "handled yet\n"); + } +@@ -5981,7 +5988,8 @@ void lpfc_sli4_async_event_proc(struct l + lpfc_sli4_async_sli_evt(phba, &cq_event->cqe.acqe_sli); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "1804 Invalid asynchronous event code: " + "x%x\n", bf_get(lpfc_trailer_code, + &cq_event->cqe.mcqe_cmpl)); +@@ -6017,7 +6025,7 @@ void lpfc_sli4_fcf_redisc_event_proc(str + "2777 Start post-quiescent FCF table scan\n"); + rc = lpfc_sli4_fcf_scan_read_fcf_rec(phba, LPFC_FCOE_FCF_GET_FIRST); + if (rc) +- lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2747 Issue FCF scan read FCF mailbox " + "command failed 0x%x\n", rc); + } +@@ -6088,7 +6096,7 @@ static void lpfc_log_intr_mode(struct lp + "0480 Enabled MSI-X interrupt mode.\n"); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0482 Illegal interrupt mode.\n"); + break; + } +@@ -6136,7 +6144,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phb + out_disable_device: + pci_disable_device(pdev); + out_error: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1401 Failed to enable pci device\n"); + return -ENODEV; + } +@@ -6237,7 +6245,7 @@ lpfc_sli_probe_sriov_nr_virtfn(struct lp + + max_nr_vfn = lpfc_sli_sriov_nr_virtfn_get(phba); + if (nr_vfn > max_nr_vfn) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3057 Requested vfs (%d) greater than " + "supported vfs (%d)", nr_vfn, max_nr_vfn); + return -EINVAL; +@@ -6276,6 +6284,9 @@ lpfc_setup_driver_resource_phase1(struct + * Driver resources common to all SLI revisions + */ + atomic_set(&phba->fast_event_count, 0); ++ atomic_set(&phba->dbg_log_idx, 0); ++ atomic_set(&phba->dbg_log_cnt, 0); ++ atomic_set(&phba->dbg_log_dmping, 0); + spin_lock_init(&phba->hbalock); + + /* Initialize ndlp management spinlock */ +@@ -6702,7 +6713,8 @@ lpfc_sli4_driver_resource_setup(struct l + lpfc_read_nv(phba, mboxq); + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6016 Mailbox failed , mbxCmd x%x " + "READ_NV, mbxStatus x%x\n", + bf_get(lpfc_mqe_command, &mboxq->u.mqe), +@@ -6731,11 +6743,13 @@ lpfc_sli4_driver_resource_setup(struct l + + phba->nvmet_support = 1; /* a match */ + +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6017 NVME Target %016llx\n", + wwn); + #else +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "6021 Can't enable NVME Target." + " NVME_TARGET_FC infrastructure" + " is not in kernel\n"); +@@ -6795,9 +6809,9 @@ lpfc_sli4_driver_resource_setup(struct l + &phba->sli4_hba.sli_intf); + if (phba->sli4_hba.extents_in_use && + phba->sli4_hba.rpi_hdrs_in_use) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "2999 Unsupported SLI4 Parameters " +- "Extents and RPI headers enabled.\n"); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2999 Unsupported SLI4 Parameters " ++ "Extents and RPI headers enabled.\n"); + if (if_type == LPFC_SLI_INTF_IF_TYPE_0 && + if_fam == LPFC_SLI_INTF_FAMILY_BE2) { + mempool_free(mboxq, phba->mbox_mem_pool); +@@ -6957,13 +6971,13 @@ lpfc_sli4_driver_resource_setup(struct l + /* Allocate and initialize active sgl array */ + rc = lpfc_init_active_sgl_array(phba); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1430 Failed to initialize sgl list.\n"); + goto out_destroy_cq_event_pool; + } + rc = lpfc_sli4_init_rpi_hdrs(phba); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1432 Failed to initialize rpi headers.\n"); + goto out_free_active_sgl; + } +@@ -6984,7 +6998,7 @@ lpfc_sli4_driver_resource_setup(struct l + sizeof(struct lpfc_hba_eq_hdl), + GFP_KERNEL); + if (!phba->sli4_hba.hba_eq_hdl) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2572 Failed allocate memory for " + "fast-path per-EQ handle array\n"); + rc = -ENOMEM; +@@ -6995,7 +7009,7 @@ lpfc_sli4_driver_resource_setup(struct l + sizeof(struct lpfc_vector_map_info), + GFP_KERNEL); + if (!phba->sli4_hba.cpu_map) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3327 Failed allocate memory for msi-x " + "interrupt vector mapping\n"); + rc = -ENOMEM; +@@ -7004,7 +7018,7 @@ lpfc_sli4_driver_resource_setup(struct l + + phba->sli4_hba.eq_info = alloc_percpu(struct lpfc_eq_intr_info); + if (!phba->sli4_hba.eq_info) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3321 Failed allocation for per_cpu stats\n"); + rc = -ENOMEM; + goto out_free_hba_cpu_map; +@@ -7014,7 +7028,7 @@ lpfc_sli4_driver_resource_setup(struct l + sizeof(*phba->sli4_hba.idle_stat), + GFP_KERNEL); + if (!phba->sli4_hba.idle_stat) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3390 Failed allocation for idle_stat\n"); + rc = -ENOMEM; + goto out_free_hba_eq_info; +@@ -7023,7 +7037,7 @@ lpfc_sli4_driver_resource_setup(struct l + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + phba->sli4_hba.c_stat = alloc_percpu(struct lpfc_hdwq_stat); + if (!phba->sli4_hba.c_stat) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3332 Failed allocating per cpu hdwq stats\n"); + rc = -ENOMEM; + goto out_free_hba_idle_stat; +@@ -7171,7 +7185,7 @@ lpfc_init_api_table_setup(struct lpfc_hb + phba->lpfc_stop_port = lpfc_stop_port_s4; + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1431 Invalid HBA PCI-device group: 0x%x\n", + dev_grp); + return -ENODEV; +@@ -7466,7 +7480,7 @@ lpfc_sli4_init_rpi_hdrs(struct lpfc_hba + + rpi_hdr = lpfc_sli4_create_rpi_hdr(phba); + if (!rpi_hdr) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0391 Error during rpi post operation\n"); + lpfc_sli4_remove_rpis(phba); + rc = -ENODEV; +@@ -7778,7 +7792,7 @@ lpfc_setup_bg(struct lpfc_hba *phba, str + if (phba->cfg_prot_mask && phba->cfg_prot_guard) { + if ((old_mask != phba->cfg_prot_mask) || + (old_guard != phba->cfg_prot_guard)) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1475 Registering BlockGuard with the " + "SCSI layer: mask %d guard %d\n", + phba->cfg_prot_mask, +@@ -7787,7 +7801,7 @@ lpfc_setup_bg(struct lpfc_hba *phba, str + scsi_host_set_prot(shost, phba->cfg_prot_mask); + scsi_host_set_guard(shost, phba->cfg_prot_guard); + } else +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1479 Not Registering BlockGuard with the SCSI " + "layer, Bad protection parameters: %d %d\n", + old_mask, old_guard); +@@ -8018,7 +8032,7 @@ lpfc_sli4_post_status_check(struct lpfc_ + * other register reads as the data may not be valid. Just exit. + */ + if (port_error) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1408 Port Failed POST - portsmphr=0x%x, " + "perr=x%x, sfi=x%x, nip=x%x, ipc=x%x, scr1=x%x, " + "scr2=x%x, hscratch=x%x, pstatus=x%x\n", +@@ -8067,7 +8081,8 @@ lpfc_sli4_post_status_check(struct lpfc_ + readl(phba->sli4_hba.u.if_type0.UERRHIregaddr); + if ((~phba->sli4_hba.ue_mask_lo & uerrlo_reg.word0) || + (~phba->sli4_hba.ue_mask_hi & uerrhi_reg.word0)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "1422 Unrecoverable Error " + "Detected during POST " + "uerr_lo_reg=0x%x, " +@@ -8094,7 +8109,7 @@ lpfc_sli4_post_status_check(struct lpfc_ + phba->work_status[1] = + readl(phba->sli4_hba.u.if_type2. + ERR2regaddr); +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2888 Unrecoverable port error " + "following POST: port status reg " + "0x%x, port_smphr reg 0x%x, " +@@ -8488,7 +8503,7 @@ lpfc_sli4_read_config(struct lpfc_hba *p + + pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!pmb) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2011 Unable to allocate memory for issuing " + "SLI_CONFIG_SPECIAL mailbox command\n"); + return -ENOMEM; +@@ -8498,11 +8513,11 @@ lpfc_sli4_read_config(struct lpfc_hba *p + + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "2012 Mailbox failed , mbxCmd x%x " +- "READ_CONFIG, mbxStatus x%x\n", +- bf_get(lpfc_mqe_command, &pmb->u.mqe), +- bf_get(lpfc_mqe_status, &pmb->u.mqe)); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "2012 Mailbox failed , mbxCmd x%x " ++ "READ_CONFIG, mbxStatus x%x\n", ++ bf_get(lpfc_mqe_command, &pmb->u.mqe), ++ bf_get(lpfc_mqe_status, &pmb->u.mqe)); + rc = -EIO; + } else { + rd_config = &pmb->u.mqe.un.rd_config; +@@ -8612,7 +8627,7 @@ lpfc_sli4_read_config(struct lpfc_hba *p + /* Check to see if there is enough for NVME */ + if ((phba->cfg_irq_chann > qmin) || + (phba->cfg_hdw_queue > qmin)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2005 Reducing Queues: " + "WQ %d CQ %d EQ %d: min %d: " + "IRQ %d HDWQ %d\n", +@@ -8678,7 +8693,8 @@ lpfc_sli4_read_config(struct lpfc_hba *p + LPFC_USER_LINK_SPEED_AUTO; + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "0047 Unrecognized link " + "speed : %d\n", + forced_link_speed); +@@ -8715,7 +8731,7 @@ lpfc_sli4_read_config(struct lpfc_hba *p + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (rc2 || shdr_status || shdr_add_status) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3026 Mailbox failed , mbxCmd x%x " + "GET_FUNCTION_CONFIG, mbxStatus x%x\n", + bf_get(lpfc_mqe_command, &pmb->u.mqe), +@@ -8789,7 +8805,7 @@ lpfc_setup_endian_order(struct lpfc_hba + mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, + GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0492 Unable to allocate memory for " + "issuing SLI_CONFIG_SPECIAL mailbox " + "command\n"); +@@ -8804,7 +8820,7 @@ lpfc_setup_endian_order(struct lpfc_hba + memcpy(&mboxq->u.mqe, &endian_mb_data, sizeof(endian_mb_data)); + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0493 SLI_CONFIG_SPECIAL mailbox " + "failed with status x%x\n", + rc); +@@ -8884,8 +8900,9 @@ lpfc_alloc_io_wq_cq(struct lpfc_hba *phb + phba->sli4_hba.cq_esize, + phba->sli4_hba.cq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "0499 Failed allocate fast-path IO CQ (%d)\n", idx); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0499 Failed allocate fast-path IO CQ (%d)\n", ++ idx); + return 1; + } + qdesc->qe_valid = 1; +@@ -8907,7 +8924,7 @@ lpfc_alloc_io_wq_cq(struct lpfc_hba *phb + phba->sli4_hba.wq_ecount, cpu); + + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0503 Failed allocate fast-path IO WQ (%d)\n", + idx); + return 1; +@@ -8963,7 +8980,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->cfg_hdw_queue, sizeof(struct lpfc_sli4_hdw_queue), + GFP_KERNEL); + if (!phba->sli4_hba.hdwq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6427 Failed allocate memory for " + "fast-path Hardware Queue array\n"); + goto out_error; +@@ -8995,7 +9012,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + sizeof(struct lpfc_queue *), + GFP_KERNEL); + if (!phba->sli4_hba.nvmet_cqset) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3121 Fail allocate memory for " + "fast-path CQ set array\n"); + goto out_error; +@@ -9005,7 +9022,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + sizeof(struct lpfc_queue *), + GFP_KERNEL); + if (!phba->sli4_hba.nvmet_mrq_hdr) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3122 Fail allocate memory for " + "fast-path RQ set hdr array\n"); + goto out_error; +@@ -9015,7 +9032,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + sizeof(struct lpfc_queue *), + GFP_KERNEL); + if (!phba->sli4_hba.nvmet_mrq_data) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3124 Fail allocate memory for " + "fast-path RQ set data array\n"); + goto out_error; +@@ -9043,7 +9060,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.eq_esize, + phba->sli4_hba.eq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0497 Failed allocate EQ (%d)\n", + cpup->hdwq); + goto out_error; +@@ -9097,7 +9114,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.cq_ecount, + cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3142 Failed allocate NVME " + "CQ Set (%d)\n", idx); + goto out_error; +@@ -9119,7 +9136,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.cq_esize, + phba->sli4_hba.cq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0500 Failed allocate slow-path mailbox CQ\n"); + goto out_error; + } +@@ -9131,7 +9148,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.cq_esize, + phba->sli4_hba.cq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0501 Failed allocate slow-path ELS CQ\n"); + goto out_error; + } +@@ -9150,7 +9167,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.mq_esize, + phba->sli4_hba.mq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0505 Failed allocate slow-path MQ\n"); + goto out_error; + } +@@ -9166,7 +9183,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.wq_esize, + phba->sli4_hba.wq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0504 Failed allocate slow-path ELS WQ\n"); + goto out_error; + } +@@ -9180,7 +9197,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.cq_esize, + phba->sli4_hba.cq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6079 Failed allocate NVME LS CQ\n"); + goto out_error; + } +@@ -9193,7 +9210,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.wq_esize, + phba->sli4_hba.wq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6080 Failed allocate NVME LS WQ\n"); + goto out_error; + } +@@ -9211,7 +9228,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.rq_esize, + phba->sli4_hba.rq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0506 Failed allocate receive HRQ\n"); + goto out_error; + } +@@ -9222,7 +9239,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + phba->sli4_hba.rq_esize, + phba->sli4_hba.rq_ecount, cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0507 Failed allocate receive DRQ\n"); + goto out_error; + } +@@ -9240,7 +9257,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + LPFC_NVMET_RQE_DEF_COUNT, + cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3146 Failed allocate " + "receive HRQ\n"); + goto out_error; +@@ -9253,7 +9270,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + GFP_KERNEL, + cpu_to_node(cpu)); + if (qdesc->rqbp == NULL) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6131 Failed allocate " + "Header RQBP\n"); + goto out_error; +@@ -9269,7 +9286,7 @@ lpfc_sli4_queue_create(struct lpfc_hba * + LPFC_NVMET_RQE_DEF_COUNT, + cpu); + if (!qdesc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3156 Failed allocate " + "receive DRQ\n"); + goto out_error; +@@ -9460,7 +9477,7 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, + int rc; + + if (!eq || !cq || !wq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6085 Fast-path %s (%d) not allocated\n", + ((eq) ? ((cq) ? "WQ" : "CQ") : "EQ"), qidx); + return -ENOMEM; +@@ -9470,9 +9487,9 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, + rc = lpfc_cq_create(phba, cq, eq, + (qtype == LPFC_MBOX) ? LPFC_MCQ : LPFC_WCQ, qtype); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "6086 Failed setup of CQ (%d), rc = 0x%x\n", +- qidx, (uint32_t)rc); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "6086 Failed setup of CQ (%d), rc = 0x%x\n", ++ qidx, (uint32_t)rc); + return rc; + } + +@@ -9488,7 +9505,7 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, + /* create the wq */ + rc = lpfc_wq_create(phba, wq, cq, qtype); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "4618 Fail setup fastpath WQ (%d), rc = 0x%x\n", + qidx, (uint32_t)rc); + /* no need to tear down cq - caller will do so */ +@@ -9506,9 +9523,9 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, + } else { + rc = lpfc_mq_create(phba, wq, cq, LPFC_MBOX); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, +- "0539 Failed setup of slow-path MQ: " +- "rc = 0x%x\n", rc); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "0539 Failed setup of slow-path MQ: " ++ "rc = 0x%x\n", rc); + /* no need to tear down cq - caller will do so */ + return rc; + } +@@ -9581,7 +9598,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + /* Check for dual-ULP support */ + mboxq = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3249 Unable to allocate memory for " + "QUERY_FW_CFG mailbox command\n"); + return -ENOMEM; +@@ -9599,7 +9616,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3250 QUERY_FW_CFG mailbox failed with status " + "x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -9630,7 +9647,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + + /* Set up HBA event queue */ + if (!qp) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3147 Fast-path EQs not allocated\n"); + rc = -ENOMEM; + goto out_error; +@@ -9654,7 +9671,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + rc = lpfc_eq_create(phba, qp[cpup->hdwq].hba_eq, + phba->cfg_fcp_imax); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0523 Failed setup of fast-path" + " EQ (%d), rc = 0x%x\n", + cpup->eq, (uint32_t)rc); +@@ -9686,7 +9703,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + qidx, + LPFC_IO); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0535 Failed to setup fastpath " + "IO WQ/CQ (%d), rc = 0x%x\n", + qidx, (uint32_t)rc); +@@ -9701,7 +9718,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + /* Set up slow-path MBOX CQ/MQ */ + + if (!phba->sli4_hba.mbx_cq || !phba->sli4_hba.mbx_wq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0528 %s not allocated\n", + phba->sli4_hba.mbx_cq ? + "Mailbox WQ" : "Mailbox CQ"); +@@ -9714,14 +9731,14 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + phba->sli4_hba.mbx_wq, + NULL, 0, LPFC_MBOX); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0529 Failed setup of mailbox WQ/CQ: rc = 0x%x\n", + (uint32_t)rc); + goto out_destroy; + } + if (phba->nvmet_support) { + if (!phba->sli4_hba.nvmet_cqset) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3165 Fast-path NVME CQ Set " + "array not allocated\n"); + rc = -ENOMEM; +@@ -9733,7 +9750,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + qp, + LPFC_WCQ, LPFC_NVMET); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3164 Failed setup of NVME CQ " + "Set, rc = 0x%x\n", + (uint32_t)rc); +@@ -9745,7 +9762,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + qp[0].hba_eq, + LPFC_WCQ, LPFC_NVMET); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6089 Failed setup NVMET CQ: " + "rc = 0x%x\n", (uint32_t)rc); + goto out_destroy; +@@ -9762,7 +9779,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + + /* Set up slow-path ELS WQ/CQ */ + if (!phba->sli4_hba.els_cq || !phba->sli4_hba.els_wq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0530 ELS %s not allocated\n", + phba->sli4_hba.els_cq ? "WQ" : "CQ"); + rc = -ENOMEM; +@@ -9773,7 +9790,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + phba->sli4_hba.els_wq, + NULL, 0, LPFC_ELS); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0525 Failed setup of ELS WQ/CQ: rc = 0x%x\n", + (uint32_t)rc); + goto out_destroy; +@@ -9786,7 +9803,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) { + /* Set up NVME LS Complete Queue */ + if (!phba->sli4_hba.nvmels_cq || !phba->sli4_hba.nvmels_wq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6091 LS %s not allocated\n", + phba->sli4_hba.nvmels_cq ? "WQ" : "CQ"); + rc = -ENOMEM; +@@ -9797,7 +9814,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + phba->sli4_hba.nvmels_wq, + NULL, 0, LPFC_NVME_LS); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0526 Failed setup of NVVME LS WQ/CQ: " + "rc = 0x%x\n", (uint32_t)rc); + goto out_destroy; +@@ -9817,7 +9834,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + if ((!phba->sli4_hba.nvmet_cqset) || + (!phba->sli4_hba.nvmet_mrq_hdr) || + (!phba->sli4_hba.nvmet_mrq_data)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6130 MRQ CQ Queues not " + "allocated\n"); + rc = -ENOMEM; +@@ -9830,7 +9847,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + phba->sli4_hba.nvmet_cqset, + LPFC_NVMET); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6098 Failed setup of NVMET " + "MRQ: rc = 0x%x\n", + (uint32_t)rc); +@@ -9844,7 +9861,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + phba->sli4_hba.nvmet_cqset[0], + LPFC_NVMET); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6057 Failed setup of NVMET " + "Receive Queue: rc = 0x%x\n", + (uint32_t)rc); +@@ -9863,7 +9880,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + } + + if (!phba->sli4_hba.hdr_rq || !phba->sli4_hba.dat_rq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0540 Receive Queue not allocated\n"); + rc = -ENOMEM; + goto out_destroy; +@@ -9872,7 +9889,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + rc = lpfc_rq_create(phba, phba->sli4_hba.hdr_rq, phba->sli4_hba.dat_rq, + phba->sli4_hba.els_cq, LPFC_USOL); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0541 Failed setup of Receive Queue: " + "rc = 0x%x\n", (uint32_t)rc); + goto out_destroy; +@@ -9900,7 +9917,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *p + phba->sli4_hba.cq_lookup = kcalloc((phba->sli4_hba.cq_max + 1), + sizeof(struct lpfc_queue *), GFP_KERNEL); + if (!phba->sli4_hba.cq_lookup) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0549 Failed setup of CQ Lookup table: " + "size 0x%x\n", phba->sli4_hba.cq_max); + rc = -ENOMEM; +@@ -10200,7 +10217,7 @@ lpfc_pci_function_reset(struct lpfc_hba + mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, + GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0494 Unable to allocate memory for " + "issuing SLI_FUNCTION_RESET mailbox " + "command\n"); +@@ -10220,7 +10237,7 @@ lpfc_pci_function_reset(struct lpfc_hba + if (rc != MBX_TIMEOUT) + mempool_free(mboxq, phba->mbox_mem_pool); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0495 SLI_FUNCTION_RESET mailbox " + "failed with status x%x add_status x%x," + " mbx status x%x\n", +@@ -10252,7 +10269,7 @@ lpfc_pci_function_reset(struct lpfc_hba + phba->sli4_hba.u.if_type2.ERR1regaddr); + phba->work_status[1] = readl( + phba->sli4_hba.u.if_type2.ERR2regaddr); +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2890 Port not ready, port status reg " + "0x%x error 1=0x%x, error 2=0x%x\n", + reg_data.word0, +@@ -10294,7 +10311,7 @@ lpfc_pci_function_reset(struct lpfc_hba + out: + /* Catch the not-ready port failure after a port reset. */ + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3317 HBA not functional: IP Reset Failed " + "try: echo fw_reset > board_mode\n"); + rc = -ENODEV; +@@ -10344,7 +10361,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba + /* There is no SLI3 failback for SLI4 devices. */ + if (bf_get(lpfc_sli_intf_valid, &phba->sli4_hba.sli_intf) != + LPFC_SLI_INTF_VALID) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2894 SLI_INTF reg contents invalid " + "sli_intf reg 0x%x\n", + phba->sli4_hba.sli_intf.word0); +@@ -10619,7 +10636,7 @@ lpfc_sli_enable_msix(struct lpfc_hba *ph + + if (!pmb) { + rc = -ENOMEM; +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0474 Unable to allocate memory for issuing " + "MBOX_CONFIG_MSI command\n"); + goto mem_fail_out; +@@ -11600,7 +11617,7 @@ lpfc_sli4_enable_msix(struct lpfc_hba *p + } + + if (vectors != phba->cfg_irq_chann) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3238 Reducing IO channels to match number of " + "MSI-X vectors, requested %d got %d\n", + phba->cfg_irq_chann, vectors); +@@ -11873,17 +11890,17 @@ lpfc_sli4_xri_exchange_busy_wait(struct + while (!els_xri_cmpl || !io_xri_cmpl || !nvmet_xri_cmpl) { + if (wait_time > LPFC_XRI_EXCH_BUSY_WAIT_TMO) { + if (!nvmet_xri_cmpl) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6424 NVMET XRI exchange busy " + "wait time: %d seconds.\n", + wait_time/1000); + if (!io_xri_cmpl) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6100 IO XRI exchange busy " + "wait time: %d seconds.\n", + wait_time/1000); + if (!els_xri_cmpl) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2878 ELS XRI exchange busy " + "wait time: %d seconds.\n", + wait_time/1000); +@@ -12378,14 +12395,14 @@ lpfc_pci_probe_one_s3(struct pci_dev *pd + /* Configure and enable interrupt */ + intr_mode = lpfc_sli_enable_intr(phba, cfg_mode); + if (intr_mode == LPFC_INTR_ERROR) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0431 Failed to enable interrupt.\n"); + error = -ENODEV; + goto out_free_sysfs_attr; + } + /* SLI-3 HBA setup */ + if (lpfc_sli_hba_setup(phba)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1477 Failed to set up hba\n"); + error = -ENODEV; + goto out_remove_device; +@@ -12643,7 +12660,7 @@ lpfc_pci_resume_one_s3(struct pci_dev *p + /* Configure and enable interrupt */ + intr_mode = lpfc_sli_enable_intr(phba, phba->intr_mode); + if (intr_mode == LPFC_INTR_ERROR) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0430 PM resume Failed to enable interrupt\n"); + return -EIO; + } else +@@ -12669,7 +12686,7 @@ lpfc_pci_resume_one_s3(struct pci_dev *p + static void + lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) + { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2723 PCI channel I/O abort preparing for recovery\n"); + + /* +@@ -12690,7 +12707,7 @@ lpfc_sli_prep_dev_for_recover(struct lpf + static void + lpfc_sli_prep_dev_for_reset(struct lpfc_hba *phba) + { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2710 PCI channel disable preparing for reset\n"); + + /* Block any management I/Os to the device */ +@@ -12721,7 +12738,7 @@ lpfc_sli_prep_dev_for_reset(struct lpfc_ + static void + lpfc_sli_prep_dev_for_perm_failure(struct lpfc_hba *phba) + { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2711 PCI channel permanent disable for failure\n"); + /* Block all SCSI devices' I/Os on the host */ + lpfc_scsi_dev_block(phba); +@@ -12772,7 +12789,7 @@ lpfc_io_error_detected_s3(struct pci_dev + return PCI_ERS_RESULT_DISCONNECT; + default: + /* Unknown state, prepare and request slot reset */ +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0472 Unknown PCI error state: x%x\n", state); + lpfc_sli_prep_dev_for_reset(phba); + return PCI_ERS_RESULT_NEED_RESET; +@@ -12830,7 +12847,7 @@ lpfc_io_slot_reset_s3(struct pci_dev *pd + /* Configure and enable interrupt */ + intr_mode = lpfc_sli_enable_intr(phba, phba->intr_mode); + if (intr_mode == LPFC_INTR_ERROR) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0427 Cannot re-enable interrupt after " + "slot reset.\n"); + return PCI_ERS_RESULT_DISCONNECT; +@@ -12937,7 +12954,7 @@ lpfc_log_write_firmware_error(struct lpf + magic_number != MAGIC_NUMBER_G6) || + (phba->pcidev->device == PCI_DEVICE_ID_LANCER_G7_FC && + magic_number != MAGIC_NUMBER_G7)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3030 This firmware version is not supported on" + " this HBA model. Device:%x Magic:%x Type:%x " + "ID:%x Size %d %zd\n", +@@ -12945,7 +12962,7 @@ lpfc_log_write_firmware_error(struct lpf + fsize, fw->size); + rc = -EINVAL; + } else if (offset == ADD_STATUS_FW_DOWNLOAD_HW_DISABLED) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3021 Firmware downloads have been prohibited " + "by a system configuration setting on " + "Device:%x Magic:%x Type:%x ID:%x Size %d " +@@ -12954,7 +12971,7 @@ lpfc_log_write_firmware_error(struct lpf + fsize, fw->size); + rc = -EACCES; + } else { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3022 FW Download failed. Add Status x%x " + "Device:%x Magic:%x Type:%x ID:%x Size %d " + "%zd\n", +@@ -12999,7 +13016,7 @@ lpfc_write_firmware(const struct firmwar + INIT_LIST_HEAD(&dma_buffer_list); + lpfc_decode_firmware_rev(phba, fwrev, 1); + if (strncmp(fwrev, image->revision, strnlen(image->revision, 16))) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3023 Updating Firmware, Current Version:%s " + "New Version:%s\n", + fwrev, image->revision); +@@ -13049,7 +13066,7 @@ lpfc_write_firmware(const struct firmwar + } + rc = offset; + } else +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3029 Skipped Firmware update, Current " + "Version:%s New Version:%s\n", + fwrev, image->revision); +@@ -13064,10 +13081,10 @@ lpfc_write_firmware(const struct firmwar + release_firmware(fw); + out: + if (rc < 0) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3062 Firmware update error, status %d.\n", rc); + else +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3024 Firmware update success: size %d.\n", rc); + } + +@@ -13196,7 +13213,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pd + /* Configure and enable interrupt */ + intr_mode = lpfc_sli4_enable_intr(phba, cfg_mode); + if (intr_mode == LPFC_INTR_ERROR) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0426 Failed to enable interrupt.\n"); + error = -ENODEV; + goto out_unset_driver_resource; +@@ -13231,7 +13248,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pd + + /* Set up SLI-4 HBA */ + if (lpfc_sli4_hba_setup(phba)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1421 Failed to set up hba\n"); + error = -ENODEV; + goto out_free_sysfs_attr; +@@ -13256,7 +13273,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pd + */ + error = lpfc_nvme_create_localport(vport); + if (error) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6004 NVME registration " + "failed, error x%x\n", + error); +@@ -13490,7 +13507,7 @@ lpfc_pci_resume_one_s4(struct pci_dev *p + /* Configure and enable interrupt */ + intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode); + if (intr_mode == LPFC_INTR_ERROR) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0294 PM resume Failed to enable interrupt\n"); + return -EIO; + } else +@@ -13516,7 +13533,7 @@ lpfc_pci_resume_one_s4(struct pci_dev *p + static void + lpfc_sli4_prep_dev_for_recover(struct lpfc_hba *phba) + { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2828 PCI channel I/O abort preparing for recovery\n"); + /* + * There may be errored I/Os through HBA, abort all I/Os on txcmplq +@@ -13536,7 +13553,7 @@ lpfc_sli4_prep_dev_for_recover(struct lp + static void + lpfc_sli4_prep_dev_for_reset(struct lpfc_hba *phba) + { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2826 PCI channel disable preparing for reset\n"); + + /* Block any management I/Os to the device */ +@@ -13568,7 +13585,7 @@ lpfc_sli4_prep_dev_for_reset(struct lpfc + static void + lpfc_sli4_prep_dev_for_perm_failure(struct lpfc_hba *phba) + { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2827 PCI channel permanent disable for failure\n"); + + /* Block all SCSI devices' I/Os on the host */ +@@ -13618,7 +13635,7 @@ lpfc_io_error_detected_s4(struct pci_dev + return PCI_ERS_RESULT_DISCONNECT; + default: + /* Unknown state, prepare and request slot reset */ +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2825 Unknown PCI error state: x%x\n", state); + lpfc_sli4_prep_dev_for_reset(phba); + return PCI_ERS_RESULT_NEED_RESET; +@@ -13676,7 +13693,7 @@ lpfc_io_slot_reset_s4(struct pci_dev *pd + /* Configure and enable interrupt */ + intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode); + if (intr_mode == LPFC_INTR_ERROR) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2824 Cannot re-enable interrupt after " + "slot reset.\n"); + return PCI_ERS_RESULT_DISCONNECT; +@@ -13785,7 +13802,7 @@ lpfc_pci_remove_one(struct pci_dev *pdev + lpfc_pci_remove_one_s4(pdev); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1424 Invalid PCI device group: 0x%x\n", + phba->pci_dev_grp); + break; +@@ -13822,7 +13839,7 @@ lpfc_pci_suspend_one(struct pci_dev *pde + rc = lpfc_pci_suspend_one_s4(pdev, msg); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1425 Invalid PCI device group: 0x%x\n", + phba->pci_dev_grp); + break; +@@ -13858,7 +13875,7 @@ lpfc_pci_resume_one(struct pci_dev *pdev + rc = lpfc_pci_resume_one_s4(pdev); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1426 Invalid PCI device group: 0x%x\n", + phba->pci_dev_grp); + break; +@@ -13896,7 +13913,7 @@ lpfc_io_error_detected(struct pci_dev *p + rc = lpfc_io_error_detected_s4(pdev, state); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1427 Invalid PCI device group: 0x%x\n", + phba->pci_dev_grp); + break; +@@ -13933,7 +13950,7 @@ lpfc_io_slot_reset(struct pci_dev *pdev) + rc = lpfc_io_slot_reset_s4(pdev); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1428 Invalid PCI device group: 0x%x\n", + phba->pci_dev_grp); + break; +@@ -13965,7 +13982,7 @@ lpfc_io_resume(struct pci_dev *pdev) + lpfc_io_resume_s4(pdev); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1429 Invalid PCI device group: 0x%x\n", + phba->pci_dev_grp); + break; +@@ -14121,6 +14138,86 @@ lpfc_init(void) + return error; + } + ++void lpfc_dmp_dbg(struct lpfc_hba *phba) ++{ ++ unsigned int start_idx; ++ unsigned int dbg_cnt; ++ unsigned int temp_idx; ++ int i; ++ int j = 0; ++ unsigned long rem_nsec; ++ ++ if (phba->cfg_log_verbose) ++ return; ++ ++ if (atomic_cmpxchg(&phba->dbg_log_dmping, 0, 1) != 0) ++ return; ++ ++ start_idx = (unsigned int)atomic_read(&phba->dbg_log_idx) % DBG_LOG_SZ; ++ dbg_cnt = (unsigned int)atomic_read(&phba->dbg_log_cnt); ++ temp_idx = start_idx; ++ if (dbg_cnt >= DBG_LOG_SZ) { ++ dbg_cnt = DBG_LOG_SZ; ++ temp_idx -= 1; ++ } else { ++ if ((start_idx + dbg_cnt) > (DBG_LOG_SZ - 1)) { ++ temp_idx = (start_idx + dbg_cnt) % DBG_LOG_SZ; ++ } else { ++ if ((start_idx - dbg_cnt) < 0) { ++ start_idx = DBG_LOG_SZ - (dbg_cnt - start_idx); ++ temp_idx = 0; ++ } else { ++ start_idx -= dbg_cnt; ++ } ++ } ++ } ++ dev_info(&phba->pcidev->dev, "start %d end %d cnt %d\n", ++ start_idx, temp_idx, dbg_cnt); ++ ++ for (i = 0; i < dbg_cnt; i++) { ++ if ((start_idx + i) < DBG_LOG_SZ) ++ temp_idx = (start_idx + i) % (DBG_LOG_SZ - 1); ++ else ++ temp_idx = j++; ++ rem_nsec = do_div(phba->dbg_log[temp_idx].t_ns, NSEC_PER_SEC); ++ dev_info(&phba->pcidev->dev, "%d: [%5lu.%06lu] %s", ++ temp_idx, ++ (unsigned long)phba->dbg_log[temp_idx].t_ns, ++ rem_nsec / 1000, ++ phba->dbg_log[temp_idx].log); ++ } ++ atomic_set(&phba->dbg_log_cnt, 0); ++ atomic_set(&phba->dbg_log_dmping, 0); ++} ++ ++void lpfc_dbg_print(struct lpfc_hba *phba, const char *fmt, ...) ++{ ++ unsigned int idx; ++ va_list args; ++ int dbg_dmping = atomic_read(&phba->dbg_log_dmping); ++ struct va_format vaf; ++ ++ ++ va_start(args, fmt); ++ if (unlikely(dbg_dmping)) { ++ vaf.fmt = fmt; ++ vaf.va = &args; ++ dev_info(&phba->pcidev->dev, "%pV", &vaf); ++ va_end(args); ++ return; ++ } ++ idx = (unsigned int)atomic_fetch_add(1, &phba->dbg_log_idx) % ++ DBG_LOG_SZ; ++ ++ atomic_inc(&phba->dbg_log_cnt); ++ ++ vscnprintf(phba->dbg_log[idx].log, ++ sizeof(phba->dbg_log[idx].log), fmt, args); ++ va_end(args); ++ ++ phba->dbg_log[idx].t_ns = local_clock(); ++} ++ + /** + * lpfc_exit - lpfc module removal routine + * +--- a/drivers/scsi/lpfc/lpfc_logmsg.h ++++ b/drivers/scsi/lpfc/lpfc_logmsg.h +@@ -44,7 +44,11 @@ + #define LOG_NVME_DISC 0x00200000 /* NVME Discovery/Connect events. */ + #define LOG_NVME_ABTS 0x00400000 /* NVME ABTS events. */ + #define LOG_NVME_IOERR 0x00800000 /* NVME IO Error events. */ +-#define LOG_ALL_MSG 0xffffffff /* LOG all messages */ ++#define LOG_TRACE_EVENT 0x80000000 /* Dmp the DBG log on this err */ ++#define LOG_ALL_MSG 0x7fffffff /* LOG all messages */ ++ ++void lpfc_dmp_dbg(struct lpfc_hba *phba); ++void lpfc_dbg_print(struct lpfc_hba *phba, const char *fmt, ...); + + /* generate message by verbose log setting or severity */ + #define lpfc_vlog_msg(vport, level, mask, fmt, arg...) \ +@@ -65,9 +69,15 @@ do { \ + + #define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \ + do { \ +- { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '3')) \ ++ { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '3')) { \ ++ if ((mask) & LOG_TRACE_EVENT) \ ++ lpfc_dmp_dbg((vport)->phba); \ + dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \ +- fmt, (vport)->phba->brd_no, vport->vpi, ##arg); } \ ++ fmt, (vport)->phba->brd_no, vport->vpi, ##arg); \ ++ } else if (!(vport)->cfg_log_verbose) \ ++ lpfc_dbg_print((vport)->phba, "%d:(%d):" fmt, \ ++ (vport)->phba->brd_no, (vport)->vpi, ##arg); \ ++ } \ + } while (0) + + #define lpfc_printf_log(phba, level, mask, fmt, arg...) \ +@@ -75,8 +85,12 @@ do { \ + { uint32_t log_verbose = (phba)->pport ? \ + (phba)->pport->cfg_log_verbose : \ + (phba)->cfg_log_verbose; \ +- if (((mask) & log_verbose) || (level[1] <= '3')) \ ++ if (((mask) & log_verbose) || (level[1] <= '3')) { \ ++ if ((mask) & LOG_TRACE_EVENT) \ ++ lpfc_dmp_dbg(phba); \ + dev_printk(level, &((phba)->pcidev)->dev, "%d:" \ +- fmt, phba->brd_no, ##arg); \ ++ fmt, phba->brd_no, ##arg); \ ++ } else if (!(phba)->cfg_log_verbose)\ ++ lpfc_dbg_print(phba, "%d:" fmt, phba->brd_no, ##arg); \ + } \ + } while (0) +--- a/drivers/scsi/lpfc/lpfc_nportdisc.c ++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c +@@ -154,7 +154,7 @@ lpfc_check_sparm(struct lpfc_vport *vpor + memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name)); + return 1; + bad_service_param: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0207 Device %x " + "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent " + "invalid service parameters. Ignoring device.\n", +@@ -303,7 +303,7 @@ lpfc_defer_pt2pt_acc(struct lpfc_hba *ph + + /* Check for CONFIG_LINK error */ + if (mb->mbxStatus) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "4575 CONFIG_LINK fails pt2pt discovery: %x\n", + mb->mbxStatus); + mempool_free(login_mbox, phba->mbox_mem_pool); +@@ -318,7 +318,7 @@ lpfc_defer_pt2pt_acc(struct lpfc_hba *ph + rc = lpfc_els_rsp_acc(link_mbox->vport, ELS_CMD_PLOGI, + save_iocb, ndlp, login_mbox); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "4576 PLOGI ACC fails pt2pt discovery: %x\n", + rc); + mempool_free(login_mbox, phba->mbox_mem_pool); +@@ -363,7 +363,7 @@ lpfc_defer_acc_rsp(struct lpfc_hba *phba + lpfc_sli4_unreg_rpi_cmpl_clr(phba, pmb); + + if (!piocb) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY | LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "4578 PLOGI ACC fail\n"); + if (mbox) + mempool_free(mbox, phba->mbox_mem_pool); +@@ -372,7 +372,7 @@ lpfc_defer_acc_rsp(struct lpfc_hba *phba + + rc = lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, piocb, ndlp, mbox); + if (rc) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY | LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "4579 PLOGI ACC fail %x\n", rc); + if (mbox) + mempool_free(mbox, phba->mbox_mem_pool); +@@ -407,7 +407,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, + lp = (uint32_t *) pcmd->virt; + sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); + if (wwn_to_u64(sp->portName.u.wwn) == 0) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0140 PLOGI Reject: invalid nname\n"); + stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; + stat.un.b.lsRjtRsnCodeExp = LSEXP_INVALID_PNAME; +@@ -416,7 +416,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, + return 0; + } + if (wwn_to_u64(sp->nodeName.u.wwn) == 0) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0141 PLOGI Reject: invalid pname\n"); + stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; + stat.un.b.lsRjtRsnCodeExp = LSEXP_INVALID_NNAME; +@@ -483,7 +483,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, + } + if (nlp_portwwn != 0 && + nlp_portwwn != wwn_to_u64(sp->portName.u.wwn)) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0143 PLOGI recv'd from DID: x%x " + "WWPN changed: old %llx new %llx\n", + ndlp->nlp_DID, +@@ -686,7 +686,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, + return 1; + out: + if (defer_acc) +- lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "4577 discovery failure: %p %p %p\n", + save_iocb, link_mbox, login_mbox); + kfree(save_iocb); +@@ -1088,8 +1088,8 @@ lpfc_release_rpi(struct lpfc_hba *phba, + pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, + GFP_KERNEL); + if (!pmb) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, +- "2796 mailbox memory allocation failed \n"); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2796 mailbox memory allocation failed \n"); + else { + lpfc_unreg_login(phba, vport->vpi, rpi, pmb); + pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; +@@ -1127,7 +1127,7 @@ lpfc_disc_illegal(struct lpfc_vport *vpo + rpi = pmb->u.mb.un.varWords[0]; + lpfc_release_rpi(phba, vport, ndlp, rpi); + } +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0271 Illegal State Transition: node x%x " + "event x%x, state x%x Data: x%x x%x\n", + ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, +@@ -1145,11 +1145,11 @@ lpfc_cmpl_plogi_illegal(struct lpfc_vpor + * to stop it. + */ + if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, +- "0272 Illegal State Transition: node x%x " +- "event x%x, state x%x Data: x%x x%x\n", +- ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, +- ndlp->nlp_flag); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "0272 Illegal State Transition: node x%x " ++ "event x%x, state x%x Data: x%x x%x\n", ++ ndlp->nlp_DID, evt, ndlp->nlp_state, ++ ndlp->nlp_rpi, ndlp->nlp_flag); + } + return ndlp->nlp_state; + } +@@ -1369,7 +1369,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_ + if ((ndlp->nlp_DID != FDMI_DID) && + (wwn_to_u64(sp->portName.u.wwn) == 0 || + wwn_to_u64(sp->nodeName.u.wwn) == 0)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0142 PLOGI RSP: Invalid WWN.\n"); + goto out; + } +@@ -1431,7 +1431,8 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_ + } else { + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0133 PLOGI: no memory " + "for config_link " + "Data: x%x x%x x%x x%x\n", +@@ -1456,7 +1457,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_ + + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0018 PLOGI: no memory for reg_login " + "Data: x%x x%x x%x x%x\n", + ndlp->nlp_DID, ndlp->nlp_state, +@@ -1496,7 +1497,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_ + kfree(mp); + mempool_free(mbox, phba->mbox_mem_pool); + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0134 PLOGI: cannot issue reg_login " + "Data: x%x x%x x%x x%x\n", + ndlp->nlp_DID, ndlp->nlp_state, +@@ -1504,7 +1505,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_ + } else { + mempool_free(mbox, phba->mbox_mem_pool); + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0135 PLOGI: cannot format reg_login " + "Data: x%x x%x x%x x%x\n", + ndlp->nlp_DID, ndlp->nlp_state, +@@ -1515,7 +1516,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_ + out: + if (ndlp->nlp_DID == NameServer_DID) { + lpfc_vport_set_state(vport, FC_VPORT_FAILED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0261 Cannot Register NameServer login\n"); + } + +@@ -1937,8 +1938,8 @@ lpfc_cmpl_reglogin_reglogin_issue(struct + + if (mb->mbxStatus) { + /* RegLogin failed */ +- lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, +- "0246 RegLogin failed Data: x%x x%x x%x x%x " ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "0246 RegLogin failed Data: x%x x%x x%x x%x " + "x%x\n", + did, mb->mbxStatus, vport->port_state, + mb->un.varRegLogin.vpi, +--- a/drivers/scsi/lpfc/lpfc_nvme.c ++++ b/drivers/scsi/lpfc/lpfc_nvme.c +@@ -936,8 +936,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hb + + /* Sanity check on return of outstanding command */ + if (!lpfc_ncmd) { +- lpfc_printf_vlog(vport, KERN_ERR, +- LOG_NODE | LOG_NVME_IOERR, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6071 Null lpfc_ncmd pointer. No " + "release, skip completion\n"); + return; +@@ -948,7 +947,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hb + + if (!lpfc_ncmd->nvmeCmd) { + spin_unlock(&lpfc_ncmd->buf_lock); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE | LOG_NVME_IOERR, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6066 Missing cmpl ptrs: lpfc_ncmd x%px, " + "nvmeCmd x%px\n", + lpfc_ncmd, lpfc_ncmd->nvmeCmd); +@@ -981,7 +980,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hb + */ + ndlp = lpfc_ncmd->ndlp; + if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6062 Ignoring NVME cmpl. No ndlp\n"); + goto out_err; + } +@@ -1052,7 +1051,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hb + /* Sanity check */ + if (nCmd->rcv_rsplen == LPFC_NVME_ERSP_LEN) + break; +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6081 NVME Completion Protocol Error: " + "xri %x status x%x result x%x " + "placed x%x\n", +@@ -1296,7 +1295,7 @@ lpfc_nvme_prep_io_dma(struct lpfc_vport + first_data_sgl = sgl; + lpfc_ncmd->seg_cnt = nCmd->sg_cnt; + if (lpfc_ncmd->seg_cnt > lpfc_nvme_template.max_sgl_segments) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6058 Too many sg segments from " + "NVME Transport. Max %d, " + "nvmeIO sg_cnt %d\n", +@@ -1319,7 +1318,7 @@ lpfc_nvme_prep_io_dma(struct lpfc_vport + j = 2; + for (i = 0; i < nseg; i++) { + if (data_sg == NULL) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6059 dptr err %d, nseg %d\n", + i, nseg); + lpfc_ncmd->seg_cnt = 0; +@@ -1420,7 +1419,7 @@ lpfc_nvme_prep_io_dma(struct lpfc_vport + * and sg_cnt must zero. + */ + if (nCmd->payload_length != 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6063 NVME DMA Prep Err: sg_cnt %d " + "payload_length x%x\n", + nCmd->sg_cnt, nCmd->payload_length); +@@ -1783,7 +1782,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local + /* driver queued commands are in process of being flushed */ + if (phba->hba_flag & HBA_IOQ_FLUSH) { + spin_unlock_irqrestore(&phba->hbalock, flags); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6139 Driver in reset cleanup - flushing " + "NVME Req now. hba_flag x%x\n", + phba->hba_flag); +@@ -1793,13 +1792,13 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local + lpfc_nbuf = freqpriv->nvme_buf; + if (!lpfc_nbuf) { + spin_unlock_irqrestore(&phba->hbalock, flags); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6140 NVME IO req has no matching lpfc nvme " + "io buffer. Skipping abort req.\n"); + return; + } else if (!lpfc_nbuf->nvmeCmd) { + spin_unlock_irqrestore(&phba->hbalock, flags); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6141 lpfc NVME IO req has no nvme_fcreq " + "io buffer. Skipping abort req.\n"); + return; +@@ -1817,7 +1816,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local + * has not seen it yet. + */ + if (lpfc_nbuf->nvmeCmd != pnvme_fcreq) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6143 NVME req mismatch: " + "lpfc_nbuf x%px nvmeCmd x%px, " + "pnvme_fcreq x%px. Skipping Abort xri x%x\n", +@@ -1828,7 +1827,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local + + /* Don't abort IOs no longer on the pending queue. */ + if (!(nvmereq_wqe->iocb_flag & LPFC_IO_ON_TXCMPLQ)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6142 NVME IO req x%px not queued - skipping " + "abort req xri x%x\n", + pnvme_fcreq, nvmereq_wqe->sli4_xritag); +@@ -1842,7 +1841,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local + + /* Outstanding abort is in progress */ + if (nvmereq_wqe->iocb_flag & LPFC_DRIVER_ABORTED) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6144 Outstanding NVME I/O Abort Request " + "still pending on nvme_fcreq x%px, " + "lpfc_ncmd %px xri x%x\n", +@@ -1853,7 +1852,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local + + abts_buf = __lpfc_sli_get_iocbq(phba); + if (!abts_buf) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6136 No available abort wqes. Skipping " + "Abts req for nvme_fcreq x%px xri x%x\n", + pnvme_fcreq, nvmereq_wqe->sli4_xritag); +@@ -1874,7 +1873,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local + spin_unlock(&lpfc_nbuf->buf_lock); + spin_unlock_irqrestore(&phba->hbalock, flags); + if (ret_val) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6137 Failed abts issue_wqe with status x%x " + "for nvme_fcreq x%px.\n", + ret_val, pnvme_fcreq); +@@ -2145,7 +2144,7 @@ lpfc_nvme_lport_unreg_wait(struct lpfc_v + if (pring->txcmplq_cnt) + pending += pring->txcmplq_cnt; + } +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6176 Lport x%px Localport x%px wait " + "timed out. Pending %d. Renewing.\n", + lport, vport->localport, pending); +@@ -2363,7 +2362,7 @@ lpfc_nvme_register_port(struct lpfc_vpor + ndlp, prev_ndlp); + } else { + lpfc_printf_vlog(vport, KERN_ERR, +- LOG_NVME_DISC | LOG_NODE, ++ LOG_TRACE_EVENT, + "6031 RemotePort Registration failed " + "err: %d, DID x%06x\n", + ret, ndlp->nlp_DID); +@@ -2409,7 +2408,7 @@ lpfc_nvme_rescan_port(struct lpfc_vport + ndlp->nlp_state == NLP_STE_MAPPED_NODE) { + nvme_fc_rescan_remoteport(remoteport); + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6172 NVME rescanned DID x%06x " + "port_state x%x\n", + ndlp->nlp_DID, remoteport->port_state); +@@ -2492,7 +2491,7 @@ lpfc_nvme_unregister_port(struct lpfc_vp + ret = nvme_fc_unregister_remoteport(remoteport); + if (ret != 0) { + lpfc_nlp_put(ndlp); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6167 NVME unregister failed %d " + "port_state x%x\n", + ret, remoteport->port_state); +@@ -2502,7 +2501,7 @@ lpfc_nvme_unregister_port(struct lpfc_vp + + input_err: + #endif +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "6168 State error: lport x%px, rport x%px FCID x%06x\n", + vport->localport, ndlp->rport, ndlp->nlp_DID); + } +@@ -2587,7 +2586,7 @@ lpfc_nvme_wait_for_io_drain(struct lpfc_ + * dump a message. Something is wrong. + */ + if ((wait_cnt % 1000) == 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6178 NVME IO not empty, " + "cnt %d\n", wait_cnt); + } +--- a/drivers/scsi/lpfc/lpfc_nvmet.c ++++ b/drivers/scsi/lpfc/lpfc_nvmet.c +@@ -458,7 +458,7 @@ lpfc_nvmet_ctxbuf_post(struct lpfc_hba * + + if (!queue_work(phba->wq, &ctx_buf->defer_work)) { + atomic_inc(&tgtp->rcv_fcp_cmd_drop); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6181 Unable to queue deferred work " + "for oxid x%x. " + "FCP Drop IO [x%x x%x x%x]\n", +@@ -973,7 +973,7 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_ta + nvmewqeq = lpfc_nvmet_prep_fcp_wqe(phba, ctxp); + if (nvmewqeq == NULL) { + atomic_inc(&lpfc_nvmep->xmt_fcp_drop); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6152 FCP Drop IO x%x: Prep\n", + ctxp->oxid); + rc = -ENXIO; +@@ -1021,7 +1021,7 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_ta + + /* Give back resources */ + atomic_inc(&lpfc_nvmep->xmt_fcp_drop); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6153 FCP Drop IO x%x: Issue: %d\n", + ctxp->oxid, rc); + +@@ -1267,7 +1267,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_ + phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq, + sizeof(struct lpfc_nvmet_ctx_info), GFP_KERNEL); + if (!phba->sli4_hba.nvmet_ctx_info) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6419 Failed allocate memory for " + "nvmet context lists\n"); + return -ENOMEM; +@@ -1325,7 +1325,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_ + for (i = 0; i < phba->sli4_hba.nvmet_xri_cnt; i++) { + ctx_buf = kzalloc(sizeof(*ctx_buf), GFP_KERNEL); + if (!ctx_buf) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6404 Ran out of memory for NVMET\n"); + return -ENOMEM; + } +@@ -1334,7 +1334,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_ + GFP_KERNEL); + if (!ctx_buf->context) { + kfree(ctx_buf); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6405 Ran out of NVMET " + "context memory\n"); + return -ENOMEM; +@@ -1346,7 +1346,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_ + if (!ctx_buf->iocbq) { + kfree(ctx_buf->context); + kfree(ctx_buf); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6406 Ran out of NVMET iocb/WQEs\n"); + return -ENOMEM; + } +@@ -1365,7 +1365,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_ + lpfc_sli_release_iocbq(phba, ctx_buf->iocbq); + kfree(ctx_buf->context); + kfree(ctx_buf); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6407 Ran out of NVMET XRIs\n"); + return -ENOMEM; + } +@@ -1444,7 +1444,7 @@ lpfc_nvmet_create_targetport(struct lpfc + error = -ENOENT; + #endif + if (error) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6025 Cannot register NVME targetport x%x: " + "portnm %llx nodenm %llx segs %d qs %d\n", + error, +@@ -2014,7 +2014,7 @@ lpfc_nvmet_process_rcv_fcp_req(struct lp + unsigned long iflags; + + if (!nvmebuf) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6159 process_rcv_fcp_req, nvmebuf is NULL, " + "oxid: x%x flg: x%x state: x%x\n", + ctxp->oxid, ctxp->flag, ctxp->state); +@@ -2210,7 +2210,7 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_ + + ctx_buf = NULL; + if (!nvmebuf || !phba->targetport) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6157 NVMET FCP Drop IO\n"); + if (nvmebuf) + lpfc_rq_buf_free(phba, &nvmebuf->hbuf); +@@ -2325,7 +2325,7 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_ + + if (!queue_work(phba->wq, &ctx_buf->defer_work)) { + atomic_inc(&tgtp->rcv_fcp_cmd_drop); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6325 Unable to queue work for oxid x%x. " + "FCP Drop IO [x%x x%x x%x]\n", + ctxp->oxid, +@@ -2396,7 +2396,7 @@ lpfc_nvmet_unsol_fcp_event(struct lpfc_h + uint8_t cqflag) + { + if (!nvmebuf) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3167 NVMET FCP Drop IO\n"); + return; + } +@@ -2442,7 +2442,7 @@ lpfc_nvmet_prep_ls_wqe(struct lpfc_hba * + union lpfc_wqe128 *wqe; + + if (!lpfc_is_link_up(phba)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6104 NVMET prep LS wqe: link err: " + "NPORT x%x oxid:x%x ste %d\n", + ctxp->sid, ctxp->oxid, ctxp->state); +@@ -2452,7 +2452,7 @@ lpfc_nvmet_prep_ls_wqe(struct lpfc_hba * + /* Allocate buffer for command wqe */ + nvmewqe = lpfc_sli_get_iocbq(phba); + if (nvmewqe == NULL) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6105 NVMET prep LS wqe: No WQE: " + "NPORT x%x oxid x%x ste %d\n", + ctxp->sid, ctxp->oxid, ctxp->state); +@@ -2463,7 +2463,7 @@ lpfc_nvmet_prep_ls_wqe(struct lpfc_hba * + if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) || + ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && + (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6106 NVMET prep LS wqe: No ndlp: " + "NPORT x%x oxid x%x ste %d\n", + ctxp->sid, ctxp->oxid, ctxp->state); +@@ -2572,7 +2572,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba + int xc = 1; + + if (!lpfc_is_link_up(phba)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6107 NVMET prep FCP wqe: link err:" + "NPORT x%x oxid x%x ste %d\n", + ctxp->sid, ctxp->oxid, ctxp->state); +@@ -2583,7 +2583,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba + if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) || + ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && + (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6108 NVMET prep FCP wqe: no ndlp: " + "NPORT x%x oxid x%x ste %d\n", + ctxp->sid, ctxp->oxid, ctxp->state); +@@ -2591,7 +2591,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba + } + + if (rsp->sg_cnt > lpfc_tgttemplate.max_sgl_segments) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6109 NVMET prep FCP wqe: seg cnt err: " + "NPORT x%x oxid x%x ste %d cnt %d\n", + ctxp->sid, ctxp->oxid, ctxp->state, +@@ -2606,7 +2606,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba + /* Allocate buffer for command wqe */ + nvmewqe = ctxp->ctxbuf->iocbq; + if (nvmewqe == NULL) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6110 NVMET prep FCP wqe: No " + "WQE: NPORT x%x oxid x%x ste %d\n", + ctxp->sid, ctxp->oxid, ctxp->state); +@@ -3069,7 +3069,7 @@ lpfc_nvmet_xmt_ls_abort_cmp(struct lpfc_ + result, wcqe->word3); + + if (!ctxp) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6415 NVMET LS Abort No ctx: WCQE: " + "%08x %08x %08x %08x\n", + wcqe->word0, wcqe->total_data_placed, +@@ -3210,7 +3210,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lp + ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && + (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) { + atomic_inc(&tgtp->xmt_abort_rsp_error); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6160 Drop ABORT - wrong NDLP state x%x.\n", + (ndlp) ? ndlp->nlp_state : NLP_STE_MAX_STATE); + +@@ -3226,7 +3226,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lp + spin_lock_irqsave(&ctxp->ctxlock, flags); + if (!ctxp->abort_wqeq) { + atomic_inc(&tgtp->xmt_abort_rsp_error); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6161 ABORT failed: No wqeqs: " + "xri: x%x\n", ctxp->oxid); + /* No failure to an ABTS request. */ +@@ -3253,7 +3253,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lp + if (phba->hba_flag & HBA_IOQ_FLUSH) { + spin_unlock_irqrestore(&phba->hbalock, flags); + atomic_inc(&tgtp->xmt_abort_rsp_error); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6163 Driver in reset cleanup - flushing " + "NVME Req now. hba_flag x%x oxid x%x\n", + phba->hba_flag, ctxp->oxid); +@@ -3268,7 +3268,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lp + if (abts_wqeq->iocb_flag & LPFC_DRIVER_ABORTED) { + spin_unlock_irqrestore(&phba->hbalock, flags); + atomic_inc(&tgtp->xmt_abort_rsp_error); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6164 Outstanding NVME I/O Abort Request " + "still pending on oxid x%x\n", + ctxp->oxid); +@@ -3369,7 +3369,7 @@ lpfc_nvmet_unsol_fcp_issue_abort(struct + spin_unlock_irqrestore(&ctxp->ctxlock, flags); + + atomic_inc(&tgtp->xmt_abort_rsp_error); +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6135 Failed to Issue ABTS for oxid x%x. Status x%x " + "(%x)\n", + ctxp->oxid, rc, released); +@@ -3405,7 +3405,7 @@ lpfc_nvmet_unsol_ls_issue_abort(struct l + /* Issue ABTS for this WQE based on iotag */ + ctxp->wqeq = lpfc_sli_get_iocbq(phba); + if (!ctxp->wqeq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6068 Abort failed: No wqeqs: " + "xri: x%x\n", xri); + /* No failure to an ABTS request. */ +--- a/drivers/scsi/lpfc/lpfc_scsi.c ++++ b/drivers/scsi/lpfc/lpfc_scsi.c +@@ -867,11 +867,11 @@ lpfc_scsi_prep_dma_buf_s3(struct lpfc_hb + + lpfc_cmd->seg_cnt = nseg; + if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) { +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, +- "9064 BLKGRD: %s: Too many sg segments from " +- "dma_map_sg. Config %d, seg_cnt %d\n", +- __func__, phba->cfg_sg_seg_cnt, +- lpfc_cmd->seg_cnt); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "9064 BLKGRD: %s: Too many sg segments" ++ " from dma_map_sg. Config %d, seg_cnt" ++ " %d\n", __func__, phba->cfg_sg_seg_cnt, ++ lpfc_cmd->seg_cnt); + WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt); + lpfc_cmd->seg_cnt = 0; + scsi_dma_unmap(scsi_cmnd); +@@ -1061,7 +1061,8 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + * inserted in middle of the IO. + */ + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "9076 BLKGRD: Injecting reftag error: " + "write lba x%lx + x%x oldrefTag x%x\n", + (unsigned long)lba, blockoff, +@@ -1111,7 +1112,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + } + rc = BG_ERR_TGT | BG_ERR_CHECK; + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9078 BLKGRD: Injecting reftag error: " + "write lba x%lx\n", (unsigned long)lba); + break; +@@ -1132,7 +1133,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + } + rc = BG_ERR_INIT; + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9077 BLKGRD: Injecting reftag error: " + "write lba x%lx\n", (unsigned long)lba); + break; +@@ -1159,7 +1160,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + } + rc = BG_ERR_INIT; + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9079 BLKGRD: Injecting reftag error: " + "read lba x%lx\n", (unsigned long)lba); + break; +@@ -1181,7 +1182,8 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + * inserted in middle of the IO. + */ + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, + "9080 BLKGRD: Injecting apptag error: " + "write lba x%lx + x%x oldappTag x%x\n", + (unsigned long)lba, blockoff, +@@ -1230,7 +1232,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + } + rc = BG_ERR_TGT | BG_ERR_CHECK; + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0813 BLKGRD: Injecting apptag error: " + "write lba x%lx\n", (unsigned long)lba); + break; +@@ -1251,7 +1253,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + } + rc = BG_ERR_INIT; + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0812 BLKGRD: Injecting apptag error: " + "write lba x%lx\n", (unsigned long)lba); + break; +@@ -1278,7 +1280,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + } + rc = BG_ERR_INIT; + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0814 BLKGRD: Injecting apptag error: " + "read lba x%lx\n", (unsigned long)lba); + break; +@@ -1313,7 +1315,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + rc |= BG_ERR_TGT | BG_ERR_SWAP; + /* Signals the caller to swap CRC->CSUM */ + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0817 BLKGRD: Injecting guard error: " + "write lba x%lx\n", (unsigned long)lba); + break; +@@ -1335,7 +1337,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + rc = BG_ERR_INIT | BG_ERR_SWAP; + /* Signals the caller to swap CRC->CSUM */ + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0816 BLKGRD: Injecting guard error: " + "write lba x%lx\n", (unsigned long)lba); + break; +@@ -1363,7 +1365,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba + rc = BG_ERR_INIT | BG_ERR_SWAP; + /* Signals the caller to swap CRC->CSUM */ + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0818 BLKGRD: Injecting guard error: " + "read lba x%lx\n", (unsigned long)lba); + } +@@ -1413,7 +1415,7 @@ lpfc_sc_to_bg_opcodes(struct lpfc_hba *p + + case SCSI_PROT_NORMAL: + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9063 BLKGRD: Bad op/guard:%d/IP combination\n", + scsi_get_prot_op(sc)); + ret = 1; +@@ -1442,7 +1444,7 @@ lpfc_sc_to_bg_opcodes(struct lpfc_hba *p + + case SCSI_PROT_NORMAL: + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9075 BLKGRD: Bad op/guard:%d/CRC combination\n", + scsi_get_prot_op(sc)); + ret = 1; +@@ -1728,7 +1730,7 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba * + sgde = scsi_sglist(sc); + + if (!sgpe || !sgde) { +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9020 Invalid s/g entry: data=x%px prot=x%px\n", + sgpe, sgde); + return 0; +@@ -1840,7 +1842,7 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba * + return num_bde + 1; + + if (!sgde) { +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9065 BLKGRD:%s Invalid data segment\n", + __func__); + return 0; +@@ -1903,8 +1905,8 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba * + reftag += protgrp_blks; + } else { + /* if we're here, we have a bug */ +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, +- "9054 BLKGRD: bug in %s\n", __func__); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "9054 BLKGRD: bug in %s\n", __func__); + } + + } while (!alldone); +@@ -2154,7 +2156,7 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba * + sgde = scsi_sglist(sc); + + if (!sgpe || !sgde) { +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9082 Invalid s/g entry: data=x%px prot=x%px\n", + sgpe, sgde); + return 0; +@@ -2307,7 +2309,7 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba * + return num_sge + 1; + + if (!sgde) { +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9086 BLKGRD:%s Invalid data segment\n", + __func__); + return 0; +@@ -2412,8 +2414,8 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba * + reftag += protgrp_blks; + } else { + /* if we're here, we have a bug */ +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, +- "9085 BLKGRD: bug in %s\n", __func__); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "9085 BLKGRD: bug in %s\n", __func__); + } + + } while (!alldone); +@@ -2453,7 +2455,7 @@ lpfc_prot_group_type(struct lpfc_hba *ph + break; + default: + if (phba) +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9021 Unsupported protection op:%d\n", + op); + break; +@@ -2617,7 +2619,7 @@ lpfc_bg_scsi_prep_dma_buf_s3(struct lpfc + scsi_dma_unmap(scsi_cmnd); + lpfc_cmd->seg_cnt = 0; + +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9022 Unexpected protection group %i\n", + prot_group_type); + return 2; +@@ -2661,7 +2663,7 @@ lpfc_bg_scsi_prep_dma_buf_s3(struct lpfc + scsi_prot_sg_count(scsi_cmnd), + scsi_cmnd->sc_data_direction); + +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9023 Cannot setup S/G List for HBA" + "IO segs %d/%d BPL %d SCSI %d: %d %d\n", + lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt, +@@ -3085,11 +3087,12 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hb + lpfc_cmd->seg_cnt = nseg; + if (!phba->cfg_xpsgl && + lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) { +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, "9074 BLKGRD:" +- " %s: Too many sg segments from " +- "dma_map_sg. Config %d, seg_cnt %d\n", +- __func__, phba->cfg_sg_seg_cnt, +- lpfc_cmd->seg_cnt); ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ "9074 BLKGRD:" ++ " %s: Too many sg segments from " ++ "dma_map_sg. Config %d, seg_cnt %d\n", ++ __func__, phba->cfg_sg_seg_cnt, ++ lpfc_cmd->seg_cnt); + WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt); + lpfc_cmd->seg_cnt = 0; + scsi_dma_unmap(scsi_cmnd); +@@ -3366,7 +3369,7 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc + scsi_dma_unmap(scsi_cmnd); + lpfc_cmd->seg_cnt = 0; + +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9083 Unexpected protection group %i\n", + prot_group_type); + return 2; +@@ -3422,7 +3425,7 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc + scsi_prot_sg_count(scsi_cmnd), + scsi_cmnd->sc_data_direction); + +- lpfc_printf_log(phba, KERN_ERR, LOG_FCP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9084 Cannot setup S/G List for HBA" + "IO segs %d/%d SGL %d SCSI %d: %d %d\n", + lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt, +@@ -3632,17 +3635,17 @@ lpfc_handle_fcp_err(struct lpfc_vport *v + if (resp_info & RSP_LEN_VALID) { + rsplen = be32_to_cpu(fcprsp->rspRspLen); + if (rsplen != 0 && rsplen != 4 && rsplen != 8) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, +- "2719 Invalid response length: " +- "tgt x%x lun x%llx cmnd x%x rsplen x%x\n", +- cmnd->device->id, +- cmnd->device->lun, cmnd->cmnd[0], +- rsplen); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "2719 Invalid response length: " ++ "tgt x%x lun x%llx cmnd x%x rsplen " ++ "x%x\n", cmnd->device->id, ++ cmnd->device->lun, cmnd->cmnd[0], ++ rsplen); + host_status = DID_ERROR; + goto out; + } + if (fcprsp->rspInfo3 != RSP_NO_FAILURE) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2757 Protocol failure detected during " + "processing of FCP I/O op: " + "tgt x%x lun x%llx cmnd x%x rspInfo3 x%x\n", +@@ -3812,7 +3815,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba + /* Sanity check on return of outstanding command */ + cmd = lpfc_cmd->pCmd; + if (!cmd || !phba) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2621 IO completion: Not an active IO\n"); + spin_unlock(&lpfc_cmd->buf_lock); + return; +@@ -4277,7 +4280,7 @@ lpfc_scsi_api_table_setup(struct lpfc_hb + phba->lpfc_get_scsi_buf = lpfc_get_scsi_buf_s4; + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1418 Invalid HBA PCI-device group: 0x%x\n", + dev_grp); + return -ENODEV; +@@ -4324,7 +4327,7 @@ lpfc_tskmgmt_def_cmpl(struct lpfc_hba *p + * 0, successful + */ + int +-lpfc_check_pci_resettable(const struct lpfc_hba *phba) ++lpfc_check_pci_resettable(struct lpfc_hba *phba) + { + const struct pci_dev *pdev = phba->pcidev; + struct pci_dev *ptr = NULL; +@@ -4528,7 +4531,7 @@ lpfc_queuecommand(struct Scsi_Host *shos + if ((scsi_get_prot_op(cmnd) != SCSI_PROT_NORMAL) && + (!(phba->sli3_options & LPFC_SLI3_BG_ENABLED))) { + +- lpfc_printf_log(phba, KERN_ERR, LOG_BG, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "9058 BLKGRD: ERROR: rcvd protected cmd:%02x" + " op:%02x str=%s without registering for" + " BlockGuard - Rejecting command\n", +@@ -4887,7 +4890,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmn + + if (lpfc_cmd->pCmd == cmnd) { + ret = FAILED; +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0748 abort handler timed out waiting " + "for aborting I/O (xri:x%x) to complete: " + "ret %#x, ID %d, LUN %llu\n", +@@ -5080,7 +5083,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vp + (iocbqrsp->iocb.ulpStatus != IOSTAT_SUCCESS)) { + if (status != IOCB_SUCCESS || + iocbqrsp->iocb.ulpStatus != IOSTAT_FCP_RSP_ERROR) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0727 TMF %s to TGT %d LUN %llu " + "failed (%d, %d) iocb_flag x%x\n", + lpfc_taskmgmt_name(task_mgmt_cmd), +@@ -5195,7 +5198,7 @@ lpfc_reset_flush_io_context(struct lpfc_ + cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context); + } + if (cnt) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0724 I/O flush failure for context %s : cnt x%x\n", + ((context == LPFC_CTX_LUN) ? "LUN" : + ((context == LPFC_CTX_TGT) ? "TGT" : +@@ -5231,7 +5234,7 @@ lpfc_device_reset_handler(struct scsi_cm + + rdata = lpfc_rport_data_from_scsi_device(cmnd->device); + if (!rdata || !rdata->pnode) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0798 Device Reset rdata failure: rdata x%px\n", + rdata); + return FAILED; +@@ -5243,7 +5246,7 @@ lpfc_device_reset_handler(struct scsi_cm + + status = lpfc_chk_tgt_mapped(vport, cmnd); + if (status == FAILED) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0721 Device Reset rport failure: rdata x%px\n", rdata); + return FAILED; + } +@@ -5260,7 +5263,7 @@ lpfc_device_reset_handler(struct scsi_cm + status = lpfc_send_taskmgmt(vport, cmnd, tgt_id, lun_id, + FCP_LUN_RESET); + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0713 SCSI layer issued Device Reset (%d, %llu) " + "return x%x\n", tgt_id, lun_id, status); + +@@ -5302,7 +5305,7 @@ lpfc_target_reset_handler(struct scsi_cm + + rdata = lpfc_rport_data_from_scsi_device(cmnd->device); + if (!rdata || !rdata->pnode) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0799 Target Reset rdata failure: rdata x%px\n", + rdata); + return FAILED; +@@ -5314,7 +5317,7 @@ lpfc_target_reset_handler(struct scsi_cm + + status = lpfc_chk_tgt_mapped(vport, cmnd); + if (status == FAILED) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0722 Target Reset rport failure: rdata x%px\n", rdata); + if (pnode) { + spin_lock_irq(shost->host_lock); +@@ -5339,7 +5342,7 @@ lpfc_target_reset_handler(struct scsi_cm + status = lpfc_send_taskmgmt(vport, cmnd, tgt_id, lun_id, + FCP_TARGET_RESET); + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0723 SCSI layer issued Target Reset (%d, %llu) " + "return x%x\n", tgt_id, lun_id, status); + +@@ -5420,7 +5423,7 @@ lpfc_bus_reset_handler(struct scsi_cmnd + i, 0, FCP_TARGET_RESET); + + if (status != SUCCESS) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0700 Bus Reset on target %d failed\n", + i); + ret = FAILED; +@@ -5437,7 +5440,7 @@ lpfc_bus_reset_handler(struct scsi_cmnd + if (status != SUCCESS) + ret = FAILED; + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0714 SCSI layer issued Bus Reset Data: x%x\n", ret); + return ret; + } +@@ -5466,7 +5469,7 @@ lpfc_host_reset_handler(struct scsi_cmnd + struct lpfc_hba *phba = vport->phba; + int rc, ret = SUCCESS; + +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "3172 SCSI layer issued Host Reset Data:\n"); + + lpfc_offline_prep(phba, LPFC_MBX_WAIT); +@@ -5483,7 +5486,7 @@ lpfc_host_reset_handler(struct scsi_cmnd + + return ret; + error: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "3323 Failed host reset\n"); + lpfc_unblock_mgmt_io(phba); + return FAILED; +@@ -5594,7 +5597,7 @@ lpfc_slave_alloc(struct scsi_device *sde + } + num_allocated = lpfc_new_scsi_buf_s3(vport, num_to_alloc); + if (num_to_alloc != num_allocated) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0708 Allocation request of %d " + "command buffers did not succeed. " + "Allocated %d buffers.\n", +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -1570,7 +1570,7 @@ lpfc_sli_ring_map(struct lpfc_hba *phba) + lpfc_config_ring(phba, i, pmb); + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0446 Adapter failed to init (%d), " + "mbxCmd x%x CFG_RING, mbxStatus x%x, " + "ring %d\n", +@@ -1679,7 +1679,7 @@ lpfc_sli_next_iocb_slot (struct lpfc_hba + pring->sli.sli3.local_getidx = le32_to_cpu(pgp->cmdGetInx); + + if (unlikely(pring->sli.sli3.local_getidx >= max_cmd_idx)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0315 Ring %d issue: portCmdGet %d " + "is bigger than cmd ring %d\n", + pring->ringno, +@@ -1965,8 +1965,7 @@ lpfc_sli_next_hbq_slot(struct lpfc_hba * + hbqp->local_hbqGetIdx = getidx; + + if (unlikely(hbqp->local_hbqGetIdx >= hbqp->entry_count)) { +- lpfc_printf_log(phba, KERN_ERR, +- LOG_SLI | LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1802 HBQ %d: local_hbqGetIdx " + "%u is > than hbqp->entry_count %u\n", + hbqno, hbqp->local_hbqGetIdx, +@@ -2305,7 +2304,7 @@ lpfc_sli_hbqbuf_find(struct lpfc_hba *ph + } + } + spin_unlock_irq(&phba->hbalock); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1803 Bad hbq tag. Data: x%x x%x\n", + tag, phba->hbqs[tag >> 16].buffer_count); + return NULL; +@@ -2559,7 +2558,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba * + /* Check security permission status on INIT_LINK mailbox command */ + if ((pmb->u.mb.mbxCommand == MBX_INIT_LINK) && + (pmb->u.mb.mbxStatus == MBXERR_SEC_NO_PERMISSION)) +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2860 SLI authentication is required " + "for INIT_LINK but has not done yet\n"); + +@@ -2695,7 +2694,7 @@ lpfc_sli_handle_mb_event(struct lpfc_hba + if (lpfc_sli_chk_mbx_command(pmbox->mbxCommand) == + MBX_SHUTDOWN) { + /* Unknown mailbox command compl */ +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):0323 Unknown Mailbox command " + "x%x (x%x/x%x) Cmpl\n", + pmb->vport ? pmb->vport->vpi : +@@ -3059,7 +3058,7 @@ lpfc_sli_iocbq_lookup(struct lpfc_hba *p + } + + spin_unlock_irqrestore(temp_lock, iflag); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0317 iotag x%x is out of " + "range: max iotag x%x wd0 x%x\n", + iotag, phba->sli.last_iotag, +@@ -3106,7 +3105,7 @@ lpfc_sli_iocbq_lookup_by_tag(struct lpfc + } + + spin_unlock_irqrestore(temp_lock, iflag); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0372 iotag x%x lookup error: max iotag (x%x) " + "iocb_flag x%x\n", + iotag, phba->sli.last_iotag, +@@ -3282,7 +3281,7 @@ lpfc_sli_rsp_pointers_error(struct lpfc_ + * Ring handler: portRspPut is bigger than + * rsp ring + */ +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0312 Ring %d handler: portRspPut %d " + "is bigger than rsp ring %d\n", + pring->ringno, le32_to_cpu(pgp->rspPutInx), +@@ -3501,7 +3500,7 @@ lpfc_sli_handle_fast_ring_event(struct l + phba->brd_no, adaptermsg); + } else { + /* Unknown IOCB command */ +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0334 Unknown IOCB command " + "Data: x%x, x%x x%x x%x x%x\n", + type, irsp->ulpCommand, +@@ -3699,7 +3698,7 @@ lpfc_sli_sp_handle_rspiocb(struct lpfc_h + phba->brd_no, adaptermsg); + } else { + /* Unknown IOCB command */ +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0335 Unknown IOCB " + "command Data: x%x " + "x%x x%x x%x\n", +@@ -3779,7 +3778,7 @@ lpfc_sli_handle_slow_ring_event_s3(struc + * Ring handler: portRspPut is bigger than + * rsp ring + */ +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0303 Ring %d handler: portRspPut %d " + "is bigger than rsp ring %d\n", + pring->ringno, portRspPut, portRspMax); +@@ -4151,7 +4150,7 @@ lpfc_sli_brdready_s3(struct lpfc_hba *ph + + /* Check to see if any errors occurred during init */ + if ((status & HS_FFERM) || (i >= 20)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2751 Adapter failed to restart, " + "status reg x%x, FW Data: A8 x%x AC x%x\n", + status, +@@ -4373,7 +4372,7 @@ lpfc_sli_brdkill(struct lpfc_hba *phba) + if (retval != MBX_SUCCESS) { + if (retval != MBX_BUSY) + mempool_free(pmb, phba->mbox_mem_pool); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2752 KILL_BOARD command failed retval %d\n", + retval); + spin_lock_irq(&phba->hbalock); +@@ -4725,7 +4724,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *p + if (i++ >= 200) { + /* Adapter failed to init, timeout, status reg + */ +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0436 Adapter failed to init, " + "timeout, status reg x%x, " + "FW Data: A8 x%x AC x%x\n", status, +@@ -4740,7 +4739,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *p + /* ERROR: During chipset initialization */ + /* Adapter failed to init, chipset, status reg + */ +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0437 Adapter failed to init, " + "chipset, status reg x%x, " + "FW Data: A8 x%x AC x%x\n", status, +@@ -4771,7 +4770,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *p + if (status & HS_FFERM) { + /* ERROR: During chipset initialization */ + /* Adapter failed to init, chipset, status reg */ +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0438 Adapter failed to init, chipset, " + "status reg x%x, " + "FW Data: A8 x%x AC x%x\n", status, +@@ -4994,7 +4993,7 @@ lpfc_sli_config_port(struct lpfc_hba *ph + LPFC_SLI3_CRP_ENABLED | + LPFC_SLI3_DSS_ENABLED); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0442 Adapter failed to init, mbxCmd x%x " + "CONFIG_PORT, mbxStatus x%x Data: x%x\n", + pmb->u.mb.mbxCommand, pmb->u.mb.mbxStatus, 0); +@@ -5044,7 +5043,7 @@ lpfc_sli_config_port(struct lpfc_hba *ph + if (pmb->u.mb.un.varCfgPort.gbg == 0) { + phba->cfg_enable_bg = 0; + phba->sli3_options &= ~LPFC_SLI3_BG_ENABLED; +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0443 Adapter did not grant " + "BlockGuard\n"); + } +@@ -5083,7 +5082,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba + switch (phba->cfg_sli_mode) { + case 2: + if (phba->cfg_enable_npiv) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1824 NPIV enabled: Override sli_mode " + "parameter (%d) to auto (0).\n", + phba->cfg_sli_mode); +@@ -5095,7 +5094,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba + case 3: + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1819 Unrecognized sli_mode parameter: %d.\n", + phba->cfg_sli_mode); + +@@ -5106,7 +5105,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba + rc = lpfc_sli_config_port(phba, mode); + + if (rc && phba->cfg_sli_mode == 3) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1820 Unable to select SLI-3. " + "Not supported by adapter.\n"); + if (rc && mode != 2) +@@ -5199,7 +5198,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba + + lpfc_sli_hba_setup_error: + phba->link_state = LPFC_HBA_ERROR; +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0445 Firmware initialization failed\n"); + return rc; + } +@@ -5396,7 +5395,7 @@ lpfc_sli4_get_ctl_attr(struct lpfc_hba * + LPFC_SLI4_MBX_NEMBED); + + if (alloclen < reqlen) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3084 Allocated DMA memory size (%d) is " + "less than the requested DMA memory size " + "(%d)\n", alloclen, reqlen); +@@ -5656,7 +5655,7 @@ lpfc_sli4_get_avail_extnt_rsrc(struct lp + rsrc_info = &mbox->u.mqe.un.rsrc_extent_info; + if (bf_get(lpfc_mbox_hdr_status, + &rsrc_info->header.cfg_shdr.response)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2930 Failed to get resource extents " + "Status 0x%x Add'l Status 0x%x\n", + bf_get(lpfc_mbox_hdr_status, +@@ -5794,7 +5793,7 @@ lpfc_sli4_cfg_post_extnts(struct lpfc_hb + LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT, + req_len, *emb); + if (alloc_len < req_len) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2982 Allocated DMA memory size (x%x) is " + "less than the requested DMA memory " + "size (x%x)\n", alloc_len, req_len); +@@ -5850,7 +5849,7 @@ lpfc_sli4_alloc_extent(struct lpfc_hba * + return -EIO; + + if ((rsrc_cnt == 0) || (rsrc_size == 0)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3009 No available Resource Extents " + "for resource type 0x%x: Count: 0x%x, " + "Size 0x%x\n", type, rsrc_cnt, +@@ -6103,7 +6102,7 @@ lpfc_sli4_dealloc_extent(struct lpfc_hba + dealloc_rsrc = &mbox->u.mqe.un.dealloc_rsrc_extents; + if (bf_get(lpfc_mbox_hdr_status, + &dealloc_rsrc->header.cfg_shdr.response)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2919 Failed to release resource extents " + "for type %d - Status 0x%x Add'l Status 0x%x. " + "Resource memory not released.\n", +@@ -6297,7 +6296,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba + &ras_fwlog->lwpd.phys, + GFP_KERNEL); + if (!ras_fwlog->lwpd.virt) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6185 LWPD Memory Alloc Failed\n"); + + return -ENOMEM; +@@ -6359,7 +6358,7 @@ lpfc_sli4_ras_mbox_cmpl(struct lpfc_hba + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + + if (mb->mbxStatus != MBX_SUCCESS || shdr_status) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6188 FW LOG mailbox " + "completed with status x%x add_status x%x," + " mbx status x%x\n", +@@ -6427,7 +6426,7 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba + /* Setup Mailbox command */ + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6190 RAS MBX Alloc Failed"); + rc = -ENOMEM; + goto mem_free; +@@ -6475,7 +6474,7 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6191 FW-Log Mailbox failed. " + "status %d mbxStatus : x%x", rc, + bf_get(lpfc_mqe_status, &mbox->u.mqe)); +@@ -6611,7 +6610,7 @@ lpfc_sli4_alloc_resource_identifiers(str + /* RPIs. */ + count = phba->sli4_hba.max_cfg_param.max_rpi; + if (count <= 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3279 Invalid provisioning of " + "rpi:%d\n", count); + rc = -EINVAL; +@@ -6640,7 +6639,7 @@ lpfc_sli4_alloc_resource_identifiers(str + /* VPIs. */ + count = phba->sli4_hba.max_cfg_param.max_vpi; + if (count <= 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3280 Invalid provisioning of " + "vpi:%d\n", count); + rc = -EINVAL; +@@ -6669,7 +6668,7 @@ lpfc_sli4_alloc_resource_identifiers(str + /* XRIs. */ + count = phba->sli4_hba.max_cfg_param.max_xri; + if (count <= 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3281 Invalid provisioning of " + "xri:%d\n", count); + rc = -EINVAL; +@@ -6699,7 +6698,7 @@ lpfc_sli4_alloc_resource_identifiers(str + /* VFIs. */ + count = phba->sli4_hba.max_cfg_param.max_vfi; + if (count <= 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3282 Invalid provisioning of " + "vfi:%d\n", count); + rc = -EINVAL; +@@ -6878,7 +6877,7 @@ lpfc_sli4_get_allocated_extnts(struct lp + LPFC_MBOX_OPCODE_GET_ALLOC_RSRC_EXTENT, + req_len, emb); + if (alloc_len < req_len) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2983 Allocated DMA memory size (x%x) is " + "less than the requested DMA memory " + "size (x%x)\n", alloc_len, req_len); +@@ -6921,7 +6920,7 @@ lpfc_sli4_get_allocated_extnts(struct lp + } + + if (bf_get(lpfc_mbox_hdr_status, &shdr->response)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2984 Failed to read allocated resources " + "for type %d - Status 0x%x Add'l Status 0x%x.\n", + type, +@@ -7076,7 +7075,7 @@ lpfc_sli4_repost_sgl_list(struct lpfc_hb + spin_unlock(&phba->sli4_hba.sgl_list_lock); + spin_unlock_irq(&phba->hbalock); + } else { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3161 Failure to post sgl to port.\n"); + return -EIO; + } +@@ -7173,7 +7172,7 @@ lpfc_post_rq_buffer(struct lpfc_hba *phb + drqe.address_hi = putPaddrHigh(rqb_buffer->dbuf.phys); + rc = lpfc_sli4_rq_put(hrq, drq, &hrqe, &drqe); + if (rc < 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6421 Cannot post to HRQ %d: %x %x %x " + "DRQ %x %x\n", + hrq->queue_id, +@@ -7248,7 +7247,7 @@ static void lpfc_sli4_dip(struct lpfc_hb + return; + + if (bf_get(lpfc_sliport_status_dip, ®_data)) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2904 Firmware Dump Image Present" + " on Adapter"); + } +@@ -7334,7 +7333,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + phba->hba_flag &= ~HBA_IOQ_FLUSH; + + if (phba->sli_rev != LPFC_SLI_REV4) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0376 READ_REV Error. SLI Level %d " + "FCoE enabled %d\n", + phba->sli_rev, phba->hba_flag & HBA_FCOE_MODE); +@@ -7376,7 +7375,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + */ + rc = lpfc_parse_vpd(phba, vpd, vpd_size); + if (unlikely(!rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0377 Error %d parsing vpd. " + "Using defaults.\n", rc); + rc = 0; +@@ -7515,7 +7514,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + dd = bf_get(lpfc_mbx_set_feature_dd, &mboxq->u.mqe.un.set_feature); + if ((rc == MBX_SUCCESS) && (dd == LPFC_ENABLE_DUAL_DUMP)) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "6448 Dual Dump is enabled\n"); + else + lpfc_printf_log(phba, KERN_INFO, LOG_SLI | LOG_INIT, +@@ -7533,7 +7532,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + */ + rc = lpfc_sli4_alloc_resource_identifiers(phba); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2920 Failed to alloc Resource IDs " + "rc = x%x\n", rc); + goto out_free_mbox; +@@ -7572,7 +7571,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + kfree(mp); + mboxq->ctx_buf = NULL; + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0382 READ_SPARAM command failed " + "status %d, mbxStatus x%x\n", + rc, bf_get(lpfc_mqe_status, mqe)); +@@ -7590,7 +7589,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + /* Create all the SLI4 queues */ + rc = lpfc_sli4_queue_create(phba); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3089 Failed to allocate queues\n"); + rc = -ENODEV; + goto out_free_mbox; +@@ -7598,7 +7597,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + /* Set up all the queues to the device */ + rc = lpfc_sli4_queue_setup(phba); + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0381 Error %d during queue setup.\n ", rc); + goto out_stop_timers; + } +@@ -7609,7 +7608,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + /* update host els xri-sgl sizes and mappings */ + rc = lpfc_sli4_els_sgl_update(phba); + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1400 Failed to update xri-sgl size and " + "mapping: %d\n", rc); + goto out_destroy_queue; +@@ -7619,7 +7618,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + rc = lpfc_sli4_repost_sgl_list(phba, &phba->sli4_hba.lpfc_els_sgl_list, + phba->sli4_hba.els_xri_cnt); + if (unlikely(rc < 0)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0582 Error %d during els sgl post " + "operation\n", rc); + rc = -ENODEV; +@@ -7631,7 +7630,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + /* update host nvmet xri-sgl sizes and mappings */ + rc = lpfc_sli4_nvmet_sgl_update(phba); + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6308 Failed to update nvmet-sgl size " + "and mapping: %d\n", rc); + goto out_destroy_queue; +@@ -7643,7 +7642,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + &phba->sli4_hba.lpfc_nvmet_sgl_list, + phba->sli4_hba.nvmet_xri_cnt); + if (unlikely(rc < 0)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3117 Error %d during nvmet " + "sgl post\n", rc); + rc = -ENODEV; +@@ -7660,7 +7659,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + /* update host common xri-sgl sizes and mappings */ + rc = lpfc_sli4_io_sgl_update(phba); + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6082 Failed to update nvme-sgl size " + "and mapping: %d\n", rc); + goto out_destroy_queue; +@@ -7669,7 +7668,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + /* register the allocated common sgl pool to the port */ + rc = lpfc_sli4_repost_io_sgl_list(phba); + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6116 Error %d during nvme sgl post " + "operation\n", rc); + /* Some NVME buffers were moved to abort nvme list */ +@@ -7690,7 +7689,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + cnt); + rc = lpfc_init_iocb_list(phba, cnt); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1413 Failed to init iocb list.\n"); + goto out_destroy_queue; + } +@@ -7719,7 +7718,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + /* Post the rpi header region to the device. */ + rc = lpfc_sli4_post_all_rpi_hdrs(phba); + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0393 Error %d during rpi post operation\n", + rc); + rc = -ENODEV; +@@ -7863,12 +7862,12 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + + if (!(phba->hba_flag & HBA_FCOE_MODE) && + (phba->hba_flag & LINK_DISABLED)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3103 Adapter Link is disabled.\n"); + lpfc_down_link(phba, mboxq); + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3104 Adapter failed to issue " + "DOWN_LINK mbox cmd, rc:x%x\n", rc); + goto out_io_buff_free; +@@ -8075,7 +8074,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hb + } + + /* Mbox cmd timeout */ +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0310 Mailbox command x%x timeout Data: x%x x%x x%px\n", + mb->mbxCommand, + phba->pport->port_state, +@@ -8097,7 +8096,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hb + + lpfc_sli_abort_fcp_rings(phba); + +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0345 Resetting board due to mailbox timeout\n"); + + /* Reset the HBA device */ +@@ -8195,7 +8194,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + spin_unlock_irqrestore(&phba->hbalock, drvr_flag); + + /* Mbox command cannot issue */ +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):0311 Mailbox command x%x cannot " + "issue Data: x%x x%x\n", + pmbox->vport ? pmbox->vport->vpi : 0, +@@ -8207,7 +8206,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + if (lpfc_readl(phba->HCregaddr, &hc_copy) || + !(hc_copy & HC_MBINT_ENA)) { + spin_unlock_irqrestore(&phba->hbalock, drvr_flag); +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2528 Mailbox command x%x cannot " + "issue Data: x%x x%x\n", + pmbox->vport ? pmbox->vport->vpi : 0, +@@ -8226,7 +8225,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + spin_unlock_irqrestore(&phba->hbalock, drvr_flag); + + /* Mbox command cannot issue */ +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2529 Mailbox command x%x " + "cannot issue Data: x%x x%x\n", + pmbox->vport ? pmbox->vport->vpi : 0, +@@ -8238,7 +8237,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + if (!(psli->sli_flag & LPFC_SLI_ACTIVE)) { + spin_unlock_irqrestore(&phba->hbalock, drvr_flag); + /* Mbox command cannot issue */ +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2530 Mailbox command x%x " + "cannot issue Data: x%x x%x\n", + pmbox->vport ? pmbox->vport->vpi : 0, +@@ -8291,7 +8290,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + psli->sli_flag &= ~LPFC_SLI_MBOX_ACTIVE; + spin_unlock_irqrestore(&phba->hbalock, drvr_flag); + /* Mbox command cannot issue */ +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2531 Mailbox command x%x " + "cannot issue Data: x%x x%x\n", + pmbox->vport ? pmbox->vport->vpi : 0, +@@ -8682,7 +8681,7 @@ lpfc_sli4_post_sync_mbox(struct lpfc_hba + spin_lock_irqsave(&phba->hbalock, iflag); + if (psli->sli_flag & LPFC_SLI_MBOX_ACTIVE) { + spin_unlock_irqrestore(&phba->hbalock, iflag); +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2532 Mailbox command x%x (x%x/x%x) " + "cannot issue Data: x%x x%x\n", + mboxq->vport ? mboxq->vport->vpi : 0, +@@ -8803,7 +8802,7 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba * + + rc = lpfc_mbox_dev_check(phba); + if (unlikely(rc)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2544 Mailbox command x%x (x%x/x%x) " + "cannot issue Data: x%x x%x\n", + mboxq->vport ? mboxq->vport->vpi : 0, +@@ -8880,7 +8879,7 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba * + /* Now, interrupt mode asynchronous mailbox command */ + rc = lpfc_mbox_cmd_check(phba, mboxq); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2543 Mailbox command x%x (x%x/x%x) " + "cannot issue Data: x%x x%x\n", + mboxq->vport ? mboxq->vport->vpi : 0, +@@ -8948,7 +8947,7 @@ lpfc_sli4_post_async_mbox(struct lpfc_hb + } + if (unlikely(phba->sli.mbox_active)) { + spin_unlock_irqrestore(&phba->hbalock, iflags); +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0384 There is pending active mailbox cmd\n"); + return MBX_NOT_FINISHED; + } +@@ -9009,7 +9008,7 @@ lpfc_sli4_post_async_mbox(struct lpfc_hb + /* Post the mailbox command to the port */ + rc = lpfc_sli4_mq_put(phba->sli4_hba.mbx_wq, mqe); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):2533 Mailbox command x%x (x%x/x%x) " + "cannot issue Data: x%x x%x\n", + mboxq->vport ? mboxq->vport->vpi : 0, +@@ -9085,7 +9084,7 @@ lpfc_mbox_api_table_setup(struct lpfc_hb + phba->lpfc_sli_brdready = lpfc_sli_brdready_s4; + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1420 Invalid HBA PCI-device group: 0x%x\n", + dev_grp); + return -ENODEV; +@@ -9186,8 +9185,7 @@ static int + if (piocb->iocb_cmpl && (!piocb->vport) && + (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) && + (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) { +- lpfc_printf_log(phba, KERN_ERR, +- LOG_SLI | LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1807 IOCB x%x failed. No vport\n", + piocb->iocb.ulpCommand); + dump_stack(); +@@ -9482,7 +9480,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba + else + ndlp = (struct lpfc_nodelist *)iocbq->context1; + if (!iocbq->iocb.ulpLe) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2007 Only Limited Edition cmd Format" + " supported 0x%x\n", + iocbq->iocb.ulpCommand); +@@ -9790,7 +9788,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba + /* word6 context tag copied in memcpy */ + if (iocbq->iocb.ulpCt_h || iocbq->iocb.ulpCt_l) { + ct = ((iocbq->iocb.ulpCt_h << 1) | iocbq->iocb.ulpCt_l); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2015 Invalid CT %x command 0x%x\n", + ct, iocbq->iocb.ulpCommand); + return IOCB_ERROR; +@@ -9969,7 +9967,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba + case CMD_FCP_TRSP64_CX: /* Target mode rcv */ + case CMD_FCP_AUTO_TRSP_CX: /* Auto target rsp */ + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2014 Invalid command 0x%x\n", + iocbq->iocb.ulpCommand); + return IOCB_ERROR; +@@ -10131,7 +10129,7 @@ lpfc_sli_api_table_setup(struct lpfc_hba + phba->__lpfc_sli_release_iocbq = __lpfc_sli_release_iocbq_s4; + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1419 Invalid HBA PCI-device group: 0x%x\n", + dev_grp); + return -ENODEV; +@@ -10391,13 +10389,13 @@ lpfc_sli_async_event_handler(struct lpfc + temp_event_data.event_type = FC_REG_TEMPERATURE_EVENT; + if (evt_code == ASYNC_TEMP_WARN) { + temp_event_data.event_code = LPFC_THRESHOLD_TEMP; +- lpfc_printf_log(phba, KERN_ERR, LOG_TEMP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0347 Adapter is very hot, please take " + "corrective action. temperature : %d Celsius\n", + (uint32_t) icmd->ulpContext); + } else { + temp_event_data.event_code = LPFC_NORMAL_TEMP; +- lpfc_printf_log(phba, KERN_ERR, LOG_TEMP, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0340 Adapter temperature is OK now. " + "temperature : %d Celsius\n", + (uint32_t) icmd->ulpContext); +@@ -10414,7 +10412,7 @@ lpfc_sli_async_event_handler(struct lpfc + break; + default: + iocb_w = (uint32_t *) icmd; +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0346 Ring %d handler: unexpected ASYNC_STATUS" + " evt_code 0x%x\n" + "W0 0x%08x W1 0x%08x W2 0x%08x W3 0x%08x\n" +@@ -11088,7 +11086,7 @@ lpfc_sli_ring_taggedbuf_get(struct lpfc_ + } + + spin_unlock_irq(&phba->hbalock); +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0402 Cannot find virtual addr for buffer tag on " + "ring %d Data x%lx x%px x%px x%x\n", + pring->ringno, (unsigned long) tag, +@@ -11132,7 +11130,7 @@ lpfc_sli_ringpostbuf_get(struct lpfc_hba + } + + spin_unlock_irq(&phba->hbalock); +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0410 Cannot find virtual addr for mapped buf on " + "ring %d Data x%llx x%px x%px x%x\n", + pring->ringno, (unsigned long long)phys, +@@ -12026,12 +12024,12 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba + * completed. Not that it completed successfully. + * */ + } else if (timeleft == 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0338 IOCB wait timeout error - no " + "wake response Data x%x\n", timeout); + retval = IOCB_TIMEDOUT; + } else { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0330 IOCB wake NOT set, " + "Data x%x x%lx\n", + timeout, (timeleft / jiffies)); +@@ -12293,7 +12291,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *ph + } + if ((~phba->sli4_hba.ue_mask_lo & uerr_sta_lo) || + (~phba->sli4_hba.ue_mask_hi & uerr_sta_hi)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1423 HBA Unrecoverable error: " + "uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, " + "ue_mask_lo_reg=0x%x, " +@@ -12324,7 +12322,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *ph + readl(phba->sli4_hba.u.if_type2.ERR1regaddr); + phba->work_status[1] = + readl(phba->sli4_hba.u.if_type2.ERR2regaddr); +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2885 Port Status Event: " + "port status reg 0x%x, " + "port smphr reg 0x%x, " +@@ -12340,7 +12338,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *ph + break; + case LPFC_SLI_INTF_IF_TYPE_1: + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2886 HBA Error Attention on unsupported " + "if type %d.", if_type); + return 1; +@@ -12404,7 +12402,7 @@ lpfc_sli_check_eratt(struct lpfc_hba *ph + ha_copy = lpfc_sli4_eratt_read(phba); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0299 Invalid SLI revision (%d)\n", + phba->sli_rev); + ha_copy = 0; +@@ -12637,8 +12635,7 @@ lpfc_sli_sp_intr_handler(int irq, void * + * Stray Mailbox Interrupt, mbxCommand + * mbxStatus + */ +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | +- LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "(%d):0304 Stray Mailbox " + "Interrupt mbxCommand x%x " + "mbxStatus x%x\n", +@@ -12698,7 +12695,7 @@ lpfc_sli_sp_intr_handler(int irq, void * + if (rc != MBX_BUSY) + lpfc_printf_log(phba, + KERN_ERR, +- LOG_MBOX | LOG_SLI, ++ LOG_TRACE_EVENT, + "0350 rc should have" + "been MBX_BUSY\n"); + if (rc != MBX_NOT_FINISHED) +@@ -12727,8 +12724,9 @@ lpfc_sli_sp_intr_handler(int irq, void * + MBX_NOWAIT); + } while (rc == MBX_NOT_FINISHED); + if (rc != MBX_SUCCESS) +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | +- LOG_SLI, "0349 rc should be " ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, ++ "0349 rc should be " + "MBX_SUCCESS\n"); + } + +@@ -13155,7 +13153,7 @@ lpfc_cq_event_setup(struct lpfc_hba *phb + /* Allocate a new internal CQ_EVENT entry */ + cq_event = lpfc_sli4_cq_event_alloc(phba); + if (!cq_event) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0602 Failed to alloc CQ_EVENT entry\n"); + return NULL; + } +@@ -13230,7 +13228,7 @@ lpfc_sli4_sp_handle_mbox_event(struct lp + spin_lock_irqsave(&phba->hbalock, iflags); + pmb = phba->sli.mbox_active; + if (unlikely(!pmb)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1832 No pending MBOX command to handle\n"); + spin_unlock_irqrestore(&phba->hbalock, iflags); + goto out_no_mqe_complete; +@@ -13279,8 +13277,9 @@ lpfc_sli4_sp_handle_mbox_event(struct lp + pmb->vport = vport; + rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); + if (rc != MBX_BUSY) +- lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | +- LOG_SLI, "0385 rc should " ++ lpfc_printf_log(phba, KERN_ERR, ++ LOG_TRACE_EVENT, ++ "0385 rc should " + "have been MBX_BUSY\n"); + if (rc != MBX_NOT_FINISHED) + goto send_current_mbox; +@@ -13387,7 +13386,7 @@ lpfc_sli4_sp_handle_els_wcqe(struct lpfc + txq_cnt++; + if (!list_empty(&pring->txcmplq)) + txcmplq_cnt++; +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0387 NO IOCBQ data: txq_cnt=%d iocb_cnt=%d " + "els_txcmplq_cnt=%d\n", + txq_cnt, phba->iocb_cnt, +@@ -13478,7 +13477,7 @@ lpfc_sli4_sp_handle_abort_xri_wcqe(struc + workposted = true; + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0603 Invalid CQ subtype %d: " + "%08x %08x %08x %08x\n", + cq->subtype, wcqe->word0, wcqe->parameter, +@@ -13526,7 +13525,7 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba + status = bf_get(lpfc_rcqe_status, rcqe); + switch (status) { + case FC_STATUS_RQ_BUF_LEN_EXCEEDED: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2537 Receive Frame Truncated!!\n"); + /* fall through */ + case FC_STATUS_RQ_SUCCESS: +@@ -13563,7 +13562,7 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba + case FC_STATUS_INSUFF_BUF_FRM_DISC: + if (phba->nvmet_support) { + tgtp = phba->targetport->private; +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6402 RQE Error x%x, posted %d err_cnt " + "%d: %x %x %x\n", + status, hrq->RQ_buf_posted, +@@ -13635,7 +13634,7 @@ lpfc_sli4_sp_handle_cqe(struct lpfc_hba + (struct lpfc_rcqe *)&cqevt); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0388 Not a valid WCQE code: x%x\n", + bf_get(lpfc_cqe_code, &cqevt)); + break; +@@ -13675,7 +13674,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba + } + if (unlikely(!cq)) { + if (phba->sli.sli_flag & LPFC_SLI_ACTIVE) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0365 Slow-path CQ identifier " + "(%d) does not exist\n", cqid); + return; +@@ -13690,7 +13689,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba + ret = queue_work_on(cq->chann, phba->wq, &cq->spwork); + + if (!ret) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0390 Cannot schedule queue work " + "for CQ eqcqid=%d, cqid=%d on CPU %d\n", + cqid, cq->queue_id, raw_smp_processor_id()); +@@ -13828,7 +13827,7 @@ static void + &delay, LPFC_QUEUE_WORK); + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0370 Invalid completion queue type (%d)\n", + cq->type); + return; +@@ -13842,7 +13841,7 @@ static void + ret = queue_delayed_work_on(cq->chann, phba->wq, + &cq->sched_spwork, delay); + if (!ret) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0394 Cannot schedule queue work " + "for cqid=%d on CPU %d\n", + cq->queue_id, cq->chann); +@@ -14052,7 +14051,7 @@ lpfc_sli4_nvmet_handle_rcqe(struct lpfc_ + status = bf_get(lpfc_rcqe_status, rcqe); + switch (status) { + case FC_STATUS_RQ_BUF_LEN_EXCEEDED: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6126 Receive Frame Truncated!!\n"); + /* fall through */ + case FC_STATUS_RQ_SUCCESS: +@@ -14092,7 +14091,7 @@ lpfc_sli4_nvmet_handle_rcqe(struct lpfc_ + case FC_STATUS_INSUFF_BUF_FRM_DISC: + if (phba->nvmet_support) { + tgtp = phba->targetport->private; +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6401 RQE Error x%x, posted %d err_cnt " + "%d: %x %x %x\n", + status, hrq->RQ_buf_posted, +@@ -14166,7 +14165,7 @@ lpfc_sli4_fp_handle_cqe(struct lpfc_hba + } + break; + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0144 Not a valid CQE code: x%x\n", + bf_get(lpfc_wcqe_c_code, &wcqe)); + break; +@@ -14204,7 +14203,7 @@ static void lpfc_sli4_sched_cq_work(stru + else + ret = queue_work_on(cq->chann, phba->wq, &cq->irqwork); + if (!ret) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0383 Cannot schedule queue work " + "for CQ eqcqid=%d, cqid=%d on CPU %d\n", + cqid, cq->queue_id, +@@ -14233,7 +14232,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba + uint16_t cqid, id; + + if (unlikely(bf_get_le32(lpfc_eqe_major_code, eqe) != 0)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0366 Not a valid completion " + "event: majorcode=x%x, minorcode=x%x\n", + bf_get_le32(lpfc_eqe_major_code, eqe), +@@ -14276,7 +14275,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba + + process_cq: + if (unlikely(cqid != cq->queue_id)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0368 Miss-matched fast-path completion " + "queue identifier: eqcqid=%d, fcpcqid=%d\n", + cqid, cq->queue_id); +@@ -14330,7 +14329,7 @@ static void + ret = queue_delayed_work_on(cq->chann, phba->wq, + &cq->sched_irqwork, delay); + if (!ret) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0367 Cannot schedule queue work " + "for cqid=%d on CPU %d\n", + cq->queue_id, cq->chann); +@@ -14861,7 +14860,7 @@ lpfc_modify_hba_eq_delay(struct lpfc_hba + + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_FCP | LOG_NVME, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6428 Failed allocating mailbox cmd buffer." + " EQ delay was not set.\n"); + return; +@@ -14903,7 +14902,7 @@ lpfc_modify_hba_eq_delay(struct lpfc_hba + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2512 MODIFY_EQ_DELAY mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -14980,7 +14979,7 @@ lpfc_eq_create(struct lpfc_hba *phba, st + dmult); + switch (eq->entry_count) { + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0360 Unsupported EQ count. (%d)\n", + eq->entry_count); + if (eq->entry_count < 256) { +@@ -15024,7 +15023,7 @@ lpfc_eq_create(struct lpfc_hba *phba, st + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2500 EQ_CREATE mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -15129,7 +15128,7 @@ lpfc_cq_create(struct lpfc_hba *phba, st + } + /* fall through */ + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0361 Unsupported CQ count: " + "entry cnt %d sz %d pg cnt %d\n", + cq->entry_count, cq->entry_size, +@@ -15165,7 +15164,7 @@ lpfc_cq_create(struct lpfc_hba *phba, st + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2501 CQ_CREATE mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -15252,7 +15251,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba + LPFC_MBOX_OPCODE_FCOE_CQ_CREATE_SET, length, + LPFC_SLI4_MBX_NEMBED); + if (alloclen < length) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3098 Allocated DMA memory size (%d) is " + "less than the requested DMA memory size " + "(%d)\n", alloclen, length); +@@ -15306,7 +15305,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba + } + /* fall through */ + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3118 Bad CQ count. (%d)\n", + cq->entry_count); + if (cq->entry_count < 256) { +@@ -15424,7 +15423,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3119 CQ_CREATE_SET mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -15582,7 +15581,7 @@ lpfc_mq_create(struct lpfc_hba *phba, st + cq->queue_id); + switch (mq->entry_count) { + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0362 Unsupported MQ count. (%d)\n", + mq->entry_count); + if (mq->entry_count < 16) { +@@ -15638,7 +15637,7 @@ lpfc_mq_create(struct lpfc_hba *phba, st + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2502 MQ_CREATE mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -15787,7 +15786,7 @@ lpfc_wq_create(struct lpfc_hba *phba, st + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2503 WQ_CREATE mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -15814,7 +15813,7 @@ lpfc_wq_create(struct lpfc_hba *phba, st + &wq_create->u.response); + if ((wq->db_format != LPFC_DB_LIST_FORMAT) && + (wq->db_format != LPFC_DB_RING_FORMAT)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3265 WQ[%d] doorbell format " + "not supported: x%x\n", + wq->queue_id, wq->db_format); +@@ -15826,7 +15825,7 @@ lpfc_wq_create(struct lpfc_hba *phba, st + bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba, + pci_barset); + if (!bar_memmap_p) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3263 WQ[%d] failed to memmap " + "pci barset:x%x\n", + wq->queue_id, pci_barset); +@@ -15836,7 +15835,7 @@ lpfc_wq_create(struct lpfc_hba *phba, st + db_offset = wq_create->u.response.doorbell_offset; + if ((db_offset != LPFC_ULP0_WQ_DOORBELL) && + (db_offset != LPFC_ULP1_WQ_DOORBELL)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3252 WQ[%d] doorbell offset " + "not supported: x%x\n", + wq->queue_id, db_offset); +@@ -15860,7 +15859,7 @@ lpfc_wq_create(struct lpfc_hba *phba, st + bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba, + pci_barset); + if (!bar_memmap_p) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3267 WQ[%d] failed to memmap " + "pci barset:x%x\n", + wq->queue_id, pci_barset); +@@ -15876,7 +15875,7 @@ lpfc_wq_create(struct lpfc_hba *phba, st + bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba, + dpp_barset); + if (!bar_memmap_p) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3268 WQ[%d] failed to memmap " + "pci barset:x%x\n", + wq->queue_id, dpp_barset); +@@ -16000,7 +15999,7 @@ lpfc_rq_create(struct lpfc_hba *phba, st + } else { + switch (hrq->entry_count) { + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2535 Unsupported RQ count. (%d)\n", + hrq->entry_count); + if (hrq->entry_count < 512) { +@@ -16051,7 +16050,7 @@ lpfc_rq_create(struct lpfc_hba *phba, st + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2504 RQ_CREATE mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16069,7 +16068,7 @@ lpfc_rq_create(struct lpfc_hba *phba, st + &rq_create->u.response); + if ((hrq->db_format != LPFC_DB_LIST_FORMAT) && + (hrq->db_format != LPFC_DB_RING_FORMAT)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3262 RQ [%d] doorbell format not " + "supported: x%x\n", hrq->queue_id, + hrq->db_format); +@@ -16081,7 +16080,7 @@ lpfc_rq_create(struct lpfc_hba *phba, st + &rq_create->u.response); + bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba, pci_barset); + if (!bar_memmap_p) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3269 RQ[%d] failed to memmap pci " + "barset:x%x\n", hrq->queue_id, + pci_barset); +@@ -16092,7 +16091,7 @@ lpfc_rq_create(struct lpfc_hba *phba, st + db_offset = rq_create->u.response.doorbell_offset; + if ((db_offset != LPFC_ULP0_RQ_DOORBELL) && + (db_offset != LPFC_ULP1_RQ_DOORBELL)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3270 RQ[%d] doorbell offset not " + "supported: x%x\n", hrq->queue_id, + db_offset); +@@ -16137,7 +16136,7 @@ lpfc_rq_create(struct lpfc_hba *phba, st + } else { + switch (drq->entry_count) { + default: +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2536 Unsupported RQ count. (%d)\n", + drq->entry_count); + if (drq->entry_count < 512) { +@@ -16274,7 +16273,7 @@ lpfc_mrq_create(struct lpfc_hba *phba, s + LPFC_MBOX_OPCODE_FCOE_RQ_CREATE, length, + LPFC_SLI4_MBX_NEMBED); + if (alloclen < length) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3099 Allocated DMA memory size (%d) is " + "less than the requested DMA memory size " + "(%d)\n", alloclen, length); +@@ -16384,7 +16383,7 @@ lpfc_mrq_create(struct lpfc_hba *phba, s + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3120 RQ_CREATE mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16454,7 +16453,7 @@ lpfc_eq_destroy(struct lpfc_hba *phba, s + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2505 EQ_DESTROY mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16509,7 +16508,7 @@ lpfc_cq_destroy(struct lpfc_hba *phba, s + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2506 CQ_DESTROY mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16563,7 +16562,7 @@ lpfc_mq_destroy(struct lpfc_hba *phba, s + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2507 MQ_DESTROY mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16616,7 +16615,7 @@ lpfc_wq_destroy(struct lpfc_hba *phba, s + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2508 WQ_DESTROY mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16673,7 +16672,7 @@ lpfc_rq_destroy(struct lpfc_hba *phba, s + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2509 RQ_DESTROY mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16689,7 +16688,7 @@ lpfc_rq_destroy(struct lpfc_hba *phba, s + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2510 RQ_DESTROY mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16737,7 +16736,7 @@ lpfc_sli4_post_sgl(struct lpfc_hba *phba + union lpfc_sli4_cfg_shdr *shdr; + + if (xritag == NO_XRI) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0364 Invalid param:\n"); + return -EINVAL; + } +@@ -16778,7 +16777,7 @@ lpfc_sli4_post_sgl(struct lpfc_hba *phba + if (rc != MBX_TIMEOUT) + mempool_free(mbox, phba->mbox_mem_pool); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2511 POST_SGL mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -16909,7 +16908,7 @@ lpfc_sli4_post_sgl_list(struct lpfc_hba + reqlen = post_cnt * sizeof(struct sgl_page_pairs) + + sizeof(union lpfc_sli4_cfg_shdr) + sizeof(uint32_t); + if (reqlen > SLI4_PAGE_SIZE) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2559 Block sgl registration required DMA " + "size (%d) great than a page\n", reqlen); + return -ENOMEM; +@@ -16925,7 +16924,7 @@ lpfc_sli4_post_sgl_list(struct lpfc_hba + LPFC_SLI4_MBX_NEMBED); + + if (alloclen < reqlen) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "0285 Allocated DMA memory size (%d) is " + "less than the requested DMA memory " + "size (%d)\n", alloclen, reqlen); +@@ -16973,7 +16972,7 @@ lpfc_sli4_post_sgl_list(struct lpfc_hba + if (rc != MBX_TIMEOUT) + lpfc_sli4_mbox_cmd_free(phba, mbox); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2513 POST_SGL_BLOCK mailbox command failed " + "status x%x add_status x%x mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -17021,7 +17020,7 @@ lpfc_sli4_post_io_sgl_block(struct lpfc_ + } + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6119 Failed to allocate mbox cmd memory\n"); + return -ENOMEM; + } +@@ -17032,7 +17031,7 @@ lpfc_sli4_post_io_sgl_block(struct lpfc_ + reqlen, LPFC_SLI4_MBX_NEMBED); + + if (alloclen < reqlen) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6120 Allocated DMA memory size (%d) is " + "less than the requested DMA memory " + "size (%d)\n", alloclen, reqlen); +@@ -17086,7 +17085,7 @@ lpfc_sli4_post_io_sgl_block(struct lpfc_ + if (rc != MBX_TIMEOUT) + lpfc_sli4_mbox_cmd_free(phba, mbox); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "6125 POST_SGL_BLOCK mailbox command failed " + "status x%x add_status x%x mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -17670,7 +17669,7 @@ lpfc_sli4_seq_abort_rsp_cmpl(struct lpfc + + /* Failure means BLS ABORT RSP did not get delivered to remote node*/ + if (rsp_iocbq && rsp_iocbq->iocb.ulpStatus) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3154 BLS ABORT RSP failed, data: x%x/x%x\n", + rsp_iocbq->iocb.ulpStatus, + rsp_iocbq->iocb.un.ulpWord[4]); +@@ -17833,7 +17832,7 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_vpor + + rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, ctiocb, 0); + if (rc == IOCB_ERROR) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2925 Failed to issue CT ABTS RSP x%x on " + "xri x%x, Data x%x\n", + icmd->un.xseq64.w5.hcsw.Rctl, oxid, +@@ -18083,7 +18082,7 @@ lpfc_sli4_send_seq_to_ulp(struct lpfc_vp + fc_hdr = (struct fc_frame_header *)seq_dmabuf->hbuf.virt; + iocbq = lpfc_prep_seq(vport, seq_dmabuf); + if (!iocbq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2707 Ring %d handler: Failed to allocate " + "iocb Rctl x%x Type x%x received\n", + LPFC_ELS_RING, +@@ -18094,7 +18093,7 @@ lpfc_sli4_send_seq_to_ulp(struct lpfc_vp + phba->sli4_hba.els_wq->pring, + iocbq, fc_hdr->fh_r_ctl, + fc_hdr->fh_type)) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2540 Ring %d handler: unexpected Rctl " + "x%x Type x%x received\n", + LPFC_ELS_RING, +@@ -18359,7 +18358,7 @@ lpfc_sli4_post_all_rpi_hdrs(struct lpfc_ + + rc = lpfc_sli4_post_rpi_hdr(phba, rpi_page); + if (rc != MBX_SUCCESS) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2008 Error %d posting all rpi " + "headers\n", rc); + rc = -EIO; +@@ -18405,7 +18404,7 @@ lpfc_sli4_post_rpi_hdr(struct lpfc_hba * + /* The port is notified of the header region via a mailbox command. */ + mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2001 Unable to allocate memory for issuing " + "SLI_CONFIG_SPECIAL mailbox command\n"); + return -ENOMEM; +@@ -18435,7 +18434,7 @@ lpfc_sli4_post_rpi_hdr(struct lpfc_hba * + if (rc != MBX_TIMEOUT) + mempool_free(mboxq, phba->mbox_mem_pool); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2514 POST_RPI_HDR mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -18525,7 +18524,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phb + if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) { + rpi_hdr = lpfc_sli4_create_rpi_hdr(phba); + if (!rpi_hdr) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2002 Error Could not grow rpi " + "count\n"); + } else { +@@ -18627,7 +18626,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelis + mboxq->vport = ndlp->vport; + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2010 Resume RPI Mailbox failed " + "status %d, mbxStatus x%x\n", rc, + bf_get(lpfc_mqe_status, &mboxq->u.mqe)); +@@ -18662,7 +18661,7 @@ lpfc_sli4_init_vpi(struct lpfc_vport *vp + mbox_tmo = lpfc_mbox_tmo_val(phba, mboxq); + rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); + if (rc != MBX_SUCCESS) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "2022 INIT VPI Mailbox failed " + "status %d, mbxStatus x%x\n", rc, + bf_get(lpfc_mqe_status, &mboxq->u.mqe)); +@@ -18698,7 +18697,7 @@ lpfc_mbx_cmpl_add_fcf_record(struct lpfc + + if ((shdr_status || shdr_add_status) && + (shdr_status != STATUS_FCF_IN_USE)) +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2558 ADD_FCF_RECORD mailbox failed with " + "status x%x add_status x%x\n", + shdr_status, shdr_add_status); +@@ -18728,7 +18727,7 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba + + mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2009 Failed to allocate mbox for ADD_FCF cmd\n"); + return -ENOMEM; + } +@@ -18741,7 +18740,7 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba + LPFC_MBOX_OPCODE_FCOE_ADD_FCF, + req_len, LPFC_SLI4_MBX_NEMBED); + if (alloc_len < req_len) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2523 Allocated DMA memory size (x%x) is " + "less than the requested DMA memory " + "size (x%x)\n", alloc_len, req_len); +@@ -18774,7 +18773,7 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba + mboxq->mbox_cmpl = lpfc_mbx_cmpl_add_fcf_record; + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2515 ADD_FCF_RECORD mailbox failed with " + "status 0x%x\n", rc); + lpfc_sli4_mbox_cmd_free(phba, mboxq); +@@ -18847,7 +18846,7 @@ lpfc_sli4_fcf_scan_read_fcf_rec(struct l + phba->fcoe_cvl_eventtag_attn = phba->fcoe_cvl_eventtag; + mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2000 Failed to allocate mbox for " + "READ_FCF cmd\n"); + error = -ENOMEM; +@@ -19290,7 +19289,7 @@ lpfc_sli4_redisc_fcf_table(struct lpfc_h + + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) { +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2745 Failed to allocate mbox for " + "requesting FCF rediscover.\n"); + return -ENOMEM; +@@ -19365,7 +19364,7 @@ lpfc_sli_get_config_region23(struct lpfc + + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!pmb) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2600 failed to allocate mailbox memory\n"); + return 0; + } +@@ -19424,7 +19423,7 @@ lpfc_sli4_get_config_region23(struct lpf + + mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3105 failed to allocate mailbox memory\n"); + return 0; + } +@@ -19488,7 +19487,7 @@ lpfc_sli_read_link_ste(struct lpfc_hba * + + /* Check the region signature first */ + if (memcmp(&rgn23_data[offset], LPFC_REGION23_SIGNATURE, 4)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2619 Config region 23 has bad signature\n"); + goto out; + } +@@ -19496,7 +19495,7 @@ lpfc_sli_read_link_ste(struct lpfc_hba * + + /* Check the data structure version */ + if (rgn23_data[offset] != LPFC_REGION23_VERSION) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2620 Config region 23 has bad version\n"); + goto out; + } +@@ -19673,7 +19672,7 @@ lpfc_wr_object(struct lpfc_hba *phba, st + if (rc != MBX_TIMEOUT) + mempool_free(mbox, phba->mbox_mem_pool); + if (shdr_status || shdr_add_status || rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3025 Write Object mailbox failed with " + "status x%x add_status x%x, mbx status x%x\n", + shdr_status, shdr_add_status, rc); +@@ -19853,7 +19852,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) + piocbq = lpfc_sli_ringtx_get(phba, pring); + if (!piocbq) { + spin_unlock_irqrestore(&pring->ring_lock, iflags); +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2823 txq empty and txq_cnt is %d\n ", + txq_cnt); + break; +@@ -19882,7 +19881,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) + + if (fail_msg) { + /* Failed means we can't issue and need to cancel */ +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2822 IOCB failed %s iotag 0x%x " + "xri 0x%x\n", + fail_msg, +--- a/drivers/scsi/lpfc/lpfc_vport.c ++++ b/drivers/scsi/lpfc/lpfc_vport.c +@@ -145,7 +145,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, + rc = lpfc_sli_issue_mbox_wait(phba, pmb, phba->fc_ratov * 2); + if (rc != MBX_SUCCESS) { + if (signal_pending(current)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1830 Signal aborted mbxCmd x%x\n", + mb->mbxCommand); + lpfc_mbuf_free(phba, mp->virt, mp->phys); +@@ -154,7 +154,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, + mempool_free(pmb, phba->mbox_mem_pool); + return -EINTR; + } else { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1818 VPort failed init, mbxCmd x%x " + "READ_SPARM mbxStatus x%x, rc = x%x\n", + mb->mbxCommand, mb->mbxStatus, rc); +@@ -190,7 +190,7 @@ lpfc_valid_wwn_format(struct lpfc_hba *p + ((wwn->u.wwn[0] & 0xf) != 0 || (wwn->u.wwn[1] & 0xf) != 0))) + return 1; + +- lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1822 Invalid %s: %02x:%02x:%02x:%02x:" + "%02x:%02x:%02x:%02x\n", + name_type, +@@ -284,11 +284,11 @@ static void lpfc_discovery_wait(struct l + } + + if (time_after(jiffies, wait_time_max)) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, +- "1835 Vport discovery quiesce failed:" +- " state x%x fc_flags x%x wait msecs x%x\n", +- vport->port_state, vport->fc_flag, +- jiffies_to_msecs(jiffies - start_time)); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "1835 Vport discovery quiesce failed:" ++ " state x%x fc_flags x%x wait msecs x%x\n", ++ vport->port_state, vport->fc_flag, ++ jiffies_to_msecs(jiffies - start_time)); + } + + int +@@ -305,7 +305,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + int status; + + if ((phba->sli_rev < 3) || !(phba->cfg_enable_npiv)) { +- lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1808 Create VPORT failed: " + "NPIV is not enabled: SLImode:%d\n", + phba->sli_rev); +@@ -315,7 +315,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + + /* NPIV is not supported if HBA has NVME Target enabled */ + if (phba->nvmet_support) { +- lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "3189 Create VPORT failed: " + "NPIV is not supported on NVME Target\n"); + rc = VPORT_INVAL; +@@ -324,7 +324,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + + vpi = lpfc_alloc_vpi(phba); + if (vpi == 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1809 Create VPORT failed: " + "Max VPORTs (%d) exceeded\n", + phba->max_vpi); +@@ -334,7 +334,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + + /* Assign an unused board number */ + if ((instance = lpfc_get_instance()) < 0) { +- lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1810 Create VPORT failed: Cannot get " + "instance number\n"); + lpfc_free_vpi(phba, vpi); +@@ -344,7 +344,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + + vport = lpfc_create_port(phba, instance, &fc_vport->dev); + if (!vport) { +- lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1811 Create VPORT failed: vpi x%x\n", vpi); + lpfc_free_vpi(phba, vpi); + rc = VPORT_NORESOURCES; +@@ -356,11 +356,11 @@ lpfc_vport_create(struct fc_vport *fc_vp + + if ((status = lpfc_vport_sparm(phba, vport))) { + if (status == -EINTR) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1831 Create VPORT Interrupted.\n"); + rc = VPORT_ERROR; + } else { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1813 Create VPORT failed. " + "Cannot get sparam\n"); + rc = VPORT_NORESOURCES; +@@ -378,7 +378,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + + if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") || + !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1821 Create VPORT failed. " + "Invalid WWN format\n"); + lpfc_free_vpi(phba, vpi); +@@ -388,7 +388,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + } + + if (!lpfc_unique_wwpn(phba, vport)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1823 Create VPORT failed. " + "Duplicate WWN on HBA\n"); + lpfc_free_vpi(phba, vpi); +@@ -426,7 +426,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + (pport->fc_flag & FC_VFI_REGISTERED)) { + rc = lpfc_sli4_init_vpi(vport); + if (rc) { +- lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "1838 Failed to INIT_VPI on vpi %d " + "status %d\n", vpi, rc); + rc = VPORT_NORESOURCES; +@@ -469,7 +469,7 @@ lpfc_vport_create(struct fc_vport *fc_vp + lpfc_initial_fdisc(vport); + } else { + lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0262 No NPIV Fabric support\n"); + } + } else { +@@ -478,8 +478,8 @@ lpfc_vport_create(struct fc_vport *fc_vp + rc = VPORT_OK; + + out: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, +- "1825 Vport Created.\n"); ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ++ "1825 Vport Created.\n"); + lpfc_host_attrib_init(lpfc_shost_from_vport(vport)); + error_out: + return rc; +@@ -534,7 +534,7 @@ disable_vport(struct fc_vport *fc_vport) + } + + lpfc_vport_set_state(vport, FC_VPORT_DISABLED); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1826 Vport Disabled.\n"); + return VPORT_OK; + } +@@ -575,7 +575,7 @@ enable_vport(struct fc_vport *fc_vport) + lpfc_initial_fdisc(vport); + } else { + lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "0264 No NPIV Fabric support\n"); + } + } else { +@@ -583,7 +583,7 @@ enable_vport(struct fc_vport *fc_vport) + } + + out: +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1827 Vport Enabled.\n"); + return VPORT_OK; + } +@@ -609,7 +609,7 @@ lpfc_vport_delete(struct fc_vport *fc_vp + bool ns_ndlp_referenced = false; + + if (vport->port_type == LPFC_PHYSICAL_PORT) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1812 vport_delete failed: Cannot delete " + "physical host\n"); + return VPORT_ERROR; +@@ -618,7 +618,7 @@ lpfc_vport_delete(struct fc_vport *fc_vp + /* If the vport is a static vport fail the deletion. */ + if ((vport->vport_flag & STATIC_VPORT) && + !(phba->pport->load_flag & FC_UNLOADING)) { +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1837 vport_delete failed: Cannot delete " + "static vport.\n"); + return VPORT_ERROR; +@@ -807,7 +807,7 @@ lpfc_vport_delete(struct fc_vport *fc_vp + spin_lock_irq(&phba->port_list_lock); + list_del_init(&vport->listentry); + spin_unlock_irq(&phba->port_list_lock); +- lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, + "1828 Vport Deleted.\n"); + scsi_host_put(shost); + return VPORT_OK; +@@ -828,7 +828,8 @@ lpfc_create_vport_work_array(struct lpfc + if (port_iterator->load_flag & FC_UNLOADING) + continue; + if (!scsi_host_get(lpfc_shost_from_vport(port_iterator))) { +- lpfc_printf_vlog(port_iterator, KERN_ERR, LOG_VPORT, ++ lpfc_printf_vlog(port_iterator, KERN_ERR, ++ LOG_TRACE_EVENT, + "1801 Create vport work array FAILED: " + "cannot do scsi_host_get\n"); + continue; +@@ -898,7 +899,8 @@ lpfc_alloc_bucket(struct lpfc_vport *vpo + GFP_ATOMIC); + + if (!ndlp->lat_data) +- lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, ++ lpfc_printf_vlog(vport, KERN_ERR, ++ LOG_TRACE_EVENT, + "0287 lpfc_alloc_bucket failed to " + "allocate statistical data buffer DID " + "0x%x\n", ndlp->nlp_DID); diff --git a/patches.suse/scsi-lpfc-Add-blk_io_poll-support-for-latency-improv.patch b/patches.suse/scsi-lpfc-Add-blk_io_poll-support-for-latency-improv.patch new file mode 100644 index 0000000..8c3b278 --- /dev/null +++ b/patches.suse/scsi-lpfc-Add-blk_io_poll-support-for-latency-improv.patch @@ -0,0 +1,512 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:59 -0700 +Subject: scsi: lpfc: Add blk_io_poll support for latency improvment +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 317aeb83c92b26f8c6a3e318157f20892556c343 +References: bsc#1172687 bsc#1171530 + +Although the existing implementation is very good at high I/O load, on +tests involving light load, especially on only a few hardware queues, +latency was a little higher than it can be due to using workqueue +scheduling. Other tasks in the system can delay handling. + +Change the lower level to use irq_poll by default which uses a softirq for +I/O completion. This gives better latency as variance in when the cq is +processed is reduced over the workqueue interface. However, as high load is +better served by not being in softirq when the CPU is loaded, work queues +are still used under high I/O load. + +Link: https://lore.kernel.org/r/20200630215001.70793-13-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc.h | 3 + drivers/scsi/lpfc/lpfc_init.c | 90 ++++++++++++++++++++++++++- + drivers/scsi/lpfc/lpfc_sli.c | 138 +++++++++++++++++++++++++++++++++++------- + drivers/scsi/lpfc/lpfc_sli4.h | 18 +++++ + 4 files changed, 224 insertions(+), 25 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc.h ++++ b/drivers/scsi/lpfc/lpfc.h +@@ -709,6 +709,9 @@ struct lpfc_hba { + struct workqueue_struct *wq; + struct delayed_work eq_delay_work; + ++#define LPFC_IDLE_STAT_DELAY 1000 ++ struct delayed_work idle_stat_delay_work; ++ + struct lpfc_sli sli; + uint8_t pci_dev_grp; /* lpfc PCI dev group: 0x0, 0x1, 0x2,... */ + uint32_t sli_rev; /* SLI2, SLI3, or SLI4 */ +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -1227,6 +1227,75 @@ lpfc_hb_mbox_cmpl(struct lpfc_hba * phba + return; + } + ++/** ++ * lpfc_idle_stat_delay_work - idle_stat tracking ++ * ++ * This routine tracks per-cq idle_stat and determines polling decisions. ++ * ++ * Return codes: ++ * None ++ **/ ++static void ++lpfc_idle_stat_delay_work(struct work_struct *work) ++{ ++ struct lpfc_hba *phba = container_of(to_delayed_work(work), ++ struct lpfc_hba, ++ idle_stat_delay_work); ++ struct lpfc_queue *cq; ++ struct lpfc_sli4_hdw_queue *hdwq; ++ struct lpfc_idle_stat *idle_stat; ++ u32 i, idle_percent; ++ u64 wall, wall_idle, diff_wall, diff_idle, busy_time; ++ ++ if (phba->pport->load_flag & FC_UNLOADING) ++ return; ++ ++ if (phba->link_state == LPFC_HBA_ERROR || ++ phba->pport->fc_flag & FC_OFFLINE_MODE) ++ goto requeue; ++ ++ for_each_present_cpu(i) { ++ hdwq = &phba->sli4_hba.hdwq[phba->sli4_hba.cpu_map[i].hdwq]; ++ cq = hdwq->io_cq; ++ ++ /* Skip if we've already handled this cq's primary CPU */ ++ if (cq->chann != i) ++ continue; ++ ++ idle_stat = &phba->sli4_hba.idle_stat[i]; ++ ++ /* get_cpu_idle_time returns values as running counters. Thus, ++ * to know the amount for this period, the prior counter values ++ * need to be subtracted from the current counter values. ++ * From there, the idle time stat can be calculated as a ++ * percentage of 100 - the sum of the other consumption times. ++ */ ++ wall_idle = get_cpu_idle_time(i, &wall, 1); ++ diff_idle = wall_idle - idle_stat->prev_idle; ++ diff_wall = wall - idle_stat->prev_wall; ++ ++ if (diff_wall <= diff_idle) ++ busy_time = 0; ++ else ++ busy_time = diff_wall - diff_idle; ++ ++ idle_percent = div64_u64(100 * busy_time, diff_wall); ++ idle_percent = 100 - idle_percent; ++ ++ if (idle_percent < 15) ++ cq->poll_mode = LPFC_QUEUE_WORK; ++ else ++ cq->poll_mode = LPFC_IRQ_POLL; ++ ++ idle_stat->prev_idle = wall_idle; ++ idle_stat->prev_wall = wall; ++ } ++ ++requeue: ++ schedule_delayed_work(&phba->idle_stat_delay_work, ++ msecs_to_jiffies(LPFC_IDLE_STAT_DELAY)); ++} ++ + static void + lpfc_hb_eq_delay_work(struct work_struct *work) + { +@@ -2927,6 +2996,7 @@ lpfc_stop_hba_timers(struct lpfc_hba *ph + if (phba->pport) + lpfc_stop_vport_timers(phba->pport); + cancel_delayed_work_sync(&phba->eq_delay_work); ++ cancel_delayed_work_sync(&phba->idle_stat_delay_work); + del_timer_sync(&phba->sli.mbox_tmo); + del_timer_sync(&phba->fabric_block_timer); + del_timer_sync(&phba->eratt_poll); +@@ -6259,6 +6329,9 @@ lpfc_setup_driver_resource_phase1(struct + + INIT_DELAYED_WORK(&phba->eq_delay_work, lpfc_hb_eq_delay_work); + ++ INIT_DELAYED_WORK(&phba->idle_stat_delay_work, ++ lpfc_idle_stat_delay_work); ++ + return 0; + } + +@@ -6937,13 +7010,23 @@ lpfc_sli4_driver_resource_setup(struct l + goto out_free_hba_cpu_map; + } + ++ phba->sli4_hba.idle_stat = kcalloc(phba->sli4_hba.num_possible_cpu, ++ sizeof(*phba->sli4_hba.idle_stat), ++ GFP_KERNEL); ++ if (!phba->sli4_hba.idle_stat) { ++ lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ "3390 Failed allocation for idle_stat\n"); ++ rc = -ENOMEM; ++ goto out_free_hba_eq_info; ++ } ++ + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + phba->sli4_hba.c_stat = alloc_percpu(struct lpfc_hdwq_stat); + if (!phba->sli4_hba.c_stat) { + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "3332 Failed allocating per cpu hdwq stats\n"); + rc = -ENOMEM; +- goto out_free_hba_eq_info; ++ goto out_free_hba_idle_stat; + } + #endif + +@@ -6967,9 +7050,11 @@ lpfc_sli4_driver_resource_setup(struct l + return 0; + + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS ++out_free_hba_idle_stat: ++ kfree(phba->sli4_hba.idle_stat); ++#endif + out_free_hba_eq_info: + free_percpu(phba->sli4_hba.eq_info); +-#endif + out_free_hba_cpu_map: + kfree(phba->sli4_hba.cpu_map); + out_free_hba_eq_hdl: +@@ -7011,6 +7096,7 @@ lpfc_sli4_driver_resource_unset(struct l + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + free_percpu(phba->sli4_hba.c_stat); + #endif ++ kfree(phba->sli4_hba.idle_stat); + + /* Free memory allocated for msi-x interrupt vector to CPU mapping */ + kfree(phba->sli4_hba.cpu_map); +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -7193,6 +7193,47 @@ lpfc_post_rq_buffer(struct lpfc_hba *phb + return 1; + } + ++/** ++ * lpfc_init_idle_stat_hb - Initialize idle_stat tracking ++ * ++ * This routine initializes the per-cq idle_stat to dynamically dictate ++ * polling decisions. ++ * ++ * Return codes: ++ * None ++ **/ ++static void lpfc_init_idle_stat_hb(struct lpfc_hba *phba) ++{ ++ int i; ++ struct lpfc_sli4_hdw_queue *hdwq; ++ struct lpfc_queue *cq; ++ struct lpfc_idle_stat *idle_stat; ++ u64 wall; ++ ++ for_each_present_cpu(i) { ++ hdwq = &phba->sli4_hba.hdwq[phba->sli4_hba.cpu_map[i].hdwq]; ++ cq = hdwq->io_cq; ++ ++ /* Skip if we've already handled this cq's primary CPU */ ++ if (cq->chann != i) ++ continue; ++ ++ idle_stat = &phba->sli4_hba.idle_stat[i]; ++ ++ idle_stat->prev_idle = get_cpu_idle_time(i, &wall, 1); ++ idle_stat->prev_wall = wall; ++ ++ if (phba->nvmet_support) ++ cq->poll_mode = LPFC_QUEUE_WORK; ++ else ++ cq->poll_mode = LPFC_IRQ_POLL; ++ } ++ ++ if (!phba->nvmet_support) ++ schedule_delayed_work(&phba->idle_stat_delay_work, ++ msecs_to_jiffies(LPFC_IDLE_STAT_DELAY)); ++} ++ + static void lpfc_sli4_dip(struct lpfc_hba *phba) + { + uint32_t if_type; +@@ -7770,6 +7811,9 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + queue_delayed_work(phba->wq, &phba->eq_delay_work, + msecs_to_jiffies(LPFC_EQ_DELAY_MSECS)); + ++ /* start per phba idle_stat_delay heartbeat */ ++ lpfc_init_idle_stat_hb(phba); ++ + /* Start error attention (ERATT) polling timer */ + mod_timer(&phba->eratt_poll, + jiffies + msecs_to_jiffies(1000 * phba->eratt_poll_interval)); +@@ -13647,7 +13691,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba + + if (!ret) + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "0390 Cannot schedule soft IRQ " ++ "0390 Cannot schedule queue work " + "for CQ eqcqid=%d, cqid=%d on CPU %d\n", + cqid, cq->queue_id, raw_smp_processor_id()); + } +@@ -13658,6 +13702,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba + * @cq: Pointer to CQ to be processed + * @handler: Routine to process each cqe + * @delay: Pointer to usdelay to set in case of rescheduling of the handler ++ * @poll_mode: Polling mode we were called from + * + * This routine processes completion queue entries in a CQ. While a valid + * queue element is found, the handler is called. During processing checks +@@ -13675,7 +13720,8 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba + static bool + __lpfc_sli4_process_cq(struct lpfc_hba *phba, struct lpfc_queue *cq, + bool (*handler)(struct lpfc_hba *, struct lpfc_queue *, +- struct lpfc_cqe *), unsigned long *delay) ++ struct lpfc_cqe *), unsigned long *delay, ++ enum lpfc_poll_mode poll_mode) + { + struct lpfc_cqe *cqe; + bool workposted = false; +@@ -13716,6 +13762,10 @@ static bool + arm = false; + } + ++ /* Note: complete the irq_poll softirq before rearming CQ */ ++ if (poll_mode == LPFC_IRQ_POLL) ++ irq_poll_complete(&cq->iop); ++ + /* Track the max number of CQEs processed in 1 EQ */ + if (count > cq->CQ_max_cqe) + cq->CQ_max_cqe = count; +@@ -13765,17 +13815,17 @@ static void + case LPFC_MCQ: + workposted |= __lpfc_sli4_process_cq(phba, cq, + lpfc_sli4_sp_handle_mcqe, +- &delay); ++ &delay, LPFC_QUEUE_WORK); + break; + case LPFC_WCQ: + if (cq->subtype == LPFC_IO) + workposted |= __lpfc_sli4_process_cq(phba, cq, + lpfc_sli4_fp_handle_cqe, +- &delay); ++ &delay, LPFC_QUEUE_WORK); + else + workposted |= __lpfc_sli4_process_cq(phba, cq, + lpfc_sli4_sp_handle_cqe, +- &delay); ++ &delay, LPFC_QUEUE_WORK); + break; + default: + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +@@ -13793,7 +13843,7 @@ static void + &cq->sched_spwork, delay); + if (!ret) + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "0394 Cannot schedule soft IRQ " ++ "0394 Cannot schedule queue work " + "for cqid=%d on CPU %d\n", + cq->queue_id, cq->chann); + } +@@ -14125,6 +14175,44 @@ lpfc_sli4_fp_handle_cqe(struct lpfc_hba + } + + /** ++ * lpfc_sli4_sched_cq_work - Schedules cq work ++ * @phba: Pointer to HBA context object. ++ * @cq: Pointer to CQ ++ * @cqid: CQ ID ++ * ++ * This routine checks the poll mode of the CQ corresponding to ++ * cq->chann, then either schedules a softirq or queue_work to complete ++ * cq work. ++ * ++ * queue_work path is taken if in NVMET mode, or if poll_mode is in ++ * LPFC_QUEUE_WORK mode. Otherwise, softirq path is taken. ++ * ++ **/ ++static void lpfc_sli4_sched_cq_work(struct lpfc_hba *phba, ++ struct lpfc_queue *cq, uint16_t cqid) ++{ ++ int ret = 0; ++ ++ switch (cq->poll_mode) { ++ case LPFC_IRQ_POLL: ++ irq_poll_sched(&cq->iop); ++ break; ++ case LPFC_QUEUE_WORK: ++ default: ++ if (is_kdump_kernel()) ++ ret = queue_work(phba->wq, &cq->irqwork); ++ else ++ ret = queue_work_on(cq->chann, phba->wq, &cq->irqwork); ++ if (!ret) ++ lpfc_printf_log(phba, KERN_ERR, LOG_SLI, ++ "0383 Cannot schedule queue work " ++ "for CQ eqcqid=%d, cqid=%d on CPU %d\n", ++ cqid, cq->queue_id, ++ raw_smp_processor_id()); ++ } ++} ++ ++/** + * lpfc_sli4_hba_handle_eqe - Process a fast-path event queue entry + * @phba: Pointer to HBA context object. + * @eqe: Pointer to fast-path event queue entry. +@@ -14143,7 +14231,6 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba + struct lpfc_queue *cq = NULL; + uint32_t qidx = eq->hdwq; + uint16_t cqid, id; +- int ret = 0; + + if (unlikely(bf_get_le32(lpfc_eqe_major_code, eqe) != 0)) { + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +@@ -14203,20 +14290,13 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba + else + cq->isr_timestamp = 0; + #endif +- if (is_kdump_kernel()) +- ret = queue_work(phba->wq, &cq->irqwork); +- else +- ret = queue_work_on(cq->chann, phba->wq, &cq->irqwork); +- if (!ret) +- lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "0363 Cannot schedule soft IRQ " +- "for CQ eqcqid=%d, cqid=%d on CPU %d\n", +- cqid, cq->queue_id, raw_smp_processor_id()); ++ lpfc_sli4_sched_cq_work(phba, cq, cqid); + } + + /** + * __lpfc_sli4_hba_process_cq - Process a fast-path event queue entry + * @cq: Pointer to CQ to be processed ++ * @poll_mode: Enum lpfc_poll_state to determine poll mode + * + * This routine calls the cq processing routine with the handler for + * fast path CQEs. +@@ -14230,7 +14310,8 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba + * the delay indicates when to reschedule it. + **/ + static void +-__lpfc_sli4_hba_process_cq(struct lpfc_queue *cq) ++__lpfc_sli4_hba_process_cq(struct lpfc_queue *cq, ++ enum lpfc_poll_mode poll_mode) + { + struct lpfc_hba *phba = cq->phba; + unsigned long delay; +@@ -14239,7 +14320,7 @@ static void + + /* process and rearm the CQ */ + workposted |= __lpfc_sli4_process_cq(phba, cq, lpfc_sli4_fp_handle_cqe, +- &delay); ++ &delay, poll_mode); + + if (delay) { + if (is_kdump_kernel()) +@@ -14250,9 +14331,9 @@ static void + &cq->sched_irqwork, delay); + if (!ret) + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +- "0367 Cannot schedule soft IRQ " +- "for cqid=%d on CPU %d\n", +- cq->queue_id, cq->chann); ++ "0367 Cannot schedule queue work " ++ "for cqid=%d on CPU %d\n", ++ cq->queue_id, cq->chann); + } + + /* wake up worker thread if there are works to be done */ +@@ -14272,7 +14353,7 @@ lpfc_sli4_hba_process_cq(struct work_str + { + struct lpfc_queue *cq = container_of(work, struct lpfc_queue, irqwork); + +- __lpfc_sli4_hba_process_cq(cq); ++ __lpfc_sli4_hba_process_cq(cq, LPFC_QUEUE_WORK); + } + + /** +@@ -14287,7 +14368,7 @@ lpfc_sli4_dly_hba_process_cq(struct work + struct lpfc_queue *cq = container_of(to_delayed_work(work), + struct lpfc_queue, sched_irqwork); + +- __lpfc_sli4_hba_process_cq(cq); ++ __lpfc_sli4_hba_process_cq(cq, LPFC_QUEUE_WORK); + } + + /** +@@ -14962,6 +15043,15 @@ lpfc_eq_create(struct lpfc_hba *phba, st + return status; + } + ++static int lpfc_cq_poll_hdler(struct irq_poll *iop, int budget) ++{ ++ struct lpfc_queue *cq = container_of(iop, struct lpfc_queue, iop); ++ ++ __lpfc_sli4_hba_process_cq(cq, LPFC_IRQ_POLL); ++ ++ return 1; ++} ++ + /** + * lpfc_cq_create - Create a Completion Queue on the HBA + * @phba: HBA structure that indicates port to create a queue on. +@@ -15101,6 +15191,8 @@ lpfc_cq_create(struct lpfc_hba *phba, st + + if (cq->queue_id > phba->sli4_hba.cq_max) + phba->sli4_hba.cq_max = cq->queue_id; ++ ++ irq_poll_init(&cq->iop, LPFC_IRQ_POLL_WEIGHT, lpfc_cq_poll_hdler); + out: + mempool_free(mbox, phba->mbox_mem_pool); + return status; +--- a/drivers/scsi/lpfc/lpfc_sli4.h ++++ b/drivers/scsi/lpfc/lpfc_sli4.h +@@ -20,6 +20,9 @@ + * included with this package. * + *******************************************************************/ + ++#include ++#include ++ + #if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_SCSI_LPFC_DEBUG_FS) + #define CONFIG_SCSI_LPFC_DEBUG_FS + #endif +@@ -135,6 +138,16 @@ struct lpfc_rqb { + struct rqb_dmabuf *); + }; + ++enum lpfc_poll_mode { ++ LPFC_QUEUE_WORK, ++ LPFC_IRQ_POLL ++}; ++ ++struct lpfc_idle_stat { ++ u64 prev_idle; ++ u64 prev_wall; ++}; ++ + struct lpfc_queue { + struct list_head list; + struct list_head wq_list; +@@ -265,6 +278,10 @@ struct lpfc_queue { + struct lpfc_queue *assoc_qp; + struct list_head _poll_list; + void **q_pgs; /* array to index entries per page */ ++ ++#define LPFC_IRQ_POLL_WEIGHT 256 ++ struct irq_poll iop; ++ enum lpfc_poll_mode poll_mode; + }; + + struct lpfc_sli4_link { +@@ -926,6 +943,7 @@ struct lpfc_sli4_hba { + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + struct lpfc_hdwq_stat __percpu *c_stat; + #endif ++ struct lpfc_idle_stat *idle_stat; + uint32_t conf_trunk; + #define lpfc_conf_trunk_port0_WORD conf_trunk + #define lpfc_conf_trunk_port0_SHIFT 0 diff --git a/patches.suse/scsi-lpfc-Add-support-to-display-if-adapter-dumps-ar.patch b/patches.suse/scsi-lpfc-Add-support-to-display-if-adapter-dumps-ar.patch new file mode 100644 index 0000000..a8fcd4a --- /dev/null +++ b/patches.suse/scsi-lpfc-Add-support-to-display-if-adapter-dumps-ar.patch @@ -0,0 +1,75 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:58 -0700 +Subject: scsi: lpfc: Add support to display if adapter dumps are available +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: f0020e428af7c7a705a264be21a67b1c89574af0 +References: bsc#1172687 bsc#1171530 + +Currently, if there has been an issue whereby an adapter dump was taken, +there is nothing displayed to hint that it is present. Utilities must be +run and they must query for the status in order to then download the dump. + +Add a message to the driver to query dump image presence when initializing +the SLI Port. + +Link: https://lore.kernel.org/r/20200630215001.70793-12-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_hw4.h | 3 +++ + drivers/scsi/lpfc/lpfc_sli.c | 22 ++++++++++++++++++++++ + 2 files changed, 25 insertions(+) + +--- a/drivers/scsi/lpfc/lpfc_hw4.h ++++ b/drivers/scsi/lpfc/lpfc_hw4.h +@@ -650,6 +650,9 @@ struct lpfc_register { + #define lpfc_sliport_status_oti_SHIFT 29 + #define lpfc_sliport_status_oti_MASK 0x1 + #define lpfc_sliport_status_oti_WORD word0 ++#define lpfc_sliport_status_dip_SHIFT 25 ++#define lpfc_sliport_status_dip_MASK 0x1 ++#define lpfc_sliport_status_dip_WORD word0 + #define lpfc_sliport_status_rn_SHIFT 24 + #define lpfc_sliport_status_rn_MASK 0x1 + #define lpfc_sliport_status_rn_WORD word0 +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -7193,6 +7193,26 @@ lpfc_post_rq_buffer(struct lpfc_hba *phb + return 1; + } + ++static void lpfc_sli4_dip(struct lpfc_hba *phba) ++{ ++ uint32_t if_type; ++ ++ if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); ++ if (if_type == LPFC_SLI_INTF_IF_TYPE_2 || ++ if_type == LPFC_SLI_INTF_IF_TYPE_6) { ++ struct lpfc_register reg_data; ++ ++ if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr, ++ ®_data.word0)) ++ return; ++ ++ if (bf_get(lpfc_sliport_status_dip, ®_data)) ++ lpfc_printf_log(phba, KERN_ERR, LOG_INIT, ++ "2904 Firmware Dump Image Present" ++ " on Adapter"); ++ } ++} ++ + /** + * lpfc_sli4_hba_setup - SLI4 device initialization PCI function + * @phba: Pointer to HBA context object. +@@ -7231,6 +7251,8 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + spin_unlock_irq(&phba->hbalock); + } + ++ lpfc_sli4_dip(phba); ++ + /* + * Allocate a single mailbox container for initializing the + * port. diff --git a/patches.suse/scsi-lpfc-Allow-applications-to-issue-Common-Set-Fea.patch b/patches.suse/scsi-lpfc-Allow-applications-to-issue-Common-Set-Fea.patch new file mode 100644 index 0000000..b678029 --- /dev/null +++ b/patches.suse/scsi-lpfc-Allow-applications-to-issue-Common-Set-Fea.patch @@ -0,0 +1,72 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:57 -0700 +Subject: scsi: lpfc: Allow applications to issue Common Set Features mailbox + command +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 45bc44270f0c005d6009b5427cf855cff34220b7 +References: bsc#1172687 bsc#1171530 + +Currently the driver validates command codes received from the +application. COMMON_SET_FEATURES is not currently being approved. + +Add definition of the missing command and allow it to be issued by +applications. + +Link: https://lore.kernel.org/r/20200630215001.70793-11-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_bsg.c | 1 + + drivers/scsi/lpfc/lpfc_bsg.h | 14 ++++++++++++++ + 2 files changed, 15 insertions(+) + +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -4307,6 +4307,7 @@ lpfc_bsg_handle_sli_cfg_mbox(struct lpfc + case COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES: + case COMN_OPCODE_GET_CNTL_ATTRIBUTES: + case COMN_OPCODE_GET_PROFILE_CONFIG: ++ case COMN_OPCODE_SET_FEATURES: + lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC, + "3106 Handled SLI_CONFIG " + "subsys_comn, opcode:x%x\n", +--- a/drivers/scsi/lpfc/lpfc_bsg.h ++++ b/drivers/scsi/lpfc/lpfc_bsg.h +@@ -225,6 +225,10 @@ struct lpfc_sli_config_hdr { + uint32_t reserved5; + }; + ++#define LPFC_CSF_BOOT_DEV 0x1D ++#define LPFC_CSF_QUERY 0 ++#define LPFC_CSF_SAVE 1 ++ + struct lpfc_sli_config_emb0_subsys { + struct lpfc_sli_config_hdr sli_config_hdr; + #define LPFC_MBX_SLI_CONFIG_MAX_MSE 19 +@@ -243,6 +247,15 @@ struct lpfc_sli_config_emb0_subsys { + #define FCOE_OPCODE_ADD_FCF 0x09 + #define FCOE_OPCODE_SET_DPORT_MODE 0x27 + #define FCOE_OPCODE_GET_DPORT_RESULTS 0x28 ++ uint32_t timeout; /* comn_set_feature timeout */ ++ uint32_t request_length; /* comn_set_feature request len */ ++ uint32_t version; /* comn_set_feature version */ ++ uint32_t csf_feature; /* comn_set_feature feature */ ++ uint32_t word69; /* comn_set_feature parameter len */ ++ uint32_t word70; /* comn_set_feature parameter val0 */ ++#define lpfc_emb0_subcmnd_csf_p0_SHIFT 0 ++#define lpfc_emb0_subcmnd_csf_p0_MASK 0x3 ++#define lpfc_emb0_subcmnd_csf_p0_WORD word70 + }; + + struct lpfc_sli_config_emb1_subsys { +@@ -261,6 +274,7 @@ struct lpfc_sli_config_emb1_subsys { + #define COMN_OPCODE_WRITE_OBJECT 0xAC + #define COMN_OPCODE_READ_OBJECT_LIST 0xAD + #define COMN_OPCODE_DELETE_OBJECT 0xAE ++#define COMN_OPCODE_SET_FEATURES 0xBF + #define COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES 0x79 + #define COMN_OPCODE_GET_CNTL_ATTRIBUTES 0x20 + uint32_t timeout; diff --git a/patches.suse/scsi-lpfc-Avoid-another-null-dereference-in-lpfc_sli.patch b/patches.suse/scsi-lpfc-Avoid-another-null-dereference-in-lpfc_sli.patch new file mode 100644 index 0000000..1120485 --- /dev/null +++ b/patches.suse/scsi-lpfc-Avoid-another-null-dereference-in-lpfc_sli.patch @@ -0,0 +1,40 @@ +From: SeongJae Park +Date: Tue, 23 Jun 2020 10:41:22 +0200 +Subject: scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset() +Patch-mainline: v5.8-rc3 +Git-commit: 46da547e21d6cefceec3fb3dba5ebbca056627fc +References: bsc#1172687 bsc#1171530 + +Commit cdb42becdd40 ("scsi: lpfc: Replace io_channels for nvme and fcp with +general hdw_queues per cpu") has introduced static checker warnings for +potential null dereferences in 'lpfc_sli4_hba_unset()' and commit 1ffdd2c0440d +("scsi: lpfc: resolve static checker warning in lpfc_sli4_hba_unset") has +tried to fix it. However, yet another potential null dereference is +remaining. This commit fixes it. + +This bug was discovered and resolved using Coverity Static Analysis +Security Testing (SAST) by Synopsys, Inc. + +Link: https://lore.kernel.org/r/20200623084122.30633-1-sjpark@amazon.com +Fixes: 1ffdd2c0440d ("scsi: lpfc: resolve static checker warning inlpfc_sli4_hba_unset") +Fixes: cdb42becdd40 ("scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu") +Reviewed-by: James Smart +Signed-off-by: SeongJae Park +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_init.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -11895,7 +11895,8 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phb + lpfc_sli4_xri_exchange_busy_wait(phba); + + /* per-phba callback de-registration for hotplug event */ +- lpfc_cpuhp_remove(phba); ++ if (phba->pport) ++ lpfc_cpuhp_remove(phba); + + /* Disable PCI subsystem interrupt */ + lpfc_sli4_disable_intr(phba); diff --git a/patches.suse/scsi-lpfc-Fix-NVMe-rport-deregister-and-registration.patch b/patches.suse/scsi-lpfc-Fix-NVMe-rport-deregister-and-registration.patch new file mode 100644 index 0000000..b5e88ec --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-NVMe-rport-deregister-and-registration.patch @@ -0,0 +1,63 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:51 -0700 +Subject: scsi: lpfc: Fix NVMe rport deregister and registration during ADISC +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 9806c984d43a292fc331a9735bcecc28455df80a +References: bsc#1172687 bsc#1171530 + +During driver unload/reload testing, the NVMe initiator would not +re-establish connectivity to NVMe controllers on reload. + +The failing NVMe array supports concurrent FCP and NVMe operation via +different nport_id's. The array was repeatedly sending an ADISC every 2 +seconds after PLOGI completed and while NVMe subsystems were executing +discovery. The target would continue this state for roughly 45 seconds. + +The driver's current behavior on ADISC receipt is to validate a the ADISC +vs the device and issue a RESUME_RPI to restore transmission. The receipt +of the ADISC effectively caused a driver to take actions similar to a +logout and login for the remote port, causing the deregistration of the +nvme rport and a subsequent re-registration. This caused a constant reset +and re-connect of the NVMe controller while this 45s window occurred. There +was no need for the state changes as ADISC does not change login state. + +This patch corrects this behavior by validating if the remoteport is +already logged in (MAPPED) and when true, avoids the call to set the ndlp +state to MAPPED, which triggers the unreg/re-reg. Thus ADISC does not +change the login state of the node. + +Link: https://lore.kernel.org/r/20200630215001.70793-5-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_nportdisc.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_nportdisc.c ++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c +@@ -794,11 +794,17 @@ lpfc_rcv_padisc(struct lpfc_vport *vport + ndlp, NULL); + } + out: +- /* If we are authenticated, move to the proper state */ +- if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) +- lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); +- else +- lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); ++ /* If we are authenticated, move to the proper state. ++ * It is possible an ADISC arrived and the remote nport ++ * is already in MAPPED or UNMAPPED state. Catch this ++ * condition and don't set the nlp_state again because ++ * it causes an unnecessary transport unregister/register. ++ */ ++ if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) { ++ if (ndlp->nlp_state != NLP_STE_MAPPED_NODE) ++ lpfc_nlp_set_state(vport, ndlp, ++ NLP_STE_MAPPED_NODE); ++ } + + return 1; + } diff --git a/patches.suse/scsi-lpfc-Fix-inconsistent-indenting.patch b/patches.suse/scsi-lpfc-Fix-inconsistent-indenting.patch new file mode 100644 index 0000000..f2ff4d9 --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-inconsistent-indenting.patch @@ -0,0 +1,33 @@ +From: Colin Ian King +Date: Tue, 7 Jul 2020 16:00:18 +0100 +Subject: scsi: lpfc: Fix inconsistent indenting +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 26e0b9aa35784ca1c9e8207ee9a6001c22058fde +References: bsc#1158983 + +Fix smatch warning: + + drivers/scsi/lpfc/lpfc_sli.c:15156 lpfc_cq_poll_hdler() warn: + inconsistent indenting + +Link: https://lore.kernel.org/r/20200707150018.823350-1-colin.king@canonical.com +Reviewed-by: James Smart +Signed-off-by: Colin Ian King +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_sli.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -15046,7 +15046,7 @@ static int lpfc_cq_poll_hdler(struct irq + { + struct lpfc_queue *cq = container_of(iop, struct lpfc_queue, iop); + +- __lpfc_sli4_hba_process_cq(cq, LPFC_IRQ_POLL); ++ __lpfc_sli4_hba_process_cq(cq, LPFC_IRQ_POLL); + + return 1; + } diff --git a/patches.suse/scsi-lpfc-Fix-interrupt-assignments-when-multiple-ve.patch b/patches.suse/scsi-lpfc-Fix-interrupt-assignments-when-multiple-ve.patch new file mode 100644 index 0000000..06cab3c --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-interrupt-assignments-when-multiple-ve.patch @@ -0,0 +1,81 @@ +From: Dick Kennedy +Date: Mon, 6 Jul 2020 13:42:30 -0700 +Subject: scsi: lpfc: Fix interrupt assignments when multiple vectors are + supported on same CPU +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 17105d959b268ce181d877d9ff2ead5b112ce4a4 +References: bsc#1158983 + +With certain platforms its possible pci_alloc_irq_vectors() may affinitize +irq vectors to multiple (all?) CPUs. The driver is currently assuming +exclusivity and vectors being doled out to different CPUs and is assigning +primary ownership of each vector to the first CPU in the mask. The code +doesn't bother to check if the CPU already owns a vector and will +unconditionally overwrite the CPU to vector mapping. This causes the +relationships between eq's and cq's to get confused and gets worse when +CPUs start to offline. The net results are interrupts are skipped resulting +in mailbox timeouts and there are oopses in CPU offling flows. + +Fix this changing up the primary vector assignment. Now assign the eq to a +CPU only if it is the CPU in the mask that does not have a prior +assignment. And once the primary ownership is assigned, break from the +loop. For CPUs that may have been set before but not the primary owner, the +lpfc_cpu_affinity_check() routine will balance the CPU to eq assignment. + +Link: https://lore.kernel.org/r/20200706204230.130363-1-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_init.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -11525,9 +11525,9 @@ lpfc_sli4_enable_msix(struct lpfc_hba *p + char *name; + const struct cpumask *aff_mask = NULL; + unsigned int cpu = 0, cpu_cnt = 0, cpu_select = nr_cpu_ids; ++ struct lpfc_vector_map_info *cpup; + struct lpfc_hba_eq_hdl *eqhdl; + const struct cpumask *maskp; +- bool first; + unsigned int flags = PCI_IRQ_MSIX; + + /* Set up MSI-X multi-message vectors */ +@@ -11600,18 +11600,28 @@ lpfc_sli4_enable_msix(struct lpfc_hba *p + } else { + maskp = pci_irq_get_affinity(phba->pcidev, index); + +- first = true; + /* Loop through all CPUs associated with vector index */ + for_each_cpu_and(cpu, maskp, cpu_present_mask) { ++ cpup = &phba->sli4_hba.cpu_map[cpu]; ++ + /* If this is the first CPU thats assigned to + * this vector, set LPFC_CPU_FIRST_IRQ. ++ * ++ * With certain platforms its possible that irq ++ * vectors are affinitized to all the cpu's. ++ * This can result in each cpu_map.eq to be set ++ * to the last vector, resulting in overwrite ++ * of all the previous cpu_map.eq. Ensure that ++ * each vector receives a place in cpu_map. ++ * Later call to lpfc_cpu_affinity_check will ++ * ensure we are nicely balanced out. + */ ++ if (cpup->eq != LPFC_VECTOR_MAP_EMPTY) ++ continue; + lpfc_assign_eq_map_info(phba, index, +- first ? +- LPFC_CPU_FIRST_IRQ : 0, ++ LPFC_CPU_FIRST_IRQ, + cpu); +- if (first) +- first = false; ++ break; + } + } + } diff --git a/patches.suse/scsi-lpfc-Fix-kdump-hang-on-PPC.patch b/patches.suse/scsi-lpfc-Fix-kdump-hang-on-PPC.patch new file mode 100644 index 0000000..f5ccf49 --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-kdump-hang-on-PPC.patch @@ -0,0 +1,126 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:55 -0700 +Subject: scsi: lpfc: Fix kdump hang on PPC +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 86ee57a97a1764e86718d5bc37d0a3a22f0c3fd5 +References: bsc#1172687 bsc#1171530 + +When the kdump kernel shuts down lpfc calls flush_work_queue on an +interrupt to schedule the cq handler. When there is only one CPU active on +the kdump kernel, it is possible for the work_on to get scheduled on a +non-active CPU causing it to never be scheduled. + +When in the kdump environment, per-CPU affinity of cq's to cpus is not +necessary. In those cases, use a general queue_work rather than a +queue_work_on(). + +Link: https://lore.kernel.org/r/20200630215001.70793-9-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_sli.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #ifdef CONFIG_X86 + #include + #endif +@@ -13595,6 +13596,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba + { + struct lpfc_queue *cq = NULL, *childq; + uint16_t cqid; ++ int ret = 0; + + /* Get the reference to the corresponding CQ */ + cqid = bf_get_le32(lpfc_eqe_resource_id, eqe); +@@ -13616,7 +13618,12 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba + /* Save EQ associated with this CQ */ + cq->assoc_qp = speq; + +- if (!queue_work_on(cq->chann, phba->wq, &cq->spwork)) ++ if (is_kdump_kernel()) ++ ret = queue_work(phba->wq, &cq->spwork); ++ else ++ ret = queue_work_on(cq->chann, phba->wq, &cq->spwork); ++ ++ if (!ret) + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "0390 Cannot schedule soft IRQ " + "for CQ eqcqid=%d, cqid=%d on CPU %d\n", +@@ -13729,6 +13736,7 @@ static void + struct lpfc_hba *phba = cq->phba; + unsigned long delay; + bool workposted = false; ++ int ret = 0; + + /* Process and rearm the CQ */ + switch (cq->type) { +@@ -13755,8 +13763,13 @@ static void + } + + if (delay) { +- if (!queue_delayed_work_on(cq->chann, phba->wq, +- &cq->sched_spwork, delay)) ++ if (is_kdump_kernel()) ++ ret = queue_delayed_work(phba->wq, &cq->sched_spwork, ++ delay); ++ else ++ ret = queue_delayed_work_on(cq->chann, phba->wq, ++ &cq->sched_spwork, delay); ++ if (!ret) + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "0394 Cannot schedule soft IRQ " + "for cqid=%d on CPU %d\n", +@@ -14108,6 +14121,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba + struct lpfc_queue *cq = NULL; + uint32_t qidx = eq->hdwq; + uint16_t cqid, id; ++ int ret = 0; + + if (unlikely(bf_get_le32(lpfc_eqe_major_code, eqe) != 0)) { + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, +@@ -14167,7 +14181,11 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba + else + cq->isr_timestamp = 0; + #endif +- if (!queue_work_on(cq->chann, phba->wq, &cq->irqwork)) ++ if (is_kdump_kernel()) ++ ret = queue_work(phba->wq, &cq->irqwork); ++ else ++ ret = queue_work_on(cq->chann, phba->wq, &cq->irqwork); ++ if (!ret) + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "0363 Cannot schedule soft IRQ " + "for CQ eqcqid=%d, cqid=%d on CPU %d\n", +@@ -14195,14 +14213,20 @@ static void + struct lpfc_hba *phba = cq->phba; + unsigned long delay; + bool workposted = false; ++ int ret = 0; + + /* process and rearm the CQ */ + workposted |= __lpfc_sli4_process_cq(phba, cq, lpfc_sli4_fp_handle_cqe, + &delay); + + if (delay) { +- if (!queue_delayed_work_on(cq->chann, phba->wq, +- &cq->sched_irqwork, delay)) ++ if (is_kdump_kernel()) ++ ret = queue_delayed_work(phba->wq, &cq->sched_irqwork, ++ delay); ++ else ++ ret = queue_delayed_work_on(cq->chann, phba->wq, ++ &cq->sched_irqwork, delay); ++ if (!ret) + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "0367 Cannot schedule soft IRQ " + "for cqid=%d on CPU %d\n", diff --git a/patches.suse/scsi-lpfc-Fix-language-in-0373-message-to-reflect-no.patch b/patches.suse/scsi-lpfc-Fix-language-in-0373-message-to-reflect-no.patch new file mode 100644 index 0000000..b46afe4 --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-language-in-0373-message-to-reflect-no.patch @@ -0,0 +1,38 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:56 -0700 +Subject: scsi: lpfc: Fix language in 0373 message to reflect non-error message +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 28ed7374401b20915bf980fdf2d3ac80f8c2945d +References: bsc#1172687 bsc#1171530 + +Change vocabulary of 0373 log msg from "error" to "cmpl" The current +language of the 0373 message contains the word "error" which caused a +number of customers to inquire about the "error" and if it should be a +concern. It isn't an error, it's simply an io completion status. + +Revise the message to replace the word "error" with "cmpl" for completion. + +Link: https://lore.kernel.org/r/20200630215001.70793-10-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_sli.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -13840,9 +13840,9 @@ lpfc_sli4_fp_handle_fcp_wcqe(struct lpfc + IOERR_NO_RESOURCES)) + phba->lpfc_rampdown_queue_depth(phba); + +- /* Log the error status */ ++ /* Log the cmpl status */ + lpfc_printf_log(phba, KERN_INFO, LOG_SLI, +- "0373 FCP CQE error: status=x%x: " ++ "0373 FCP CQE cmpl: status=x%x: " + "CQE: %08x %08x %08x %08x\n", + bf_get(lpfc_wcqe_c_status, wcqe), + wcqe->word0, wcqe->total_data_placed, diff --git a/patches.suse/scsi-lpfc-Fix-less-than-zero-comparison-of-unsigned-.patch b/patches.suse/scsi-lpfc-Fix-less-than-zero-comparison-of-unsigned-.patch new file mode 100644 index 0000000..f9f5523 --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-less-than-zero-comparison-of-unsigned-.patch @@ -0,0 +1,54 @@ +From: Dick Kennedy +Date: Mon, 6 Jul 2020 13:42:46 -0700 +Subject: scsi: lpfc: Fix less-than-zero comparison of unsigned value +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 77dd7d7b344283a3bce334d0f43fc2c0629ffe48 +References: bsc#1158983 + +The expression start_idx - dbg_cnt is evaluated using unsigned int +arthithmetic (since these variables are unsigned ints) and hence can never +be less than zero, so the less than comparison is never true. Rewrite the +expression to check for start_idx being less than dbg_cnt. + +After the logic was corrected, temp_idx wasn't working correctly. So fix it +as well. + +Link: https://lore.kernel.org/r/20200706204246.130416-1-jsmart2021@gmail.com +Fixes: 372c187b8a70 ("scsi: lpfc: Add an internal trace log buffer") +CC: Colin Ian King +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Addresses-Coverity: ("Unsigned compared against 0") +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_init.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -14173,12 +14173,10 @@ void lpfc_dmp_dbg(struct lpfc_hba *phba) + if ((start_idx + dbg_cnt) > (DBG_LOG_SZ - 1)) { + temp_idx = (start_idx + dbg_cnt) % DBG_LOG_SZ; + } else { +- if ((start_idx - dbg_cnt) < 0) { ++ if (start_idx < dbg_cnt) + start_idx = DBG_LOG_SZ - (dbg_cnt - start_idx); +- temp_idx = 0; +- } else { ++ else + start_idx -= dbg_cnt; +- } + } + } + dev_info(&phba->pcidev->dev, "start %d end %d cnt %d\n", +@@ -14186,7 +14184,7 @@ void lpfc_dmp_dbg(struct lpfc_hba *phba) + + for (i = 0; i < dbg_cnt; i++) { + if ((start_idx + i) < DBG_LOG_SZ) +- temp_idx = (start_idx + i) % (DBG_LOG_SZ - 1); ++ temp_idx = (start_idx + i) % DBG_LOG_SZ; + else + temp_idx = j++; + rem_nsec = do_div(phba->dbg_log[temp_idx].t_ns, NSEC_PER_SEC); diff --git a/patches.suse/scsi-lpfc-Fix-missing-MDS-functionality.patch b/patches.suse/scsi-lpfc-Fix-missing-MDS-functionality.patch new file mode 100644 index 0000000..49bbb30 --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-missing-MDS-functionality.patch @@ -0,0 +1,47 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:49 -0700 +Subject: scsi: lpfc: Fix missing MDS functionality +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: c93764a65b4b2aaa1b187f815fc88a26073f758c +References: bsc#1172687 bsc#1171530 + +Visual code inspection of the MDS implementation revealed two errors in +the driver: + + - The set features Feature Code had an incorrect value + + - The routine that classifies command type for cmd completions was missing + the Send Frame definition. Send Frame is used for MDS driver loopback. + +Link: https://lore.kernel.org/r/20200630215001.70793-3-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_hw4.h | 2 +- + drivers/scsi/lpfc/lpfc_sli.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/lpfc/lpfc_hw4.h ++++ b/drivers/scsi/lpfc/lpfc_hw4.h +@@ -3531,7 +3531,7 @@ struct lpfc_sli4_parameters { + }; + + #define LPFC_SET_UE_RECOVERY 0x10 +-#define LPFC_SET_MDS_DIAGS 0x11 ++#define LPFC_SET_MDS_DIAGS 0x12 + #define LPFC_SET_DUAL_DUMP 0x1e + struct lpfc_mbx_set_feature { + struct mbox_header header; +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -1494,6 +1494,7 @@ lpfc_sli_iocb_cmd_type(uint8_t iocb_cmnd + case DSSCMD_IWRITE64_CX: + case DSSCMD_IREAD64_CR: + case DSSCMD_IREAD64_CX: ++ case CMD_SEND_FRAME: + type = LPFC_SOL_IOCB; + break; + case CMD_ABORT_XRI_CN: diff --git a/patches.suse/scsi-lpfc-Fix-oops-due-to-overrun-when-reading-SLI3-.patch b/patches.suse/scsi-lpfc-Fix-oops-due-to-overrun-when-reading-SLI3-.patch new file mode 100644 index 0000000..6f299ad --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-oops-due-to-overrun-when-reading-SLI3-.patch @@ -0,0 +1,81 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:52 -0700 +Subject: scsi: lpfc: Fix oops due to overrun when reading SLI3 data +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: d91e3abb682b07b04ced3f3d363651abedcb0309 +References: bsc#1172687 bsc#1171530 + +When using DUMP on SLI3 to read VPD and Port status data (config region +23), the adapter is overruning the kmalloc'd buffer causing havoc on other +consumers of the allocation pools. + +Rework the loops processing the dump data and validate/size memory lengths +before performing bcopy. + +Link: https://lore.kernel.org/r/20200630215001.70793-6-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_init.c | 14 ++++++++------ + drivers/scsi/lpfc/lpfc_sli.c | 14 +++++++------- + 2 files changed, 15 insertions(+), 13 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -256,13 +256,15 @@ lpfc_config_port_prep(struct lpfc_hba *p + */ + if (mb->un.varDmp.word_cnt == 0) + break; +- if (mb->un.varDmp.word_cnt > DMP_VPD_SIZE - offset) +- mb->un.varDmp.word_cnt = DMP_VPD_SIZE - offset; ++ ++ i = mb->un.varDmp.word_cnt * sizeof(uint32_t); ++ if (offset + i > DMP_VPD_SIZE) ++ i = DMP_VPD_SIZE - offset; + lpfc_sli_pcimem_bcopy(((uint8_t *)mb) + DMP_RSP_OFFSET, +- lpfc_vpd_data + offset, +- mb->un.varDmp.word_cnt); +- offset += mb->un.varDmp.word_cnt; +- } while (mb->un.varDmp.word_cnt && offset < DMP_VPD_SIZE); ++ lpfc_vpd_data + offset, i); ++ offset += i; ++ } while (offset < DMP_VPD_SIZE); ++ + lpfc_parse_vpd(phba, lpfc_vpd_data, offset); + + kfree(lpfc_vpd_data); +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -19220,7 +19220,7 @@ lpfc_sli_get_config_region23(struct lpfc + LPFC_MBOXQ_t *pmb = NULL; + MAILBOX_t *mb; + uint32_t offset = 0; +- int rc; ++ int i, rc; + + if (!rgn23_data) + return 0; +@@ -19250,14 +19250,14 @@ lpfc_sli_get_config_region23(struct lpfc + */ + if (mb->un.varDmp.word_cnt == 0) + break; +- if (mb->un.varDmp.word_cnt > DMP_RGN23_SIZE - offset) +- mb->un.varDmp.word_cnt = DMP_RGN23_SIZE - offset; + ++ i = mb->un.varDmp.word_cnt * sizeof(uint32_t); ++ if (offset + i > DMP_RGN23_SIZE) ++ i = DMP_RGN23_SIZE - offset; + lpfc_sli_pcimem_bcopy(((uint8_t *)mb) + DMP_RSP_OFFSET, +- rgn23_data + offset, +- mb->un.varDmp.word_cnt); +- offset += mb->un.varDmp.word_cnt; +- } while (mb->un.varDmp.word_cnt && offset < DMP_RGN23_SIZE); ++ rgn23_data + offset, i); ++ offset += i; ++ } while (offset < DMP_RGN23_SIZE); + + mempool_free(pmb, phba->mbox_mem_pool); + return offset; diff --git a/patches.suse/scsi-lpfc-Fix-shost-refcount-mismatch-when-deleting-.patch b/patches.suse/scsi-lpfc-Fix-shost-refcount-mismatch-when-deleting-.patch new file mode 100644 index 0000000..a57287b --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-shost-refcount-mismatch-when-deleting-.patch @@ -0,0 +1,80 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:54 -0700 +Subject: scsi: lpfc: Fix shost refcount mismatch when deleting vport +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 03dbfe0668e6692917ac278883e0586cd7f7d753 +References: bsc#1172687 bsc#1171530 + +When vports are deleted, it is observed that there is memory/kthread +leakage as the vport isn't fully being released. + +There is a shost reference taken in scsi_add_host_dma that is not released +during scsi_remove_host. It was noticed that other drivers resolve this by +doing a scsi_host_put after calling scsi_remove_host. + +The vport_delete routine is taking two references one that corresponds to +an access to the scsi_host in the vport_delete routine and another that is +released after the adapter mailbox command completes that destroys the VPI +that corresponds to the vport. + +Remove one of the references taken such that the second reference that is +put will complete the missing scsi_add_host_dma reference and the shost +will be terminated. + +Link: https://lore.kernel.org/r/20200630215001.70793-8-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_vport.c | 26 ++++++++------------------ + 1 file changed, 8 insertions(+), 18 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_vport.c ++++ b/drivers/scsi/lpfc/lpfc_vport.c +@@ -642,27 +642,16 @@ lpfc_vport_delete(struct fc_vport *fc_vp + vport->port_state < LPFC_VPORT_READY) + return -EAGAIN; + } ++ + /* +- * This is a bit of a mess. We want to ensure the shost doesn't get +- * torn down until we're done with the embedded lpfc_vport structure. +- * +- * Beyond holding a reference for this function, we also need a +- * reference for outstanding I/O requests we schedule during delete +- * processing. But once we scsi_remove_host() we can no longer obtain +- * a reference through scsi_host_get(). +- * +- * So we take two references here. We release one reference at the +- * bottom of the function -- after delinking the vport. And we +- * release the other at the completion of the unreg_vpi that get's +- * initiated after we've disposed of all other resources associated +- * with the port. ++ * Take early refcount for outstanding I/O requests we schedule during ++ * delete processing for unreg_vpi. Always keep this before ++ * scsi_remove_host() as we can no longer obtain a reference through ++ * scsi_host_get() after scsi_host_remove as shost is set to SHOST_DEL. + */ + if (!scsi_host_get(shost)) + return VPORT_INVAL; +- if (!scsi_host_get(shost)) { +- scsi_host_put(shost); +- return VPORT_INVAL; +- } ++ + lpfc_free_sysfs_attr(vport); + + lpfc_debugfs_terminate(vport); +@@ -809,8 +798,9 @@ lpfc_vport_delete(struct fc_vport *fc_vp + if (!(vport->vpi_state & LPFC_VPI_REGISTERED) || + lpfc_mbx_unreg_vpi(vport)) + scsi_host_put(shost); +- } else ++ } else { + scsi_host_put(shost); ++ } + + lpfc_free_vpi(phba, vport->vpi); + vport->work_port_events = 0; diff --git a/patches.suse/scsi-lpfc-Fix-stack-trace-seen-while-setting-rrq-act.patch b/patches.suse/scsi-lpfc-Fix-stack-trace-seen-while-setting-rrq-act.patch new file mode 100644 index 0000000..c51c514 --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-stack-trace-seen-while-setting-rrq-act.patch @@ -0,0 +1,58 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:53 -0700 +Subject: scsi: lpfc: Fix stack trace seen while setting rrq active +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 9dace1fa91ca419d44da29e877fe1e9a59ad4248 +References: bsc#1172687 bsc#1171530 + +Call traces have been observed running different tests that involve aborts +and setting the rrq active flag. The lpfc_set_rrq_active routine is doing +a mempool_alloc under the soft_irq processing level. When the mempool needs +to get a new buffer from the free pool and has to wait for memory to become +free it will check the flags passed in on the alloc and dump the stack if +the thread is running in interrupt context. + +Replace the GFP_KERNEL flag with GFP_ATOMIC so that the memory allocation +will not attempt to sleep if there is no mem available. + +Link: https://lore.kernel.org/r/20200630215001.70793-7-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_mem.c | 3 ++- + drivers/scsi/lpfc/lpfc_sli.c | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_mem.c ++++ b/drivers/scsi/lpfc/lpfc_mem.c +@@ -49,6 +49,7 @@ + #define LPFC_MBUF_POOL_SIZE 64 /* max elements in MBUF safety pool */ + #define LPFC_MEM_POOL_SIZE 64 /* max elem in non-DMA safety pool */ + #define LPFC_DEVICE_DATA_POOL_SIZE 64 /* max elements in device data pool */ ++#define LPFC_RRQ_POOL_SIZE 256 /* max elements in non-DMA pool */ + + int + lpfc_mem_alloc_active_rrq_pool_s4(struct lpfc_hba *phba) { +@@ -124,7 +125,7 @@ lpfc_mem_alloc(struct lpfc_hba *phba, in + + if (phba->sli_rev == LPFC_SLI_REV4) { + phba->rrq_pool = +- mempool_create_kmalloc_pool(LPFC_MEM_POOL_SIZE, ++ mempool_create_kmalloc_pool(LPFC_RRQ_POOL_SIZE, + sizeof(struct lpfc_node_rrq)); + if (!phba->rrq_pool) + goto fail_free_nlp_mem_pool; +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -1082,7 +1082,7 @@ lpfc_set_rrq_active(struct lpfc_hba *phb + goto out; + + spin_unlock_irqrestore(&phba->hbalock, iflags); +- rrq = mempool_alloc(phba->rrq_pool, GFP_KERNEL); ++ rrq = mempool_alloc(phba->rrq_pool, GFP_ATOMIC); + if (!rrq) { + lpfc_printf_log(phba, KERN_INFO, LOG_SLI, + "3155 Unable to allocate RRQ xri:0x%x rxid:0x%x" diff --git a/patches.suse/scsi-lpfc-Fix-unused-assignment-in-lpfc_sli4_bsg_lin.patch b/patches.suse/scsi-lpfc-Fix-unused-assignment-in-lpfc_sli4_bsg_lin.patch new file mode 100644 index 0000000..f7bb8f6 --- /dev/null +++ b/patches.suse/scsi-lpfc-Fix-unused-assignment-in-lpfc_sli4_bsg_lin.patch @@ -0,0 +1,110 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:49:48 -0700 +Subject: scsi: lpfc: Fix unused assignment in lpfc_sli4_bsg_link_diag_test +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: e5fcb81d40d44d3000e5ff8b6c9d87ea36a26faa +References: bsc#1172687 bsc#1171530 + +Coverity reported the following error: + + Assigned value that is never used may represent unnecessary computation. + +The rc variable was initially assigned a value but in several cases, when +an error case is detected, it is reassigned a new value. The initial value +had little use. + +In code-reviewing this routine, it could use some cleanup: + + - Setting the initialization value to -ENODEV is a much better choice and + lessens code in the routine. + + - The wasn't tracking logic errors vs no error and mailbox failure. + Better to resolve by adding a status to track the mailbox failure + and merge it with the logic error when the routine returns. + +Link: https://lore.kernel.org/r/20200630215001.70793-2-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_bsg.c | 34 ++++++++++++++++------------------ + 1 file changed, 16 insertions(+), 18 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -2407,33 +2407,27 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_ + union lpfc_sli4_cfg_shdr *shdr; + uint32_t shdr_status, shdr_add_status; + struct diag_status *diag_status_reply; +- int mbxstatus, rc = 0; ++ int mbxstatus, rc = -ENODEV, rc1 = 0; + + shost = fc_bsg_to_shost(job); +- if (!shost) { +- rc = -ENODEV; ++ if (!shost) + goto job_error; +- } ++ + vport = shost_priv(shost); +- if (!vport) { +- rc = -ENODEV; ++ if (!vport) + goto job_error; +- } ++ + phba = vport->phba; +- if (!phba) { +- rc = -ENODEV; ++ if (!phba) + goto job_error; +- } + +- if (phba->sli_rev < LPFC_SLI_REV4) { +- rc = -ENODEV; ++ ++ if (phba->sli_rev < LPFC_SLI_REV4) + goto job_error; +- } ++ + if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) < +- LPFC_SLI_INTF_IF_TYPE_2) { +- rc = -ENODEV; ++ LPFC_SLI_INTF_IF_TYPE_2) + goto job_error; +- } + + if (job->request_len < sizeof(struct fc_bsg_request) + + sizeof(struct sli4_link_diag)) { +@@ -2468,8 +2462,10 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_ + alloc_len = lpfc_sli4_config(phba, pmboxq, LPFC_MBOX_SUBSYSTEM_FCOE, + LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_STATE, + req_len, LPFC_SLI4_MBX_EMBED); +- if (alloc_len != req_len) ++ if (alloc_len != req_len) { ++ rc = -ENOMEM; + goto link_diag_test_exit; ++ } + + run_link_diag_test = &pmboxq->u.mqe.un.link_diag_test; + bf_set(lpfc_mbx_run_diag_test_link_num, &run_link_diag_test->u.req, +@@ -2518,7 +2514,7 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_ + diag_status_reply->shdr_add_status = shdr_add_status; + + link_diag_test_exit: +- rc = lpfc_sli4_bsg_set_link_diag_state(phba, 0); ++ rc1 = lpfc_sli4_bsg_set_link_diag_state(phba, 0); + + if (pmboxq) + mempool_free(pmboxq, phba->mbox_mem_pool); +@@ -2527,6 +2523,8 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_ + + job_error: + /* make error code available to userspace */ ++ if (rc1 && !rc) ++ rc = rc1; + bsg_reply->result = rc; + /* complete the job back to userspace if no error */ + if (rc == 0) diff --git a/patches.suse/scsi-lpfc-Update-lpfc-version-to-12.8.0.2.patch b/patches.suse/scsi-lpfc-Update-lpfc-version-to-12.8.0.2.patch new file mode 100644 index 0000000..9925ff6 --- /dev/null +++ b/patches.suse/scsi-lpfc-Update-lpfc-version-to-12.8.0.2.patch @@ -0,0 +1,30 @@ +From: Dick Kennedy +Date: Tue, 30 Jun 2020 14:50:01 -0700 +Subject: scsi: lpfc: Update lpfc version to 12.8.0.2 +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git +Git-commit: 3fed58b94e3d7607d30725cc5cb987def7884bd6 +References: bsc#1158983 + +Update lpfc version to 12.8.0.2 + +Link: https://lore.kernel.org/r/20200630215001.70793-15-jsmart2021@gmail.com +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_version.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/lpfc/lpfc_version.h ++++ b/drivers/scsi/lpfc/lpfc_version.h +@@ -20,7 +20,7 @@ + * included with this package. * + *******************************************************************/ + +-#define LPFC_DRIVER_VERSION "12.8.0.1" ++#define LPFC_DRIVER_VERSION "12.8.0.2" + #define LPFC_DRIVER_NAME "lpfc" + + /* Used for SLI 2/3 */ diff --git a/patches.suse/scsi-megaraid_sas-Fix-a-compilation-warning.patch b/patches.suse/scsi-megaraid_sas-Fix-a-compilation-warning.patch new file mode 100644 index 0000000..3dfddcd --- /dev/null +++ b/patches.suse/scsi-megaraid_sas-Fix-a-compilation-warning.patch @@ -0,0 +1,44 @@ +From: Qian Cai +Date: Fri, 26 Jul 2019 10:25:43 -0400 +Subject: [PATCH] scsi: megaraid_sas: Fix a compilation warning +Git-commit: e5460f084b84f06756e558fbfd2313202fb1dbd0 +Patch-Mainline: v5.4-rc1 +References: bsc#1174296 + +The commit de516379e85f ("scsi: megaraid_sas: changes to function +prototypes") introduced a comilation warning due to it changed the function +prototype of read_fw_status_reg() to take an instance pointer instead, but +forgot to remove an unused variable. + +drivers/scsi/megaraid/megaraid_sas_fusion.c: In function +'megasas_fusion_update_can_queue': +drivers/scsi/megaraid/megaraid_sas_fusion.c:326:39: warning: variable +'reg_set' set but not used [-Wunused-but-set-variable] + struct megasas_register_set __iomem *reg_set; + ^~~~~~~ +Fixes: de516379e85f ("scsi: megaraid_sas: changes to function prototypes") +Signed-off-by: Qian Cai +Acked-by: Sumit Saxena +Signed-off-by: Martin K. Petersen +Acked-by: Hannes Reinecke +--- + drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c +index fa4e1b607e04..fadab7a91573 100644 +--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c ++++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c +@@ -323,9 +323,6 @@ megasas_fusion_update_can_queue(struct megasas_instance *instance, int fw_boot_c + { + u16 cur_max_fw_cmds = 0; + u16 ldio_threshold = 0; +- struct megasas_register_set __iomem *reg_set; +- +- reg_set = instance->reg_set; + + /* ventura FW does not fill outbound_scratch_pad_2 with queue depth */ + if (instance->adapter_type < VENTURA_SERIES) +-- +2.16.4 + diff --git a/patches.suse/scsi-mpt3sas-Fix-double-free-in-attach-error-handlin.patch b/patches.suse/scsi-mpt3sas-Fix-double-free-in-attach-error-handlin.patch new file mode 100644 index 0000000..0897afc --- /dev/null +++ b/patches.suse/scsi-mpt3sas-Fix-double-free-in-attach-error-handlin.patch @@ -0,0 +1,45 @@ +From: Dan Carpenter +Date: Tue, 3 Dec 2019 12:36:52 +0300 +Subject: [PATCH] scsi: mpt3sas: Fix double free in attach error handling +Git-commit: ee560e7bbab0c10cf3f0e71997fbc354ab2ee5cb +Patch-Mainline: v5.5-rc4 +References: bsc#1174296 + +The caller also calls _base_release_memory_pools() on error so it leads to +a number of double frees: + +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->chain_dma_pool' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->hpr_lookup' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->internal_lookup' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->pcie_sgl_dma_pool' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_dma_pool' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_free_dma_pool' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_post_free_array_dma_pool' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_post_free_dma_pool' double freed +drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->sense_dma_pool' double freed + +Fixes: 74522a92bbf0 ("scsi: mpt3sas: Optimize I/O memory consumption in driver.") +Link: https://lore.kernel.org/r/20191203093652.gyntgvnkw2udatyc@kili.mountain +Signed-off-by: Dan Carpenter +Acked-by: Sreekanth Reddy +Signed-off-by: Martin K. Petersen +Acked-by: Hannes Reinecke +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c +index 848fbec7bda6..45fd8dfb7c40 100644 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -5248,7 +5248,6 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) + &ct->chain_buffer_dma); + if (!ct->chain_buffer) { + ioc_err(ioc, "chain_lookup: pci_pool_alloc failed\n"); +- _base_release_memory_pools(ioc); + goto out; + } + } +-- +2.16.4 + diff --git a/patches.suse/scsi-qla2xxx-Fix-a-condition-in-qla2x00_find_all_fab.patch b/patches.suse/scsi-qla2xxx-Fix-a-condition-in-qla2x00_find_all_fab.patch new file mode 100644 index 0000000..5ff6d9d --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Fix-a-condition-in-qla2x00_find_all_fab.patch @@ -0,0 +1,37 @@ +From: Dan Carpenter +Date: Fri, 19 Jun 2020 17:30:41 +0300 +Subject: [PATCH] scsi: qla2xxx: Fix a condition in + qla2x00_find_all_fabric_devs() +Git-commit: 1fc98aaf7f85fadcca57c4a86ef17e1940cad2d3 +Patch-Mainline: v5.8-rc4 +References: bsc#1174296 + +This code doesn't make sense unless the correct "fcport" was found. + +Link: https://lore.kernel.org/r/20200619143041.GD267142@mwanda +Fixes: 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver") +Reviewed-by: Himanshu Madhani +Reviewed-by: Shyam Sundar +Signed-off-by: Dan Carpenter +Signed-off-by: Martin K. Petersen +Acked-by: Hannes Reinecke +--- + drivers/scsi/qla2xxx/qla_init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index 4576d3ae9937..2436a17f5cd9 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -5944,7 +5944,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) + break; + } + +- if (NVME_TARGET(vha->hw, fcport)) { ++ if (found && NVME_TARGET(vha->hw, fcport)) { + if (fcport->disc_state == DSC_DELETE_PEND) { + qla2x00_set_fcport_disc_state(fcport, DSC_GNL); + vha->fcport_count--; +-- +2.16.4 + diff --git a/patches.suse/sctp-Don-t-add-the-shutdown-timer-if-its-already-bee.patch b/patches.suse/sctp-Don-t-add-the-shutdown-timer-if-its-already-bee.patch new file mode 100644 index 0000000..8f9a05d --- /dev/null +++ b/patches.suse/sctp-Don-t-add-the-shutdown-timer-if-its-already-bee.patch @@ -0,0 +1,79 @@ +From: Neil Horman +Date: Tue, 19 May 2020 16:04:05 -0400 +Subject: sctp: Don't add the shutdown timer if its already been added +Git-commit: 20a785aa52c82246055a089e55df9dac47d67da1 +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +This BUG halt was reported a while back, but the patch somehow got +missed: + +PID: 2879 TASK: c16adaa0 CPU: 1 COMMAND: "sctpn" + #0 [f418dd28] crash_kexec at c04a7d8c + #1 [f418dd7c] oops_end at c0863e02 + #2 [f418dd90] do_invalid_op at c040aaca + #3 [f418de28] error_code (via invalid_op) at c08631a5 + EAX: f34baac0 EBX: 00000090 ECX: f418deb0 EDX: f5542950 EBP: 00000000 + DS: 007b ESI: f34ba800 ES: 007b EDI: f418dea0 GS: 00e0 + CS: 0060 EIP: c046fa5e ERR: ffffffff EFLAGS: 00010286 + #4 [f418de5c] add_timer at c046fa5e + #5 [f418de68] sctp_do_sm at f8db8c77 [sctp] + #6 [f418df30] sctp_primitive_SHUTDOWN at f8dcc1b5 [sctp] + #7 [f418df48] inet_shutdown at c080baf9 + #8 [f418df5c] sys_shutdown at c079eedf + #9 [f418df70] sys_socketcall at c079fe88 + EAX: ffffffda EBX: 0000000d ECX: bfceea90 EDX: 0937af98 + DS: 007b ESI: 0000000c ES: 007b EDI: b7150ae4 + SS: 007b ESP: bfceea7c EBP: bfceeaa8 GS: 0033 + CS: 0073 EIP: b775c424 ERR: 00000066 EFLAGS: 00000282 + +It appears that the side effect that starts the shutdown timer was processed +multiple times, which can happen as multiple paths can trigger it. This of +course leads to the BUG halt in add_timer getting called. + +Fix seems pretty straightforward, just check before the timer is added if its +already been started. If it has mod the timer instead to min(current +expiration, new expiration) + +Its been tested but not confirmed to fix the problem, as the issue has only +occured in production environments where test kernels are enjoined from being +installed. It appears to be a sane fix to me though. Also, recentely, +Jere found a reproducer posted on list to confirm that this resolves the +issues + +Signed-off-by: Neil Horman +CC: Vlad Yasevich +CC: "David S. Miller" +CC: jere.leppanen@nokia.com +CC: marcelo.leitner@gmail.com +CC: netdev@vger.kernel.org +Acked-by: Marcelo Ricardo Leitner +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/sctp/sm_sideeffect.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- a/net/sctp/sm_sideeffect.c ++++ b/net/sctp/sm_sideeffect.c +@@ -1498,9 +1498,17 @@ static int sctp_cmd_interpreter(sctp_eve + timeout = asoc->timeouts[cmd->obj.to]; + BUG_ON(!timeout); + +- timer->expires = jiffies + timeout; +- sctp_association_hold(asoc); +- add_timer(timer); ++ /* ++ * SCTP has a hard time with timer starts. Because we process ++ * timer starts as side effects, it can be hard to tell if we ++ * have already started a timer or not, which leads to BUG ++ * halts when we call add_timer. So here, instead of just starting ++ * a timer, if the timer is already started, and just mod ++ * the timer with the shorter of the two expiration times ++ */ ++ if (!timer_pending(timer)) ++ sctp_association_hold(asoc); ++ timer_reduce(timer, jiffies + timeout); + break; + + case SCTP_CMD_TIMER_RESTART: diff --git a/patches.suse/sctp-Start-shutdown-on-association-restart-if-in-SHU.patch b/patches.suse/sctp-Start-shutdown-on-association-restart-if-in-SHU.patch new file mode 100644 index 0000000..c1df4e5 --- /dev/null +++ b/patches.suse/sctp-Start-shutdown-on-association-restart-if-in-SHU.patch @@ -0,0 +1,71 @@ +From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= +Date: Wed, 20 May 2020 18:15:31 +0300 +Subject: sctp: Start shutdown on association restart if in SHUTDOWN-SENT state + and socket is closed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: d3e8e4c11870413789f029a71e72ae6e971fe678 +Patch-mainline: 5.7-rc7 +References: networking-stable-20_05_27 + +Commit bdf6fa52f01b ("sctp: handle association restarts when the +socket is closed.") starts shutdown when an association is restarted, +if in SHUTDOWN-PENDING state and the socket is closed. However, the +rationale stated in that commit applies also when in SHUTDOWN-SENT +state - we don't want to move an association to ESTABLISHED state when +the socket has been closed, because that results in an association +that is unreachable from user space. + +The problem scenario: + +1. Client crashes and/or restarts. + +2. Server (using one-to-one socket) calls close(). SHUTDOWN is lost. + +3. Client reconnects using the same addresses and ports. + +4. Server's association is restarted. The association and the socket + move to ESTABLISHED state, even though the server process has + closed its descriptor. + +Also, after step 4 when the server process exits, some resources are +leaked in an attempt to release the underlying inet sock structure in +ESTABLISHED state: + + IPv4: Attempt to release TCP socket in state 1 00000000377288c7 + +Fix by acting the same way as in SHUTDOWN-PENDING state. That is, if +an association is restarted in SHUTDOWN-SENT state and the socket is +closed, then start shutdown and don't move the association or the +socket to ESTABLISHED state. + +Fixes: bdf6fa52f01b ("sctp: handle association restarts when the socket is closed.") +Signed-off-by: Jere Leppänen +Acked-by: Marcelo Ricardo Leitner +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + net/sctp/sm_statefuns.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/net/sctp/sm_statefuns.c ++++ b/net/sctp/sm_statefuns.c +@@ -1819,12 +1819,13 @@ static sctp_disposition_t sctp_sf_do_dup + /* Update the content of current association. */ + sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc)); + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); +- if (sctp_state(asoc, SHUTDOWN_PENDING) && ++ if ((sctp_state(asoc, SHUTDOWN_PENDING) || ++ sctp_state(asoc, SHUTDOWN_SENT)) && + (sctp_sstate(asoc->base.sk, CLOSING) || + sock_flag(asoc->base.sk, SOCK_DEAD))) { +- /* if were currently in SHUTDOWN_PENDING, but the socket +- * has been closed by user, don't transition to ESTABLISHED. +- * Instead trigger SHUTDOWN bundled with COOKIE_ACK. ++ /* If the socket has been closed by user, don't ++ * transition to ESTABLISHED. Instead trigger SHUTDOWN ++ * bundled with COOKIE_ACK. + */ + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); + return sctp_sf_do_9_2_start_shutdown(net, ep, asoc, diff --git a/patches.suse/spi-spi-sun6i-sun6i_spi_transfer_one-fix-setting-of-.patch b/patches.suse/spi-spi-sun6i-sun6i_spi_transfer_one-fix-setting-of-.patch new file mode 100644 index 0000000..6008ade --- /dev/null +++ b/patches.suse/spi-spi-sun6i-sun6i_spi_transfer_one-fix-setting-of-.patch @@ -0,0 +1,70 @@ +From ed7815db70d17b1741883f2da8e1d80bc2efe517 Mon Sep 17 00:00:00 2001 +From: Marc Kleine-Budde +Date: Mon, 6 Jul 2020 16:34:34 +0200 +Subject: [PATCH] spi: spi-sun6i: sun6i_spi_transfer_one(): fix setting of clock rate +Git-commit: ed7815db70d17b1741883f2da8e1d80bc2efe517 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +A SPI transfer defines the _maximum_ speed of the SPI transfer. However the +driver doesn't take into account that the clock divider is always rounded down +(due to integer arithmetics). This results in a too high clock rate for the SPI +transfer. + +E.g.: with a mclk_rate of 24 MHz and a SPI transfer speed of 10 MHz, the +original code calculates a reg of "0", which results in a effective divider of +"2" and a 12 MHz clock for the SPI transfer. + +This patch fixes the issue by using DIV_ROUND_UP() instead of a plain +integer division. + +While there simplify the divider calculation for the CDR1 case, use +order_base_2() instead of two ilog2() calculations. + +Fixes: 3558fe900e8a ("spi: sunxi: Add Allwinner A31 SPI controller driver") +Signed-off-by: Marc Kleine-Budde +Acked-by: Maxime Ripard +Link: https://lore.kernel.org/r/20200706143443.9855-2-mkl@pengutronix.de +Signed-off-by: Mark Brown +Acked-by: Takashi Iwai + +--- + drivers/spi/spi-sun6i.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c +index ecea15534c42..fa11cc0e809b 100644 +--- a/drivers/spi/spi-sun6i.c ++++ b/drivers/spi/spi-sun6i.c +@@ -198,7 +198,7 @@ static int sun6i_spi_transfer_one(struct spi_master *master, + struct spi_transfer *tfr) + { + struct sun6i_spi *sspi = spi_master_get_devdata(master); +- unsigned int mclk_rate, div, timeout; ++ unsigned int mclk_rate, div, div_cdr1, div_cdr2, timeout; + unsigned int start, end, tx_time; + unsigned int trig_level; + unsigned int tx_len = 0; +@@ -287,14 +287,12 @@ static int sun6i_spi_transfer_one(struct spi_master *master, + * First try CDR2, and if we can't reach the expected + * frequency, fall back to CDR1. + */ +- div = mclk_rate / (2 * tfr->speed_hz); +- if (div <= (SUN6I_CLK_CTL_CDR2_MASK + 1)) { +- if (div > 0) +- div--; +- +- reg = SUN6I_CLK_CTL_CDR2(div) | SUN6I_CLK_CTL_DRS; ++ div_cdr1 = DIV_ROUND_UP(mclk_rate, tfr->speed_hz); ++ div_cdr2 = DIV_ROUND_UP(div_cdr1, 2); ++ if (div_cdr2 <= (SUN6I_CLK_CTL_CDR2_MASK + 1)) { ++ reg = SUN6I_CLK_CTL_CDR2(div_cdr2 - 1) | SUN6I_CLK_CTL_DRS; + } else { +- div = ilog2(mclk_rate) - ilog2(tfr->speed_hz); ++ div = min(SUN6I_CLK_CTL_CDR1_MASK, order_base_2(div_cdr1)); + reg = SUN6I_CLK_CTL_CDR1(div); + } + +-- +2.16.4 + diff --git a/patches.suse/staging-comedi-verify-array-index-is-correct-before-.patch b/patches.suse/staging-comedi-verify-array-index-is-correct-before-.patch new file mode 100644 index 0000000..251bdc8 --- /dev/null +++ b/patches.suse/staging-comedi-verify-array-index-is-correct-before-.patch @@ -0,0 +1,54 @@ +From ef75e14a6c935eec82abac07ab68e388514e39bc Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Thu, 9 Jul 2020 13:29:36 +0300 +Subject: [PATCH] staging: comedi: verify array index is correct before using it +Git-commit: ef75e14a6c935eec82abac07ab68e388514e39bc +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +This code reads from the array before verifying that "trig" is a valid +index. If the index is wildly out of bounds then reading from an +invalid address could lead to an Oops. + +Fixes: a8c66b684efa ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions") +Signed-off-by: Dan Carpenter +Reviewed-by: Ian Abbott +Link: https://lore.kernel.org/r/20200709102936.GA20875@mwanda +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/staging/comedi/drivers/addi_apci_1500.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c +index 45ad4ba92f94..689acd69a1b9 100644 +--- a/drivers/staging/comedi/drivers/addi_apci_1500.c ++++ b/drivers/staging/comedi/drivers/addi_apci_1500.c +@@ -456,9 +456,9 @@ static int apci1500_di_cfg_trig(struct comedi_device *dev, + unsigned int lo_mask = data[5] << shift; + unsigned int chan_mask = hi_mask | lo_mask; + unsigned int old_mask = (1 << shift) - 1; +- unsigned int pm = devpriv->pm[trig] & old_mask; +- unsigned int pt = devpriv->pt[trig] & old_mask; +- unsigned int pp = devpriv->pp[trig] & old_mask; ++ unsigned int pm; ++ unsigned int pt; ++ unsigned int pp; + + if (trig > 1) { + dev_dbg(dev->class_dev, +@@ -471,6 +471,10 @@ static int apci1500_di_cfg_trig(struct comedi_device *dev, + return -EINVAL; + } + ++ pm = devpriv->pm[trig] & old_mask; ++ pt = devpriv->pt[trig] & old_mask; ++ pp = devpriv->pp[trig] & old_mask; ++ + switch (data[2]) { + case COMEDI_DIGITAL_TRIG_DISABLE: + /* clear trigger configuration */ +-- +2.16.4 + diff --git a/patches.suse/timers-Add-a-function-to-start-reduce-a-timer.patch b/patches.suse/timers-Add-a-function-to-start-reduce-a-timer.patch new file mode 100644 index 0000000..2b26220 --- /dev/null +++ b/patches.suse/timers-Add-a-function-to-start-reduce-a-timer.patch @@ -0,0 +1,199 @@ +From: David Howells +Date: Thu, 9 Nov 2017 12:35:07 +0000 +Subject: timers: Add a function to start/reduce a timer +Git-commit: b24591e2fcf852ad7ad2ccf745c8220bf378d312 +Patch-mainline: 4.15-rc1 +References: networking-stable-20_05_27 + +Add a function, similar to mod_timer(), that will start a timer if it isn't +running and will modify it if it is running and has an expiry time longer +than the new time. If the timer is running with an expiry time that's the +same or sooner, no change is made. + +The function looks like: + + int timer_reduce(struct timer_list *timer, unsigned long expires); + +This can be used by code such as networking code to make it easier to share +a timer for multiple timeouts. For instance, in upcoming AF_RXRPC code, +the rxrpc_call struct will maintain a number of timeouts: + + unsigned long ack_at; + unsigned long resend_at; + unsigned long ping_at; + unsigned long expect_rx_by; + unsigned long expect_req_by; + unsigned long expect_term_by; + +each of which is set independently of the others. With timer reduction +available, when the code needs to set one of the timeouts, it only needs to +look at that timeout and then call timer_reduce() to modify the timer, +starting it or bringing it forward if necessary. There is no need to refer +to the other timeouts to see which is earliest and no need to take any lock +other than, potentially, the timer lock inside timer_reduce(). + +Note, that this does not protect against concurrent invocations of any of +the timer functions. + +As an example, the expect_rx_by timeout above, which terminates a call if +we don't get a packet from the server within a certain time window, would +be set something like this: + + unsigned long now = jiffies; + unsigned long expect_rx_by = now + packet_receive_timeout; + WRITE_ONCE(call->expect_rx_by, expect_rx_by); + timer_reduce(&call->timer, expect_rx_by); + +The timer service code (which might, say, be in a work function) would then +check all the timeouts to see which, if any, had triggered, deal with +those: + + t = READ_ONCE(call->ack_at); + if (time_after_eq(now, t)) { + cmpxchg(&call->ack_at, t, now + MAX_JIFFY_OFFSET); + set_bit(RXRPC_CALL_EV_ACK, &call->events); + } + +and then restart the timer if necessary by finding the soonest timeout that +hasn't yet passed and then calling timer_reduce(). + +The disadvantage of doing things this way rather than comparing the timers +each time and calling mod_timer() is that you *will* take timer events +unless you can finish what you're doing and delete the timer in time. + +The advantage of doing things this way is that you don't need to use a lock +to work out when the next timer should be set, other than the timer's own +lock - which you might not have to take. + +[ tglx: Fixed weird formatting and adopted it to pending changes ] +[js] schedule_timeout was not converted to from_timer in 4.12 yet + +Signed-off-by: David Howells +Signed-off-by: Thomas Gleixner +Cc: keyrings@vger.kernel.org +Cc: linux-afs@lists.infradead.org +Link: https://lkml.kernel.org/r/151023090769.23050.1801643667223880753.stgit@warthog.procyon.org.uk +Signed-off-by: Jiri Slaby +--- + include/linux/timer.h | 1 + + kernel/time/timer.c | 45 ++++++++++++++++++++++++++++++++++++++------- + 2 files changed, 39 insertions(+), 7 deletions(-) + +--- a/include/linux/timer.h ++++ b/include/linux/timer.h +@@ -215,6 +215,7 @@ extern void add_timer_on(struct timer_li + extern int del_timer(struct timer_list * timer); + extern int mod_timer(struct timer_list *timer, unsigned long expires); + extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); ++extern int timer_reduce(struct timer_list *timer, unsigned long expires); + + /* + * The jiffies value which is added to now, when there is no timer +--- a/kernel/time/timer.c ++++ b/kernel/time/timer.c +@@ -929,8 +929,11 @@ static struct timer_base *lock_timer_bas + } + } + ++#define MOD_TIMER_PENDING_ONLY 0x01 ++#define MOD_TIMER_REDUCE 0x02 ++ + static inline int +-__mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only) ++__mod_timer(struct timer_list *timer, unsigned long expires, unsigned int options) + { + struct timer_base *base, *new_base; + unsigned int idx = UINT_MAX; +@@ -950,7 +953,11 @@ __mod_timer(struct timer_list *timer, un + * larger granularity than you would get from adding a new + * timer with this expiry. + */ +- if (timer->expires == expires) ++ long diff = timer->expires - expires; ++ ++ if (!diff) ++ return 1; ++ if (options & MOD_TIMER_REDUCE && diff <= 0) + return 1; + + /* +@@ -962,6 +969,12 @@ __mod_timer(struct timer_list *timer, un + base = lock_timer_base(timer, &flags); + forward_timer_base(base); + ++ if (timer_pending(timer) && (options & MOD_TIMER_REDUCE) && ++ time_before_eq(timer->expires, expires)) { ++ ret = 1; ++ goto out_unlock; ++ } ++ + clk = base->clk; + idx = calc_wheel_index(expires, clk); + +@@ -971,7 +984,10 @@ __mod_timer(struct timer_list *timer, un + * subsequent call will exit in the expires check above. + */ + if (idx == timer_get_idx(timer)) { +- timer->expires = expires; ++ if (!(options & MOD_TIMER_REDUCE)) ++ timer->expires = expires; ++ else if (time_after(timer->expires, expires)) ++ timer->expires = expires; + ret = 1; + goto out_unlock; + } +@@ -981,7 +997,7 @@ __mod_timer(struct timer_list *timer, un + } + + ret = detach_if_pending(timer, base, false); +- if (!ret && pending_only) ++ if (!ret && (options & MOD_TIMER_PENDING_ONLY)) + goto out_unlock; + + debug_activate(timer, expires); +@@ -1042,7 +1058,7 @@ out_unlock: + */ + int mod_timer_pending(struct timer_list *timer, unsigned long expires) + { +- return __mod_timer(timer, expires, true); ++ return __mod_timer(timer, expires, MOD_TIMER_PENDING_ONLY); + } + EXPORT_SYMBOL(mod_timer_pending); + +@@ -1068,11 +1084,26 @@ EXPORT_SYMBOL(mod_timer_pending); + */ + int mod_timer(struct timer_list *timer, unsigned long expires) + { +- return __mod_timer(timer, expires, false); ++ return __mod_timer(timer, expires, 0); + } + EXPORT_SYMBOL(mod_timer); + + /** ++ * timer_reduce - Modify a timer's timeout if it would reduce the timeout ++ * @timer: The timer to be modified ++ * @expires: New timeout in jiffies ++ * ++ * timer_reduce() is very similar to mod_timer(), except that it will only ++ * modify a running timer if that would reduce the expiration time (it will ++ * start a timer that isn't running). ++ */ ++int timer_reduce(struct timer_list *timer, unsigned long expires) ++{ ++ return __mod_timer(timer, expires, MOD_TIMER_REDUCE); ++} ++EXPORT_SYMBOL(timer_reduce); ++ ++/** + * add_timer - start a timer + * @timer: the timer to be added + * +@@ -1739,7 +1770,7 @@ signed long __sched schedule_timeout(sig + expire = timeout + jiffies; + + setup_timer_on_stack(&timer, process_timeout, (unsigned long)current); +- __mod_timer(&timer, expire, false); ++ __mod_timer(&timer, expire, 0); + schedule(); + del_singleshot_timer_sync(&timer); + diff --git a/patches.suse/timers-Invoke-timer_start_debug-where-it-makes-sense.patch b/patches.suse/timers-Invoke-timer_start_debug-where-it-makes-sense.patch index f1af576..6cc7882 100644 --- a/patches.suse/timers-Invoke-timer_start_debug-where-it-makes-sense.patch +++ b/patches.suse/timers-Invoke-timer_start_debug-where-it-makes-sense.patch @@ -28,8 +28,8 @@ Signed-off-by: Mike Galbraith --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -982,8 +982,6 @@ __mod_timer(struct timer_list *timer, un - if (!ret && pending_only) +@@ -998,8 +998,6 @@ __mod_timer(struct timer_list *timer, un + if (!ret && (options & MOD_TIMER_PENDING_ONLY)) goto out_unlock; - debug_activate(timer, expires); @@ -37,7 +37,7 @@ Signed-off-by: Mike Galbraith new_base = get_target_base(base, timer->flags); if (base != new_base) { -@@ -1007,6 +1005,8 @@ __mod_timer(struct timer_list *timer, un +@@ -1023,6 +1021,8 @@ __mod_timer(struct timer_list *timer, un } } diff --git a/patches.suse/tpm_tis-Remove-the-HID-IFX0102.patch b/patches.suse/tpm_tis-Remove-the-HID-IFX0102.patch new file mode 100644 index 0000000..d30a07f --- /dev/null +++ b/patches.suse/tpm_tis-Remove-the-HID-IFX0102.patch @@ -0,0 +1,56 @@ +From e918e570415ced9898a51109000a3f39a6e03be5 Mon Sep 17 00:00:00 2001 +From: Jarkko Sakkinen +Date: Thu, 25 Jun 2020 05:31:11 +0300 +Subject: [PATCH] tpm_tis: Remove the HID IFX0102 +Git-commit: e918e570415ced9898a51109000a3f39a6e03be5 +Patch-mainline: v5.8-rc4 +References: bsc#1111666 + +Acer C720 running Linux v5.3 reports this in klog: + +Tpm_tis: 1.2 TPM (device-id 0xB, rev-id 16) +tpm tpm0: tpm_try_transmit: send(): error -5 +tpm tpm0: A TPM error (-5) occurred attempting to determine the timeouts +tpm_tis tpm_tis: Could not get TPM timeouts and durations +tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16) +tpm tpm0: tpm_try_transmit: send(): error -5 +tpm tpm0: A TPM error (-5) occurred attempting to determine the timeouts +tpm_tis 00:08: Could not get TPM timeouts and durations +Ima: No TPM chip found, activating TPM-bypass! +tpm_inf_pnp 00:08: Found TPM with ID IFX0102 + +% git --no-pager grep IFX0102 drivers/char/tpm +Drivers/char/tpm/tpm_infineon.c: {"IFX0102", 0}, +Drivers/char/tpm/tpm_tis.c: {"IFX0102", 0}, /* Infineon */ + +Obviously IFX0102 was added to the HID table for the TCG TIS driver by +mistake. + +Fixes: 93e1b7d42e1e ("[PATCH] tpm: add HID module parameter") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=203877 +Cc: stable@vger.kernel.org +Cc: Kylene Jo Hall +Reported-by: Ferry Toth: +Reviewed-by: Jerry Snitselaar +Signed-off-by: Jarkko Sakkinen +Acked-by: Takashi Iwai + +--- + drivers/char/tpm/tpm_tis.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c +index e7df342a317d..c58ea10fc92f 100644 +--- a/drivers/char/tpm/tpm_tis.c ++++ b/drivers/char/tpm/tpm_tis.c +@@ -238,7 +238,6 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev, + static struct pnp_device_id tpm_pnp_tbl[] = { + {"PNP0C31", 0}, /* TPM */ + {"ATM1200", 0}, /* Atmel */ +- {"IFX0102", 0}, /* Infineon */ + {"BCM0101", 0}, /* Broadcom */ + {"BCM0102", 0}, /* Broadcom */ + {"NSC1200", 0}, /* National */ +-- +2.16.4 + diff --git a/patches.suse/tunnel-Propagate-ECT-1-when-decapsulating-as-recomme.patch b/patches.suse/tunnel-Propagate-ECT-1-when-decapsulating-as-recomme.patch new file mode 100644 index 0000000..4870ce7 --- /dev/null +++ b/patches.suse/tunnel-Propagate-ECT-1-when-decapsulating-as-recomme.patch @@ -0,0 +1,114 @@ +From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= +Date: Mon, 27 Apr 2020 16:11:05 +0200 +Subject: tunnel: Propagate ECT(1) when decapsulating as recommended by RFC6040 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: b723748750ece7d844cdf2f52c01d37f83387208 +Patch-mainline: 5.7-rc5 +References: networking-stable-20_05_12 + +RFC 6040 recommends propagating an ECT(1) mark from an outer tunnel header +to the inner header if that inner header is already marked as ECT(0). When +RFC 6040 decapsulation was implemented, this case of propagation was not +added. This simply appears to be an oversight, so let's fix that. + +Fixes: eccc1bb8d4b4 ("tunnel: drop packet if ECN present with not-ECT") +Reported-by: Bob Briscoe +Reported-by: Olivier Tilmans +Cc: Dave Taht +Cc: Stephen Hemminger +Signed-off-by: Toke Høiland-Jørgensen +Signed-off-by: David S. Miller +Signed-off-by: Jiri Slaby +--- + include/net/inet_ecn.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 55 insertions(+), 2 deletions(-) + +--- a/include/net/inet_ecn.h ++++ b/include/net/inet_ecn.h +@@ -98,6 +98,20 @@ static inline int IP_ECN_set_ce(struct i + return 1; + } + ++static inline int IP_ECN_set_ect1(struct iphdr *iph) ++{ ++ u32 check = (__force u32)iph->check; ++ ++ if ((iph->tos & INET_ECN_MASK) != INET_ECN_ECT_0) ++ return 0; ++ ++ check += (__force u16)htons(0x100); ++ ++ iph->check = (__force __sum16)(check + (check>=0xFFFF)); ++ iph->tos ^= INET_ECN_MASK; ++ return 1; ++} ++ + static inline void IP_ECN_clear(struct iphdr *iph) + { + iph->tos &= ~INET_ECN_MASK; +@@ -138,6 +152,22 @@ static inline void IP6_ECN_clear(struct + *(__be32*)iph &= ~htonl(INET_ECN_MASK << 20); + } + ++static inline int IP6_ECN_set_ect1(struct sk_buff *skb, struct ipv6hdr *iph) ++{ ++ __be32 from, to; ++ ++ if ((ipv6_get_dsfield(iph) & INET_ECN_MASK) != INET_ECN_ECT_0) ++ return 0; ++ ++ from = *(__be32 *)iph; ++ to = from ^ htonl(INET_ECN_MASK << 20); ++ *(__be32 *)iph = to; ++ if (skb->ip_summed == CHECKSUM_COMPLETE) ++ skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from), ++ (__force __wsum)to); ++ return 1; ++} ++ + static inline void ipv6_copy_dscp(unsigned int dscp, struct ipv6hdr *inner) + { + dscp &= ~INET_ECN_MASK; +@@ -163,6 +193,25 @@ static inline int INET_ECN_set_ce(struct + return 0; + } + ++static inline int INET_ECN_set_ect1(struct sk_buff *skb) ++{ ++ switch (skb->protocol) { ++ case cpu_to_be16(ETH_P_IP): ++ if (skb_network_header(skb) + sizeof(struct iphdr) <= ++ skb_tail_pointer(skb)) ++ return IP_ECN_set_ect1(ip_hdr(skb)); ++ break; ++ ++ case cpu_to_be16(ETH_P_IPV6): ++ if (skb_network_header(skb) + sizeof(struct ipv6hdr) <= ++ skb_tail_pointer(skb)) ++ return IP6_ECN_set_ect1(skb, ipv6_hdr(skb)); ++ break; ++ } ++ ++ return 0; ++} ++ + /* + * RFC 6040 4.2 + * To decapsulate the inner header at the tunnel egress, a compliant +@@ -212,8 +261,12 @@ static inline int INET_ECN_decapsulate(s + int rc; + + rc = __INET_ECN_decapsulate(outer, inner, &set_ce); +- if (!rc && set_ce) +- INET_ECN_set_ce(skb); ++ if (!rc) { ++ if (set_ce) ++ INET_ECN_set_ce(skb); ++ else if ((outer & INET_ECN_MASK) == INET_ECN_ECT_1) ++ INET_ECN_set_ect1(skb); ++ } + + return rc; + } diff --git a/patches.suse/ubifs-remove-broken-lazytime-support.patch b/patches.suse/ubifs-remove-broken-lazytime-support.patch new file mode 100644 index 0000000..70c0581 --- /dev/null +++ b/patches.suse/ubifs-remove-broken-lazytime-support.patch @@ -0,0 +1,48 @@ +From ecf84096a526f2632ee85c32a3d05de3fa60ce80 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Thu, 9 Apr 2020 13:33:05 +0200 +Subject: [PATCH] ubifs: remove broken lazytime support +Git-commit: ecf84096a526f2632ee85c32a3d05de3fa60ce80 +Patch-mainline: v5.7-rc7 +References: bsc#1173826 + +When "ubifs: introduce UBIFS_ATIME_SUPPORT to ubifs" introduced atime +support to ubifs, it also added lazytime support. As far as I can tell +the lazytime support is terminally broken, as it causes +mark_inode_dirty_sync to be called from __writeback_single_inode, which +will then trigger the locking assert in ubifs_dirty_inode. Just remove +the broken lazytime support for now, it can be added back later, +especially as some infrastructure changes should make that easier soon. + +Fixes: 8c1c5f263833 ("ubifs: introduce UBIFS_ATIME_SUPPORT to ubifs") +Signed-off-by: Christoph Hellwig +Signed-off-by: Richard Weinberger +Acked-by: Jan Kara + +--- + fs/ubifs/file.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +--- a/fs/ubifs/file.c ++++ b/fs/ubifs/file.c +@@ -1384,7 +1384,6 @@ int ubifs_update_time(struct inode *inod + struct ubifs_info *c = inode->i_sb->s_fs_info; + struct ubifs_budget_req req = { .dirtied_ino = 1, + .dirtied_ino_d = ALIGN(ui->data_len, 8) }; +- int iflags = I_DIRTY_TIME; + int err, release; + + err = ubifs_budget_space(c, &req); +@@ -1399,11 +1398,8 @@ int ubifs_update_time(struct inode *inod + if (flags & S_MTIME) + inode->i_mtime = *time; + +- if (!(inode->i_sb->s_flags & MS_LAZYTIME)) +- iflags |= I_DIRTY_SYNC; +- + release = ui->dirty; +- __mark_inode_dirty(inode, iflags); ++ __mark_inode_dirty(inode, I_DIRTY_SYNC); + mutex_unlock(&ui->ui_mutex); + if (release) + ubifs_release_budget(c, &req); diff --git a/patches.suse/usb-add-USB_QUIRK_DELAY_INIT-for-Logitech-C922.patch b/patches.suse/usb-add-USB_QUIRK_DELAY_INIT-for-Logitech-C922.patch new file mode 100644 index 0000000..2521ef8 --- /dev/null +++ b/patches.suse/usb-add-USB_QUIRK_DELAY_INIT-for-Logitech-C922.patch @@ -0,0 +1,45 @@ +From 5d8021923e8a8cc37a421a64e27c7221f0fee33c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tomasz=20Meresi=C5=84ski?= +Date: Wed, 3 Jun 2020 22:33:46 +0200 +Subject: [PATCH] usb: add USB_QUIRK_DELAY_INIT for Logitech C922 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: 5d8021923e8a8cc37a421a64e27c7221f0fee33c +References: git-fixes +Patch-mainline: v5.8-rc3 + +The Logitech C922, just like other Logitech webcams, +needs the USB_QUIRK_DELAY_INIT or it will randomly +not respond after device connection + +Signed-off-by: Tomasz Meresiński +Cc: stable +Link: https://lore.kernel.org/r/20200603203347.7792-1-tomasz@meresinski.eu +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/core/quirks.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c +index 3e8efe759c3e..e0b77674869c 100644 +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -218,11 +218,12 @@ static const struct usb_device_id usb_quirk_list[] = { + /* Logitech HD Webcam C270 */ + { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME }, + +- /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */ ++ /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */ + { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT }, ++ { USB_DEVICE(0x046d, 0x085c), .driver_info = USB_QUIRK_DELAY_INIT }, + + /* Logitech ConferenceCam CC3000e */ + { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT }, +-- +2.16.4 + diff --git a/patches.suse/usb-chipidea-core-add-wakeup-support-for-extcon.patch b/patches.suse/usb-chipidea-core-add-wakeup-support-for-extcon.patch new file mode 100644 index 0000000..f0258ef --- /dev/null +++ b/patches.suse/usb-chipidea-core-add-wakeup-support-for-extcon.patch @@ -0,0 +1,71 @@ +From 876d4e1e8298ad1f94d9e9392fc90486755437b4 Mon Sep 17 00:00:00 2001 +From: Peter Chen +Date: Tue, 7 Jul 2020 14:06:01 +0800 +Subject: [PATCH] usb: chipidea: core: add wakeup support for extcon +Git-commit: 876d4e1e8298ad1f94d9e9392fc90486755437b4 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +If wakeup event occurred by extcon event, it needs to call +ci_irq again since the first ci_irq calling at extcon notifier +only wakes up controller, but do noop for event handling, +it causes the extcon use case can't work well from low power mode. + +Cc: +Fixes: 3ecb3e09b042 ("usb: chipidea: Use extcon framework for VBUS and ID detect") +Reported-by: Philippe Schenker +Tested-by: Philippe Schenker +Signed-off-by: Peter Chen +Link: https://lore.kernel.org/r/20200707060601.31907-2-peter.chen@kernel.org +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/chipidea/core.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c +index 9a7c53d09ab4..bb133245beed 100644 +--- a/drivers/usb/chipidea/core.c ++++ b/drivers/usb/chipidea/core.c +@@ -1243,6 +1243,29 @@ static void ci_controller_suspend(struct ci_hdrc *ci) + enable_irq(ci->irq); + } + ++/* ++ * Handle the wakeup interrupt triggered by extcon connector ++ * We need to call ci_irq again for extcon since the first ++ * interrupt (wakeup int) only let the controller be out of ++ * low power mode, but not handle any interrupts. ++ */ ++static void ci_extcon_wakeup_int(struct ci_hdrc *ci) ++{ ++ struct ci_hdrc_cable *cable_id, *cable_vbus; ++ u32 otgsc = hw_read_otgsc(ci, ~0); ++ ++ cable_id = &ci->platdata->id_extcon; ++ cable_vbus = &ci->platdata->vbus_extcon; ++ ++ if (!IS_ERR(cable_id->edev) && ci->is_otg && ++ (otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS)) ++ ci_irq(ci->irq, ci); ++ ++ if (!IS_ERR(cable_vbus->edev) && ci->is_otg && ++ (otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) ++ ci_irq(ci->irq, ci); ++} ++ + static int ci_controller_resume(struct device *dev) + { + struct ci_hdrc *ci = dev_get_drvdata(dev); +@@ -1275,6 +1298,7 @@ static int ci_controller_resume(struct device *dev) + enable_irq(ci->irq); + if (ci_otg_is_fsm_mode(ci)) + ci_otg_fsm_wakeup_by_srp(ci); ++ ci_extcon_wakeup_int(ci); + } + + return 0; +-- +2.16.4 + diff --git a/patches.suse/usb-dwc2-Fix-shutdown-callback-in-platform.patch b/patches.suse/usb-dwc2-Fix-shutdown-callback-in-platform.patch new file mode 100644 index 0000000..a4e9ce4 --- /dev/null +++ b/patches.suse/usb-dwc2-Fix-shutdown-callback-in-platform.patch @@ -0,0 +1,44 @@ +From 4fdf228cdf6925af45a2066d403821e0977bfddb Mon Sep 17 00:00:00 2001 +From: Minas Harutyunyan +Date: Sat, 30 May 2020 11:41:50 +0400 +Subject: [PATCH] usb: dwc2: Fix shutdown callback in platform +Git-commit: 4fdf228cdf6925af45a2066d403821e0977bfddb +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +To avoid lot of interrupts from dwc2 core, which can be asserted in +specific conditions need to disable interrupts on HW level instead of +disable IRQs on Kernel level, because of IRQ can be shared between +drivers. + +Cc: stable@vger.kernel.org +Fixes: a40a00318c7fc ("usb: dwc2: add shutdown callback to platform variant") +Tested-by: Frank Mori Hess +Reviewed-by: Alan Stern +Reviewed-by: Doug Anderson +Reviewed-by: Frank Mori Hess +Signed-off-by: Minas Harutyunyan +Signed-off-by: Felipe Balbi +Acked-by: Takashi Iwai + +--- + drivers/usb/dwc2/platform.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c +index c347d93eae64..cb8ddbd53718 100644 +--- a/drivers/usb/dwc2/platform.c ++++ b/drivers/usb/dwc2/platform.c +@@ -342,7 +342,8 @@ static void dwc2_driver_shutdown(struct platform_device *dev) + { + struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); + +- disable_irq(hsotg->irq); ++ dwc2_disable_global_interrupts(hsotg); ++ synchronize_irq(hsotg->irq); + } + + /** +-- +2.16.4 + diff --git a/patches.suse/usb-dwc3-gadget-introduce-cancelled_list.patch b/patches.suse/usb-dwc3-gadget-introduce-cancelled_list.patch new file mode 100644 index 0000000..5ac4847 --- /dev/null +++ b/patches.suse/usb-dwc3-gadget-introduce-cancelled_list.patch @@ -0,0 +1,71 @@ +From d5443bbf5fc8f8389cce146b1fc2987cdd229d12 Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Wed, 1 Aug 2018 13:53:29 +0300 +Subject: [PATCH] usb: dwc3: gadget: introduce cancelled_list +Git-commit: d5443bbf5fc8f8389cce146b1fc2987cdd229d12 +References: git-fixes +Patch-mainline: v5.0-rc1 + +This list will host cancelled requests who still have TRBs being +processed. + +Signed-off-by: Felipe Balbi +Signed-off-by: Oliver Neukum +--- + drivers/usb/dwc3/core.h | 2 ++ + drivers/usb/dwc3/gadget.c | 1 + + drivers/usb/dwc3/gadget.h | 15 +++++++++++++++ + 3 files changed, 18 insertions(+) + +--- a/drivers/usb/dwc3/core.h ++++ b/drivers/usb/dwc3/core.h +@@ -517,6 +517,7 @@ struct dwc3_event_buffer { + /** + * struct dwc3_ep - device side endpoint representation + * @endpoint: usb endpoint ++ * @cancelled_list: list of cancelled requests for this endpoint + * @pending_list: list of pending requests for this endpoint + * @started_list: list of started requests on this endpoint + * @wait_end_transfer: wait_queue_head_t for waiting on End Transfer complete +@@ -542,6 +543,7 @@ struct dwc3_event_buffer { + */ + struct dwc3_ep { + struct usb_ep endpoint; ++ struct list_head cancelled_list; + struct list_head pending_list; + struct list_head started_list; + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -2104,6 +2104,7 @@ static int dwc3_gadget_init_endpoints(st + + INIT_LIST_HEAD(&dep->pending_list); + INIT_LIST_HEAD(&dep->started_list); ++ INIT_LIST_HEAD(&dep->cancelled_list); + } + + return 0; +--- a/drivers/usb/dwc3/gadget.h ++++ b/drivers/usb/dwc3/gadget.h +@@ -73,6 +73,21 @@ static inline void dwc3_gadget_move_star + list_move_tail(&req->list, &dep->started_list); + } + ++/** ++ * dwc3_gadget_move_cancelled_request - move @req to the cancelled_list ++ * @req: the request to be moved ++ * ++ * Caller should take care of locking. This function will move @req from its ++ * current list to the endpoint's cancelled_list. ++ */ ++static inline void dwc3_gadget_move_cancelled_request(struct dwc3_request *req) ++{ ++ struct dwc3_ep *dep = req->dep; ++ ++ req->started = false; ++ list_move_tail(&req->list, &dep->cancelled_list); ++} ++ + void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, + int status); + diff --git a/patches.suse/usb-dwc3-gadget-never-call-complete-from-ep_queue.patch b/patches.suse/usb-dwc3-gadget-never-call-complete-from-ep_queue.patch new file mode 100644 index 0000000..e24c2e4 --- /dev/null +++ b/patches.suse/usb-dwc3-gadget-never-call-complete-from-ep_queue.patch @@ -0,0 +1,108 @@ +From c91815b596245fd7da349ecc43c8def670d2269e Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Mon, 26 Mar 2018 13:14:47 +0300 +Subject: [PATCH] usb: dwc3: gadget: never call ->complete() from ->ep_queue() +Git-commit: c91815b596245fd7da349ecc43c8def670d2269e +References: git-fixes +Patch-mainline: v4.17-rc1 + +This is a requirement which has always existed but, somehow, wasn't +reflected in the documentation and problems weren't found until now +when Tuba Yavuz found a possible deadlock happening between dwc3 and +f_hid. She described the situation as follows: + +spin_lock_irqsave(&hidg->write_spinlock, flags); // first acquire +/* we our function has been disabled by host */ +if (!hidg->req) { + free_ep_req(hidg->in_ep, hidg->req); + goto try_again; +} + +[...] + +status = usb_ep_queue(hidg->in_ep, hidg->req, GFP_ATOMIC); +=> + [...] + => usb_gadget_giveback_request + => + f_hidg_req_complete + => + spin_lock_irqsave(&hidg->write_spinlock, flags); // second acquire + +Note that this happens because dwc3 would call ->complete() on a +failed usb_ep_queue() due to failed Start Transfer command. This is, +anyway, a theoretical situation because dwc3 currently uses "No +Response Update Transfer" command for Bulk and Interrupt endpoints. + +It's still good to make this case impossible to happen even if the "No +Reponse Update Transfer" command is changed. + +Reported-by: Tuba Yavuz +Signed-off-by: Felipe Balbi +Cc: stable +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/dwc3/gadget.c | 31 ++++++++++++++++++++++++------- + 1 file changed, 24 insertions(+), 7 deletions(-) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -167,8 +167,8 @@ static void dwc3_ep_inc_deq(struct dwc3_ + dwc3_ep_inc_trb(&dep->trb_dequeue); + } + +-void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, +- int status) ++void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, ++ struct dwc3_request *req, int status) + { + struct dwc3 *dwc = dep->dwc; + +@@ -181,16 +181,33 @@ void dwc3_gadget_giveback(struct dwc3_ep + req->request.status = status; + + usb_gadget_unmap_request_by_dev(dwc->sysdev, +- &req->request, req->direction); ++ &req->request, req->direction); + + trace_dwc3_gadget_giveback(req); ++ if (dep->number > 1) ++ pm_runtime_put(dwc->dev); ++} ++ ++/** ++ * dwc3_gadget_giveback - call struct usb_request's ->complete callback ++ * @dep: The endpoint to whom the request belongs to ++ * @req: The request we're giving back ++ * @status: completion code for the request ++ * ++ * Must be called with controller's lock held and interrupts disabled. This ++ * function will unmap @req and call its ->complete() callback to notify upper ++ * layers that it has completed. ++ */ ++void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, ++ int status) ++{ ++ struct dwc3 *dwc = dep->dwc; ++ ++ dwc3_gadget_del_and_unmap_request(dep, req, status); + + spin_unlock(&dwc->lock); + usb_gadget_giveback_request(&dep->endpoint, &req->request); + spin_lock(&dwc->lock); +- +- if (dep->number > 1) +- pm_runtime_put(dwc->dev); + } + + int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param) +@@ -1150,7 +1167,7 @@ static int __dwc3_gadget_kick_transfer(s + if (req->trb) + memset(req->trb, 0, sizeof(struct dwc3_trb)); + dep->queued_requests--; +- dwc3_gadget_giveback(dep, req, ret); ++ dwc3_gadget_del_and_unmap_request(dep, req, ret); + return ret; + } + diff --git a/patches.suse/usb-gadget-fix-potential-double-free-in-m66592_probe.patch b/patches.suse/usb-gadget-fix-potential-double-free-in-m66592_probe.patch new file mode 100644 index 0000000..27d5092 --- /dev/null +++ b/patches.suse/usb-gadget-fix-potential-double-free-in-m66592_probe.patch @@ -0,0 +1,38 @@ +From 44734a594196bf1d474212f38fe3a0d37a73278b Mon Sep 17 00:00:00 2001 +From: Qiushi Wu +Date: Fri, 22 May 2020 23:06:25 -0500 +Subject: [PATCH] usb: gadget: fix potential double-free in m66592_probe. +Git-commit: 44734a594196bf1d474212f38fe3a0d37a73278b +Patch-mainline: v5.8-rc1 +References: bsc#1111666 + +m66592_free_request() is called under label "err_add_udc" +and "clean_up", and m66592->ep0_req is not set to NULL after +first free, leading to a double-free. Fix this issue by +setting m66592->ep0_req to NULL after the first free. + +Fixes: 0f91349b89f3 ("usb: gadget: convert all users to the new udc infrastructure") +Signed-off-by: Qiushi Wu +Signed-off-by: Felipe Balbi +Acked-by: Takashi Iwai + +--- + drivers/usb/gadget/udc/m66592-udc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c +index 75d16a8902e6..931e6362a13d 100644 +--- a/drivers/usb/gadget/udc/m66592-udc.c ++++ b/drivers/usb/gadget/udc/m66592-udc.c +@@ -1667,7 +1667,7 @@ static int m66592_probe(struct platform_device *pdev) + + err_add_udc: + m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req); +- ++ m66592->ep0_req = NULL; + clean_up3: + if (m66592->pdata->on_chip) { + clk_disable(m66592->clk); +-- +2.16.4 + diff --git a/patches.suse/usb-gadget-udc-Potential-Oops-in-error-handling-code.patch b/patches.suse/usb-gadget-udc-Potential-Oops-in-error-handling-code.patch new file mode 100644 index 0000000..39c1aa4 --- /dev/null +++ b/patches.suse/usb-gadget-udc-Potential-Oops-in-error-handling-code.patch @@ -0,0 +1,38 @@ +From e55f3c37cb8d31c7e301f46396b2ac6a19eb3a7c Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 15 Jun 2020 14:27:19 +0300 +Subject: [PATCH] usb: gadget: udc: Potential Oops in error handling code +Git-commit: e55f3c37cb8d31c7e301f46396b2ac6a19eb3a7c +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +If this is in "transceiver" mode the the ->qwork isn't required and is +a NULL pointer. This can lead to a NULL dereference when we call +destroy_workqueue(udc->qwork). + +Fixes: 3517c31a8ece ("usb: gadget: mv_udc: use devm_xxx for probe") +Signed-off-by: Dan Carpenter +Signed-off-by: Felipe Balbi +Acked-by: Takashi Iwai + +--- + drivers/usb/gadget/udc/mv_udc_core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c +index cafde053788b..80a1b52c656e 100644 +--- a/drivers/usb/gadget/udc/mv_udc_core.c ++++ b/drivers/usb/gadget/udc/mv_udc_core.c +@@ -2313,7 +2313,8 @@ static int mv_udc_probe(struct platform_device *pdev) + return 0; + + err_create_workqueue: +- destroy_workqueue(udc->qwork); ++ if (udc->qwork) ++ destroy_workqueue(udc->qwork); + err_destroy_dma: + dma_pool_destroy(udc->dtd_pool); + err_free_dma: +-- +2.16.4 + diff --git a/patches.suse/usb-gadget-udc-atmel-fix-uninitialized-read-in-debug.patch b/patches.suse/usb-gadget-udc-atmel-fix-uninitialized-read-in-debug.patch new file mode 100644 index 0000000..f25b8ef --- /dev/null +++ b/patches.suse/usb-gadget-udc-atmel-fix-uninitialized-read-in-debug.patch @@ -0,0 +1,39 @@ +From 30517ffeb3bff842e1355cbc32f1959d9dbb5414 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= +Date: Thu, 28 May 2020 20:35:54 +0200 +Subject: [PATCH] usb: gadget: udc: atmel: fix uninitialized read in debug printk +Mime-version: 1.0 +Content-type: text/plain; charset=UTF-8 +Content-transfer-encoding: 8bit +Git-commit: 30517ffeb3bff842e1355cbc32f1959d9dbb5414 +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +Fixed commit moved the assignment of 'req', but did not update a +reference in the DBG() call. Use the argument as it was renamed. + +Fixes: 5fb694f96e7c ("usb: gadget: udc: atmel: fix possible oops when unloading module") +Signed-off-by: Michał Mirosław +Signed-off-by: Felipe Balbi +Acked-by: Takashi Iwai + +--- + drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c +index 9153e220848d..9342a3d24963 100644 +--- a/drivers/usb/gadget/udc/atmel_usba_udc.c ++++ b/drivers/usb/gadget/udc/atmel_usba_udc.c +@@ -865,7 +865,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) + u32 status; + + DBG(DBG_GADGET | DBG_QUEUE, "ep_dequeue: %s, req %p\n", +- ep->ep.name, req); ++ ep->ep.name, _req); + + spin_lock_irqsave(&udc->lock, flags); + +-- +2.16.4 + diff --git a/patches.suse/usb-gadget-udc-atmel-remove-outdated-comment-in-usba.patch b/patches.suse/usb-gadget-udc-atmel-remove-outdated-comment-in-usba.patch new file mode 100644 index 0000000..140f208 --- /dev/null +++ b/patches.suse/usb-gadget-udc-atmel-remove-outdated-comment-in-usba.patch @@ -0,0 +1,45 @@ +From 9706247d94165ef9d6f7f00308e1cd7e0cc9251d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= +Date: Thu, 28 May 2020 20:35:53 +0200 +Subject: [PATCH] usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable() +Mime-version: 1.0 +Content-type: text/plain; charset=UTF-8 +Content-transfer-encoding: 8bit +Git-commit: 9706247d94165ef9d6f7f00308e1cd7e0cc9251d +Patch-mainline: v5.8-rc6 +References: bsc#1111666 + +Fixed commit removed the offending behaviour from the driver, but missed +the comment and associated test. Remove them now. + +Fixes: 38e58986e6fc ("usb: gadget: udc: atmel: don't disable enpdoints we don't own") +Signed-off-by: Michał Mirosław +Signed-off-by: Felipe Balbi +Acked-by: Takashi Iwai + +--- + drivers/usb/gadget/udc/atmel_usba_udc.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c +index d69f61ff0181..9153e220848d 100644 +--- a/drivers/usb/gadget/udc/atmel_usba_udc.c ++++ b/drivers/usb/gadget/udc/atmel_usba_udc.c +@@ -676,13 +676,7 @@ static int usba_ep_disable(struct usb_ep *_ep) + + if (!ep->ep.desc) { + spin_unlock_irqrestore(&udc->lock, flags); +- /* REVISIT because this driver disables endpoints in +- * reset_all_endpoints() before calling disconnect(), +- * most gadget drivers would trigger this non-error ... +- */ +- if (udc->gadget.speed != USB_SPEED_UNKNOWN) +- DBG(DBG_ERR, "ep_disable: %s not enabled\n", +- ep->ep.name); ++ DBG(DBG_ERR, "ep_disable: %s not enabled\n", ep->ep.name); + return -EINVAL; + } + ep->ep.desc = NULL; +-- +2.16.4 + diff --git a/patches.suse/usb-host-ehci-exynos-Fix-error-check-in-exynos_ehci_.patch b/patches.suse/usb-host-ehci-exynos-Fix-error-check-in-exynos_ehci_.patch new file mode 100644 index 0000000..2139207 --- /dev/null +++ b/patches.suse/usb-host-ehci-exynos-Fix-error-check-in-exynos_ehci_.patch @@ -0,0 +1,45 @@ +From 44ed240d62736ad29943ec01e41e194b96f7c5e9 Mon Sep 17 00:00:00 2001 +From: Tang Bin +Date: Tue, 2 Jun 2020 19:47:08 +0800 +Subject: [PATCH] usb: host: ehci-exynos: Fix error check in exynos_ehci_probe() +Git-commit: 44ed240d62736ad29943ec01e41e194b96f7c5e9 +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +If the function platform_get_irq() failed, the negative value +returned will not be detected here. So fix error handling in +exynos_ehci_probe(). And when get irq failed, the function +platform_get_irq() logs an error message, so remove redundant +message here. + +Fixes: 1bcc5aa87f04 ("USB: Add initial S5P EHCI driver") +Cc: stable +Signed-off-by: Zhang Shengju +Signed-off-by: Tang Bin +Link: https://lore.kernel.org/r/20200602114708.28620-1-tangbin@cmss.chinamobile.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/host/ehci-exynos.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c +index a4e9abcbdc4f..1a9b7572e17f 100644 +--- a/drivers/usb/host/ehci-exynos.c ++++ b/drivers/usb/host/ehci-exynos.c +@@ -203,9 +203,8 @@ static int exynos_ehci_probe(struct platform_device *pdev) + hcd->rsrc_len = resource_size(res); + + irq = platform_get_irq(pdev, 0); +- if (!irq) { +- dev_err(&pdev->dev, "Failed to get IRQ\n"); +- err = -ENODEV; ++ if (irq < 0) { ++ err = irq; + goto fail_io; + } + +-- +2.16.4 + diff --git a/patches.suse/usb-usbtest-fix-missing-kfree-dev-buf-in-usbtest_dis.patch b/patches.suse/usb-usbtest-fix-missing-kfree-dev-buf-in-usbtest_dis.patch new file mode 100644 index 0000000..0d9cd4a --- /dev/null +++ b/patches.suse/usb-usbtest-fix-missing-kfree-dev-buf-in-usbtest_dis.patch @@ -0,0 +1,69 @@ +From 28ebeb8db77035e058a510ce9bd17c2b9a009dba Mon Sep 17 00:00:00 2001 +From: Zqiang +Date: Fri, 12 Jun 2020 11:52:10 +0800 +Subject: [PATCH] usb: usbtest: fix missing kfree(dev->buf) in usbtest_disconnect +Git-commit: 28ebeb8db77035e058a510ce9bd17c2b9a009dba +Patch-mainline: v5.8-rc3 +References: CVE-2020-15393 bsc#1173514 + +Bug: memory leak +unreferenced object 0xffff888055046e00 (size 256): + comm "kworker/2:9", pid 2570, jiffies 4294942129 (age 1095.500s) + hex dump (first 32 bytes): + 00 70 04 55 80 88 ff ff 18 bb 5a 81 ff ff ff ff .p.U......Z..... + f5 96 78 81 ff ff ff ff 37 de 8e 81 ff ff ff ff ..x.....7....... + backtrace: + [<00000000d121dccf>] kmemleak_alloc_recursive +include/linux/kmemleak.h:43 [inline] + [<00000000d121dccf>] slab_post_alloc_hook mm/slab.h:586 [inline] + [<00000000d121dccf>] slab_alloc_node mm/slub.c:2786 [inline] + [<00000000d121dccf>] slab_alloc mm/slub.c:2794 [inline] + [<00000000d121dccf>] kmem_cache_alloc_trace+0x15e/0x2d0 mm/slub.c:2811 + [<000000005c3c3381>] kmalloc include/linux/slab.h:555 [inline] + [<000000005c3c3381>] usbtest_probe+0x286/0x19d0 +drivers/usb/misc/usbtest.c:2790 + [<000000001cec6910>] usb_probe_interface+0x2bd/0x870 +drivers/usb/core/driver.c:361 + [<000000007806c118>] really_probe+0x48d/0x8f0 drivers/base/dd.c:551 + [<00000000a3308c3e>] driver_probe_device+0xfc/0x2a0 drivers/base/dd.c:724 + [<000000003ef66004>] __device_attach_driver+0x1b6/0x240 +drivers/base/dd.c:831 + [<00000000eee53e97>] bus_for_each_drv+0x14e/0x1e0 drivers/base/bus.c:431 + [<00000000bb0648d0>] __device_attach+0x1f9/0x350 drivers/base/dd.c:897 + [<00000000838b324a>] device_initial_probe+0x1a/0x20 drivers/base/dd.c:944 + [<0000000030d501c1>] bus_probe_device+0x1e1/0x280 drivers/base/bus.c:491 + [<000000005bd7adef>] device_add+0x131d/0x1c40 drivers/base/core.c:2504 + [<00000000a0937814>] usb_set_configuration+0xe84/0x1ab0 +drivers/usb/core/message.c:2030 + [<00000000e3934741>] generic_probe+0x6a/0xe0 drivers/usb/core/generic.c:210 + [<0000000098ade0f1>] usb_probe_device+0x90/0xd0 +drivers/usb/core/driver.c:266 + [<000000007806c118>] really_probe+0x48d/0x8f0 drivers/base/dd.c:551 + [<00000000a3308c3e>] driver_probe_device+0xfc/0x2a0 drivers/base/dd.c:724 + +Acked-by: Alan Stern +Reported-by: Kyungtae Kim +Signed-off-by: Zqiang +Link: https://lore.kernel.org/r/20200612035210.20494-1-qiang.zhang@windriver.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/misc/usbtest.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c +index 98ada1a3425c..bae88893ee8e 100644 +--- a/drivers/usb/misc/usbtest.c ++++ b/drivers/usb/misc/usbtest.c +@@ -2873,6 +2873,7 @@ static void usbtest_disconnect(struct usb_interface *intf) + + usb_set_intfdata(intf, NULL); + dev_dbg(&intf->dev, "disconnect\n"); ++ kfree(dev->buf); + kfree(dev); + } + +-- +2.16.4 + diff --git a/patches.suse/usbnet-smsc95xx-Fix-use-after-free-after-removal.patch b/patches.suse/usbnet-smsc95xx-Fix-use-after-free-after-removal.patch new file mode 100644 index 0000000..ee72851 --- /dev/null +++ b/patches.suse/usbnet-smsc95xx-Fix-use-after-free-after-removal.patch @@ -0,0 +1,42 @@ +From b835a71ef64a61383c414d6bf2896d2c0161deca Mon Sep 17 00:00:00 2001 +From: Tuomas Tynkkynen +Date: Sun, 21 Jun 2020 13:43:26 +0300 +Subject: [PATCH] usbnet: smsc95xx: Fix use-after-free after removal +Git-commit: b835a71ef64a61383c414d6bf2896d2c0161deca +Patch-mainline: v5.8-rc3 +References: bsc#1111666 + +Syzbot reports an use-after-free in workqueue context: + +Bug: KASAN: use-after-free in mutex_unlock+0x19/0x40 kernel/locking/mutex.c:737 mutex_unlock+0x19/0x40 kernel/locking/mutex.c:737 __smsc95xx_mdio_read drivers/net/usb/smsc95xx.c:217 [inline] smsc95xx_mdio_read+0x583/0x870 drivers/net/usb/smsc95xx.c:278 check_carrier+0xd1/0x2e0 drivers/net/usb/smsc95xx.c:644 process_one_work+0x777/0xf90 kernel/workqueue.c:2274 worker_thread+0xa8f/0x1430 kernel/workqueue.c:2420 kthread+0x2df/0x300 kernel/kthread.c:255 + +It looks like that smsc95xx_unbind() is freeing the structures that are +still in use by the concurrently running workqueue callback. Thus switch +to using cancel_delayed_work_sync() to ensure the work callback really +is no longer active. + +Reported-by: syzbot+29dc7d4ae19b703ff947@syzkaller.appspotmail.com +Signed-off-by: Tuomas Tynkkynen +Signed-off-by: David S. Miller +Acked-by: Takashi Iwai + +--- + drivers/net/usb/smsc95xx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 355be77f4241..3cf4dc3433f9 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -1324,7 +1324,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) + struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); + + if (pdata) { +- cancel_delayed_work(&pdata->carrier_check); ++ cancel_delayed_work_sync(&pdata->carrier_check); + netif_dbg(dev, ifdown, dev->net, "free pdata\n"); + kfree(pdata); + pdata = NULL; +-- +2.16.4 + diff --git a/patches.suse/vfio-pci-fix-sr-iov-vf-handling-with-mmio-blocking b/patches.suse/vfio-pci-fix-sr-iov-vf-handling-with-mmio-blocking new file mode 100644 index 0000000..8477728 --- /dev/null +++ b/patches.suse/vfio-pci-fix-sr-iov-vf-handling-with-mmio-blocking @@ -0,0 +1,60 @@ +From: Alex Williamson +Date: Thu, 25 Jun 2020 11:04:23 -0600 +Subject: vfio/pci: Fix SR-IOV VF handling with MMIO blocking +Git-commit: ebfa440ce38b7e2e04c3124aa89c8a9f4094cf21 +Patch-mainline: v5.8-rc3 +References: bsc#1174123 + +SR-IOV VFs do not implement the memory enable bit of the command +register, therefore this bit is not set in config space after +pci_enable_device(). This leads to an unintended difference +between PF and VF in hand-off state to the user. We can correct +this by setting the initial value of the memory enable bit in our +virtualized config space. There's really no need however to +ever fault a user on a VF though as this would only indicate an +error in the user's management of the enable bit, versus a PF +where the same access could trigger hardware faults. + +Fixes: abafbc551fdd ("vfio-pci: Invalidate mmaps and block MMIO access on disabled memory") +Signed-off-by: Alex Williamson +Acked-by: Joerg Roedel +--- + drivers/vfio/pci/vfio_pci_config.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +--- a/drivers/vfio/pci/vfio_pci_config.c ++++ b/drivers/vfio/pci/vfio_pci_config.c +@@ -401,9 +401,15 @@ static inline void p_setd(struct perm_bi + /* Caller should hold memory_lock semaphore */ + bool __vfio_pci_memory_enabled(struct vfio_pci_device *vdev) + { ++ struct pci_dev *pdev = vdev->pdev; + u16 cmd = le16_to_cpu(*(__le16 *)&vdev->vconfig[PCI_COMMAND]); + +- return cmd & PCI_COMMAND_MEMORY; ++ /* ++ * SR-IOV VF memory enable is handled by the MSE bit in the ++ * PF SR-IOV capability, there's therefore no need to trigger ++ * faults based on the virtual value. ++ */ ++ return pdev->is_virtfn || (cmd & PCI_COMMAND_MEMORY); + } + + /* +@@ -1693,6 +1699,15 @@ int vfio_config_init(struct vfio_pci_dev + if (pdev->is_virtfn) { + *(__le16 *)&vconfig[PCI_VENDOR_ID] = cpu_to_le16(pdev->vendor); + *(__le16 *)&vconfig[PCI_DEVICE_ID] = cpu_to_le16(pdev->device); ++ ++ /* ++ * VFs do no implement the memory enable bit of the COMMAND ++ * register therefore we'll not have it set in our initial ++ * copy of config space after pci_enable_device(). For ++ * consistency with PFs, set the virtual enable bit here. ++ */ ++ *(__le16 *)&vconfig[PCI_COMMAND] |= ++ cpu_to_le16(PCI_COMMAND_MEMORY); + } + + if (!IS_ENABLED(CONFIG_VFIO_PCI_INTX) || vdev->nointx) + diff --git a/patches.suse/vfs-Fix-EOVERFLOW-testing-in-put_compat_statfs64.patch b/patches.suse/vfs-Fix-EOVERFLOW-testing-in-put_compat_statfs64.patch new file mode 100644 index 0000000..f483b8a --- /dev/null +++ b/patches.suse/vfs-Fix-EOVERFLOW-testing-in-put_compat_statfs64.patch @@ -0,0 +1,58 @@ +From: Eric Sandeen +Date: Wed, 2 Oct 2019 16:17:54 -0500 +Subject: vfs: Fix EOVERFLOW testing in put_compat_statfs64 +Git-commit: cc3a7bfe62b947b423fcb2cfe89fcba92bf48fa3 +Patch-mainline: 5.4-rc2 +References: bnc#1151927 5.3.6 + +Today, put_compat_statfs64() disallows nearly any field value over +2^32 if f_bsize is only 32 bits, but that makes no sense. +compat_statfs64 is there for the explicit purpose of providing 64-bit +fields for f_files, f_ffree, etc. And f_bsize is always only 32 bits. + +As a result, 32-bit userspace gets -EOVERFLOW for i.e. large file +counts even with -D_FILE_OFFSET_BITS=64 set. + +In reality, only f_bsize and f_frsize can legitimately overflow +(fields like f_type and f_namelen should never be large), so test +only those fields. + +This bug was discussed at length some time ago, and this is the proposal +Al suggested at https://lkml.org/lkml/2018/8/6/640. It seemed to get +dropped amid the discussion of other related changes, but this +part seems obviously correct on its own, so I've picked it up and +sent it, for expediency. + +Fixes: 64d2ab32efe3 ("vfs: fix put_compat_statfs64() does not handle errors") +Signed-off-by: Eric Sandeen +Signed-off-by: Linus Torvalds +Signed-off-by: Jiri Slaby +--- + fs/statfs.c | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +--- a/fs/statfs.c ++++ b/fs/statfs.c +@@ -299,19 +299,9 @@ COMPAT_SYSCALL_DEFINE2(fstatfs, unsigned + + static int put_compat_statfs64(struct compat_statfs64 __user *ubuf, struct kstatfs *kbuf) + { +- if (sizeof(ubuf->f_bsize) == 4) { +- if ((kbuf->f_type | kbuf->f_bsize | kbuf->f_namelen | +- kbuf->f_frsize | kbuf->f_flags) & 0xffffffff00000000ULL) +- return -EOVERFLOW; +- /* f_files and f_ffree may be -1; it's okay +- * to stuff that into 32 bits */ +- if (kbuf->f_files != 0xffffffffffffffffULL +- && (kbuf->f_files & 0xffffffff00000000ULL)) +- return -EOVERFLOW; +- if (kbuf->f_ffree != 0xffffffffffffffffULL +- && (kbuf->f_ffree & 0xffffffff00000000ULL)) +- return -EOVERFLOW; +- } ++ if ((kbuf->f_bsize | kbuf->f_frsize) & 0xffffffff00000000ULL) ++ return -EOVERFLOW; ++ + if (!access_ok(VERIFY_WRITE, ubuf, sizeof(*ubuf)) || + __put_user(kbuf->f_type, &ubuf->f_type) || + __put_user(kbuf->f_bsize, &ubuf->f_bsize) || diff --git a/patches.suse/vxlan-Avoid-infinite-loop-when-suppressing-NS-messag.patch b/patches.suse/vxlan-Avoid-infinite-loop-when-suppressing-NS-messag.patch new file mode 100644 index 0000000..8593a08 --- /dev/null +++ b/patches.suse/vxlan-Avoid-infinite-loop-when-suppressing-NS-messag.patch @@ -0,0 +1,47 @@ +From: Ido Schimmel +Date: Mon, 1 Jun 2020 15:58:55 +0300 +Subject: vxlan: Avoid infinite loop when suppressing NS messages with invalid + options +Patch-mainline: v5.8-rc1 +Git-commit: 8066e6b449e050675df48e7c4b16c29f00507ff0 +References: git-fixes + +When proxy mode is enabled the vxlan device might reply to Neighbor +Solicitation (NS) messages on behalf of remote hosts. + +In case the NS message includes the "Source link-layer address" option +[1], the vxlan device will use the specified address as the link-layer +destination address in its reply. + +To avoid an infinite loop, break out of the options parsing loop when +encountering an option with length zero and disregard the NS message. + +This is consistent with the IPv6 ndisc code and RFC 4886 which states +that "Nodes MUST silently discard an ND packet that contains an option +with length zero" [2]. + +[1] https://tools.ietf.org/html/rfc4861#section-4.3 +[2] https://tools.ietf.org/html/rfc4861#section-4.6 + +Fixes: 4b29dba9c085 ("vxlan: fix nonfunctional neigh_reduce()") +Signed-off-by: Ido Schimmel +Acked-by: Nikolay Aleksandrov +Signed-off-by: David S. Miller +Acked-by: Thomas Bogendoerfer +--- + drivers/net/vxlan.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/vxlan.c ++++ b/drivers/net/vxlan.c +@@ -1662,6 +1662,10 @@ static struct sk_buff *vxlan_na_create(s + ns_olen = request->len - skb_network_offset(request) - + sizeof(struct ipv6hdr) - sizeof(*ns); + for (i = 0; i < ns_olen-1; i += (ns->opt[i+1]<<3)) { ++ if (!ns->opt[i + 1]) { ++ kfree_skb(reply); ++ return NULL; ++ } + if (ns->opt[i] == ND_OPT_SOURCE_LL_ADDR) { + daddr = ns->opt + i + sizeof(struct nd_opt_hdr); + break; diff --git a/patches.suse/wil6210-make-sure-Rx-ring-sizes-are-correlated.patch b/patches.suse/wil6210-make-sure-Rx-ring-sizes-are-correlated.patch new file mode 100644 index 0000000..e63490c --- /dev/null +++ b/patches.suse/wil6210-make-sure-Rx-ring-sizes-are-correlated.patch @@ -0,0 +1,94 @@ +From 61e5ec044748486f06dec760a19dce78247b3ad8 Mon Sep 17 00:00:00 2001 +From: Dedy Lansky +Date: Wed, 31 Oct 2018 10:52:12 +0200 +Subject: [PATCH] wil6210: make sure Rx ring sizes are correlated +Git-commit: 61e5ec044748486f06dec760a19dce78247b3ad8 +References: git-fixes +Patch-mainline: v5.0-rc1 + +When enlarging rx_ring_order module param, wil6210 fails to load +because there are not enough Rx buffers. +Fix this by enlarging number of Rx buffers at startup, if needed based +on rx_ring_order. + +Signed-off-by: Dedy Lansky +Signed-off-by: Maya Erez +Signed-off-by: Kalle Valo +Signed-off-by: Oliver Neukum +--- + drivers/net/wireless/ath/wil6210/main.c | 2 +- + drivers/net/wireless/ath/wil6210/txrx.c | 4 ++-- + drivers/net/wireless/ath/wil6210/txrx_edma.c | 11 ++++++++--- + drivers/net/wireless/ath/wil6210/wil6210.h | 2 +- + 4 files changed, 12 insertions(+), 7 deletions(-) + +--- a/drivers/net/wireless/ath/wil6210/main.c ++++ b/drivers/net/wireless/ath/wil6210/main.c +@@ -1680,7 +1680,7 @@ int __wil_up(struct wil6210_priv *wil) + return rc; + + /* Rx RING. After MAC and beacon */ +- rc = wil->txrx_ops.rx_init(wil, 1 << rx_ring_order); ++ rc = wil->txrx_ops.rx_init(wil, rx_ring_order); + if (rc) + return rc; + +--- a/drivers/net/wireless/ath/wil6210/txrx.c ++++ b/drivers/net/wireless/ath/wil6210/txrx.c +@@ -880,7 +880,7 @@ static void wil_rx_buf_len_init(struct w + } + } + +-static int wil_rx_init(struct wil6210_priv *wil, u16 size) ++static int wil_rx_init(struct wil6210_priv *wil, uint order) + { + struct wil_ring *vring = &wil->ring_rx; + int rc; +@@ -894,7 +894,7 @@ static int wil_rx_init(struct wil6210_pr + + wil_rx_buf_len_init(wil); + +- vring->size = size; ++ vring->size = 1 << order; + vring->is_rx = true; + rc = wil_vring_alloc(wil, vring); + if (rc) +--- a/drivers/net/wireless/ath/wil6210/txrx_edma.c ++++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c +@@ -606,9 +606,9 @@ static void wil_rx_buf_len_init_edma(str + WIL_MAX_ETH_MTU : WIL_EDMA_RX_BUF_LEN_DEFAULT; + } + +-static int wil_rx_init_edma(struct wil6210_priv *wil, u16 desc_ring_size) ++static int wil_rx_init_edma(struct wil6210_priv *wil, uint desc_ring_order) + { +- u16 status_ring_size; ++ u16 status_ring_size, desc_ring_size = 1 << desc_ring_order; + struct wil_ring *ring = &wil->ring_rx; + int rc; + size_t elem_size = wil->use_compressed_rx_status ? +@@ -623,7 +623,12 @@ static int wil_rx_init_edma(struct wil62 + "compressed RX status cannot be used with SW reorder\n"); + return -EINVAL; + } +- ++ if (wil->rx_status_ring_order <= desc_ring_order) ++ /* make sure sring is larger than desc ring */ ++ wil->rx_status_ring_order = desc_ring_order + 1; ++ if (wil->rx_buff_id_count <= desc_ring_size) ++ /* make sure we will not run out of buff_ids */ ++ wil->rx_buff_id_count = desc_ring_size + 512; + if (wil->rx_status_ring_order < WIL_SRING_SIZE_ORDER_MIN || + wil->rx_status_ring_order > WIL_SRING_SIZE_ORDER_MAX) + wil->rx_status_ring_order = WIL_RX_SRING_SIZE_ORDER_DEFAULT; +--- a/drivers/net/wireless/ath/wil6210/wil6210.h ++++ b/drivers/net/wireless/ath/wil6210/wil6210.h +@@ -601,7 +601,7 @@ struct wil_txrx_ops { + struct wil_ring *ring, struct sk_buff *skb); + irqreturn_t (*irq_tx)(int irq, void *cookie); + /* RX ops */ +- int (*rx_init)(struct wil6210_priv *wil, u16 ring_size); ++ int (*rx_init)(struct wil6210_priv *wil, uint ring_order); + void (*rx_fini)(struct wil6210_priv *wil); + int (*wmi_addba_rx_resp)(struct wil6210_priv *wil, u8 mid, u8 cid, + u8 tid, u8 token, u16 status, bool amsdu, diff --git a/patches.suse/xhci-Fix-incorrect-EP_STATE_MASK.patch b/patches.suse/xhci-Fix-incorrect-EP_STATE_MASK.patch new file mode 100644 index 0000000..a433345 --- /dev/null +++ b/patches.suse/xhci-Fix-incorrect-EP_STATE_MASK.patch @@ -0,0 +1,40 @@ +From dceea67058fe22075db3aed62d5cb62092be5053 Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Wed, 24 Jun 2020 16:59:45 +0300 +Subject: [PATCH] xhci: Fix incorrect EP_STATE_MASK +Git-commit: dceea67058fe22075db3aed62d5cb62092be5053 +References: git-fixes +Patch-mainline: v5.8-rc3 + +EP_STATE_MASK should be 0x7 instead of 0xf + +xhci spec 6.2.3 shows that the EP state field in the endpoint context data +structure consist of bits [2:0]. +The old value included a bit from the next field which fortunately is a + RsvdZ region. So hopefully this hasn't caused too much harm + +Cc: stable@vger.kernel.org +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20200624135949.22611-2-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xhci.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h +index 2c6c4f8d1ee1..c295e8a7f5ae 100644 +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -716,7 +716,7 @@ struct xhci_ep_ctx { + * 4 - TRB error + * 5-7 - reserved + */ +-#define EP_STATE_MASK (0xf) ++#define EP_STATE_MASK (0x7) + #define EP_STATE_DISABLED 0 + #define EP_STATE_RUNNING 1 + #define EP_STATE_HALTED 2 +-- +2.16.4 + diff --git a/scripts/git_sort/git_sort.py b/scripts/git_sort/git_sort.py index 39f76a9..5be6f0f 100755 --- a/scripts/git_sort/git_sort.py +++ b/scripts/git_sort/git_sort.py @@ -65,6 +65,7 @@ class RepoURL(object): k_org_prefixes = [ "http://git.kernel.org/pub/scm/linux/kernel/git/", "https://git.kernel.org/pub/scm/linux/kernel/git/", + "ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/", "https://kernel.googlesource.com/pub/scm/linux/kernel/git/", ] for prefix in k_org_prefixes: diff --git a/series.conf b/series.conf index fc71f39..c06df4a 100644 --- a/series.conf +++ b/series.conf @@ -12019,6 +12019,7 @@ patches.suse/scsi-sas-Convert-timers-to-use-timer_setup.patch patches.suse/1400-drm-gma500-convert-timers-to-use-timer_setup patches.suse/1401-drm-etnaviv-convert-timers-to-use-timer_setup + patches.suse/timers-Add-a-function-to-start-reduce-a-timer.patch patches.suse/x86-intel_rdt-add-framework-for-better-rdt-ui-diagnostics patches.suse/x86-intel_rdt-add-diagnostics-when-writing-the-schemata-file patches.suse/x86-intel_rdt-add-diagnostics-when-writing-the-tasks-file @@ -12035,11 +12036,13 @@ patches.suse/x86-platform-uv-add-check-of-tsc-state-set-by-uv-bio.patch patches.suse/x86-tsc-make-config_x86_tsc-n-build-work-again.patch patches.suse/x86-CPU-Avoid-unnecessary-IPIs-in-arch_freq_get_on_cpu.patch + patches.suse/PM-Domains-Allow-genpd-users-to-specify-default-acti.patch patches.suse/PM-Domains-Fix-genpd-to-deal-with-drivers-returning-.patch patches.suse/PM-QoS-Drop-PM_QOS_FLAG_REMOTE_WAKEUP.patch patches.suse/cpuidle-fix-broadcast-control-when-broadcast-can-not-be-entered.patch patches.suse/0150-ARM-cpuidle-Correct-driver-unregistration-if-init-fa.patch patches.suse/0151-ARM-cpuidle-Refactor-rollback-operations-if-init-fai.patch + patches.suse/intel_idle-Graceful-probe-failure-when-MWAIT-is-disa.patch patches.suse/cpufreq-ti-cpufreq-add-missing-of_node_put.patch patches.suse/cpufreq-schedutil-Reset-cached_raw_freq-when-not-in-sync-with-next_freq.patch patches.suse/PM-OPP-Move-error-message-to-debug-level @@ -12229,6 +12232,7 @@ patches.suse/crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b patches.suse/0021-crypto-inside-secure-remove-null-check-before-kfree.patch patches.suse/crypto-brcm-Explicity-ACK-mailbox-message + patches.suse/padata-ensure-the-reorder-timer-callback-runs-on-the.patch patches.suse/crypto-lrw-Fix-an-error-handling-path-in-create patches.suse/crypto-lrw-Check-for-incorrect-cipher-name patches.suse/crypto-chelsio-pr_err-strings-should-end-with-newlin.patch @@ -19404,6 +19408,7 @@ patches.suse/cpufreq-intel_pstate-Replace-bxt_funcs-with-core_funcs.patch patches.suse/cpufreq-intel_pstate-Add-Skylake-servers-support.patch patches.suse/cpufreq-powernv-Dont-assume-distinct-pstate-values-f.patch + patches.suse/PM-domains-Don-t-skip-driver-s-suspend-resume_noirq-.patch patches.suse/0001-PM-genpd-Stop-start-devices-without-pm_runtime_force.patch patches.suse/0001-PM-core-Add-LEAVE_SUSPENDED-driver-flag.patch patches.suse/0002-PCI-PM-Support-for-LEAVE_SUSPENDED-driver-flag.patch @@ -28347,6 +28352,7 @@ patches.suse/0001-USB-fix-USB3-devices-behind-USB3-hubs-not-resuming-a.patch patches.suse/USB-gadget-f_midi-fixing-a-possible-double-free-in-f.patch patches.suse/usb-gadget-udc-core-update-usb_ep_queue-documentatio.patch + patches.suse/usb-dwc3-gadget-never-call-complete-from-ep_queue.patch patches.suse/USB-serial-option-reimplement-interface-masking.patch patches.suse/USB-serial-option-drop-redundant-interface-class-tes.patch patches.suse/usb-musb-gadget-misplaced-out-of-bounds-check.patch @@ -35097,6 +35103,7 @@ patches.suse/tcp-prevent-bogus-FRTO-undos-with-non-SACK-flows.patch patches.suse/net-fix-use-after-free-in-GRO-with-ESP.patch patches.suse/ipv6-sr-fix-passing-wrong-flags-to-crypto_alloc_shas.patch + patches.suse/ipvlan-call-dev_change_flags-when-ipvlan-mode-is-res.patch patches.suse/qed-Limit-msix-vectors-in-kdump-kernel-to-the-minimu.patch patches.suse/qed-Fix-setting-of-incorrect-eswitch-mode.patch patches.suse/qed-Fix-use-of-incorrect-size-in-memcpy-call.patch @@ -39004,6 +39011,7 @@ patches.suse/0001-PCI-portdrv-Deduplicate-PM-callback-iterator.patch patches.suse/0001-PCI-pciehp-Clear-spurious-events-earlier-on-resume.patch patches.suse/PCI-pciehp-Obey-compulsory-command-delay-after-resum.patch + patches.suse/PCI-pciehp-Support-interrupts-sent-from-D3hot.patch patches.suse/0001-PCI-pciehp-Resume-parent-to-D0-on-config-space-acces.patch patches.suse/0001-PCI-pciehp-Deduplicate-presence-check-on-probe-resum.patch patches.suse/PCI-Mark-fall-through-switch-cases-before-enabling-W.patch @@ -40262,6 +40270,7 @@ patches.suse/scsi-hpsa-limit-transfer-length-to-1mb-not-512kb.patch patches.suse/scsi-target-iscsi-cxgbit-use-pr_debug-instead-of-pr_info patches.suse/scsi-libata-Add-missing-newline-at-end-of-file.patch + patches.suse/scsi-aacraid-fix-a-signedness-bug.patch patches.suse/gpio-adp5588-Fix-sleep-in-atomic-context-bug.patch patches.suse/gpiolib-acpi-Switch-to-cansleep-version-of-GPIO-libr.patch patches.suse/gpiolib-acpi-Register-GpioInt-ACPI-event-handlers-fr.patch @@ -44963,6 +44972,7 @@ patches.suse/wireless-airo-potential-buffer-overflow-in-sprintf.patch patches.suse/rtlwifi-rtl8192de-Fix-misleading-REG_MCUFWDL-informa.patch patches.suse/wil6210-fix-reset-flow-for-Talyn-mb.patch + patches.suse/wil6210-make-sure-Rx-ring-sizes-are-correlated.patch patches.suse/wil6210-fix-memory-leak-in-wil_find_tx_bcast_2.patch patches.suse/wil6210-add-general-initialization-size-checks.patch patches.suse/wil6210-fix-debugfs-memory-access-alignment.patch @@ -45113,6 +45123,7 @@ patches.suse/bpf-tls_sw-init-TLS-ULP-removes-BPF-proto-hooks.patch patches.suse/net-mlx5e-drop-useless-LIST_HEAD.patch patches.suse/mlxsw-spectrum-drop-useless-LIST_HEAD.patch + patches.suse/net-mlx4_core-drop-useless-LIST_HEAD.patch patches.suse/net-core-Fix-Spectre-v1-vulnerability.patch patches.suse/phonet-af_phonet-Fix-Spectre-v1-vulnerability.patch patches.suse/packet-validate-address-length-if-non-zero.patch @@ -45426,6 +45437,7 @@ patches.suse/RDMA-srp-Document-srp_parse_in-arguments.patch patches.suse/RDMA-bnxt_re-Query-HWRM-Interface-version-from-FW.patch patches.suse/RDMA-bnxt_re-Increase-depth-of-control-path-command-.patch + patches.suse/net-mlx5-Continue-driver-initialization-despite-debu.patch patches.suse/net-mlx5-Add-shared-Q-counter-bits.patch patches.suse/IB-mlx5-Introduce-uid-as-part-of-alloc-dealloc-trans.patch patches.suse/IB-mlx5-Use-uid-as-part-of-alloc-dealloc-transport-d.patch @@ -45503,6 +45515,7 @@ patches.suse/phy-sun4i-usb-add-support-for-missing-USB-PHY-index.patch patches.suse/usb-dwc3-debugfs-Properly-print-set-link-state-for-H.patch patches.suse/usb-dwc3-don-t-log-probe-deferrals-but-do-log-other-.patch + patches.suse/usb-dwc3-gadget-introduce-cancelled_list.patch patches.suse/usb-dwc3-Correct-the-logic-for-checking-TRB-full-in-.patch patches.suse/usb-mtu3-fix-the-issue-about-SetFeature-U1-U2_Enable.patch patches.suse/usb-dwc2-host-use-hrtimer-for-nak-retries.patch @@ -45952,7 +45965,9 @@ patches.suse/net-Fix-typo-in-NET_FAILOVER-help-text.patch patches.suse/mlxsw-pci-Ring-CQ-s-doorbell-before-RDQ-s.patch patches.suse/mlxsw-pci-Increase-PCI-SW-reset-timeout.patch + patches.suse/mlxsw-pci-Return-error-on-PCI-reset-timeout.patch patches.suse/mlxsw-spectrum_fid-Update-dummy-FID-index.patch + patches.suse/mlxsw-spectrum_switchdev-Do-not-treat-static-FDB-ent.patch patches.suse/net-mlx5e-Force-CHECKSUM_UNNECESSARY-for-short-ether.patch patches.suse/net-mlx5e-Fix-wrong-error-code-return-on-FEC-query-f.patch patches.suse/isdn-avm-Fix-string-plus-integer-warning-from-Clang.patch @@ -46406,6 +46421,7 @@ patches.suse/net-Set-rtm_table-to-RT_TABLE_COMPAT-for-ipv6-for-ta.patch patches.suse/mdio_bus-Fix-use-after-free-on-device_register-fails.patch patches.suse/bpf-lpm-fix-lookup-bug-in-map_delete_elem.patch + patches.suse/nfp-bpf-fix-code-gen-bug-on-BPF_ALU-BPF_XOR-BPF_K.patch patches.suse/0001-nfp-bpf-fix-ALU32-high-bits-clearance-bug.patch patches.suse/net-phy-marvell10g-Fix-Multi-G-advertisement-to-only.patch patches.suse/net-x25-fix-a-race-in-x25_bind.patch @@ -46454,6 +46470,7 @@ patches.suse/scsi-lpfc-fix-calls-to-dma_set_mask_and_coherent.patch patches.suse/scsi-bfa-fix-calls-to-dma_set_mask_and_coherent patches.suse/scsi-csiostor-fix-calls-to-dma_set_mask_and_coherent + patches.suse/hisi_sas-fix-calls-to-dma_set_mask_and_coherent.patch patches.suse/x86-uaccess-don-t-leak-the-ac-flag-into-_put_user-value-evaluation.patch patches.suse/msft-hv-1843-x86-hyper-v-Fix-definition-of-HV_MAX_FLUSH_REP_COUNT.patch patches.suse/tee-optee-add-missing-of_node_put-after-of_device_is.patch @@ -47522,6 +47539,7 @@ patches.suse/net-mlx5-Fix-multiple-updates-of-steering-rules-in-p.patch patches.suse/0001-net-mlx5e-IPoIB-Fix-RX-checksum-statistics-update.patch patches.suse/net-mlx5-Avoid-panic-when-setting-vport-mac-getting-.patch + patches.suse/net-mlx5-Avoid-panic-when-setting-vport-rate.patch patches.suse/0001-net-mlx4_core-Fix-reset-flow-when-in-command-polling.patch patches.suse/0001-net-mlx4_core-Fix-locking-in-SRIOV-mode-when-switchi.patch patches.suse/0001-net-mlx4_core-Fix-qp-mtt-size-calculation.patch @@ -48002,7 +48020,10 @@ patches.suse/mac80211-do-not-call-driver-wake_tx_queue-op-during-.patch patches.suse/nl80211-Add-NL80211_FLAG_CLEAR_SKB-flag-for-other-NL.patch patches.suse/mac80211-Honor-SW_CRYPTO_CONTROL-for-unicast-keys-in.patch + patches.suse/mlxsw-spectrum_switchdev-Add-MDB-entries-in-prepare-.patch patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-EMAD-workqu.patch + patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-order.patch + patches.suse/mlxsw-core-Do-not-use-WQ_MEM_RECLAIM-for-mlxsw-workq.patch patches.suse/ibmvnic-Enable-GRO.patch patches.suse/ibmvnic-Fix-netdev-feature-clobbering-during-a-reset.patch patches.suse/net-tls-fix-the-IV-leaks.patch @@ -48398,6 +48419,7 @@ patches.suse/mmc-core-Fix-tag-set-memory-leak.patch patches.suse/mmc-sdhci-pci-Fix-BYT-OCP-setting.patch patches.suse/drivers-fix-a-typo-in-the-kernel-doc-for-devm_platfo.patch + patches.suse/kernfs-fix-barrier-usage-in-__kernfs_new_node.patch patches.suse/iio-common-ssp_sensors-Initialize-calculated_time-in.patch patches.suse/iio-hmc5843-fix-potential-NULL-pointer-dereferences.patch patches.suse/iio-ad_sigma_delta-Properly-handle-SPI-bus-locking-v.patch @@ -49516,6 +49538,7 @@ patches.suse/net-mlx5-Avoid-double-free-in-fs-init-error-unwindin.patch patches.suse/net-mlx5-Allocate-root-ns-memory-using-kzalloc-to-ma.patch patches.suse/net-dsa-mv88e6xxx-fix-handling-of-upper-half-of-STAT.patch + patches.suse/mlxsw-spectrum-Prevent-force-of-56G.patch patches.suse/net-mvpp2-fix-bad-MVPP2_TXQ_SCHED_TOKEN_CNTR_REG-que.patch patches.suse/net-gro-fix-use-after-free-read-in-napi_gro_frags.patch patches.suse/net-don-t-clear-sock-sk-early-to-avoid-trouble-in-st.patch @@ -49575,6 +49598,7 @@ patches.suse/net-hns-Fix-loopback-test-failed-at-copper-ports.patch patches.suse/net-ethernet-ti-cpsw_ethtool-fix-ethtool-ring-param-.patch patches.suse/net-tls-replace-the-sleeping-lock-around-RX-resync-w.patch + patches.suse/net-ipvlan-Fix-ipvlan-device-tso-disabled-while-NETI.patch patches.suse/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-udev-event patches.suse/Fix-memory-leak-in-sctp_process_init.patch patches.suse/ethtool-fix-potential-userspace-buffer-overflow.patch @@ -49695,7 +49719,9 @@ patches.suse/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch patches.suse/net-openvswitch-do-not-free-vport-if-register_netdev.patch patches.suse/net-tls-correctly-account-for-copied-bytes-with-mult.patch + patches.suse/mlxsw-spectrum_router-Refresh-nexthop-neighbour-when.patch patches.suse/mlxsw-spectrum_flower-Fix-TOS-matching.patch + patches.suse/mlxsw-spectrum-Disallow-prio-tagged-packets-when-PVI.patch patches.suse/net-mvpp2-prs-Fix-parser-range-for-VID-filtering.patch patches.suse/net-mvpp2-prs-Use-the-correct-helpers-when-removing-.patch patches.suse/mac80211-handle-deauthentication-disassociation-from.patch @@ -49774,6 +49800,7 @@ patches.suse/scsi-ufs-avoid-runtime-suspend-possibly-being-blocked-forever patches.suse/scsi-qla2xxx-Fix-hardlockup-in-abort-command-during-.patch patches.suse/powerpc-mm-64s-hash-Reallocate-context-ids-on-fork.patch + patches.suse/be2net-fix-link-failure-after-ethtool-offline-test.patch patches.suse/ppp-mppe-Add-softdep-to-arc4.patch patches.suse/net-stmmac-fixed-new-system-time-seconds-value-calcu.patch patches.suse/net-stmmac-set-IC-bit-when-transmitting-frames-with-.patch @@ -50211,11 +50238,13 @@ patches.suse/xdp-fix-race-on-generic-receive-path.patch patches.suse/mwifiex-Don-t-abort-on-small-spec-compliant-vendor-I.patch patches.suse/batman-adv-fix-for-leaked-TVLV-handler.patch + patches.suse/net-mvpp2-prs-Don-t-override-the-sign-bit-in-SRAM-pa.patch patches.suse/net-make-skb_dst_force-return-true-when-dst-is-refco.patch patches.suse/igmp-fix-memory-leak-in-igmpv3_del_delrec.patch patches.suse/bnx2x-Prevent-ptp_task-to-be-rescheduled-indefinitel.patch patches.suse/net-dsa-mv88e6xxx-wait-after-reset-deactivation.patch patches.suse/bnxt_en-Disable-bus-master-during-PCI-shutdown-and-d.patch + patches.suse/bnxt_en-Fix-ethtool-selftest-crash-under-error-condi.patch patches.suse/bnxt_en-Fix-statistics-context-reservation-logic-for.patch patches.suse/bnxt_en-Cap-the-returned-MSIX-vectors-to-the-RDMA-dr.patch patches.suse/bnxt_en-Suppress-error-messages-when-querying-DSCP-D.patch @@ -50243,6 +50272,7 @@ patches.suse/tcp-Reset-bytes_acked-and-bytes_received-when-discon.patch patches.suse/net-tls-fix-socket-wmem-accounting-on-fallback-with-.patch patches.suse/dt-bindings-allow-up-to-four-clocks-for-orion-mdio.patch + patches.suse/net-mvmdio-allow-up-to-four-clocks-to-be-specified-f.patch patches.suse/irqchip-gic-v3-its-Fix-misuse-of-GENMASK-macro.patch patches.suse/stacktrace-use-pf_kthread-to-check-for-kernel-threads.patch patches.suse/x86-alternatives-fix-int3_emulate_call-selftest-stack-corruption.patch @@ -50512,6 +50542,7 @@ patches.suse/0001-PCI-qcom-Ensure-that-PERST-is-asserted-for-at-least-.patch patches.suse/PCI-tegra-Enable-Relaxed-Ordering-only-for-Tegra20-T.patch patches.suse/0001-PCI-xilinx-nwl-Fix-Multi-MSI-data-programming.patch + patches.suse/cgroup-blkcg-Prepare-some-symbols-for-module-and-CON.patch patches.suse/nvme-multipath-factor-out-a-nvme_path_is_disabled-he.patch patches.suse/nvme-multipath-also-check-for-a-disabled-path-if-the.patch patches.suse/nvme-multipath-do-not-select-namespaces-which-are-ab.patch @@ -50954,6 +50985,7 @@ patches.suse/cx82310_eth-fix-a-memory-leak-bug.patch patches.suse/bnxt_en-Fix-VNIC-clearing-logic-for-57500-chips.patch patches.suse/bnxt_en-Improve-RX-doorbell-sequence.patch + patches.suse/bnxt_en-Fix-handling-FRAG_ERR-when-NVM_INSTALL_UPDAT.patch patches.suse/bnxt_en-Use-correct-src_fid-to-determine-direction-o.patch patches.suse/bnxt_en-Fix-to-include-flow-direction-in-L2-key.patch patches.suse/ibmvnic-Unmap-DMA-address-of-TX-descriptor-buffers-a.patch @@ -51319,6 +51351,7 @@ patches.suse/crypto-cavium-zip-Add-missing-single_release.patch patches.suse/e1000e-Use-dev_get_drvdata-where-possible.patch patches.suse/e1000e-add-workaround-for-possible-stalled-packet.patch + patches.suse/qed-reduce-maximum-stack-frame-size.patch patches.suse/net-hns3-change-GFP-flag-during-lock-period.patch patches.suse/NFC-fix-attrs-checks-in-netlink-interface.patch patches.suse/bnxt_en-Update-firmware-interface-spec.-to-1.10.0.89.patch @@ -51337,7 +51370,9 @@ patches.suse/Revert-mwifiex-fix-system-hang-problem-after-resume.patch patches.suse/can-mcp251x-mcp251x_hw_reset-allow-more-time-after-a.patch patches.suse/mac80211-minstrel_ht-fix-per-group-max-throughput-ra.patch + patches.suse/i40e-reduce-stack-usage-in-i40e_set_fc.patch patches.suse/IB-mlx5-Support-MLX5_CMD_OP_QUERY_LAG-as-a-DEVX-gene.patch + patches.suse/net-mlx5e-ethtool-Fix-a-typo-in-WOL-function-names.patch patches.suse/tools-bpftool-fix-arguments-for-p_err-in-do_event_pi.patch patches.suse/xsk-avoid-store-tearing-when-assigning-queues.patch patches.suse/xsk-avoid-store-tearing-when-assigning-umem.patch @@ -51345,6 +51380,7 @@ patches.suse/bcma-fix-incorrect-update-of-BCMA_CORE_PCI_MDIO_DATA.patch patches.suse/rtlwifi-Fix-file-release-memory-leak.patch patches.suse/netfilter-not-mark-a-spinlock-as-__read_mostly.patch + patches.suse/net-mlx5e-Remove-unnecessary-clear_bit-s.patch patches.suse/ixgbe-sync-the-first-fragment-unconditionally.patch patches.suse/i40e-Add-support-for-X710-device.patch patches.suse/net-mlx5-FWTrace-Reduce-stack-usage.patch @@ -51357,6 +51393,10 @@ patches.suse/ath9k-release-allocated-buffer-if-timed-out.patch patches.suse/ath10k-adjust-skb-length-in-ath10k_sdio_mbox_rx_pack.patch patches.suse/bnxt_en-Increase-timeout-for-HWRM_DBG_COREDUMP_XX-co.patch + patches.suse/net-ena-add-intr_moder_rx_interval-to-struct-ena_com.patch + patches.suse/net-ena-reimplement-set-get_coalesce.patch + patches.suse/net-ena-fix-retrieval-of-nonadaptive-interrupt-moder.patch + patches.suse/net-ena-don-t-wake-up-tx-queue-when-down.patch patches.suse/0001-xen-netfront-do-not-assume-sk_buff_head-list-is-empt.patch patches.suse/btrfs-volumes-Remove-ENOSPC-prone-btrfs_can_relocate.patch patches.suse/0001-btrfs-tree-checker-Add-ROOT_ITEM-check.patch @@ -51531,6 +51571,7 @@ patches.suse/scsi-qla2xxx-Fix-hang-in-fcport-delete-path.patch patches.suse/scsi-qla2xxx-Allow-NVMe-IO-to-resume-with-short-cabl.patch patches.suse/scsi-qla2xxx-Update-driver-version-to-10.01.00.18-k.patch + patches.suse/scsi-megaraid_sas-Fix-a-compilation-warning.patch patches.suse/scsi-ibmvfc-Mark-expected-switch-fall-throughs.patch patches.suse/scsi-qla2xxx-Make-qla2x00_abort_srb-again-decrease-t.patch patches.suse/scsi-qla2xxx-Really-fix-qla2xxx_eh_abort.patch @@ -51735,6 +51776,7 @@ patches.suse/nfsd-handle-drc-over-allocation-gracefully.patch patches.suse/nfsd-degraded-slot-count-more-gracefully-as-allocati.patch patches.suse/ima-always-return-negative-code-for-error.patch + patches.suse/efi-Restrict-efivar_ssdt_load-when-the-kernel-is-loc.patch patches.suse/KVM-PPC-Book3S-HV-use-smp_mb-when-setting-clearing-h.patch patches.suse/powerpc-pseries-Read-TLB-Block-Invalidate-Characteri.patch patches.suse/powerpc-pseries-Call-H_BLOCK_REMOVE-when-supported.patch @@ -51763,6 +51805,7 @@ patches.suse/ppp-Fix-memory-leak-in-ppp_write.patch patches.suse/net-sched-cbs-Fix-not-adding-cbs-instance-to-list.patch patches.suse/net-mlx5-Add-device-ID-of-upcoming-BlueField-2.patch + patches.suse/net-mlx5e-Fix-traffic-duplication-in-ethtool-steerin.patch patches.suse/macsec-drop-skb-sk-before-calling-gro_cells_receive.patch patches.suse/openvswitch-change-type-of-UPCALL_PID-attribute-to-N.patch patches.suse/iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-.patch @@ -51799,6 +51842,7 @@ patches.suse/0002-btrfs-qgroup-Fix-reserved-data-space-leak-if-we-have.patch patches.suse/char-random-Add-a-newline-at-the-end-of-the-file.patch patches.suse/tick-broadcast-hrtimer-fix-a-race-in-bc_set_next.patch + patches.suse/vfs-Fix-EOVERFLOW-testing-in-put_compat_statfs64.patch patches.suse/blk-mq-honor-io-scheduler-for-multiqueue-devices.patch patches.suse/0008-block-sed-opal-fix-sparse-warning-convert-__be64-dat.patch patches.suse/drm-amdgpu-fix-multiple-memory-leaks-in-acp_hw_init.patch @@ -52292,6 +52336,7 @@ patches.suse/crypto-ecdh-fix-big-endian-bug-in-ECC-library.patch patches.suse/crypto-crypto4xx-fix-double-free-in-crypto4xx_destro.patch patches.suse/crypto-tgr192-remove-unneeded-semicolon.patch + patches.suse/mvpp2-remove-misleading-comment.patch patches.suse/Bluetooth-hci_core-fix-init-for-HCI_USER_CHANNEL.patch patches.suse/bpf-stackmap-Fix-deadlock-with-rq_lock-in-bpf_get_st.patch patches.suse/e1000e-Add-support-for-Comet-Lake.patch @@ -52892,6 +52937,8 @@ patches.suse/s390-qeth-fix-promiscuous-mode-after-reset patches.suse/s390-qeth-don-t-return-enotsupp-to-userspace patches.suse/net-hisilicon-Fix-a-BUG-trigered-by-wrong-bytes_comp.patch + patches.suse/net-ena-fix-default-tx-interrupt-moderation-interval.patch + patches.suse/net-ena-fix-issues-in-setting-interrupt-moderation-p.patch patches.suse/qede-Disable-hardware-gro-when-xdp-prog-is-installed.patch patches.suse/mod_devicetable-fix-PHY-module-format.patch patches.suse/msft-hv-1998-hv_netvsc-Fix-unwanted-rx_table-reset.patch @@ -52902,6 +52949,7 @@ patches.suse/gpio-Fix-error-message-on-out-of-range-GPIO-in-looku.patch patches.suse/0011-compat_ioctl-block-handle-BLKREPORTZONE-BLKRESETZONE.patch patches.suse/0012-compat_ioctl-block-handle-Persistent-Reservations.patch + patches.suse/scsi-mpt3sas-Fix-double-free-in-attach-error-handlin.patch patches.suse/scsi-lpfc-fix-build-failure-with-DEBUGFS-disabled.patch patches.suse/scsi-lpfc-fix-spelling-mistakes-of-asynchronous.patch patches.suse/cifs-Adjust-indentation-in-smb2_open_file.patch @@ -53007,6 +53055,7 @@ patches.suse/x86-resctrl-fix-potential-memory-leak.patch patches.suse/drm-i915-Add-missing-include-file-linux-math64.h.patch patches.suse/sh_eth-check-sh_eth_cpu_data-dual_port-when-dumping-.patch + patches.suse/ixgbevf-Remove-limit-of-10-entries-for-unicast-filte.patch patches.suse/net-tls-fix-async-operation.patch patches.suse/qmi_wwan-Add-support-for-Quectel-RM500Q.patch patches.suse/NFC-pn533-fix-bulk-message-timeout.patch @@ -53033,6 +53082,7 @@ patches.suse/net-dsa-tag_qca-fix-doubled-Tx-statistics.patch patches.suse/net-hns-fix-soft-lockup-when-there-is-not-enough-mem.patch patches.suse/bnxt_en-Fix-NTUPLE-firmware-command-failures.patch + patches.suse/bnxt_en-Fix-ipv6-RFS-filter-matching-logic.patch patches.suse/hwmon-nct7802-Fix-voltage-limits-to-wrong-registers.patch patches.suse/hwmon-adt7475-Make-volt2reg-return-same-reg-as-reg2v.patch patches.suse/hwmon-core-Do-not-use-device-managed-functions-for-m.patch @@ -53434,6 +53484,7 @@ patches.suse/net-systemport-Avoid-RBUF-stuck-in-Wake-on-LAN-mode.patch patches.suse/net-mlx5-IPsec-Fix-esp-modify-function-attribute.patch patches.suse/net-mlx5-IPsec-fix-memory-leak-at-mlx5_fpga_ipsec_de.patch + patches.suse/mlxsw-spectrum_dpipe-Add-missing-error-path.patch patches.suse/mwifiex-fix-unbalanced-locking-in-mwifiex_process_co.patch patches.suse/mwifiex-Fix-possible-buffer-overflows-in-mwifiex_ret.patch patches.suse/mwifiex-Fix-possible-buffer-overflows-in-mwifiex_cmd.patch @@ -53466,6 +53517,18 @@ patches.suse/qmi_wwan-unconditionally-reject-2-ep-interfaces.patch patches.suse/core-Don-t-skip-generic-XDP-program-execution-for-cl.patch patches.suse/net-smc-fix-leak-of-kernel-memory-to-user-space.patch + patches.suse/net-ena-fix-potential-crash-when-rxfh-key-is-NULL.patch + patches.suse/net-ena-fix-uses-of-round_jiffies.patch + patches.suse/net-ena-add-missing-ethtool-TX-timestamping-indicati.patch + patches.suse/net-ena-fix-incorrect-default-RSS-key.patch + patches.suse/net-ena-rss-do-not-allocate-key-when-not-supported.patch + patches.suse/net-ena-rss-fix-failure-to-get-indirection-table.patch + patches.suse/net-ena-rss-store-hash-function-as-values-and-not-bi.patch + patches.suse/net-ena-fix-incorrectly-saving-queue-numbers-when-se.patch + patches.suse/net-ena-fix-corruption-of-dev_idx_to_host_tbl.patch + patches.suse/net-ena-make-ena-rxfh-support-ETH_RSS_HASH_NO_CHANGE.patch + patches.suse/net-ena-ethtool-use-correct-value-for-crc32-hash.patch + patches.suse/net-ena-ena-com.c-prevent-NULL-pointer-dereference.patch patches.suse/0001-enic-prevent-waking-up-stopped-tx-queues-over-watchd.patch patches.suse/net-sched-matchall-add-missing-validation-of-TCA_MAT.patch patches.suse/net-sched-flower-add-missing-validation-of-TCA_FLOWE.patch @@ -53733,6 +53796,8 @@ patches.suse/hsr-set-.netnsok-flag.patch patches.suse/net_sched-cls_route-remove-the-right-filter-from-has.patch patches.suse/net-mvneta-Fix-the-case-where-the-last-poll-did-not-.patch + patches.suse/net-ena-avoid-memory-access-violation-by-validating-.patch + patches.suse/net-ena-fix-continuous-keep-alive-resets.patch patches.suse/vxlan-check-return-value-of-gro_cells_init.patch patches.suse/cxgb4-fix-Txq-restart-check-during-backpressure.patch patches.suse/hsr-fix-general-protection-fault-in-hsr_addr_is_self.patch @@ -53752,6 +53817,7 @@ patches.suse/Input-avoid-BIT-macro-usage-in-the-serio.h-UAPI-head.patch patches.suse/clk-imx-align-imx-sc-clock-msg-structs-to-4.patch patches.suse/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch + patches.suse/bus-sunxi-rsb-Return-correct-data-when-mixing-16-bit.patch patches.suse/scsi-qla2xxx-Fix-I-Os-being-passed-down-when-FC-devi.patch patches.suse/i2c-hix5hd2-add-missed-clk_disable_unprepare-in-remo.patch patches.suse/i2c-st-fix-missing-struct-parameter-description.patch @@ -53785,6 +53851,7 @@ patches.suse/USB-serial-io_edgeport-fix-slab-out-of-bounds-read-i.patch patches.suse/usb-gadget-f_fs-Fix-use-after-free-issue-as-part-of-.patch patches.suse/0001-USB-cdc-acm-restore-capability-check-order.patch + patches.suse/debugfs-Check-module-state-before-warning-in-full-op.patch patches.suse/libfs-fix-infoleak-in-simple_attr_read.patch patches.suse/iio-potentiostat-lmp9100-fix-iio_triggered_buffer_-p.patch patches.suse/staging-rtl8188eu-Add-ASUS-USB-N10-Nano-B1-to-device.patch @@ -54025,6 +54092,7 @@ patches.suse/x86-xen-make-the-secondary-cpu-idle-tasks-reliable.patch patches.suse/0019-coresight-do-not-use-the-BIT-macro-in-the-UAPI-heade.patch patches.suse/PCI-ASPM-Clear-the-correct-bits-when-enabling-L1-sub.patch + patches.suse/PCI-pciehp-Fix-indefinite-wait-on-sysfs-requests.patch patches.suse/pci-pciehp-fix-msi-interrupt-race patches.suse/PCI-endpoint-Fix-clearing-start-entry-in-configfs.patch patches.suse/misc-pci_endpoint_test-Fix-to-support-10-pci-endpoin.patch @@ -54037,6 +54105,7 @@ patches.suse/SUNRPC-Fix-a-potential-buffer-overflow-in-svc_print_.patch patches.suse/svcrdma-Fix-leak-of-transport-addresses.patch patches.suse/ftrace-kprobe-show-the-maxactive-number-on-kprobe_events.patch + patches.suse/ext4-fix-a-data-race-at-inode-i_blocks.patch patches.suse/ext4-Check-for-non-zero-journal-inum-in-ext4_calculate_overhead.patches patches.suse/ext4-Avoid-ENOSPC-when-avoiding-to-reuse-recently-de.patch patches.suse/ext4-fix-incorrect-inodes-per-group-in-error-message.patch @@ -54118,6 +54187,7 @@ patches.suse/pwm-pca9685-Fix-PWM-GPIO-inter-operation.patch patches.suse/0001-xen-blkfront-fix-memory-allocation-flags-in-blkfront.patch patches.suse/x86-xen-fix-booting-32-bit-pv-guest.patch + patches.suse/ocfs2-no-need-try-to-truncate-file-beyond-i_size.patch patches.suse/0020-lib-raid6-test-fix-build-on-distros-whose-bin-sh-is-.patch patches.suse/cifs-ignore-cached-share-root-handle-closing-errors.patch patches.suse/cifs-smbd-Merge-code-to-track-pending-packets.patch @@ -54142,6 +54212,7 @@ patches.suse/hsr-check-protocol-version-in-hsr_newlink.patch patches.suse/l2tp-Allow-management-of-tunnels-and-session-in-user.patch patches.suse/net-ipv4-devinet-Fix-crash-when-add-del-multicast-IP.patch + patches.suse/net-cxgb4-Check-the-return-from-t4_query_params-prop.patch patches.suse/mac80211_hwsim-Use-kstrndup-in-place-of-kasprintf.patch patches.suse/xsk-Add-missing-check-on-user-supplied-headroom-size.patch patches.suse/ALSA-ctxfi-Remove-unnecessary-cast-in-kfree.patch @@ -54272,17 +54343,33 @@ patches.suse/HID-wacom-Read-HID_DG_CONTACTMAX-directly-for-non-ge.patch patches.suse/HID-multitouch-add-eGalaxTouch-P80H84-support.patch patches.suse/platform-x86-asus-nb-wmi-Do-not-load-on-Asus-T100TA-.patch + patches.suse/net-tls-Fix-sk_psock-refcnt-leak-in-bpf_exec_tx_verd.patch + patches.suse/net-tls-Fix-sk_psock-refcnt-leak-when-in-tls_data_re.patch + patches.suse/fq_codel-fix-TCA_FQ_CODEL_DROP_BATCH_SIZE-sanity-che.patch + patches.suse/sch_choke-avoid-potential-panic-in-choke_reset.patch + patches.suse/bnxt_en-Fix-VF-anti-spoof-filter-setup.patch patches.suse/bnxt_en-Reduce-BNXT_MSIX_VEC_MAX-value-to-supported-.patch + patches.suse/bnxt_en-Improve-AER-slot-reset.patch patches.suse/bnxt_en-Return-error-when-allocating-zero-size-conte.patch + patches.suse/bnxt_en-Fix-VLAN-acceleration-handling-in-bnxt_fix_f.patch + patches.suse/sch_sfq-validate-silly-quantum-values.patch patches.suse/batman-adv-fix-batadv_nc_random_weight_tq.patch patches.suse/batman-adv-Fix-refcnt-leak-in-batadv_show_throughput.patch patches.suse/batman-adv-Fix-refcnt-leak-in-batadv_store_throughpu.patch patches.suse/batman-adv-Fix-refcnt-leak-in-batadv_v_ogm_process.patch + patches.suse/net-mlx5-Fix-forced-completion-access-non-initialize.patch + patches.suse/net-mlx5-Fix-command-entry-leak-in-Internal-Error-St.patch patches.suse/ibmvnic-Skip-fatal-error-reset-after-passive-init.patch patches.suse/dp83640-reverse-arguments-to-list_add_tail.patch + patches.suse/net-macsec-preserve-ingress-frame-ordering.patch + patches.suse/tunnel-Propagate-ECT-1-when-decapsulating-as-recomme.patch + patches.suse/mlxsw-spectrum_acl_tcam-Position-vchunk-in-a-vregion.patch patches.suse/devlink-fix-return-value-after-hitting-end-in-region.patch patches.suse/net_sched-sch_skbprio-add-message-validation-to-skbp.patch + patches.suse/net-usb-qmi_wwan-add-support-for-DW5816e.patch + patches.suse/net-mlx4_core-Fix-use-of-ENOSPC-around-mlx4_counter_.patch patches.suse/nfp-abm-fix-a-memory-leak-bug.patch + patches.suse/net-stricter-validation-of-untrusted-gso-packets.patch patches.suse/tracing-add-a-vmalloc_sync_mappings-for-safe-measure.patch patches.suse/scripts-decodecode-fix-trapping-instruction-formatti.patch patches.suse/mm-limit-boost_watermark-on-small-zones.patch @@ -54328,9 +54415,15 @@ patches.suse/ALSA-hda-realtek-Enable-headset-mic-of-ASUS-UX581LV-.patch patches.suse/ALSA-hda-realtek-Add-COEF-workaround-for-ASUS-ZenBoo.patch patches.suse/ALSA-hda-realtek-Limit-int-mic-boost-for-Thinkpad-T5.patch + patches.suse/Revert-ipv6-add-mtu-lock-check-in-__ip6_rt_update_pm.patch + patches.suse/net-fix-a-potential-recursive-NETDEV_FEAT_CHANGE.patch patches.suse/bpf-Fix-sk_psock-refcnt-leak-when-receiving-message.patch + patches.suse/netprio_cgroup-Fix-unlimited-memory-leak-of-v2-cgrou.patch + patches.suse/net-dsa-loop-Add-module-soft-dependency.patch patches.suse/netlabel-cope-with-NULL-catmap.patch patches.suse/s390-ism-fix-error-return-code-in-ism_probe + patches.suse/net-phy-fix-aneg-restart-in-phy_ethtool_set_eee.patch + patches.suse/pppoe-only-process-PADT-targeted-at-local-interfaces.patch patches.suse/pinctrl-sunrisepoint-Fix-PAD-lock-register-offset-fo.patch patches.suse/pinctrl-baytrail-Enable-pin-configuration-setting-fo.patch patches.suse/pinctrl-cherryview-Add-missing-spinlock-usage-in-chv.patch @@ -54351,6 +54444,8 @@ patches.suse/iommu-amd-fix-over-read-of-acpi-uid-from-ivrs-table patches.suse/i2c-fix-missing-pm_runtime_put_sync-in-i2c_device_probe.patch patches.suse/i2c-mux-demux-pinctrl-Fix-an-error-handling-path-in-.patch + patches.suse/fix-multiplication-overflow-in-copy_fdtable.patch + patches.suse/ubifs-remove-broken-lazytime-support.patch patches.suse/dmaengine-tegra210-adma-Fix-an-error-handling-path-i.patch patches.suse/ALSA-pcm-fix-incorrect-hw_base-increase.patch patches.suse/ALSA-hda-realtek-Fix-silent-output-on-Gigabyte-X57-2.patch @@ -54363,6 +54458,19 @@ patches.suse/iio-adc-stm32-adc-fix-device-used-to-request-dma.patch patches.suse/iio-sca3000-Remove-an-erroneous-get_device.patch patches.suse/mei-release-me_cl-object-reference.patch + patches.suse/net-dsa-mt7530-fix-roaming-from-DSA-user-ports.patch + patches.suse/net-revert-net-get-rid-of-an-signed-integer-overflow.patch + patches.suse/net-sched-fix-reporting-the-first-time-use-timestamp.patch + patches.suse/r8152-support-additional-Microsoft-Surface-Ethernet-.patch + patches.suse/net-inet_csk-Fix-so_reuseport-bind-address-cache-in-.patch + patches.suse/sctp-Don-t-add-the-shutdown-timer-if-its-already-bee.patch + patches.suse/ax25-fix-setsockopt-SO_BINDTODEVICE.patch + patches.suse/net-qrtr-Fix-passing-invalid-reference-to-qrtr_local.patch + patches.suse/net-ipip-fix-wrong-address-family-in-init-error-path.patch + patches.suse/sctp-Start-shutdown-on-association-restart-if-in-SHU.patch + patches.suse/net-mlx4_core-fix-a-memory-leak-bug.patch + patches.suse/net-mlx5-Add-command-entry-handling-completion.patch + patches.suse/net-mlx5e-Update-netdev-txq-on-completions-during-cl.patch patches.suse/x86-unwind-orc-fix-unwind_get_return_address_ptr-for-inactive-tasks.patch patches.suse/Input-usbtouchscreen-add-support-for-BonXeon-TP.patch patches.suse/Input-evdev-call-input_flush_device-on-release-not-f.patch @@ -54381,6 +54489,8 @@ patches.suse/mmc-block-Fix-use-after-free-issue-for-rpmb.patch patches.suse/iommu-fix-reference-count-leak-in-iommu_group_alloc patches.suse/libceph-ignore-pool-overlay-and-cache-logic-on-redirects.patch + patches.suse/dpaa_eth-fix-usage-as-DSA-master-try-3.patch + patches.suse/qlcnic-fix-missing-release-in-qlcnic_83xx_interrupt_.patch patches.suse/mac80211-mesh-fix-discovery-timer-re-arming-issue-cr.patch patches.suse/crypto-chelsio-chtls-properly-set-tp-lsndtime.patch patches.suse/0022-xfrm-fix-error-in-comment.patch @@ -54395,6 +54505,7 @@ patches.suse/objtool-clean-instruction-state-before-each-function-validation.patch patches.suse/objtool-ignore-empty-alternatives.patch patches.suse/x86-cpu-amd-make-erratum-1054-a-legacy-erratum.patch + patches.suse/lpfc_debugfs-get-rid-of-pointless-access_ok.patch patches.suse/pcm_native-result-of-put_user-needs-to-be-checked.patch patches.suse/mmc-sdhci-msm-Set-SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12.patch patches.suse/mmc-sdio-Fix-potential-NULL-pointer-error-in-mmc_sdi.patch @@ -54408,10 +54519,13 @@ patches.suse/ACPI-GED-add-support-for-_Exx-_Lxx-handler-methods.patch patches.suse/ACPI-GED-use-correct-trigger-type-field-in-_Exx-_Lxx.patch patches.suse/agp-intel-Reinforce-the-barrier-after-GTT-updates.patch + patches.suse/0001-drm-qxl-Use-correct-notify-port-address-when-creatin.patch patches.suse/drm-dp_mst-Reformat-drm_dp_check_act_status-a-bit.patch + patches.suse/0002-drm-dp_mst-Increase-ACT-retry-timeout-to-3s.patch patches.suse/drm-bridge-adv7511-Extend-list-of-audio-sample-rates.patch patches.suse/0001-drm-amd-display-fix-Kconfig-help-text.patch patches.suse/video-fbdev-w100fb-Fix-a-potential-double-free.patch + patches.suse/0001-drm-vkms-Hold-gem-object-while-still-in-use.patch patches.suse/0001-md-use-memalloc-scope-APIs-in-mddev_suspend-mddev_re.patch patches.suse/0001-raid5-remove-gfp-flags-from-scribble_alloc.patch patches.suse/nvme-fc-print-proper-nvme-fc-devloss_tmo-value.patch @@ -54427,7 +54541,6 @@ patches.suse/ath9k-Fix-use-after-free-Read-in-ath9k_wmi_ctrl_rx.patch patches.suse/ath9k-Fix-use-after-free-Write-in-ath9k_htc_rx_msg.patch patches.suse/ath9x-Fix-stack-out-of-bounds-Write-in-ath9k_hif_usb.patch - patches.suse/ath9k-Fix-general-protection-fault-in-ath9k_hif_usb_.patch patches.suse/brcmfmac-fix-wrong-location-to-get-firmware-feature.patch patches.suse/p54usb-add-AirVasT-USB-stick-device-id.patch patches.suse/b43legacy-Fix-case-where-channel-status-is-corrupted.patch @@ -54446,6 +54559,7 @@ patches.suse/b43-Fix-connection-problem-with-WPA3.patch patches.suse/b43_legacy-Fix-connection-problem-with-WPA3.patch patches.suse/Bluetooth-Add-SCO-fallback-for-invalid-LMP-parameter.patch + patches.suse/vxlan-Avoid-infinite-loop-when-suppressing-NS-messag.patch patches.suse/net-vmxnet3-fix-possible-buffer-overflow-caused-by-b.patch patches.suse/ipv6-fix-IPV6_ADDRFORM-operation-logic.patch patches.suse/s390-bpf-maintain-8-byte-stack-alignment @@ -54453,6 +54567,7 @@ patches.suse/media-dvb-return-EREMOTEIO-on-i2c-transfer-failure.patch patches.suse/media-platform-fcp-Set-appropriate-DMA-parameters.patch patches.suse/media-si2157-Better-check-for-running-tuner-in-init.patch + patches.suse/ALSA-usb-audio-Improve-frames-size-computation.patch patches.suse/ALSA-usb-audio-Fix-racy-list-management-in-output-qu.patch patches.suse/ALSA-hda-realtek-Introduce-polarity-for-micmute-LED-.patch patches.suse/ALSA-hda-realtek-Enable-micmute-LED-on-and-HP-system.patch @@ -54470,7 +54585,9 @@ patches.suse/livepatch-remove-klp-arch.patch patches.suse/livepatch-prevent-module-specific-klp-rela-sections-from-referencing-vmlinux-symbols.patch patches.suse/livepatch-make-klp_apply_object_relocs-static.patch + patches.suse/fanotify-fix-ignore-mask-logic-for-events-on-child-a.patch patches.suse/relay-handle-alloc_percpu-returning-NULL-in-relay_open.patch + patches.suse/power-vexpress-add-suppress_bind_attrs-to-true.patch patches.suse/firmware-imx-scu-fix-corruption-of-header.patch patches.suse/firmware-imx-scu-Fix-possible-memory-leak-in-imx_scu.patch patches.suse/drivers-soc-ti-knav_qmss_queue-Make-knav_gp_range_op.patch @@ -54493,6 +54610,8 @@ patches.suse/scsi-lpfc-Update-lpfc-version-to-12.8.0.1.patch patches.suse/scsi-lpfc-Remove-redundant-initialization-to-variabl.patch patches.suse/scsi-lpfc-Fix-lpfc_nodelist-leak-when-processing-uns.patch + patches.suse/ext4-fix-race-between-ext4_sync_parent-and-rename.patch + patches.suse/jbd2-avoid-leaking-transaction-credits-when-unreserv.patch patches.suse/cifs-set-up-next-DFS-target-before-generic_ip_connect-.patch patches.suse/cifs-handle-hostnames-that-resolve-to-same-ip-in-failover.patch patches.suse/cifs-get-rid-of-unused-parameter-in-reconn_setup_dfs_targets-.patch @@ -54507,6 +54626,7 @@ patches.suse/usb-dwc2-gadget-move-gadget-resume-after-the-core-is.patch patches.suse/USB-gadget-udc-s3c2410_udc-Remove-pointless-NULL-che.patch patches.suse/usb-gadget-lpc32xx_udc-don-t-dereference-ep-pointer-.patch + patches.suse/usb-gadget-fix-potential-double-free-in-m66592_probe.patch patches.suse/usb-musb-start-session-in-resume-for-host-port.patch patches.suse/usb-musb-Fix-runtime-PM-imbalance-on-error.patch patches.suse/CDC-ACM-heed-quirk-also-in-error-handling.patch @@ -54549,17 +54669,26 @@ patches.suse/ALSA-usb-audio-Manage-auto-pm-of-all-bundled-interfa.patch patches.suse/ALSA-pcm-disallow-linking-stream-to-itself.patch patches.suse/mailbox-imx-disable-the-clock-on-devm_mbox_controller_register-failure.patch + patches.suse/nilfs2-fix-null-pointer-dereference-at-nilfs_segctor.patch patches.suse/x86-reboot-quirks-add-macbook6-1-reboot-quirk.patch patches.suse/x86-speculation-avoid-force-disabling-ibpb-based-on-stibp-and-enhanced-ibrs.patch patches.suse/x86-speculation-prevent-rogue-cross-process-ssbd-shutdown.patch patches.suse/x86-speculation-pr_spec_force_disable-enforcement-for-indirect-branches.patch + patches.suse/block-nr_sects_write-Disable-preemption-on-seqcount-.patch patches.suse/amdgpu-a-null-mm-does-not-mean-a-thread-is-a-kthread + patches.suse/kvm-x86-fix-apic-page-invalidation-race patches.suse/x86_mce_mm-Unmap_the_entire_page_if_the_whole_page_is_affected_and_poisoned.patch patches.suse/scsi-ibmvscsi-Don-t-send-host-info-in-adapter-info-M.patch patches.suse/ibmvnic-Flush-existing-work-items-before-device-remo.patch + patches.suse/ext4-fix-partial-cluster-initialization-when-splitti.patch + patches.suse/ext4-jbd2-ensure-panic-by-fix-a-race-between-jbd2-ab.patch patches.suse/ibmvnic-Harden-device-login-requests.patch + patches.suse/bnxt_en-Fix-AER-reset-logic-on-57500-chips.patch patches.suse/e1000e-Do-not-wake-up-the-system-via-WOL-if-device-w.patch patches.suse/libceph-don-t-omit-recovery_deletes-in-target_copy.patch + patches.suse/0001-drm-i915-icl-Fix-hotplug-interrupt-disabling-after-s.patch + patches.suse/0001-bcache-fix-potential-deadlock-problem-in-btree_gc_co.patch + patches.suse/loop-replace-kill_bdev-with-invalidate_bdev.patch patches.suse/s390-fix-syscall_get_error-for-compat-processes patches.suse/0004-drm-encoder_slave-fix-refcouting-error-for-modules.patch patches.suse/crypto-algif_skcipher-Cap-recv-SG-list-at-ctx-used.patch @@ -54570,8 +54699,83 @@ patches.suse/tg3-driver-sleeps-indefinitely-when-EEH-errors-excee.patch patches.suse/ibmveth-Fix-max-MTU-limit.patch patches.suse/ibmvnic-continue-to-init-in-CRQ-reset-returns-H_CLOS.patch + patches.suse/usbnet-smsc95xx-Fix-use-after-free-after-removal.patch + patches.suse/net-qede-stop-adding-events-on-an-already-destroyed-.patch + patches.suse/net-qed-fix-NVMe-login-fails-over-VFs.patch + patches.suse/net-qed-fix-excessive-QM-ILT-lines-consumption.patch + patches.suse/drm-tegra-hub-Do-not-enable-orphaned-window-group.patch + patches.suse/gpu-host1x-Detach-driver-on-unregister.patch + patches.suse/0001-drm-radeon-fix-fb_div-check-in-ni_init_smc_spll_tabl.patch + patches.suse/drm-panel-orientation-quirks-Add-quirk-for-Asus-T101.patch + patches.suse/drm-panel-orientation-quirks-Use-generic-orientation.patch + patches.suse/iommu-vt-d-enable-pci-acs-for-platform-opt-in-hint + patches.suse/ACPI-configfs-Disallow-loading-ACPI-tables-when-lock.patch + patches.suse/ACPI-sysfs-Fix-pm_profile_attr-type.patch patches.suse/edac-amd64-read-back-the-scrub-rate-pci-register-on-f15h.patch + patches.suse/usb-host-ehci-exynos-Fix-error-check-in-exynos_ehci_.patch + patches.suse/usb-add-USB_QUIRK_DELAY_INIT-for-Logitech-C922.patch + patches.suse/usb-usbtest-fix-missing-kfree-dev-buf-in-usbtest_dis.patch + patches.suse/USB-ehci-reopen-solution-for-Synopsys-HC-bug.patch + patches.suse/USB-ohci-sm501-Add-missed-iounmap-in-remove.patch + patches.suse/xhci-Fix-incorrect-EP_STATE_MASK.patch + patches.suse/usb-gadget-udc-Potential-Oops-in-error-handling-code.patch + patches.suse/vfio-pci-fix-sr-iov-vf-handling-with-mmio-blocking patches.suse/scsi-qla2xxx-Set-NVMe-status-code-for-failed-NVMe-FC.patch + patches.suse/scsi-lpfc-Avoid-another-null-dereference-in-lpfc_sli.patch + patches.suse/msft-hv-2106-Drivers-hv-Change-flag-to-write-log-level-in-panic-m.patch + patches.suse/tpm_tis-Remove-the-HID-IFX0102.patch + patches.suse/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch + patches.suse/hwmon-max6697-Make-sure-the-OVERT-mask-is-set-correc.patch + patches.suse/hwmon-acpi_power_meter-Fix-potential-memory-leak-in-.patch + patches.suse/i2c-algo-pca-Add-0x78-as-SCL-stuck-low-status-for-PC.patch + patches.suse/i2c-mlxcpld-check-correct-size-of-maximum-RECV_LEN-p.patch + patches.suse/scsi-qla2xxx-Fix-a-condition-in-qla2x00_find_all_fab.patch + patches.suse/Revert-commit-e918e570415c-tpm_tis-Remove-the-HID-IF.patch + patches.suse/ALSA-usb-audio-Fix-packet-size-calculation.patch + patches.suse/0001-drm-mediatek-Check-plane-visibility-in-atomic_update.patch + patches.suse/0001-drm-radeon-fix-double-free.patch + patches.suse/bnxt_en-fix-NULL-dereference-in-case-SR-IOV-configur.patch + patches.suse/mlxsw-spectrum_router-Remove-inappropriate-usage-of-.patch + patches.suse/Revert-thermal-mediatek-fix-register-index-error.patch + patches.suse/iio-health-afe4404-Fix-timestamp-alignment-and-preve.patch + patches.suse/iio-mma8452-Add-missed-iio_device_unregister-call-in.patch + patches.suse/iio-pressure-zpa2326-handle-pm_runtime_get_sync-fail.patch + patches.suse/iio-magnetometer-ak8974-Fix-alignment-and-data-leak-.patch + patches.suse/iio-humidity-hdc100x-Fix-alignment-and-data-leak-iss.patch + patches.suse/iio-pressure-ms5611-Fix-buffer-element-alignment.patch + patches.suse/staging-comedi-verify-array-index-is-correct-before-.patch + patches.suse/revert-zram-convert-remaining-class_attr-to-class_attr_ro + patches.suse/intel_th-Fix-a-NULL-dereference-when-hub-driver-is-n.patch + patches.suse/ALSA-hda-realtek-Enable-Speaker-for-ASUS-UX533-and-U.patch + patches.suse/regmap-debugfs-Don-t-sleep-while-atomic-for-fast_io-.patch + patches.suse/spi-spi-sun6i-sun6i_spi_transfer_one-fix-setting-of-.patch + patches.suse/powerpc-book3s64-pkeys-Fix-pkey_access_permitted-for.patch + patches.suse/hwmon-emc2103-fix-unable-to-change-fan-pwm1_enable-a.patch + patches.suse/usb-chipidea-core-add-wakeup-support-for-extcon.patch + patches.suse/USB-c67x00-fix-use-after-free-in-c67x00_giveback_urb.patch + patches.suse/usb-dwc2-Fix-shutdown-callback-in-platform.patch + patches.suse/usb-gadget-udc-atmel-remove-outdated-comment-in-usba.patch + patches.suse/usb-gadget-udc-atmel-fix-uninitialized-read-in-debug.patch + patches.suse/USB-serial-iuu_phoenix-fix-memory-corruption.patch + + # jejb/scsi for-next + patches.suse/scsi-lpfc-Fix-unused-assignment-in-lpfc_sli4_bsg_lin.patch + patches.suse/scsi-lpfc-Fix-missing-MDS-functionality.patch + patches.suse/scsi-lpfc-Fix-NVMe-rport-deregister-and-registration.patch + patches.suse/scsi-lpfc-Fix-oops-due-to-overrun-when-reading-SLI3-.patch + patches.suse/scsi-lpfc-Fix-stack-trace-seen-while-setting-rrq-act.patch + patches.suse/scsi-lpfc-Fix-shost-refcount-mismatch-when-deleting-.patch + patches.suse/scsi-lpfc-Fix-kdump-hang-on-PPC.patch + patches.suse/scsi-lpfc-Fix-language-in-0373-message-to-reflect-no.patch + patches.suse/scsi-lpfc-Allow-applications-to-issue-Common-Set-Fea.patch + patches.suse/scsi-lpfc-Add-support-to-display-if-adapter-dumps-ar.patch + patches.suse/scsi-lpfc-Add-blk_io_poll-support-for-latency-improv.patch + patches.suse/scsi-lpfc-Add-an-internal-trace-log-buffer.patch + patches.suse/scsi-lpfc-Update-lpfc-version-to-12.8.0.2.patch + + # powerpc/linux next + patches.suse/powerpc-xmon-Reset-RCU-and-soft-lockup-watchdogs.patch + patches.suse/powerpc-fadump-fix-race-between-pstore-write-and-fad.patch # dhowells/linux-fs keys-uefi patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch @@ -54580,6 +54784,14 @@ patches.suse/0005-MODSIGN-Allow-the-db-UEFI-variable-to-be-suppressed.patch patches.suse/0006-modsign-Use-secondary-trust-keyring-for-module-signi.patch + # kvalo/wireless-drivers-next + patches.suse/brcmfmac-Transform-compatible-string-for-FW-loading.patch + + # mkp/scsi queue + patches.suse/scsi-lpfc-Fix-inconsistent-indenting.patch + patches.suse/scsi-lpfc-Fix-interrupt-assignments-when-multiple-ve.patch + patches.suse/scsi-lpfc-Fix-less-than-zero-comparison-of-unsigned-.patch + # out-of-tree patches patches.suse/net-mvpp2-fix-condition-for-setting-up-link-interrup.patch patches.suse/cifs-handle-netapp-error-codes.patch @@ -54934,6 +55146,7 @@ patches.suse/btrfs-8888-add-allow_unsupported-module-parameter.patch patches.suse/btrfs-qgroup-Mark-qgroup-inconsistent-if-we-re-inher.patch + patches.suse/btrfs-qgroup-Fix-a-bug-that-prevents-qgroup-to-be-re.patch patches.suse/btrfs-provide-super_operations-get_inode_dev patches.suse/btrfs-fs-super.c-add-new-super-block-devices-super_block_d.patch patches.suse/btrfs-btrfs-use-the-new-VFS-super_block_dev.patch @@ -55387,6 +55600,10 @@ patches.kabi/libnvdimm-cover-up-changes-in-struct-nvdimm_bus.patch patches.kabi/libnvdimm-cover-up-nd_pfn_sb-change.patch + patches.kabi/jbd2-abort-mutex-kabi.patch + patches.kabi/net-mlx5-Add-command-entry-handling-completion.patch + + patches.kabi/padata-reorder-work-kABI-fixup.patch ######################################################## # You'd better have a good reason for adding a patch