From ddc9ed4c0081eee7e1ff709e2c08e9896708a63e Mon Sep 17 00:00:00 2001 From: Ivan T. Ivanov Date: May 03 2023 12:43:13 +0000 Subject: Merge branch 'users/oneukum/SLE12-SP5/for-next' into SLE12-SP5 --- diff --git a/patches.kabi/struct-ci_hdrc-hide-new-member-at-end.patch b/patches.kabi/struct-ci_hdrc-hide-new-member-at-end.patch new file mode 100644 index 0000000..8c9d9fc --- /dev/null +++ b/patches.kabi/struct-ci_hdrc-hide-new-member-at-end.patch @@ -0,0 +1,31 @@ +From e0b347f1acbe9b1dc8f25298c84496b49960263e Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Tue, 2 May 2023 15:26:57 +0200 +Subject: [PATCH] struct ci_hdrc: hide new member at end +References: git-fixes +Patch-mainline: Never, kABI fixup + +We can just hide the new member at the end + +Signed-off-by: Oliver Neukum +--- + drivers/usb/chipidea/ci.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h +index 1c2393644..e140e3b6a 100644 +--- a/drivers/usb/chipidea/ci.h ++++ b/drivers/usb/chipidea/ci.h +@@ -260,7 +260,9 @@ struct ci_hdrc { + bool in_lpm; + bool wakeup_int; + enum ci_revision rev; ++#ifndef __GENKSYMS__ + struct mutex mutex; ++#endif + }; + + static inline struct ci_role_driver *ci_role(struct ci_hdrc *ci) +-- +2.40.1 + diff --git a/patches.kabi/xhci-hide-include-of-iommu.h.patch b/patches.kabi/xhci-hide-include-of-iommu.h.patch new file mode 100644 index 0000000..93e7486 --- /dev/null +++ b/patches.kabi/xhci-hide-include-of-iommu.h.patch @@ -0,0 +1,31 @@ +From 9b84925f68d29844116d29ad421acb03176b15da Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Tue, 2 May 2023 18:10:54 +0200 +Subject: [PATCH] xhci: hide include of iommu.h +References: git-fixes +Patch-mainline: Never, kABI fixup + +The include confuses the kABI checker by making symbols defined + +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xhci.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c +index de4d25557..226883fd9 100644 +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -21,7 +21,9 @@ + */ + + #include ++#ifndef __GENKSYMS__ + #include ++#endif + #include + #include + #include +-- +2.40.1 + diff --git a/patches.suse/usb-chipidea-core-fix-possible-concurrent-when-switc.patch b/patches.suse/usb-chipidea-core-fix-possible-concurrent-when-switc.patch new file mode 100644 index 0000000..93ea4ec --- /dev/null +++ b/patches.suse/usb-chipidea-core-fix-possible-concurrent-when-switc.patch @@ -0,0 +1,93 @@ +From 451b15ed138ec15bffbebb58a00ebdd884c3e659 Mon Sep 17 00:00:00 2001 +From: Xu Yang +Date: Fri, 17 Mar 2023 14:15:16 +0800 +Subject: [PATCH] usb: chipidea: core: fix possible concurrent when switch role +Git-commit: 451b15ed138ec15bffbebb58a00ebdd884c3e659 +References: git-fixes +Patch-mainline: v6.3-rc4 + +The user may call role_store() when driver is handling +ci_handle_id_switch() which is triggerred by otg event or power lost +event. Unfortunately, the controller may go into chaos in this case. +Fix this by protecting it with mutex lock. + +Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group") +cc: +Acked-by: Peter Chen +Signed-off-by: Xu Yang +Link: https://lore.kernel.org/r/20230317061516.2451728-2-xu.yang_2@nxp.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/chipidea/ci.h | 2 ++ + drivers/usb/chipidea/core.c | 4 ++++ + drivers/usb/chipidea/otg.c | 5 ++++- + 3 files changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/usb/chipidea/ci.h ++++ b/drivers/usb/chipidea/ci.h +@@ -205,6 +205,7 @@ struct hw_bank { + * @in_lpm: if the core in low power mode + * @wakeup_int: if wakeup interrupt occur + * @rev: The revision number for controller ++ * @mutex: protect code from concorrent running when doing role switch + */ + struct ci_hdrc { + struct device *dev; +@@ -259,6 +260,7 @@ struct ci_hdrc { + bool in_lpm; + bool wakeup_int; + enum ci_revision rev; ++ struct mutex mutex; + }; + + static inline struct ci_role_driver *ci_role(struct ci_hdrc *ci) +--- a/drivers/usb/chipidea/core.c ++++ b/drivers/usb/chipidea/core.c +@@ -878,6 +878,8 @@ static ssize_t ci_role_store(struct devi + if (role == CI_ROLE_END || role == ci->role) + return -EINVAL; + ++ mutex_lock(&ci->mutex); ++ + pm_runtime_get_sync(dev); + disable_irq(ci->irq); + ci_role_stop(ci); +@@ -886,6 +888,7 @@ static ssize_t ci_role_store(struct devi + ci_handle_vbus_change(ci); + enable_irq(ci->irq); + pm_runtime_put_sync(dev); ++ mutex_unlock(&ci->mutex); + + return (ret == 0) ? n : ret; + } +@@ -924,6 +927,7 @@ static int ci_hdrc_probe(struct platform + return -ENOMEM; + + spin_lock_init(&ci->lock); ++ mutex_init(&ci->mutex); + ci->dev = dev; + ci->platdata = dev_get_platdata(dev); + ci->imx28_write_fix = !!(ci->platdata->flags & +--- a/drivers/usb/chipidea/otg.c ++++ b/drivers/usb/chipidea/otg.c +@@ -167,8 +167,10 @@ static int hw_wait_vbus_lower_bsv(struct + + static void ci_handle_id_switch(struct ci_hdrc *ci) + { +- enum ci_role role = ci_otg_role(ci); ++ enum ci_role role; + ++ mutex_lock(&ci->mutex); ++ role = ci_otg_role(ci); + if (role != ci->role) { + dev_dbg(ci->dev, "switching from %s to %s\n", + ci_role(ci)->name, ci->roles[role]->name); +@@ -191,6 +193,7 @@ static void ci_handle_id_switch(struct c + if (role == CI_ROLE_GADGET) + ci_handle_vbus_change(ci); + } ++ mutex_unlock(&ci->mutex); + } + /** + * ci_otg_work - perform otg (vbus/id) event handle diff --git a/patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch b/patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch new file mode 100644 index 0000000..cc14fb7 --- /dev/null +++ b/patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch @@ -0,0 +1,57 @@ +From ecaa4902439298f6b0e29f47424a86b310a9ff4f Mon Sep 17 00:00:00 2001 +From: D Scott Phillips +Date: Thu, 30 Mar 2023 17:30:54 +0300 +Subject: [PATCH] xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a + passthrough iommu +Git-commit: ecaa4902439298f6b0e29f47424a86b310a9ff4f +References: git-fixes +Patch-mainline: v6.3-rc6 + +Previously the quirk was skipped when no iommu was present. The same +rationale for skipping the quirk also applies in the iommu.passthrough=1 +case. + +Skip applying the XHCI_ZERO_64B_REGS quirk if the device's iommu domain is +passthrough. + +Fixes: 12de0a35c996 ("xhci: Add quirk to zero 64bit registers on Renesas PCIe controllers") +Cc: stable +Signed-off-by: D Scott Phillips +Acked-by: Marc Zyngier +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20230330143056.1390020-2-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xhci.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -21,6 +21,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -237,6 +238,7 @@ int xhci_reset(struct xhci_hcd *xhci) + static void xhci_zero_64b_regs(struct xhci_hcd *xhci) + { + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; ++ struct iommu_domain *domain; + int err, i; + u64 val; + +@@ -254,7 +256,9 @@ static void xhci_zero_64b_regs(struct xh + * an iommu. Doing anything when there is no iommu is definitely + * unsafe... + */ +- if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !dev->iommu_group) ++ domain = iommu_get_domain_for_dev(dev); ++ if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !dev->iommu_group || ++ domain->type == IOMMU_DOMAIN_IDENTITY) + return; + + xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n"); diff --git a/series.conf b/series.conf index 682b5a8..e40e0c8 100644 --- a/series.conf +++ b/series.conf @@ -63251,11 +63251,13 @@ patches.suse/net-usb-lan78xx-Limit-packet-length-to-skb-len.patch patches.suse/Bluetooth-btsdio-fix-use-after-free-bug-in-btsdio_re.patch patches.suse/power-supply-da9150-Fix-use-after-free-bug-in-da9150.patch + patches.suse/usb-chipidea-core-fix-possible-concurrent-when-switc.patch patches.suse/s390-vfio-ap-fix-memory-leak-in-vfio_ap-device-drive.patch patches.suse/NFSv4-Fix-hangs-when-recovering-open-state-after-a-s.patch patches.suse/ring-buffer-Fix-race-while-reader-and-writer-are-on-the-same-page.patch patches.suse/ftrace-Mark-get_lock_parent_ip-__always_inline.patch patches.suse/scsi-qla2xxx-Fix-memory-leak-in-qla2x00_probe_one.patch + patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch patches.suse/cgroup-cpuset-Wake-up-cpuset_attach_wq-tasks-in-cpuset_cancel_attach.patch patches.suse/cifs-fix-negotiate-context-parsing.patch patches.suse/powerpc-papr_scm-Update-the-NUMA-distance-table-for-.patch @@ -64306,6 +64308,8 @@ patches.kabi/PCI-endpoint-Fix-for-concurrent-memory-allocation-in.patch patches.kabi/intel_pmc_ipc-restore-ability-to-call-functions-with.patch patches.kabi/struct-wmi_svc_avail_ev_arg-new-member-to-end.patch + patches.kabi/struct-ci_hdrc-hide-new-member-at-end.patch + patches.kabi/xhci-hide-include-of-iommu.h.patch ######################################################## # You'd better have a good reason for adding a patch