diff options
author | Loic Poulain <loic.poulain@linaro.org> | 2020-09-29 20:52:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-02 12:33:47 +0300 |
commit | b0fc0167f25401a5dd0325a935e3a20d1da2aa0b (patch) | |
tree | c917d58f11bf2d27851b9b34ad18563961582f21 /drivers/bus/mhi/core/init.c | |
parent | 21cb9b18edea0c3533799069abc95c9c55c8607d (diff) | |
download | linux-b0fc0167f25401a5dd0325a935e3a20d1da2aa0b.tar.xz |
bus: mhi: core: Allow shared IRQ for event rings
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.
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20200929175218.8178-17-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bus/mhi/core/init.c')
-rw-r--r-- | drivers/bus/mhi/core/init.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index a33665b7ee54..103d51f35e28 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -162,6 +162,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, |