[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200921160815.28071-18-manivannan.sadhasivam@linaro.org>
Date: Mon, 21 Sep 2020 21:38:13 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: gregkh@...uxfoundation.org
Cc: hemantk@...eaurora.org, jhugo@...eaurora.org,
bbhatt@...eaurora.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Loic Poulain <loic.poulain@...aro.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Subject: [PATCH 16/18] bus: mhi: core: Allow shared IRQ for event rings
From: Loic Poulain <loic.poulain@...aro.org>
There is no requirement for using a dedicated IRQ per event ring.
Some systems does not support multiple MSI vectors (e.g. intel
without CONFIG_IRQ_REMAP), In that case the MHI controller can
configure all the event rings to use the same interrupt (as fallback).
Allow this by removing the nr_irqs = ev_ring test and add extra check
in the irq_setup function.
Signed-off-by: Loic Poulain <loic.poulain@...aro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
---
drivers/bus/mhi/core/init.c | 7 +++++++
drivers/bus/mhi/core/pm.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
index 1b4161eaf0d8..049a10fa42d7 100644
--- a/drivers/bus/mhi/core/init.c
+++ b/drivers/bus/mhi/core/init.c
@@ -176,6 +176,13 @@ int mhi_init_irq_setup(struct mhi_controller *mhi_cntrl)
if (mhi_event->offload_ev)
continue;
+ if (mhi_event->irq >= mhi_cntrl->nr_irqs) {
+ dev_err(dev, "irq %d not available for event ring\n",
+ mhi_event->irq);
+ ret = -EINVAL;
+ goto error_request;
+ }
+
ret = request_irq(mhi_cntrl->irq[mhi_event->irq],
mhi_irq_handler,
IRQF_SHARED | IRQF_NO_SUSPEND,
diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
index ce4d969818b4..3de7b1639ec6 100644
--- a/drivers/bus/mhi/core/pm.c
+++ b/drivers/bus/mhi/core/pm.c
@@ -918,7 +918,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
dev_info(dev, "Requested to power ON\n");
- if (mhi_cntrl->nr_irqs < mhi_cntrl->total_ev_rings)
+ if (mhi_cntrl->nr_irqs < 1)
return -EINVAL;
/* Supply default wake routines if not provided by controller driver */
--
2.17.1
Powered by blists - more mailing lists