]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Dec 2024 06:59:14 +0000 (07:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Dec 2024 06:59:14 +0000 (07:59 +0100)
added patches:
scsi-ufs-qcom-only-free-platform-msis-when-esi-is-enabled.patch

queue-6.6/genirq-irqdomain-add-domain_bus_device_msi.patch [deleted file]
queue-6.6/irqchip-convert-all-platform-msi-users-to-the-new-ap.patch [deleted file]
queue-6.6/platform-msi-prepare-for-real-per-device-domains.patch [deleted file]
queue-6.6/scsi-ufs-convert-all-platform-drivers-to-return-void.patch [deleted file]
queue-6.6/scsi-ufs-pltfrm-dellocate-hba-during-ufshcd_pltfrm_r.patch [deleted file]
queue-6.6/scsi-ufs-pltfrm-disable-runtime-pm-during-removal-of.patch [deleted file]
queue-6.6/scsi-ufs-pltfrm-drop-pm-runtime-reference-count-afte.patch [deleted file]
queue-6.6/scsi-ufs-qcom-only-free-platform-msis-when-esi-is-enabled.patch [moved from queue-6.6/scsi-ufs-qcom-only-free-platform-msis-when-esi-is-en.patch with 64% similarity]
queue-6.6/series

diff --git a/queue-6.6/genirq-irqdomain-add-domain_bus_device_msi.patch b/queue-6.6/genirq-irqdomain-add-domain_bus_device_msi.patch
deleted file mode 100644 (file)
index 9b0e683..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From d143460613d4f5c352e9fd397f083421e249ffe6 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sat, 27 Jan 2024 21:47:32 +0530
-Subject: genirq/irqdomain: Add DOMAIN_BUS_DEVICE_MSI
-
-From: Thomas Gleixner <tglx@linutronix.de>
-
-[ Upstream commit 6516d5a295356f8fd5827a1c0954d7ed5b2324dd ]
-
-Add a new domain bus token to prepare for device MSI which aims to replace
-the existing platform MSI maze.
-
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Signed-off-by: Anup Patel <apatel@ventanamicro.com>
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Link: https://lore.kernel.org/r/20240127161753.114685-5-apatel@ventanamicro.com
-Stable-dep-of: 64506b3d23a3 ("scsi: ufs: qcom: Only free platform MSIs when ESI is enabled")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/linux/irqdomain_defs.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/include/linux/irqdomain_defs.h b/include/linux/irqdomain_defs.h
-index c29921fd8cd15..a7dea0c8c5e0c 100644
---- a/include/linux/irqdomain_defs.h
-+++ b/include/linux/irqdomain_defs.h
-@@ -26,6 +26,7 @@ enum irq_domain_bus_token {
-       DOMAIN_BUS_DMAR,
-       DOMAIN_BUS_AMDVI,
-       DOMAIN_BUS_PCI_DEVICE_IMS,
-+      DOMAIN_BUS_DEVICE_MSI,
- };
- #endif /* _LINUX_IRQDOMAIN_DEFS_H */
--- 
-2.43.0
-
diff --git a/queue-6.6/irqchip-convert-all-platform-msi-users-to-the-new-ap.patch b/queue-6.6/irqchip-convert-all-platform-msi-users-to-the-new-ap.patch
deleted file mode 100644 (file)
index f742f9c..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-From 5df23ec861a0208ef524a27e44c694ca2decb7ea Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sat, 27 Jan 2024 21:47:34 +0530
-Subject: irqchip: Convert all platform MSI users to the new API
-
-From: Thomas Gleixner <tglx@linutronix.de>
-
-[ Upstream commit 14fd06c776b5289a43c91cdc64bac3bdbc7b397e ]
-
-Switch all the users of the platform MSI domain over to invoke the new
-interfaces which branch to the original platform MSI functions when the
-irqdomain associated to the caller device does not yet provide MSI parent
-functionality.
-
-No functional change.
-
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Signed-off-by: Anup Patel <apatel@ventanamicro.com>
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Link: https://lore.kernel.org/r/20240127161753.114685-7-apatel@ventanamicro.com
-Stable-dep-of: 64506b3d23a3 ("scsi: ufs: qcom: Only free platform MSIs when ESI is enabled")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/dma/mv_xor_v2.c                     | 8 ++++----
- drivers/dma/qcom/hidma.c                    | 6 +++---
- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +++--
- drivers/mailbox/bcm-flexrm-mailbox.c        | 8 ++++----
- drivers/perf/arm_smmuv3_pmu.c               | 4 ++--
- drivers/ufs/host/ufs-qcom.c                 | 8 ++++----
- 6 files changed, 20 insertions(+), 19 deletions(-)
-
-diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
-index 0e1e9ca1c005a..cd2b9a6ab621d 100644
---- a/drivers/dma/mv_xor_v2.c
-+++ b/drivers/dma/mv_xor_v2.c
-@@ -747,8 +747,8 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
-       if (IS_ERR(xor_dev->clk))
-               return PTR_ERR(xor_dev->clk);
--      ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1,
--                                           mv_xor_v2_set_msi_msg);
-+      ret = platform_device_msi_init_and_alloc_irqs(&pdev->dev, 1,
-+                                                    mv_xor_v2_set_msi_msg);
-       if (ret)
-               return ret;
-@@ -851,7 +851,7 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
-                         xor_dev->desc_size * MV_XOR_V2_DESC_NUM,
-                         xor_dev->hw_desq_virt, xor_dev->hw_desq);
- free_msi_irqs:
--      platform_msi_domain_free_irqs(&pdev->dev);
-+      platform_device_msi_free_irqs_all(&pdev->dev);
-       return ret;
- }
-@@ -867,7 +867,7 @@ static int mv_xor_v2_remove(struct platform_device *pdev)
-       devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev);
--      platform_msi_domain_free_irqs(&pdev->dev);
-+      platform_device_msi_free_irqs_all(&pdev->dev);
-       tasklet_kill(&xor_dev->irq_tasklet);
-diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
-index 834ae519c15de..f2b299c23b1e8 100644
---- a/drivers/dma/qcom/hidma.c
-+++ b/drivers/dma/qcom/hidma.c
-@@ -696,7 +696,7 @@ static void hidma_free_msis(struct hidma_dev *dmadev)
-                       devm_free_irq(dev, virq, &dmadev->lldev);
-       }
--      platform_msi_domain_free_irqs(dev);
-+      platform_device_msi_free_irqs_all(dev);
- #endif
- }
-@@ -706,8 +706,8 @@ static int hidma_request_msi(struct hidma_dev *dmadev,
- #ifdef CONFIG_GENERIC_MSI_IRQ
-       int rc, i, virq;
--      rc = platform_msi_domain_alloc_irqs(&pdev->dev, HIDMA_MSI_INTS,
--                                          hidma_write_msi_msg);
-+      rc = platform_device_msi_init_and_alloc_irqs(&pdev->dev, HIDMA_MSI_INTS,
-+                                                   hidma_write_msi_msg);
-       if (rc)
-               return rc;
-diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
-index 68b81f9c2f4b1..435eee52e033a 100644
---- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
-+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
-@@ -3141,7 +3141,8 @@ static int arm_smmu_update_gbpa(struct arm_smmu_device *smmu, u32 set, u32 clr)
- static void arm_smmu_free_msis(void *data)
- {
-       struct device *dev = data;
--      platform_msi_domain_free_irqs(dev);
-+
-+      platform_device_msi_free_irqs_all(dev);
- }
- static void arm_smmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
-@@ -3182,7 +3183,7 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
-       }
-       /* Allocate MSIs for evtq, gerror and priq. Ignore cmdq */
--      ret = platform_msi_domain_alloc_irqs(dev, nvec, arm_smmu_write_msi_msg);
-+      ret = platform_device_msi_init_and_alloc_irqs(dev, nvec, arm_smmu_write_msi_msg);
-       if (ret) {
-               dev_warn(dev, "failed to allocate MSIs - falling back to wired irqs\n");
-               return;
-diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
-index a2b8839d4e7c5..7094d44869a8e 100644
---- a/drivers/mailbox/bcm-flexrm-mailbox.c
-+++ b/drivers/mailbox/bcm-flexrm-mailbox.c
-@@ -1587,8 +1587,8 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
-       }
-       /* Allocate platform MSIs for each ring */
--      ret = platform_msi_domain_alloc_irqs(dev, mbox->num_rings,
--                                              flexrm_mbox_msi_write);
-+      ret = platform_device_msi_init_and_alloc_irqs(dev, mbox->num_rings,
-+                                                    flexrm_mbox_msi_write);
-       if (ret)
-               goto fail_destroy_cmpl_pool;
-@@ -1641,7 +1641,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
- fail_free_debugfs_root:
-       debugfs_remove_recursive(mbox->root);
--      platform_msi_domain_free_irqs(dev);
-+      platform_device_msi_free_irqs_all(dev);
- fail_destroy_cmpl_pool:
-       dma_pool_destroy(mbox->cmpl_pool);
- fail_destroy_bd_pool:
-@@ -1657,7 +1657,7 @@ static int flexrm_mbox_remove(struct platform_device *pdev)
-       debugfs_remove_recursive(mbox->root);
--      platform_msi_domain_free_irqs(dev);
-+      platform_device_msi_free_irqs_all(dev);
-       dma_pool_destroy(mbox->cmpl_pool);
-       dma_pool_destroy(mbox->bd_pool);
-diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
-index 31e491e7f2065..2946422539fb7 100644
---- a/drivers/perf/arm_smmuv3_pmu.c
-+++ b/drivers/perf/arm_smmuv3_pmu.c
-@@ -719,7 +719,7 @@ static void smmu_pmu_free_msis(void *data)
- {
-       struct device *dev = data;
--      platform_msi_domain_free_irqs(dev);
-+      platform_device_msi_free_irqs_all(dev);
- }
- static void smmu_pmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
-@@ -749,7 +749,7 @@ static void smmu_pmu_setup_msi(struct smmu_pmu *pmu)
-       if (!(readl(pmu->reg_base + SMMU_PMCG_CFGR) & SMMU_PMCG_CFGR_MSI))
-               return;
--      ret = platform_msi_domain_alloc_irqs(dev, 1, smmu_pmu_write_msi_msg);
-+      ret = platform_device_msi_init_and_alloc_irqs(dev, 1, smmu_pmu_write_msi_msg);
-       if (ret) {
-               dev_warn(dev, "failed to allocate MSIs\n");
-               return;
-diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
-index 0a914fd44494d..d77cfb2ab1acd 100644
---- a/drivers/ufs/host/ufs-qcom.c
-+++ b/drivers/ufs/host/ufs-qcom.c
-@@ -1816,8 +1816,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
-        * 2. Poll queues do not need ESI.
-        */
-       nr_irqs = hba->nr_hw_queues - hba->nr_queues[HCTX_TYPE_POLL];
--      ret = platform_msi_domain_alloc_irqs(hba->dev, nr_irqs,
--                                           ufs_qcom_write_msi_msg);
-+      ret = platform_device_msi_init_and_alloc_irqs(hba->dev, nr_irqs,
-+                                                    ufs_qcom_write_msi_msg);
-       if (ret) {
-               dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
-               goto out;
-@@ -1846,7 +1846,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
-                       devm_free_irq(hba->dev, desc->irq, hba);
-               }
-               msi_unlock_descs(hba->dev);
--              platform_msi_domain_free_irqs(hba->dev);
-+              platform_device_msi_free_irqs_all(hba->dev);
-       } else {
-               if (host->hw_ver.major == 6 && host->hw_ver.minor == 0 &&
-                   host->hw_ver.step == 0) {
-@@ -1926,7 +1926,7 @@ static void ufs_qcom_remove(struct platform_device *pdev)
-       pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_remove(hba);
--      platform_msi_domain_free_irqs(hba->dev);
-+      platform_device_msi_free_irqs_all(hba->dev);
- }
- static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
--- 
-2.43.0
-
diff --git a/queue-6.6/platform-msi-prepare-for-real-per-device-domains.patch b/queue-6.6/platform-msi-prepare-for-real-per-device-domains.patch
deleted file mode 100644 (file)
index 31d84c4..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-From 1c3c977271d7d952c04732d5b0175a8b3d5039a7 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sat, 27 Jan 2024 21:47:33 +0530
-Subject: platform-msi: Prepare for real per device domains
-
-From: Thomas Gleixner <tglx@linutronix.de>
-
-[ Upstream commit c88f9110bfbca5975a8dee4c9792ba12684c7bca ]
-
-Provide functions to create and remove per device MSI domains which replace
-the platform-MSI domains. The new model is that each of the devices which
-utilize platform-MSI gets now its private MSI domain which is "customized"
-in size and with a device specific function to write the MSI message into
-the device.
-
-This is the same functionality as platform-MSI but it avoids all the down
-sides of platform MSI, i.e. the extra ID book keeping, the special data
-structure in the msi descriptor. Further the domains are only created when
-the devices are really in use, so the burden is on the usage and not on the
-infrastructure.
-
-Fill in the domain template and provide two functions to init/allocate and
-remove a per device MSI domain.
-
-Until all users and parent domain providers are converted, the init/alloc
-function invokes the original platform-MSI code when the irqdomain which is
-associated to the device does not provide MSI parent functionality yet.
-
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Signed-off-by: Anup Patel <apatel@ventanamicro.com>
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Link: https://lore.kernel.org/r/20240127161753.114685-6-apatel@ventanamicro.com
-Stable-dep-of: 64506b3d23a3 ("scsi: ufs: qcom: Only free platform MSIs when ESI is enabled")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/base/platform-msi.c | 103 ++++++++++++++++++++++++++++++++++++
- include/linux/msi.h         |   4 ++
- 2 files changed, 107 insertions(+)
-
-diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
-index f37ad34c80ec4..b56e919acabb9 100644
---- a/drivers/base/platform-msi.c
-+++ b/drivers/base/platform-msi.c
-@@ -13,6 +13,8 @@
- #include <linux/msi.h>
- #include <linux/slab.h>
-+/* Begin of removal area. Once everything is converted over. Cleanup the includes too! */
-+
- #define DEV_ID_SHIFT  21
- #define MAX_DEV_MSIS  (1 << (32 - DEV_ID_SHIFT))
-@@ -350,3 +352,104 @@ int platform_msi_device_domain_alloc(struct irq_domain *domain, unsigned int vir
-       return msi_domain_populate_irqs(domain->parent, dev, virq, nr_irqs, &data->arg);
- }
-+
-+/* End of removal area */
-+
-+/* Real per device domain interfaces */
-+
-+/*
-+ * This indirection can go when platform_device_msi_init_and_alloc_irqs()
-+ * is switched to a proper irq_chip::irq_write_msi_msg() callback. Keep it
-+ * simple for now.
-+ */
-+static void platform_msi_write_msi_msg(struct irq_data *d, struct msi_msg *msg)
-+{
-+      irq_write_msi_msg_t cb = d->chip_data;
-+
-+      cb(irq_data_get_msi_desc(d), msg);
-+}
-+
-+static void platform_msi_set_desc_byindex(msi_alloc_info_t *arg, struct msi_desc *desc)
-+{
-+      arg->desc = desc;
-+      arg->hwirq = desc->msi_index;
-+}
-+
-+static const struct msi_domain_template platform_msi_template = {
-+      .chip = {
-+              .name                   = "pMSI",
-+              .irq_mask               = irq_chip_mask_parent,
-+              .irq_unmask             = irq_chip_unmask_parent,
-+              .irq_write_msi_msg      = platform_msi_write_msi_msg,
-+              /* The rest is filled in by the platform MSI parent */
-+      },
-+
-+      .ops = {
-+              .set_desc               = platform_msi_set_desc_byindex,
-+      },
-+
-+      .info = {
-+              .bus_token              = DOMAIN_BUS_DEVICE_MSI,
-+      },
-+};
-+
-+/**
-+ * platform_device_msi_init_and_alloc_irqs - Initialize platform device MSI
-+ *                                         and allocate interrupts for @dev
-+ * @dev:              The device for which to allocate interrupts
-+ * @nvec:             The number of interrupts to allocate
-+ * @write_msi_msg:    Callback to write an interrupt message for @dev
-+ *
-+ * Returns:
-+ * Zero for success, or an error code in case of failure
-+ *
-+ * This creates a MSI domain on @dev which has @dev->msi.domain as
-+ * parent. The parent domain sets up the new domain. The domain has
-+ * a fixed size of @nvec. The domain is managed by devres and will
-+ * be removed when the device is removed.
-+ *
-+ * Note: For migration purposes this falls back to the original platform_msi code
-+ *     up to the point where all platforms have been converted to the MSI
-+ *     parent model.
-+ */
-+int platform_device_msi_init_and_alloc_irqs(struct device *dev, unsigned int nvec,
-+                                          irq_write_msi_msg_t write_msi_msg)
-+{
-+      struct irq_domain *domain = dev->msi.domain;
-+
-+      if (!domain || !write_msi_msg)
-+              return -EINVAL;
-+
-+      /* Migration support. Will go away once everything is converted */
-+      if (!irq_domain_is_msi_parent(domain))
-+              return platform_msi_domain_alloc_irqs(dev, nvec, write_msi_msg);
-+
-+      /*
-+       * @write_msi_msg is stored in the resulting msi_domain_info::data.
-+       * The underlying domain creation mechanism will assign that
-+       * callback to the resulting irq chip.
-+       */
-+      if (!msi_create_device_irq_domain(dev, MSI_DEFAULT_DOMAIN,
-+                                        &platform_msi_template,
-+                                        nvec, NULL, write_msi_msg))
-+              return -ENODEV;
-+
-+      return msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, nvec - 1);
-+}
-+EXPORT_SYMBOL_GPL(platform_device_msi_init_and_alloc_irqs);
-+
-+/**
-+ * platform_device_msi_free_irqs_all - Free all interrupts for @dev
-+ * @dev:      The device for which to free interrupts
-+ */
-+void platform_device_msi_free_irqs_all(struct device *dev)
-+{
-+      struct irq_domain *domain = dev->msi.domain;
-+
-+      msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN);
-+
-+      /* Migration support. Will go away once everything is converted */
-+      if (!irq_domain_is_msi_parent(domain))
-+              platform_msi_free_priv_data(dev);
-+}
-+EXPORT_SYMBOL_GPL(platform_device_msi_free_irqs_all);
-diff --git a/include/linux/msi.h b/include/linux/msi.h
-index ddace8c34dcf9..fc32c919e2edd 100644
---- a/include/linux/msi.h
-+++ b/include/linux/msi.h
-@@ -656,6 +656,10 @@ int platform_msi_device_domain_alloc(struct irq_domain *domain, unsigned int vir
- void platform_msi_device_domain_free(struct irq_domain *domain, unsigned int virq,
-                                    unsigned int nvec);
- void *platform_msi_get_host_data(struct irq_domain *domain);
-+/* Per device platform MSI */
-+int platform_device_msi_init_and_alloc_irqs(struct device *dev, unsigned int nvec,
-+                                          irq_write_msi_msg_t write_msi_msg);
-+void platform_device_msi_free_irqs_all(struct device *dev);
- bool msi_device_has_isolated_msi(struct device *dev);
- #else /* CONFIG_GENERIC_MSI_IRQ */
--- 
-2.43.0
-
diff --git a/queue-6.6/scsi-ufs-convert-all-platform-drivers-to-return-void.patch b/queue-6.6/scsi-ufs-convert-all-platform-drivers-to-return-void.patch
deleted file mode 100644 (file)
index df41763..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-From 53940a5722e6b2e1963ad33d83f92b8251830b0f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sun, 17 Sep 2023 16:57:22 +0200
-Subject: scsi: ufs: Convert all platform drivers to return void
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-
-[ Upstream commit 0842b7617e3491f489aff6f84712c388e32c1877 ]
-
-The .remove() callback for a platform driver returns an int which makes
-many driver authors wrongly assume it's possible to do error handling by
-returning an error code. However the value returned is ignored (apart from
-emitting a warning) and this typically results in resource leaks.  To
-improve here there is a quest to make the remove callback return void. In
-the first step of this quest all drivers are converted to .remove_new()
-which already returns void. Eventually after all drivers are converted,
-.remove_new() is renamed to .remove().
-
-All platform drivers below drivers/ufs/ unconditionally return zero in
-their remove callback and so can be converted trivially to the variant
-returning void.
-
-Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-Link: https://lore.kernel.org/r/20230917145722.1131557-1-u.kleine-koenig@pengutronix.de
-Reviewed-by: Bean Huo <beanhuo@micron.com>
-Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-Stable-dep-of: 64506b3d23a3 ("scsi: ufs: qcom: Only free platform MSIs when ESI is enabled")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/ufs/host/cdns-pltfrm.c        | 5 ++---
- drivers/ufs/host/tc-dwc-g210-pltfrm.c | 6 ++----
- drivers/ufs/host/ti-j721e-ufs.c       | 6 ++----
- drivers/ufs/host/ufs-exynos.c         | 6 ++----
- drivers/ufs/host/ufs-hisi.c           | 5 ++---
- drivers/ufs/host/ufs-mediatek.c       | 5 ++---
- drivers/ufs/host/ufs-qcom.c           | 5 ++---
- drivers/ufs/host/ufs-renesas.c        | 6 ++----
- drivers/ufs/host/ufs-sprd.c           | 5 ++---
- 9 files changed, 18 insertions(+), 31 deletions(-)
-
-diff --git a/drivers/ufs/host/cdns-pltfrm.c b/drivers/ufs/host/cdns-pltfrm.c
-index 56014ef302b49..66811d8d1929c 100644
---- a/drivers/ufs/host/cdns-pltfrm.c
-+++ b/drivers/ufs/host/cdns-pltfrm.c
-@@ -305,12 +305,11 @@ static int cdns_ufs_pltfrm_probe(struct platform_device *pdev)
-  *
-  * Return: 0 (success).
-  */
--static int cdns_ufs_pltfrm_remove(struct platform_device *pdev)
-+static void cdns_ufs_pltfrm_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       ufshcd_remove(hba);
--      return 0;
- }
- static const struct dev_pm_ops cdns_ufs_dev_pm_ops = {
-@@ -322,7 +321,7 @@ static const struct dev_pm_ops cdns_ufs_dev_pm_ops = {
- static struct platform_driver cdns_ufs_pltfrm_driver = {
-       .probe  = cdns_ufs_pltfrm_probe,
--      .remove = cdns_ufs_pltfrm_remove,
-+      .remove_new = cdns_ufs_pltfrm_remove,
-       .driver = {
-               .name   = "cdns-ufshcd",
-               .pm     = &cdns_ufs_dev_pm_ops,
-diff --git a/drivers/ufs/host/tc-dwc-g210-pltfrm.c b/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-index 4d5389dd95857..a3877592604d5 100644
---- a/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-+++ b/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-@@ -74,14 +74,12 @@ static int tc_dwc_g210_pltfm_probe(struct platform_device *pdev)
-  * @pdev: pointer to platform device structure
-  *
-  */
--static int tc_dwc_g210_pltfm_remove(struct platform_device *pdev)
-+static void tc_dwc_g210_pltfm_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_remove(hba);
--
--      return 0;
- }
- static const struct dev_pm_ops tc_dwc_g210_pltfm_pm_ops = {
-@@ -91,7 +89,7 @@ static const struct dev_pm_ops tc_dwc_g210_pltfm_pm_ops = {
- static struct platform_driver tc_dwc_g210_pltfm_driver = {
-       .probe          = tc_dwc_g210_pltfm_probe,
--      .remove         = tc_dwc_g210_pltfm_remove,
-+      .remove_new     = tc_dwc_g210_pltfm_remove,
-       .driver         = {
-               .name   = "tc-dwc-g210-pltfm",
-               .pm     = &tc_dwc_g210_pltfm_pm_ops,
-diff --git a/drivers/ufs/host/ti-j721e-ufs.c b/drivers/ufs/host/ti-j721e-ufs.c
-index 117eb7da92acd..250c22df000d5 100644
---- a/drivers/ufs/host/ti-j721e-ufs.c
-+++ b/drivers/ufs/host/ti-j721e-ufs.c
-@@ -65,13 +65,11 @@ static int ti_j721e_ufs_probe(struct platform_device *pdev)
-       return ret;
- }
--static int ti_j721e_ufs_remove(struct platform_device *pdev)
-+static void ti_j721e_ufs_remove(struct platform_device *pdev)
- {
-       of_platform_depopulate(&pdev->dev);
-       pm_runtime_put_sync(&pdev->dev);
-       pm_runtime_disable(&pdev->dev);
--
--      return 0;
- }
- static const struct of_device_id ti_j721e_ufs_of_match[] = {
-@@ -85,7 +83,7 @@ MODULE_DEVICE_TABLE(of, ti_j721e_ufs_of_match);
- static struct platform_driver ti_j721e_ufs_driver = {
-       .probe  = ti_j721e_ufs_probe,
--      .remove = ti_j721e_ufs_remove,
-+      .remove_new = ti_j721e_ufs_remove,
-       .driver = {
-               .name   = "ti-j721e-ufs",
-               .of_match_table = ti_j721e_ufs_of_match,
-diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
-index 268189f01e15b..25bc11811b4c1 100644
---- a/drivers/ufs/host/ufs-exynos.c
-+++ b/drivers/ufs/host/ufs-exynos.c
-@@ -1605,7 +1605,7 @@ static int exynos_ufs_probe(struct platform_device *pdev)
-       return err;
- }
--static int exynos_ufs_remove(struct platform_device *pdev)
-+static void exynos_ufs_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       struct exynos_ufs *ufs = ufshcd_get_variant(hba);
-@@ -1615,8 +1615,6 @@ static int exynos_ufs_remove(struct platform_device *pdev)
-       phy_power_off(ufs->phy);
-       phy_exit(ufs->phy);
--
--      return 0;
- }
- static struct exynos_ufs_uic_attr exynos7_uic_attr = {
-@@ -1756,7 +1754,7 @@ static const struct dev_pm_ops exynos_ufs_pm_ops = {
- static struct platform_driver exynos_ufs_pltform = {
-       .probe  = exynos_ufs_probe,
--      .remove = exynos_ufs_remove,
-+      .remove_new = exynos_ufs_remove,
-       .driver = {
-               .name   = "exynos-ufshc",
-               .pm     = &exynos_ufs_pm_ops,
-diff --git a/drivers/ufs/host/ufs-hisi.c b/drivers/ufs/host/ufs-hisi.c
-index 5b3060cd0ab8b..0229ac0a8dbed 100644
---- a/drivers/ufs/host/ufs-hisi.c
-+++ b/drivers/ufs/host/ufs-hisi.c
-@@ -575,12 +575,11 @@ static int ufs_hisi_probe(struct platform_device *pdev)
-       return ufshcd_pltfrm_init(pdev, of_id->data);
- }
--static int ufs_hisi_remove(struct platform_device *pdev)
-+static void ufs_hisi_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       ufshcd_remove(hba);
--      return 0;
- }
- static const struct dev_pm_ops ufs_hisi_pm_ops = {
-@@ -592,7 +591,7 @@ static const struct dev_pm_ops ufs_hisi_pm_ops = {
- static struct platform_driver ufs_hisi_pltform = {
-       .probe  = ufs_hisi_probe,
--      .remove = ufs_hisi_remove,
-+      .remove_new = ufs_hisi_remove,
-       .driver = {
-               .name   = "ufshcd-hisi",
-               .pm     = &ufs_hisi_pm_ops,
-diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
-index 2383ecd88f1cb..1238faec3cc68 100644
---- a/drivers/ufs/host/ufs-mediatek.c
-+++ b/drivers/ufs/host/ufs-mediatek.c
-@@ -1748,13 +1748,12 @@ static int ufs_mtk_probe(struct platform_device *pdev)
-  *
-  * Always return 0
-  */
--static int ufs_mtk_remove(struct platform_device *pdev)
-+static void ufs_mtk_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_remove(hba);
--      return 0;
- }
- #ifdef CONFIG_PM_SLEEP
-@@ -1818,7 +1817,7 @@ static const struct dev_pm_ops ufs_mtk_pm_ops = {
- static struct platform_driver ufs_mtk_pltform = {
-       .probe      = ufs_mtk_probe,
--      .remove     = ufs_mtk_remove,
-+      .remove_new = ufs_mtk_remove,
-       .driver = {
-               .name   = "ufshcd-mtk",
-               .pm     = &ufs_mtk_pm_ops,
-diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
-index 643157a92c62a..0a914fd44494d 100644
---- a/drivers/ufs/host/ufs-qcom.c
-+++ b/drivers/ufs/host/ufs-qcom.c
-@@ -1920,14 +1920,13 @@ static int ufs_qcom_probe(struct platform_device *pdev)
-  *
-  * Always returns 0
-  */
--static int ufs_qcom_remove(struct platform_device *pdev)
-+static void ufs_qcom_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_remove(hba);
-       platform_msi_domain_free_irqs(hba->dev);
--      return 0;
- }
- static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
-@@ -1959,7 +1958,7 @@ static const struct dev_pm_ops ufs_qcom_pm_ops = {
- static struct platform_driver ufs_qcom_pltform = {
-       .probe  = ufs_qcom_probe,
--      .remove = ufs_qcom_remove,
-+      .remove_new = ufs_qcom_remove,
-       .driver = {
-               .name   = "ufshcd-qcom",
-               .pm     = &ufs_qcom_pm_ops,
-diff --git a/drivers/ufs/host/ufs-renesas.c b/drivers/ufs/host/ufs-renesas.c
-index ea3da773b1c14..3ff97112e1f6d 100644
---- a/drivers/ufs/host/ufs-renesas.c
-+++ b/drivers/ufs/host/ufs-renesas.c
-@@ -395,18 +395,16 @@ static int ufs_renesas_probe(struct platform_device *pdev)
-       return ufshcd_pltfrm_init(pdev, &ufs_renesas_vops);
- }
--static int ufs_renesas_remove(struct platform_device *pdev)
-+static void ufs_renesas_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba = platform_get_drvdata(pdev);
-       ufshcd_remove(hba);
--
--      return 0;
- }
- static struct platform_driver ufs_renesas_platform = {
-       .probe  = ufs_renesas_probe,
--      .remove = ufs_renesas_remove,
-+      .remove_new = ufs_renesas_remove,
-       .driver = {
-               .name   = "ufshcd-renesas",
-               .of_match_table = of_match_ptr(ufs_renesas_of_match),
-diff --git a/drivers/ufs/host/ufs-sprd.c b/drivers/ufs/host/ufs-sprd.c
-index 2bad75dd6d589..d8b165908809d 100644
---- a/drivers/ufs/host/ufs-sprd.c
-+++ b/drivers/ufs/host/ufs-sprd.c
-@@ -425,13 +425,12 @@ static int ufs_sprd_probe(struct platform_device *pdev)
-       return err;
- }
--static int ufs_sprd_remove(struct platform_device *pdev)
-+static void ufs_sprd_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_remove(hba);
--      return 0;
- }
- static const struct dev_pm_ops ufs_sprd_pm_ops = {
-@@ -443,7 +442,7 @@ static const struct dev_pm_ops ufs_sprd_pm_ops = {
- static struct platform_driver ufs_sprd_pltform = {
-       .probe = ufs_sprd_probe,
--      .remove = ufs_sprd_remove,
-+      .remove_new = ufs_sprd_remove,
-       .driver = {
-               .name = "ufshcd-sprd",
-               .pm = &ufs_sprd_pm_ops,
--- 
-2.43.0
-
diff --git a/queue-6.6/scsi-ufs-pltfrm-dellocate-hba-during-ufshcd_pltfrm_r.patch b/queue-6.6/scsi-ufs-pltfrm-dellocate-hba-during-ufshcd_pltfrm_r.patch
deleted file mode 100644 (file)
index 9426986..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-From 2574a5ed78f1f65bc32917a55e63a7f3c601b6ac Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Nov 2024 23:18:34 +0530
-Subject: scsi: ufs: pltfrm: Dellocate HBA during ufshcd_pltfrm_remove()
-
-From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-
-[ Upstream commit 897df60c16d54ad515a3d0887edab5c63da06d1f ]
-
-This will ensure that the scsi host is cleaned up properly using
-scsi_host_dev_release(). Otherwise, it may lead to memory leaks.
-
-Cc: stable@vger.kernel.org # 4.4
-Fixes: 03b1781aa978 ("[SCSI] ufs: Add Platform glue driver for ufshcd")
-Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-5-45ad8b62f02e@linaro.org
-Reviewed-by: Peter Wang <peter.wang@mediatek.com>
-Reviewed-by: Bean Huo <beanhuo@micron.com>
-Reviewed-by: Bart Van Assche <bvanassche@acm.org>
-Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/ufs/host/ufshcd-pltfrm.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
-index 05836cb8b885b..e99d89d00606b 100644
---- a/drivers/ufs/host/ufshcd-pltfrm.c
-+++ b/drivers/ufs/host/ufshcd-pltfrm.c
-@@ -402,6 +402,7 @@ void ufshcd_pltfrm_remove(struct platform_device *pdev)
-       pm_runtime_get_sync(&pdev->dev);
-       ufshcd_remove(hba);
-+      ufshcd_dealloc_host(hba);
-       pm_runtime_disable(&pdev->dev);
-       pm_runtime_put_noidle(&pdev->dev);
- }
--- 
-2.43.0
-
diff --git a/queue-6.6/scsi-ufs-pltfrm-disable-runtime-pm-during-removal-of.patch b/queue-6.6/scsi-ufs-pltfrm-disable-runtime-pm-during-removal-of.patch
deleted file mode 100644 (file)
index 5eac0d5..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-From f2020ee0d7f8af71ab3b510729abbc7912be6399 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Nov 2024 23:18:32 +0530
-Subject: scsi: ufs: pltfrm: Disable runtime PM during removal of glue drivers
-
-From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-
-[ Upstream commit d3326e6a3f9bf1e075be2201fb704c2fdf19e2b7 ]
-
-When the UFSHCD platform glue drivers are removed, runtime PM should be
-disabled using pm_runtime_disable() to balance the enablement done in
-ufshcd_pltfrm_init(). This is also reported by PM core when the glue driver
-is removed and inserted again:
-
-ufshcd-qcom 1d84000.ufshc: Unbalanced pm_runtime_enable!
-
-So disable runtime PM using a new helper API ufshcd_pltfrm_remove(), that
-also takes care of removing ufshcd. This helper should be called during the
-remove() stage of glue drivers.
-
-Cc: stable@vger.kernel.org # 3.12
-Fixes: 62694735ca95 ("[SCSI] ufs: Add runtime PM support for UFS host controller driver")
-Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-3-45ad8b62f02e@linaro.org
-Reviewed-by: Peter Wang <peter.wang@mediatek.com>
-Reviewed-by: Bean Huo <beanhuo@micron.com>
-Reviewed-by: Bart Van Assche <bvanassche@acm.org>
-Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-Stable-dep-of: 1745dcdb7227 ("scsi: ufs: pltfrm: Drop PM runtime reference count after ufshcd_remove()")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/ufs/host/cdns-pltfrm.c        |  4 +---
- drivers/ufs/host/tc-dwc-g210-pltfrm.c |  4 +---
- drivers/ufs/host/ufs-exynos.c         |  2 +-
- drivers/ufs/host/ufs-hisi.c           |  4 +---
- drivers/ufs/host/ufs-mediatek.c       |  4 +---
- drivers/ufs/host/ufs-qcom.c           |  2 +-
- drivers/ufs/host/ufs-renesas.c        |  4 +---
- drivers/ufs/host/ufs-sprd.c           |  4 +---
- drivers/ufs/host/ufshcd-pltfrm.c      | 13 +++++++++++++
- drivers/ufs/host/ufshcd-pltfrm.h      |  1 +
- 10 files changed, 22 insertions(+), 20 deletions(-)
-
-diff --git a/drivers/ufs/host/cdns-pltfrm.c b/drivers/ufs/host/cdns-pltfrm.c
-index 66811d8d1929c..b31aa84111511 100644
---- a/drivers/ufs/host/cdns-pltfrm.c
-+++ b/drivers/ufs/host/cdns-pltfrm.c
-@@ -307,9 +307,7 @@ static int cdns_ufs_pltfrm_probe(struct platform_device *pdev)
-  */
- static void cdns_ufs_pltfrm_remove(struct platform_device *pdev)
- {
--      struct ufs_hba *hba =  platform_get_drvdata(pdev);
--
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
- }
- static const struct dev_pm_ops cdns_ufs_dev_pm_ops = {
-diff --git a/drivers/ufs/host/tc-dwc-g210-pltfrm.c b/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-index a3877592604d5..113e0ef7b2cf8 100644
---- a/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-+++ b/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-@@ -76,10 +76,8 @@ static int tc_dwc_g210_pltfm_probe(struct platform_device *pdev)
-  */
- static void tc_dwc_g210_pltfm_remove(struct platform_device *pdev)
- {
--      struct ufs_hba *hba =  platform_get_drvdata(pdev);
--
-       pm_runtime_get_sync(&(pdev)->dev);
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
- }
- static const struct dev_pm_ops tc_dwc_g210_pltfm_pm_ops = {
-diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
-index 25bc11811b4c1..1cca797a00ba0 100644
---- a/drivers/ufs/host/ufs-exynos.c
-+++ b/drivers/ufs/host/ufs-exynos.c
-@@ -1611,7 +1611,7 @@ static void exynos_ufs_remove(struct platform_device *pdev)
-       struct exynos_ufs *ufs = ufshcd_get_variant(hba);
-       pm_runtime_get_sync(&(pdev)->dev);
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
-       phy_power_off(ufs->phy);
-       phy_exit(ufs->phy);
-diff --git a/drivers/ufs/host/ufs-hisi.c b/drivers/ufs/host/ufs-hisi.c
-index 0229ac0a8dbed..ceae0dd1617ed 100644
---- a/drivers/ufs/host/ufs-hisi.c
-+++ b/drivers/ufs/host/ufs-hisi.c
-@@ -577,9 +577,7 @@ static int ufs_hisi_probe(struct platform_device *pdev)
- static void ufs_hisi_remove(struct platform_device *pdev)
- {
--      struct ufs_hba *hba =  platform_get_drvdata(pdev);
--
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
- }
- static const struct dev_pm_ops ufs_hisi_pm_ops = {
-diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
-index 1238faec3cc68..49f63b13a040d 100644
---- a/drivers/ufs/host/ufs-mediatek.c
-+++ b/drivers/ufs/host/ufs-mediatek.c
-@@ -1750,10 +1750,8 @@ static int ufs_mtk_probe(struct platform_device *pdev)
-  */
- static void ufs_mtk_remove(struct platform_device *pdev)
- {
--      struct ufs_hba *hba =  platform_get_drvdata(pdev);
--
-       pm_runtime_get_sync(&(pdev)->dev);
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
- }
- #ifdef CONFIG_PM_SLEEP
-diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
-index 1e75368930d99..762b3aa19f31d 100644
---- a/drivers/ufs/host/ufs-qcom.c
-+++ b/drivers/ufs/host/ufs-qcom.c
-@@ -1926,7 +1926,7 @@ static void ufs_qcom_remove(struct platform_device *pdev)
-       struct ufs_qcom_host *host = ufshcd_get_variant(hba);
-       pm_runtime_get_sync(&(pdev)->dev);
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
-       if (host->esi_enabled)
-               platform_device_msi_free_irqs_all(hba->dev);
- }
-diff --git a/drivers/ufs/host/ufs-renesas.c b/drivers/ufs/host/ufs-renesas.c
-index 3ff97112e1f6d..21a64b34397d8 100644
---- a/drivers/ufs/host/ufs-renesas.c
-+++ b/drivers/ufs/host/ufs-renesas.c
-@@ -397,9 +397,7 @@ static int ufs_renesas_probe(struct platform_device *pdev)
- static void ufs_renesas_remove(struct platform_device *pdev)
- {
--      struct ufs_hba *hba = platform_get_drvdata(pdev);
--
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
- }
- static struct platform_driver ufs_renesas_platform = {
-diff --git a/drivers/ufs/host/ufs-sprd.c b/drivers/ufs/host/ufs-sprd.c
-index d8b165908809d..e455890cf7d49 100644
---- a/drivers/ufs/host/ufs-sprd.c
-+++ b/drivers/ufs/host/ufs-sprd.c
-@@ -427,10 +427,8 @@ static int ufs_sprd_probe(struct platform_device *pdev)
- static void ufs_sprd_remove(struct platform_device *pdev)
- {
--      struct ufs_hba *hba =  platform_get_drvdata(pdev);
--
-       pm_runtime_get_sync(&(pdev)->dev);
--      ufshcd_remove(hba);
-+      ufshcd_pltfrm_remove(pdev);
- }
- static const struct dev_pm_ops ufs_sprd_pm_ops = {
-diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
-index 797a4dfe45d90..0dc8651eabc22 100644
---- a/drivers/ufs/host/ufshcd-pltfrm.c
-+++ b/drivers/ufs/host/ufshcd-pltfrm.c
-@@ -392,6 +392,19 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
- }
- EXPORT_SYMBOL_GPL(ufshcd_pltfrm_init);
-+/**
-+ * ufshcd_pltfrm_remove - Remove ufshcd platform
-+ * @pdev: pointer to Platform device handle
-+ */
-+void ufshcd_pltfrm_remove(struct platform_device *pdev)
-+{
-+      struct ufs_hba *hba =  platform_get_drvdata(pdev);
-+
-+      ufshcd_remove(hba);
-+      pm_runtime_disable(&pdev->dev);
-+}
-+EXPORT_SYMBOL_GPL(ufshcd_pltfrm_remove);
-+
- MODULE_AUTHOR("Santosh Yaragnavi <santosh.sy@samsung.com>");
- MODULE_AUTHOR("Vinayak Holikatti <h.vinayak@samsung.com>");
- MODULE_DESCRIPTION("UFS host controller Platform bus based glue driver");
-diff --git a/drivers/ufs/host/ufshcd-pltfrm.h b/drivers/ufs/host/ufshcd-pltfrm.h
-index 2df108f4ac131..1cfc4f8ea07eb 100644
---- a/drivers/ufs/host/ufshcd-pltfrm.h
-+++ b/drivers/ufs/host/ufshcd-pltfrm.h
-@@ -31,6 +31,7 @@ int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *dev_param,
- void ufshcd_init_pwr_dev_param(struct ufs_dev_params *dev_param);
- int ufshcd_pltfrm_init(struct platform_device *pdev,
-                      const struct ufs_hba_variant_ops *vops);
-+void ufshcd_pltfrm_remove(struct platform_device *pdev);
- int ufshcd_populate_vreg(struct device *dev, const char *name,
-                        struct ufs_vreg **out_vreg);
--- 
-2.43.0
-
diff --git a/queue-6.6/scsi-ufs-pltfrm-drop-pm-runtime-reference-count-afte.patch b/queue-6.6/scsi-ufs-pltfrm-drop-pm-runtime-reference-count-afte.patch
deleted file mode 100644 (file)
index e7659fb..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-From ea4799f2d7ae0a481aa95411f6f649d09f9f62f9 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Nov 2024 23:18:33 +0530
-Subject: scsi: ufs: pltfrm: Drop PM runtime reference count after
- ufshcd_remove()
-
-From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-
-[ Upstream commit 1745dcdb7227102e16248a324c600b9121c8f6df ]
-
-During the remove stage of glue drivers, some of them are incrementing the
-reference count using pm_runtime_get_sync(), before removing the ufshcd
-using ufshcd_remove(). But they are not dropping that reference count after
-ufshcd_remove() to balance the refcount.
-
-So drop the reference count by calling pm_runtime_put_noidle() after
-ufshcd_remove(). Since the behavior is applicable to all glue drivers, move
-the PM handling to ufshcd_pltfrm_remove().
-
-Cc: stable@vger.kernel.org # 3.12
-Fixes: 62694735ca95 ("[SCSI] ufs: Add runtime PM support for UFS host controller driver")
-Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-4-45ad8b62f02e@linaro.org
-Reviewed-by: Peter Wang <peter.wang@mediatek.com>
-Reviewed-by: Bean Huo <beanhuo@micron.com>
-Reviewed-by: Bart Van Assche <bvanassche@acm.org>
-Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/ufs/host/tc-dwc-g210-pltfrm.c | 1 -
- drivers/ufs/host/ufs-exynos.c         | 1 -
- drivers/ufs/host/ufs-mediatek.c       | 1 -
- drivers/ufs/host/ufs-qcom.c           | 1 -
- drivers/ufs/host/ufs-sprd.c           | 1 -
- drivers/ufs/host/ufshcd-pltfrm.c      | 2 ++
- 6 files changed, 2 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/ufs/host/tc-dwc-g210-pltfrm.c b/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-index 113e0ef7b2cf8..c6f8565ede21a 100644
---- a/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-+++ b/drivers/ufs/host/tc-dwc-g210-pltfrm.c
-@@ -76,7 +76,6 @@ static int tc_dwc_g210_pltfm_probe(struct platform_device *pdev)
-  */
- static void tc_dwc_g210_pltfm_remove(struct platform_device *pdev)
- {
--      pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_pltfrm_remove(pdev);
- }
-diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
-index 1cca797a00ba0..4418c497a6d71 100644
---- a/drivers/ufs/host/ufs-exynos.c
-+++ b/drivers/ufs/host/ufs-exynos.c
-@@ -1610,7 +1610,6 @@ static void exynos_ufs_remove(struct platform_device *pdev)
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       struct exynos_ufs *ufs = ufshcd_get_variant(hba);
--      pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_pltfrm_remove(pdev);
-       phy_power_off(ufs->phy);
-diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
-index 49f63b13a040d..64d85e63b7501 100644
---- a/drivers/ufs/host/ufs-mediatek.c
-+++ b/drivers/ufs/host/ufs-mediatek.c
-@@ -1750,7 +1750,6 @@ static int ufs_mtk_probe(struct platform_device *pdev)
-  */
- static void ufs_mtk_remove(struct platform_device *pdev)
- {
--      pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_pltfrm_remove(pdev);
- }
-diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
-index 762b3aa19f31d..0dc4c14e9f35c 100644
---- a/drivers/ufs/host/ufs-qcom.c
-+++ b/drivers/ufs/host/ufs-qcom.c
-@@ -1925,7 +1925,6 @@ static void ufs_qcom_remove(struct platform_device *pdev)
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-       struct ufs_qcom_host *host = ufshcd_get_variant(hba);
--      pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_pltfrm_remove(pdev);
-       if (host->esi_enabled)
-               platform_device_msi_free_irqs_all(hba->dev);
-diff --git a/drivers/ufs/host/ufs-sprd.c b/drivers/ufs/host/ufs-sprd.c
-index e455890cf7d49..d220978c2d8c8 100644
---- a/drivers/ufs/host/ufs-sprd.c
-+++ b/drivers/ufs/host/ufs-sprd.c
-@@ -427,7 +427,6 @@ static int ufs_sprd_probe(struct platform_device *pdev)
- static void ufs_sprd_remove(struct platform_device *pdev)
- {
--      pm_runtime_get_sync(&(pdev)->dev);
-       ufshcd_pltfrm_remove(pdev);
- }
-diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
-index 0dc8651eabc22..05836cb8b885b 100644
---- a/drivers/ufs/host/ufshcd-pltfrm.c
-+++ b/drivers/ufs/host/ufshcd-pltfrm.c
-@@ -400,8 +400,10 @@ void ufshcd_pltfrm_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-+      pm_runtime_get_sync(&pdev->dev);
-       ufshcd_remove(hba);
-       pm_runtime_disable(&pdev->dev);
-+      pm_runtime_put_noidle(&pdev->dev);
- }
- EXPORT_SYMBOL_GPL(ufshcd_pltfrm_remove);
--- 
-2.43.0
-
similarity index 64%
rename from queue-6.6/scsi-ufs-qcom-only-free-platform-msis-when-esi-is-en.patch
rename to queue-6.6/scsi-ufs-qcom-only-free-platform-msis-when-esi-is-enabled.patch
index 036edce87f1a0080e010b9e9ba6863d13ded2380..665621f3d612e99fb46b4835dd532438a6a6d5f3 100644 (file)
@@ -1,11 +1,11 @@
-From fa58fa5bb0bd735892f87767755f409f2e7dd7f9 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
+From 64506b3d23a337e98a74b18dcb10c8619365f2bd Mon Sep 17 00:00:00 2001
+From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
 Date: Mon, 11 Nov 2024 23:18:31 +0530
 Subject: scsi: ufs: qcom: Only free platform MSIs when ESI is enabled
 
 From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
 
-[ Upstream commit 64506b3d23a337e98a74b18dcb10c8619365f2bd ]
+commit 64506b3d23a337e98a74b18dcb10c8619365f2bd upstream.
 
 Otherwise, it will result in a NULL pointer dereference as below:
 
@@ -37,29 +37,21 @@ Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-2-45ad8b62f02e@linaro.or
 Reviewed-by: Bean Huo <beanhuo@micron.com>
 Reviewed-by: Bart Van Assche <bvanassche@acm.org>
 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- drivers/ufs/host/ufs-qcom.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ drivers/ufs/host/ufs-qcom.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
 
-diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
-index d77cfb2ab1acd..1e75368930d99 100644
 --- a/drivers/ufs/host/ufs-qcom.c
 +++ b/drivers/ufs/host/ufs-qcom.c
-@@ -1923,10 +1923,12 @@ static int ufs_qcom_probe(struct platform_device *pdev)
- static void ufs_qcom_remove(struct platform_device *pdev)
- {
-       struct ufs_hba *hba =  platform_get_drvdata(pdev);
-+      struct ufs_qcom_host *host = ufshcd_get_variant(hba);
+@@ -1926,7 +1926,8 @@ static int ufs_qcom_remove(struct platfo
  
        pm_runtime_get_sync(&(pdev)->dev);
        ufshcd_remove(hba);
--      platform_device_msi_free_irqs_all(hba->dev);
+-      platform_msi_domain_free_irqs(hba->dev);
 +      if (host->esi_enabled)
-+              platform_device_msi_free_irqs_all(hba->dev);
++              platform_msi_domain_free_irqs(hba->dev);
+       return 0;
  }
  
- static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
--- 
-2.43.0
-
index 3e256a9894c879ea6bb0cc018ef34022eaf7a45c..3a2b482e1c838ecc9342082cea34259143328f0f 100644 (file)
@@ -316,14 +316,7 @@ serial-8250_dw-add-sophgo-sg2044-quirk.patch
 smb-client-don-t-try-following-dfs-links-in-cifs_tre.patch
 setlocalversion-work-around-git-describe-performance.patch
 io_uring-tctx-work-around-xa_store-allocation-error-.patch
-scsi-ufs-convert-all-platform-drivers-to-return-void.patch
-genirq-irqdomain-add-domain_bus_device_msi.patch
-platform-msi-prepare-for-real-per-device-domains.patch
-irqchip-convert-all-platform-msi-users-to-the-new-ap.patch
-scsi-ufs-qcom-only-free-platform-msis-when-esi-is-en.patch
-scsi-ufs-pltfrm-disable-runtime-pm-during-removal-of.patch
-scsi-ufs-pltfrm-drop-pm-runtime-reference-count-afte.patch
-scsi-ufs-pltfrm-dellocate-hba-during-ufshcd_pltfrm_r.patch
+scsi-ufs-qcom-only-free-platform-msis-when-esi-is-enabled.patch
 sched-numa-fix-mm-numa_scan_seq-based-unconditional-.patch
 sched-numa-fix-memory-leak-due-to-the-overwritten-vm.patch
 mempolicy-fix-migrate_pages-2-syscall-return-nr_fail.patch