Thread (27 messages) 27 messages, 2 authors, 2025-01-29

Re: [PATCH v4 09/13] wifi: ath12k: Power up root PD

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2024-12-10 14:50:41
Also in: ath12k, linux-devicetree, lkml

On 10/12/2024 08:41, Raj Kumar Bhagat wrote:
+
+static void ath12k_ahb_unregister_rproc_notifier(struct ath12k_base *ab)
+{
+	struct ath12k_ahb *ab_ahb = ath12k_ab_to_ahb(ab);
+
+	if (!ab_ahb->root_pd_notifier) {
+		ath12k_err(ab, "Rproc notifier not registered\n");
+		return;
+	}
+
+	qcom_unregister_ssr_notifier(ab_ahb->root_pd_notifier,
+				     &ab_ahb->root_pd_nb);
+}
+
+static int ath12k_ahb_get_rproc(struct ath12k_base *ab)
+{
+	struct ath12k_ahb *ab_ahb = ath12k_ab_to_ahb(ab);
+	struct device *dev = ab->dev;
+	struct rproc *prproc;
+	phandle rproc_phandle;
+
+	if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) {
You are not supposed to read phandles as numbers but use proper phandle
parsing API. See of.h, e.g. of_parse_phandle.
+		ath12k_err(ab, "failed to get q6_rproc handle\n");
+		return -ENOENT;
+	}
+
+	prproc = rproc_get_by_phandle(rproc_phandle);
+	if (!prproc) {
+		ath12k_err(ab, "failed to get rproc\n");
This is supposed to be dev_err_probe. Lack of handling deferred probes
and resulting dmesg flood is all over your code. You need to start
supporting defer.
+		return -EINVAL;
+	}
+	ab_ahb->tgt_rproc = prproc;
+
+	return 0;
+}



Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help