From 0260d6f82b1e4f66ca27d9251bc8d82219271fd1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 21 Jul 2023 09:00:51 +0200 Subject: [PATCH] 5.15-stable patches added patches: mfd-pm8008-fix-module-autoloading.patch misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch misc-pci_endpoint_test-re-init-completion-for-every-test.patch --- .../mfd-pm8008-fix-module-autoloading.patch | 33 ++++++++++++ ...free-irqs-before-removing-the-device.patch | 50 +++++++++++++++++++ ...st-re-init-completion-for-every-test.patch | 44 ++++++++++++++++ queue-5.15/series | 3 ++ 4 files changed, 130 insertions(+) create mode 100644 queue-5.15/mfd-pm8008-fix-module-autoloading.patch create mode 100644 queue-5.15/misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch create mode 100644 queue-5.15/misc-pci_endpoint_test-re-init-completion-for-every-test.patch diff --git a/queue-5.15/mfd-pm8008-fix-module-autoloading.patch b/queue-5.15/mfd-pm8008-fix-module-autoloading.patch new file mode 100644 index 00000000000..cb9a9a2e03d --- /dev/null +++ b/queue-5.15/mfd-pm8008-fix-module-autoloading.patch @@ -0,0 +1,33 @@ +From d420c9886f5369697047b880221789bf0054e438 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 26 May 2023 11:16:45 +0200 +Subject: mfd: pm8008: Fix module autoloading + +From: Johan Hovold + +commit d420c9886f5369697047b880221789bf0054e438 upstream. + +Add the missing module device table alias to that the driver can be +autoloaded when built as a module. + +Cc: stable@vger.kernel.org # 5.14 +Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC") +Signed-off-by: Johan Hovold +Reviewed-by: Konrad Dybcio +Signed-off-by: Lee Jones +Link: https://lore.kernel.org/r/20230526091646.17318-2-johan+linaro@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mfd/qcom-pm8008.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mfd/qcom-pm8008.c ++++ b/drivers/mfd/qcom-pm8008.c +@@ -233,6 +233,7 @@ static const struct of_device_id pm8008_ + { .compatible = "qcom,pm8008", }, + { }, + }; ++MODULE_DEVICE_TABLE(of, pm8008_match); + + static struct i2c_driver pm8008_mfd_driver = { + .driver = { diff --git a/queue-5.15/misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch b/queue-5.15/misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch new file mode 100644 index 00000000000..46bebc831d7 --- /dev/null +++ b/queue-5.15/misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch @@ -0,0 +1,50 @@ +From f61b7634a3249d12b9daa36ffbdb9965b6f24c6c Mon Sep 17 00:00:00 2001 +From: Damien Le Moal +Date: Sat, 15 Apr 2023 11:35:39 +0900 +Subject: misc: pci_endpoint_test: Free IRQs before removing the device + +From: Damien Le Moal + +commit f61b7634a3249d12b9daa36ffbdb9965b6f24c6c upstream. + +In pci_endpoint_test_remove(), freeing the IRQs after removing the device +creates a small race window for IRQs to be received with the test device +memory already released, causing the IRQ handler to access invalid memory, +resulting in an oops. + +Free the device IRQs before removing the device to avoid this issue. + +Link: https://lore.kernel.org/r/20230415023542.77601-15-dlemoal@kernel.org +Fixes: e03327122e2c ("pci_endpoint_test: Add 2 ioctl commands") +Signed-off-by: Damien Le Moal +Signed-off-by: Lorenzo Pieralisi +Signed-off-by: Bjorn Helgaas +Reviewed-by: Manivannan Sadhasivam +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/pci_endpoint_test.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/misc/pci_endpoint_test.c ++++ b/drivers/misc/pci_endpoint_test.c +@@ -937,6 +937,9 @@ static void pci_endpoint_test_remove(str + if (id < 0) + return; + ++ pci_endpoint_test_release_irq(test); ++ pci_endpoint_test_free_irq_vectors(test); ++ + misc_deregister(&test->miscdev); + kfree(misc_device->name); + kfree(test->name); +@@ -946,9 +949,6 @@ static void pci_endpoint_test_remove(str + pci_iounmap(pdev, test->bar[bar]); + } + +- pci_endpoint_test_release_irq(test); +- pci_endpoint_test_free_irq_vectors(test); +- + pci_release_regions(pdev); + pci_disable_device(pdev); + } diff --git a/queue-5.15/misc-pci_endpoint_test-re-init-completion-for-every-test.patch b/queue-5.15/misc-pci_endpoint_test-re-init-completion-for-every-test.patch new file mode 100644 index 00000000000..59138f07ab3 --- /dev/null +++ b/queue-5.15/misc-pci_endpoint_test-re-init-completion-for-every-test.patch @@ -0,0 +1,44 @@ +From fb620ae73b70c2f57b9d3e911fc24c024ba2324f Mon Sep 17 00:00:00 2001 +From: Damien Le Moal +Date: Sat, 15 Apr 2023 11:35:40 +0900 +Subject: misc: pci_endpoint_test: Re-init completion for every test + +From: Damien Le Moal + +commit fb620ae73b70c2f57b9d3e911fc24c024ba2324f upstream. + +The irq_raised completion used to detect the end of a test case is +initialized when the test device is probed, but never reinitialized again +before a test case. As a result, the irq_raised completion synchronization +is effective only for the first ioctl test case executed. Any subsequent +call to wait_for_completion() by another ioctl() call will immediately +return, potentially too early, leading to false positive failures. + +Fix this by reinitializing the irq_raised completion before starting a new +ioctl() test command. + +Link: https://lore.kernel.org/r/20230415023542.77601-16-dlemoal@kernel.org +Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device") +Signed-off-by: Damien Le Moal +Signed-off-by: Lorenzo Pieralisi +Signed-off-by: Bjorn Helgaas +Reviewed-by: Manivannan Sadhasivam +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/pci_endpoint_test.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/misc/pci_endpoint_test.c ++++ b/drivers/misc/pci_endpoint_test.c +@@ -728,6 +728,10 @@ static long pci_endpoint_test_ioctl(stru + struct pci_dev *pdev = test->pdev; + + mutex_lock(&test->mutex); ++ ++ reinit_completion(&test->irq_raised); ++ test->last_irq = -ENODATA; ++ + switch (cmd) { + case PCITEST_BAR: + bar = arg; diff --git a/queue-5.15/series b/queue-5.15/series index 83359a08f0e..4a947046505 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -478,3 +478,6 @@ pci-rockchip-add-poll-and-timeout-to-wait-for-phy-plls-to-be-locked.patch pci-rockchip-fix-legacy-irq-generation-for-rk3399-pcie-endpoint-core.patch pci-rockchip-use-u32-variable-to-access-32-bit-registers.patch pci-rockchip-set-address-alignment-for-endpoint-mode.patch +misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch +misc-pci_endpoint_test-re-init-completion-for-every-test.patch +mfd-pm8008-fix-module-autoloading.patch -- 2.47.3