]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop mhi patches from 5.10 as they are too much.
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2023 06:40:10 +0000 (08:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2023 06:40:10 +0000 (08:40 +0200)
queue-5.10/bus-mhi-add-mhi-pci-support-for-wwan-modems.patch [deleted file]
queue-5.10/bus-mhi-add-mmio-region-length-to-controller-structu.patch [deleted file]
queue-5.10/bus-mhi-host-range-check-chdboff-and-erdboff.patch [deleted file]
queue-5.10/bus-mhi-move-host-mhi-code-to-host-directory.patch [deleted file]
queue-5.10/series

diff --git a/queue-5.10/bus-mhi-add-mhi-pci-support-for-wwan-modems.patch b/queue-5.10/bus-mhi-add-mhi-pci-support-for-wwan-modems.patch
deleted file mode 100644 (file)
index fbdf272..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-From 3049952ab66db9880b96789de72d7c34ae9d53da Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 21 Oct 2020 19:18:19 +0200
-Subject: bus: mhi: Add MHI PCI support for WWAN modems
-
-From: Loic Poulain <loic.poulain@linaro.org>
-
-[ Upstream commit 855a70c12021bdc5df60512f1d3f6d492dc715be ]
-
-This is a generic MHI-over-PCI controller driver for MHI only devices
-such as QCOM modems. For now it supports registering of Qualcomm SDX55
-based PCIe modules. The MHI channels have been extracted from mhi
-downstream driver.
-
-This driver is for MHI-only devices which have all functionalities
-exposed through MHI channels and accessed by the corresponding MHI
-device drivers (no out-of-band communication).
-
-Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
-Reviewed-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
-Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
-Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-[mani: fixed up the Makefile rule]
-Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Stable-dep-of: 6a0c637bfee6 ("bus: mhi: host: Range check CHDBOFF and ERDBOFF")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/bus/mhi/Kconfig       |   9 +
- drivers/bus/mhi/Makefile      |   4 +
- drivers/bus/mhi/pci_generic.c | 345 ++++++++++++++++++++++++++++++++++
- 3 files changed, 358 insertions(+)
- create mode 100644 drivers/bus/mhi/pci_generic.c
-
-diff --git a/drivers/bus/mhi/Kconfig b/drivers/bus/mhi/Kconfig
-index e841c1097fb4d..da5cd0c9fc620 100644
---- a/drivers/bus/mhi/Kconfig
-+++ b/drivers/bus/mhi/Kconfig
-@@ -20,3 +20,12 @@ config MHI_BUS_DEBUG
-         Enable debugfs support for use with the MHI transport. Allows
-         reading and/or modifying some values within the MHI controller
-         for debug and test purposes.
-+
-+config MHI_BUS_PCI_GENERIC
-+      tristate "MHI PCI controller driver"
-+      depends on MHI_BUS
-+      depends on PCI
-+      help
-+        This driver provides MHI PCI controller driver for devices such as
-+        Qualcomm SDX55 based PCIe modems.
-+
-diff --git a/drivers/bus/mhi/Makefile b/drivers/bus/mhi/Makefile
-index 19e6443b72df4..0a2d778d6fb42 100644
---- a/drivers/bus/mhi/Makefile
-+++ b/drivers/bus/mhi/Makefile
-@@ -1,2 +1,6 @@
- # core layer
- obj-y += core/
-+
-+obj-$(CONFIG_MHI_BUS_PCI_GENERIC) += mhi_pci_generic.o
-+mhi_pci_generic-y += pci_generic.o
-+
-diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
-new file mode 100644
-index 0000000000000..e3df838c3c80e
---- /dev/null
-+++ b/drivers/bus/mhi/pci_generic.c
-@@ -0,0 +1,345 @@
-+// SPDX-License-Identifier: GPL-2.0-or-later
-+/*
-+ * MHI PCI driver - MHI over PCI controller driver
-+ *
-+ * This module is a generic driver for registering MHI-over-PCI devices,
-+ * such as PCIe QCOM modems.
-+ *
-+ * Copyright (C) 2020 Linaro Ltd <loic.poulain@linaro.org>
-+ */
-+
-+#include <linux/device.h>
-+#include <linux/mhi.h>
-+#include <linux/module.h>
-+#include <linux/pci.h>
-+
-+#define MHI_PCI_DEFAULT_BAR_NUM 0
-+
-+/**
-+ * struct mhi_pci_dev_info - MHI PCI device specific information
-+ * @config: MHI controller configuration
-+ * @name: name of the PCI module
-+ * @fw: firmware path (if any)
-+ * @edl: emergency download mode firmware path (if any)
-+ * @bar_num: PCI base address register to use for MHI MMIO register space
-+ * @dma_data_width: DMA transfer word size (32 or 64 bits)
-+ */
-+struct mhi_pci_dev_info {
-+      const struct mhi_controller_config *config;
-+      const char *name;
-+      const char *fw;
-+      const char *edl;
-+      unsigned int bar_num;
-+      unsigned int dma_data_width;
-+};
-+
-+#define MHI_CHANNEL_CONFIG_UL(ch_num, ch_name, el_count, ev_ring) \
-+      {                                               \
-+              .num = ch_num,                          \
-+              .name = ch_name,                        \
-+              .num_elements = el_count,               \
-+              .event_ring = ev_ring,                  \
-+              .dir = DMA_TO_DEVICE,                   \
-+              .ee_mask = BIT(MHI_EE_AMSS),            \
-+              .pollcfg = 0,                           \
-+              .doorbell = MHI_DB_BRST_DISABLE,        \
-+              .lpm_notify = false,                    \
-+              .offload_channel = false,               \
-+              .doorbell_mode_switch = false,          \
-+      }                                               \
-+
-+#define MHI_CHANNEL_CONFIG_DL(ch_num, ch_name, el_count, ev_ring) \
-+      {                                               \
-+              .num = ch_num,                          \
-+              .name = ch_name,                        \
-+              .num_elements = el_count,               \
-+              .event_ring = ev_ring,                  \
-+              .dir = DMA_FROM_DEVICE,                 \
-+              .ee_mask = BIT(MHI_EE_AMSS),            \
-+              .pollcfg = 0,                           \
-+              .doorbell = MHI_DB_BRST_DISABLE,        \
-+              .lpm_notify = false,                    \
-+              .offload_channel = false,               \
-+              .doorbell_mode_switch = false,          \
-+      }
-+
-+#define MHI_EVENT_CONFIG_CTRL(ev_ring)                \
-+      {                                       \
-+              .num_elements = 64,             \
-+              .irq_moderation_ms = 0,         \
-+              .irq = (ev_ring) + 1,           \
-+              .priority = 1,                  \
-+              .mode = MHI_DB_BRST_DISABLE,    \
-+              .data_type = MHI_ER_CTRL,       \
-+              .hardware_event = false,        \
-+              .client_managed = false,        \
-+              .offload_channel = false,       \
-+      }
-+
-+#define MHI_EVENT_CONFIG_DATA(ev_ring)                \
-+      {                                       \
-+              .num_elements = 128,            \
-+              .irq_moderation_ms = 5,         \
-+              .irq = (ev_ring) + 1,           \
-+              .priority = 1,                  \
-+              .mode = MHI_DB_BRST_DISABLE,    \
-+              .data_type = MHI_ER_DATA,       \
-+              .hardware_event = false,        \
-+              .client_managed = false,        \
-+              .offload_channel = false,       \
-+      }
-+
-+#define MHI_EVENT_CONFIG_HW_DATA(ev_ring, ch_num) \
-+      {                                       \
-+              .num_elements = 128,            \
-+              .irq_moderation_ms = 5,         \
-+              .irq = (ev_ring) + 1,           \
-+              .priority = 1,                  \
-+              .mode = MHI_DB_BRST_DISABLE,    \
-+              .data_type = MHI_ER_DATA,       \
-+              .hardware_event = true,         \
-+              .client_managed = false,        \
-+              .offload_channel = false,       \
-+              .channel = ch_num,              \
-+      }
-+
-+static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
-+      MHI_CHANNEL_CONFIG_UL(12, "MBIM", 4, 0),
-+      MHI_CHANNEL_CONFIG_DL(13, "MBIM", 4, 0),
-+      MHI_CHANNEL_CONFIG_UL(14, "QMI", 4, 0),
-+      MHI_CHANNEL_CONFIG_DL(15, "QMI", 4, 0),
-+      MHI_CHANNEL_CONFIG_UL(20, "IPCR", 8, 0),
-+      MHI_CHANNEL_CONFIG_DL(21, "IPCR", 8, 0),
-+      MHI_CHANNEL_CONFIG_UL(100, "IP_HW0", 128, 1),
-+      MHI_CHANNEL_CONFIG_DL(101, "IP_HW0", 128, 2),
-+};
-+
-+static const struct mhi_event_config modem_qcom_v1_mhi_events[] = {
-+      /* first ring is control+data ring */
-+      MHI_EVENT_CONFIG_CTRL(0),
-+      /* Hardware channels request dedicated hardware event rings */
-+      MHI_EVENT_CONFIG_HW_DATA(1, 100),
-+      MHI_EVENT_CONFIG_HW_DATA(2, 101)
-+};
-+
-+static const struct mhi_controller_config modem_qcom_v1_mhiv_config = {
-+      .max_channels = 128,
-+      .timeout_ms = 5000,
-+      .num_channels = ARRAY_SIZE(modem_qcom_v1_mhi_channels),
-+      .ch_cfg = modem_qcom_v1_mhi_channels,
-+      .num_events = ARRAY_SIZE(modem_qcom_v1_mhi_events),
-+      .event_cfg = modem_qcom_v1_mhi_events,
-+};
-+
-+static const struct mhi_pci_dev_info mhi_qcom_sdx55_info = {
-+      .name = "qcom-sdx55m",
-+      .fw = "qcom/sdx55m/sbl1.mbn",
-+      .edl = "qcom/sdx55m/edl.mbn",
-+      .config = &modem_qcom_v1_mhiv_config,
-+      .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
-+      .dma_data_width = 32
-+};
-+
-+static const struct pci_device_id mhi_pci_id_table[] = {
-+      { PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0306),
-+              .driver_data = (kernel_ulong_t) &mhi_qcom_sdx55_info },
-+      {  }
-+};
-+MODULE_DEVICE_TABLE(pci, mhi_pci_id_table);
-+
-+static int mhi_pci_read_reg(struct mhi_controller *mhi_cntrl,
-+                          void __iomem *addr, u32 *out)
-+{
-+      *out = readl(addr);
-+      return 0;
-+}
-+
-+static void mhi_pci_write_reg(struct mhi_controller *mhi_cntrl,
-+                            void __iomem *addr, u32 val)
-+{
-+      writel(val, addr);
-+}
-+
-+static void mhi_pci_status_cb(struct mhi_controller *mhi_cntrl,
-+                            enum mhi_callback cb)
-+{
-+      /* Nothing to do for now */
-+}
-+
-+static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
-+                       unsigned int bar_num, u64 dma_mask)
-+{
-+      struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
-+      int err;
-+
-+      err = pci_assign_resource(pdev, bar_num);
-+      if (err)
-+              return err;
-+
-+      err = pcim_enable_device(pdev);
-+      if (err) {
-+              dev_err(&pdev->dev, "failed to enable pci device: %d\n", err);
-+              return err;
-+      }
-+
-+      err = pcim_iomap_regions(pdev, 1 << bar_num, pci_name(pdev));
-+      if (err) {
-+              dev_err(&pdev->dev, "failed to map pci region: %d\n", err);
-+              return err;
-+      }
-+      mhi_cntrl->regs = pcim_iomap_table(pdev)[bar_num];
-+
-+      err = pci_set_dma_mask(pdev, dma_mask);
-+      if (err) {
-+              dev_err(&pdev->dev, "Cannot set proper DMA mask\n");
-+              return err;
-+      }
-+
-+      err = pci_set_consistent_dma_mask(pdev, dma_mask);
-+      if (err) {
-+              dev_err(&pdev->dev, "set consistent dma mask failed\n");
-+              return err;
-+      }
-+
-+      pci_set_master(pdev);
-+
-+      return 0;
-+}
-+
-+static int mhi_pci_get_irqs(struct mhi_controller *mhi_cntrl,
-+                          const struct mhi_controller_config *mhi_cntrl_config)
-+{
-+      struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
-+      int nr_vectors, i;
-+      int *irq;
-+
-+      /*
-+       * Alloc one MSI vector for BHI + one vector per event ring, ideally...
-+       * No explicit pci_free_irq_vectors required, done by pcim_release.
-+       */
-+      mhi_cntrl->nr_irqs = 1 + mhi_cntrl_config->num_events;
-+
-+      nr_vectors = pci_alloc_irq_vectors(pdev, 1, mhi_cntrl->nr_irqs, PCI_IRQ_MSI);
-+      if (nr_vectors < 0) {
-+              dev_err(&pdev->dev, "Error allocating MSI vectors %d\n",
-+                      nr_vectors);
-+              return nr_vectors;
-+      }
-+
-+      if (nr_vectors < mhi_cntrl->nr_irqs) {
-+              dev_warn(&pdev->dev, "Not enough MSI vectors (%d/%d), use shared MSI\n",
-+                       nr_vectors, mhi_cntrl_config->num_events);
-+      }
-+
-+      irq = devm_kcalloc(&pdev->dev, mhi_cntrl->nr_irqs, sizeof(int), GFP_KERNEL);
-+      if (!irq)
-+              return -ENOMEM;
-+
-+      for (i = 0; i < mhi_cntrl->nr_irqs; i++) {
-+              int vector = i >= nr_vectors ? (nr_vectors - 1) : i;
-+
-+              irq[i] = pci_irq_vector(pdev, vector);
-+      }
-+
-+      mhi_cntrl->irq = irq;
-+
-+      return 0;
-+}
-+
-+static int mhi_pci_runtime_get(struct mhi_controller *mhi_cntrl)
-+{
-+      /* no PM for now */
-+      return 0;
-+}
-+
-+static void mhi_pci_runtime_put(struct mhi_controller *mhi_cntrl)
-+{
-+      /* no PM for now */
-+}
-+
-+static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
-+{
-+      const struct mhi_pci_dev_info *info = (struct mhi_pci_dev_info *) id->driver_data;
-+      const struct mhi_controller_config *mhi_cntrl_config;
-+      struct mhi_controller *mhi_cntrl;
-+      int err;
-+
-+      dev_dbg(&pdev->dev, "MHI PCI device found: %s\n", info->name);
-+
-+      mhi_cntrl = mhi_alloc_controller();
-+      if (!mhi_cntrl)
-+              return -ENOMEM;
-+
-+      mhi_cntrl_config = info->config;
-+      mhi_cntrl->cntrl_dev = &pdev->dev;
-+      mhi_cntrl->iova_start = 0;
-+      mhi_cntrl->iova_stop = DMA_BIT_MASK(info->dma_data_width);
-+      mhi_cntrl->fw_image = info->fw;
-+      mhi_cntrl->edl_image = info->edl;
-+
-+      mhi_cntrl->read_reg = mhi_pci_read_reg;
-+      mhi_cntrl->write_reg = mhi_pci_write_reg;
-+      mhi_cntrl->status_cb = mhi_pci_status_cb;
-+      mhi_cntrl->runtime_get = mhi_pci_runtime_get;
-+      mhi_cntrl->runtime_put = mhi_pci_runtime_put;
-+
-+      err = mhi_pci_claim(mhi_cntrl, info->bar_num, DMA_BIT_MASK(info->dma_data_width));
-+      if (err)
-+              goto err_release;
-+
-+      err = mhi_pci_get_irqs(mhi_cntrl, mhi_cntrl_config);
-+      if (err)
-+              goto err_release;
-+
-+      pci_set_drvdata(pdev, mhi_cntrl);
-+
-+      err = mhi_register_controller(mhi_cntrl, mhi_cntrl_config);
-+      if (err)
-+              goto err_release;
-+
-+      /* MHI bus does not power up the controller by default */
-+      err = mhi_prepare_for_power_up(mhi_cntrl);
-+      if (err) {
-+              dev_err(&pdev->dev, "failed to prepare MHI controller\n");
-+              goto err_unregister;
-+      }
-+
-+      err = mhi_sync_power_up(mhi_cntrl);
-+      if (err) {
-+              dev_err(&pdev->dev, "failed to power up MHI controller\n");
-+              goto err_unprepare;
-+      }
-+
-+      return 0;
-+
-+err_unprepare:
-+      mhi_unprepare_after_power_down(mhi_cntrl);
-+err_unregister:
-+      mhi_unregister_controller(mhi_cntrl);
-+err_release:
-+      mhi_free_controller(mhi_cntrl);
-+
-+      return err;
-+}
-+
-+static void mhi_pci_remove(struct pci_dev *pdev)
-+{
-+      struct mhi_controller *mhi_cntrl = pci_get_drvdata(pdev);
-+
-+      mhi_power_down(mhi_cntrl, true);
-+      mhi_unprepare_after_power_down(mhi_cntrl);
-+      mhi_unregister_controller(mhi_cntrl);
-+      mhi_free_controller(mhi_cntrl);
-+}
-+
-+static struct pci_driver mhi_pci_driver = {
-+      .name           = "mhi-pci-generic",
-+      .id_table       = mhi_pci_id_table,
-+      .probe          = mhi_pci_probe,
-+      .remove         = mhi_pci_remove
-+};
-+module_pci_driver(mhi_pci_driver);
-+
-+MODULE_AUTHOR("Loic Poulain <loic.poulain@linaro.org>");
-+MODULE_DESCRIPTION("Modem Host Interface (MHI) PCI controller driver");
-+MODULE_LICENSE("GPL");
--- 
-2.39.2
-
diff --git a/queue-5.10/bus-mhi-add-mmio-region-length-to-controller-structu.patch b/queue-5.10/bus-mhi-add-mmio-region-length-to-controller-structu.patch
deleted file mode 100644 (file)
index 076242c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From 02b448eda71c9e6080c4f49200ce601ea2bd175c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 2 Aug 2021 10:42:50 +0530
-Subject: bus: mhi: Add MMIO region length to controller structure
-
-From: Bhaumik Bhatt <bbhatt@codeaurora.org>
-
-[ Upstream commit baa7a08569358d9d16e71ce36f287c39a665d776 ]
-
-Make controller driver specify the MMIO register region length
-for range checking of BHI or BHIe space. This can help validate
-that offsets are in acceptable memory region or not and avoid any
-boot-up issues due to BHI or BHIe memory accesses.
-
-Link: https://lore.kernel.org/r/1620330705-40192-4-git-send-email-bbhatt@codeaurora.org
-Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
-Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
-Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
-Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Link: https://lore.kernel.org/r/20210802051255.5771-6-manivannan.sadhasivam@linaro.org
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Stable-dep-of: 6a0c637bfee6 ("bus: mhi: host: Range check CHDBOFF and ERDBOFF")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/linux/mhi.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/include/linux/mhi.h b/include/linux/mhi.h
-index d4841e5a5f458..5d9f8c6f3d40f 100644
---- a/include/linux/mhi.h
-+++ b/include/linux/mhi.h
-@@ -303,6 +303,7 @@ struct mhi_controller_config {
-  * @rddm_size: RAM dump size that host should allocate for debugging purpose
-  * @sbl_size: SBL image size downloaded through BHIe (optional)
-  * @seg_len: BHIe vector size (optional)
-+ * @reg_len: Length of the MHI MMIO region (required)
-  * @fbc_image: Points to firmware image buffer
-  * @rddm_image: Points to RAM dump buffer
-  * @mhi_chan: Points to the channel configuration table
-@@ -383,6 +384,7 @@ struct mhi_controller {
-       size_t rddm_size;
-       size_t sbl_size;
-       size_t seg_len;
-+      size_t reg_len;
-       struct image_info *fbc_image;
-       struct image_info *rddm_image;
-       struct mhi_chan *mhi_chan;
--- 
-2.39.2
-
diff --git a/queue-5.10/bus-mhi-host-range-check-chdboff-and-erdboff.patch b/queue-5.10/bus-mhi-host-range-check-chdboff-and-erdboff.patch
deleted file mode 100644 (file)
index 040aa0e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-From ffecd7beda1bb049865050fd0b57b0861def8409 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 24 Mar 2023 10:13:04 -0600
-Subject: bus: mhi: host: Range check CHDBOFF and ERDBOFF
-
-From: Jeffrey Hugo <quic_jhugo@quicinc.com>
-
-[ Upstream commit 6a0c637bfee69a74c104468544d9f2a6579626d0 ]
-
-If the value read from the CHDBOFF and ERDBOFF registers is outside the
-range of the MHI register space then an invalid address might be computed
-which later causes a kernel panic.  Range check the read value to prevent
-a crash due to bad data from the device.
-
-Fixes: 6cd330ae76ff ("bus: mhi: core: Add support for ringing channel/event ring doorbells")
-Cc: stable@vger.kernel.org
-Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
-Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
-Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
-Link: https://lore.kernel.org/r/1679674384-27209-1-git-send-email-quic_jhugo@quicinc.com
-Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/bus/mhi/host/init.c | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c
-index 0d0386f67ffe2..2cc48f96afdbc 100644
---- a/drivers/bus/mhi/host/init.c
-+++ b/drivers/bus/mhi/host/init.c
-@@ -498,6 +498,12 @@ int mhi_init_mmio(struct mhi_controller *mhi_cntrl)
-               return -EIO;
-       }
-+      if (val >= mhi_cntrl->reg_len - (8 * MHI_DEV_WAKE_DB)) {
-+              dev_err(dev, "CHDB offset: 0x%x is out of range: 0x%zx\n",
-+                      val, mhi_cntrl->reg_len - (8 * MHI_DEV_WAKE_DB));
-+              return -ERANGE;
-+      }
-+
-       /* Setup wake db */
-       mhi_cntrl->wake_db = base + val + (8 * MHI_DEV_WAKE_DB);
-       mhi_write_reg(mhi_cntrl, mhi_cntrl->wake_db, 4, 0);
-@@ -517,6 +523,12 @@ int mhi_init_mmio(struct mhi_controller *mhi_cntrl)
-               return -EIO;
-       }
-+      if (val >= mhi_cntrl->reg_len - (8 * mhi_cntrl->total_ev_rings)) {
-+              dev_err(dev, "ERDB offset: 0x%x is out of range: 0x%zx\n",
-+                      val, mhi_cntrl->reg_len - (8 * mhi_cntrl->total_ev_rings));
-+              return -ERANGE;
-+      }
-+
-       /* Setup event db address for each ev_ring */
-       mhi_event = mhi_cntrl->mhi_event;
-       for (i = 0; i < mhi_cntrl->total_ev_rings; i++, val += 8, mhi_event++) {
--- 
-2.39.2
-
diff --git a/queue-5.10/bus-mhi-move-host-mhi-code-to-host-directory.patch b/queue-5.10/bus-mhi-move-host-mhi-code-to-host-directory.patch
deleted file mode 100644 (file)
index 9240136..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-From 49980807fded019a68228a20da8e9a0c64c637f8 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 1 Mar 2022 21:33:02 +0530
-Subject: bus: mhi: Move host MHI code to "host" directory
-
-From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-
-[ Upstream commit a0f5a630668cb8b2ebf5204f08e957875e991780 ]
-
-In preparation of the endpoint MHI support, let's move the host MHI code
-to its own "host" directory and adjust the toplevel MHI Kconfig & Makefile.
-
-While at it, let's also move the "pci_generic" driver to "host" directory
-as it is a host MHI controller driver.
-
-Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
-Reviewed-by: Alex Elder <elder@linaro.org>
-Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-Link: https://lore.kernel.org/r/20220301160308.107452-5-manivannan.sadhasivam@linaro.org
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Stable-dep-of: 6a0c637bfee6 ("bus: mhi: host: Range check CHDBOFF and ERDBOFF")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/bus/Makefile                      |  2 +-
- drivers/bus/mhi/Kconfig                   | 27 ++------------------
- drivers/bus/mhi/Makefile                  |  8 ++----
- drivers/bus/mhi/host/Kconfig              | 31 +++++++++++++++++++++++
- drivers/bus/mhi/{core => host}/Makefile   |  4 ++-
- drivers/bus/mhi/{core => host}/boot.c     |  0
- drivers/bus/mhi/{core => host}/debugfs.c  |  0
- drivers/bus/mhi/{core => host}/init.c     |  0
- drivers/bus/mhi/{core => host}/internal.h |  0
- drivers/bus/mhi/{core => host}/main.c     |  0
- drivers/bus/mhi/{ => host}/pci_generic.c  |  0
- drivers/bus/mhi/{core => host}/pm.c       |  0
- 12 files changed, 39 insertions(+), 33 deletions(-)
- create mode 100644 drivers/bus/mhi/host/Kconfig
- rename drivers/bus/mhi/{core => host}/Makefile (54%)
- rename drivers/bus/mhi/{core => host}/boot.c (100%)
- rename drivers/bus/mhi/{core => host}/debugfs.c (100%)
- rename drivers/bus/mhi/{core => host}/init.c (100%)
- rename drivers/bus/mhi/{core => host}/internal.h (100%)
- rename drivers/bus/mhi/{core => host}/main.c (100%)
- rename drivers/bus/mhi/{ => host}/pci_generic.c (100%)
- rename drivers/bus/mhi/{core => host}/pm.c (100%)
-
-diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
-index 397e35392bff8..16c47a0616ae4 100644
---- a/drivers/bus/Makefile
-+++ b/drivers/bus/Makefile
-@@ -38,4 +38,4 @@ obj-$(CONFIG_VEXPRESS_CONFIG)        += vexpress-config.o
- obj-$(CONFIG_DA8XX_MSTPRI)    += da8xx-mstpri.o
- # MHI
--obj-$(CONFIG_MHI_BUS)         += mhi/
-+obj-y                         += mhi/
-diff --git a/drivers/bus/mhi/Kconfig b/drivers/bus/mhi/Kconfig
-index da5cd0c9fc620..4748df7f9cd58 100644
---- a/drivers/bus/mhi/Kconfig
-+++ b/drivers/bus/mhi/Kconfig
-@@ -2,30 +2,7 @@
- #
- # MHI bus
- #
--# Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
-+# Copyright (c) 2021, Linaro Ltd.
- #
--config MHI_BUS
--      tristate "Modem Host Interface (MHI) bus"
--      help
--        Bus driver for MHI protocol. Modem Host Interface (MHI) is a
--        communication protocol used by the host processors to control
--        and communicate with modem devices over a high speed peripheral
--        bus or shared memory.
--
--config MHI_BUS_DEBUG
--      bool "Debugfs support for the MHI bus"
--      depends on MHI_BUS && DEBUG_FS
--      help
--        Enable debugfs support for use with the MHI transport. Allows
--        reading and/or modifying some values within the MHI controller
--        for debug and test purposes.
--
--config MHI_BUS_PCI_GENERIC
--      tristate "MHI PCI controller driver"
--      depends on MHI_BUS
--      depends on PCI
--      help
--        This driver provides MHI PCI controller driver for devices such as
--        Qualcomm SDX55 based PCIe modems.
--
-+source "drivers/bus/mhi/host/Kconfig"
-diff --git a/drivers/bus/mhi/Makefile b/drivers/bus/mhi/Makefile
-index 0a2d778d6fb42..5f5708a249f54 100644
---- a/drivers/bus/mhi/Makefile
-+++ b/drivers/bus/mhi/Makefile
-@@ -1,6 +1,2 @@
--# core layer
--obj-y += core/
--
--obj-$(CONFIG_MHI_BUS_PCI_GENERIC) += mhi_pci_generic.o
--mhi_pci_generic-y += pci_generic.o
--
-+# Host MHI stack
-+obj-y += host/
-diff --git a/drivers/bus/mhi/host/Kconfig b/drivers/bus/mhi/host/Kconfig
-new file mode 100644
-index 0000000000000..da5cd0c9fc620
---- /dev/null
-+++ b/drivers/bus/mhi/host/Kconfig
-@@ -0,0 +1,31 @@
-+# SPDX-License-Identifier: GPL-2.0
-+#
-+# MHI bus
-+#
-+# Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
-+#
-+
-+config MHI_BUS
-+      tristate "Modem Host Interface (MHI) bus"
-+      help
-+        Bus driver for MHI protocol. Modem Host Interface (MHI) is a
-+        communication protocol used by the host processors to control
-+        and communicate with modem devices over a high speed peripheral
-+        bus or shared memory.
-+
-+config MHI_BUS_DEBUG
-+      bool "Debugfs support for the MHI bus"
-+      depends on MHI_BUS && DEBUG_FS
-+      help
-+        Enable debugfs support for use with the MHI transport. Allows
-+        reading and/or modifying some values within the MHI controller
-+        for debug and test purposes.
-+
-+config MHI_BUS_PCI_GENERIC
-+      tristate "MHI PCI controller driver"
-+      depends on MHI_BUS
-+      depends on PCI
-+      help
-+        This driver provides MHI PCI controller driver for devices such as
-+        Qualcomm SDX55 based PCIe modems.
-+
-diff --git a/drivers/bus/mhi/core/Makefile b/drivers/bus/mhi/host/Makefile
-similarity index 54%
-rename from drivers/bus/mhi/core/Makefile
-rename to drivers/bus/mhi/host/Makefile
-index c3feb4130aa37..859c2f38451c6 100644
---- a/drivers/bus/mhi/core/Makefile
-+++ b/drivers/bus/mhi/host/Makefile
-@@ -1,4 +1,6 @@
- obj-$(CONFIG_MHI_BUS) += mhi.o
--
- mhi-y := init.o main.o pm.o boot.o
- mhi-$(CONFIG_MHI_BUS_DEBUG) += debugfs.o
-+
-+obj-$(CONFIG_MHI_BUS_PCI_GENERIC) += mhi_pci_generic.o
-+mhi_pci_generic-y += pci_generic.o
-diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/host/boot.c
-similarity index 100%
-rename from drivers/bus/mhi/core/boot.c
-rename to drivers/bus/mhi/host/boot.c
-diff --git a/drivers/bus/mhi/core/debugfs.c b/drivers/bus/mhi/host/debugfs.c
-similarity index 100%
-rename from drivers/bus/mhi/core/debugfs.c
-rename to drivers/bus/mhi/host/debugfs.c
-diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/host/init.c
-similarity index 100%
-rename from drivers/bus/mhi/core/init.c
-rename to drivers/bus/mhi/host/init.c
-diff --git a/drivers/bus/mhi/core/internal.h b/drivers/bus/mhi/host/internal.h
-similarity index 100%
-rename from drivers/bus/mhi/core/internal.h
-rename to drivers/bus/mhi/host/internal.h
-diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/host/main.c
-similarity index 100%
-rename from drivers/bus/mhi/core/main.c
-rename to drivers/bus/mhi/host/main.c
-diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
-similarity index 100%
-rename from drivers/bus/mhi/pci_generic.c
-rename to drivers/bus/mhi/host/pci_generic.c
-diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/host/pm.c
-similarity index 100%
-rename from drivers/bus/mhi/core/pm.c
-rename to drivers/bus/mhi/host/pm.c
--- 
-2.39.2
-
index 7ed20692ecbc262047d598e88a608d936c27cd89..25ab15a14fed6e163b8317459f4ee0a728b6d9f7 100644 (file)
@@ -305,10 +305,6 @@ mailbox-zynq-switch-to-flexible-array-to-simplify-co.patch
 mailbox-zynqmp-fix-counts-of-child-nodes.patch
 dm-verity-skip-redundant-verity_handle_err-on-i-o-er.patch
 dm-verity-fix-error-handling-for-check_at_most_once-.patch
-bus-mhi-add-mhi-pci-support-for-wwan-modems.patch
-bus-mhi-add-mmio-region-length-to-controller-structu.patch
-bus-mhi-move-host-mhi-code-to-host-directory.patch
-bus-mhi-host-range-check-chdboff-and-erdboff.patch
 scsi-qedi-fix-use-after-free-bug-in-qedi_remove.patch
 net-ncsi-clear-tx-enable-mode-when-handling-a-config.patch
 net-sched-cls_api-remove-block_cb-from-driver_list-b.patch