Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51642e13 authored by Sireesh Kodali's avatar Sireesh Kodali Committed by Greg Kroah-Hartman
Browse files

remoteproc: qcom: wcnss: Fix handling of IRQs



[ Upstream commit bed0adac1ded4cb486ba19a3a7e730fbd9a1c9c6 ]

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: aed361ad ("remoteproc: qcom: Introduce WCNSS peripheral image loader")
Signed-off-by: default avatarSireesh Kodali <sireeshkodali1@gmail.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220526141740.15834-2-sireeshkodali1@gmail.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fbf97956
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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,16 +418,21 @@ 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 the IRQ number if the IRQ was successfully acquired */
	return irq_number;
}

static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss)
{
	struct device_node *node;