Skip to contentSkip to conversation

remoteproc: qcom: Fix handling of WCNSS IRQs

PATCH Applied Sireesh Kodali 4 participants 7 messages May 26, 2022 – Jul 3, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover remoteproc: qcom: Fix handling of WCNSS IRQs

Hi,

Due to a bug in the code that fetches the IRQs from the device tree, the optional "stop-ack" IRQ was never used, even if it was defined in the device tree. This also allowed a typo in the MSM8916 SoC device tree, where the "stop-ack" irq was instead labeled "stop".

The attached patches fix the handling of IRQs in the code, and fix the typo in the MSM8916 device tree.

Changes since v1:
* Dropped blank lines between tags in commit message

Sireesh Kodali (2):
remoteproc: qcom: wcnss: Fix handling of IRQs
arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node

 arch/arm64/boot/dts/qcom/msm8916.dtsi |  4 ++--
 drivers/remoteproc/qcom_wcnss.c       | 10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
Signature · 1 line
2.36.1
#1 lore raw

PATCH v2 1/2 remoteproc: qcom: wcnss: Fix handling of IRQs

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 aed361adca9f ("remoteproc: qcom: Introduce WCNSS peripheral image loader")
---
 drivers/remoteproc/qcom_wcnss.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/remoteproc/qcom_wcnss.c +8 -2
index 9a223d394087..68f37296b151 100644
@@ -467,6 +467,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) {
@@ -477,14 +478,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)
Signature · 1 line
2.36.1
#2 lore raw

PATCH v2 2/2 arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node

In reply to Sireesh Kodali

The smem-state properties for the pronto node were incorrectly labelled, reading qcom,state* rather than qcom,smem-state*. Fix that, allowing the stop state to be used.

Fixes 88106096cbf8 ("ARM: dts: msm8916: Add and enable wcnss node")
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +2 -2
index e34963505e07..7ecd747dc624 100644
@@ -1758,8 +1758,8 @@ pronto: remoteproc@a21b000 {
 					<&rpmpd MSM8916_VDDMX>;
 			power-domain-names = "cx", "mx";
 
-			qcom,state = <&wcnss_smp2p_out 0>;
-			qcom,state-names = "stop";
+			qcom,smem-states = <&wcnss_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&wcnss_pin_a>;
Signature · 1 line
2.36.1
Reviewed-by on v2 2/2
#3 lore raw

Re: [PATCH v2 2/2] arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node

Quoted 6 lines · Sireesh Kodali

The smem-state properties for the pronto node were incorrectly labelled, reading qcom,state* rather than qcom,smem-state*. Fix that, allowing the stop state to be used.

Fixes 88106096cbf8 ("ARM: dts: msm8916: Add and enable wcnss node")

My review didn't change just because of an unneeded blank line between the tags. Thanks again for finding this. :)

Quoted 22 lines
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +2 -2
index e34963505e07..7ecd747dc624 100644
@@ -1758,8 +1758,8 @@ pronto: remoteproc@a21b000 {
 					<&rpmpd MSM8916_VDDMX>;
 			power-domain-names = "cx", "mx";
 
-			qcom,state = <&wcnss_smp2p_out 0>;
-			qcom,state-names = "stop";
+			qcom,smem-states = <&wcnss_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&wcnss_pin_a>;
Signature · 1 line
2.36.1
Reviewed-by on v2 2/2
#4 lore raw

Re: [PATCH v2 2/2] arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node

In reply to Sireesh Kodali
Quoted 6 lines · Sireesh Kodali

The smem-state properties for the pronto node were incorrectly labelled, reading qcom,state* rather than qcom,smem-state*. Fix that, allowing the stop state to be used.

Fixes 88106096cbf8 ("ARM: dts: msm8916: Add and enable wcnss node")

Include please acquired tags when sending a new version.

Best regards,
Krzysztof

#6 lore raw
In reply to Sireesh Kodali
Quoted 9 lines · Sireesh Kodali

Due to a bug in the code that fetches the IRQs from the device tree, the optional "stop-ack" IRQ was never used, even if it was defined in the device tree. This also allowed a typo in the MSM8916 SoC device tree, where the "stop-ack" irq was instead labeled "stop".

The attached patches fix the handling of IRQs in the code, and fix the typo in the MSM8916 device tree.

[...]

Applied, thanks!

[1/2] remoteproc: qcom: wcnss: Fix handling of IRQs
(no commit info)
[2/2] arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node

      commit: 5458d6f2827cd30218570f266b8d238417461f2f

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>
#5 lore raw

Re: (subset) [PATCH v2 2/2] arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node

In reply to Sireesh Kodali
Quoted 5 lines · Sireesh Kodali

The smem-state properties for the pronto node were incorrectly labelled, reading qcom,state* rather than qcom,smem-state*. Fix that, allowing the stop state to be used.

Applied, thanks!

[2/2] arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node

      commit: 5458d6f2827cd30218570f266b8d238417461f2f

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>