]> git.baikalelectronics.ru Git - kernel.git/commitdiff
remoteproc: qcom: wcnss: Fix handling of IRQs
authorSireesh Kodali <sireeshkodali1@gmail.com>
Thu, 26 May 2022 14:17:39 +0000 (19:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:02 +0000 (11:18 +0200)
[ Upstream commit 506eaf6fe7401aa3f7b1cc8c842e2caabfbb1ee0 ]

The wcnss_get_irq function is expected to return a value > 0 in the
event that an IRQ is succssfully obtained, but it instead returns 0.
This causes the stop and ready IRQs to never actually be used despite
being defined in the device-tree. This patch fixes that.

Fixes: b0354c437fc6 ("remoteproc: qcom: Introduce WCNSS peripheral image loader")
Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220526141740.15834-2-sireeshkodali1@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/qcom_wcnss.c

index c72f1b3b6085829eea94ae493defbedd27cc5309..18431ac098224b95f06940b3185b7bbccbb196c4 100644 (file)
@@ -407,6 +407,7 @@ static int wcnss_request_irq(struct qcom_wcnss *wcnss,
                             irq_handler_t thread_fn)
 {
        int ret;
+       int irq_number;
 
        ret = platform_get_irq_byname(pdev, name);
        if (ret < 0 && optional) {
@@ -417,14 +418,19 @@ static int wcnss_request_irq(struct qcom_wcnss *wcnss,
                return ret;
        }
 
+       irq_number = ret;
+
        ret = devm_request_threaded_irq(&pdev->dev, ret,
                                        NULL, thread_fn,
                                        IRQF_TRIGGER_RISING | IRQF_ONESHOT,
                                        "wcnss", wcnss);
-       if (ret)
+       if (ret) {
                dev_err(&pdev->dev, "request %s IRQ failed\n", name);
+               return ret;
+       }
 
-       return ret;
+       /* Return the IRQ number if the IRQ was successfully acquired */
+       return irq_number;
 }
 
 static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss)