Re: [PATCH v4 09/13] wifi: ath12k: Power up root PD
From: Raj Kumar Bhagat <hidden>
Date: 2025-01-29 18:32:19
Also in:
ath12k, linux-devicetree, lkml
On 12/10/2024 8:20 PM, Krzysztof Kozlowski wrote:
On 10/12/2024 08:41, Raj Kumar Bhagat wrote:quoted
+ +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.
will use of_parse_phandle() in next version.
quoted
+ 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.
Sure, will use dev_err_probe() in next version for all applicable probe error log.
quoted
+ return -EINVAL; + } + ab_ahb->tgt_rproc = prproc; + + return 0; +}Best regards, Krzysztof