mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] remoteproc: qcom_wcnss: Fix on platforms without fallback regulators
@ 2025-05-11 23:40 Matti Lehtimäki
  2025-05-12 14:09 ` Luca Weiss
  2025-05-13 20:42 ` (subset) " Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Matti Lehtimäki @ 2025-05-11 23:40 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Matti Lehtimäki,
	Bjorn Andersson, Mathieu Poirier, Luca Weiss, linux-remoteproc,
	linux-kernel

Recent change to handle platforms with only single power domain broke
pronto-v3 which requires power domains and doesn't have fallback voltage
regulators in case power domains are missing. Add a check to verify
the number of fallback voltage regulators before using the code which
handles single power domain situation.

Fixes: 65991ea8a6d1 ("remoteproc: qcom_wcnss: Handle platforms with only single power domain")
Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
---
 drivers/remoteproc/qcom_wcnss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index 775b056d795a..2c7e519a2254 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -456,7 +456,8 @@ static int wcnss_init_regulators(struct qcom_wcnss *wcnss,
 	if (wcnss->num_pds) {
 		info += wcnss->num_pds;
 		/* Handle single power domain case */
-		num_vregs += num_pd_vregs - wcnss->num_pds;
+		if (wcnss->num_pds < num_pd_vregs)
+			num_vregs += num_pd_vregs - wcnss->num_pds;
 	} else {
 		num_vregs += num_pd_vregs;
 	}
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] remoteproc: qcom_wcnss: Fix on platforms without fallback regulators
  2025-05-11 23:40 [PATCH 1/1] remoteproc: qcom_wcnss: Fix on platforms without fallback regulators Matti Lehtimäki
@ 2025-05-12 14:09 ` Luca Weiss
  2025-05-13 20:42 ` (subset) " Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Luca Weiss @ 2025-05-12 14:09 UTC (permalink / raw)
  To: Matti Lehtimäki, linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Bjorn Andersson,
	Mathieu Poirier, Luca Weiss, linux-remoteproc, linux-kernel

On Mon May 12, 2025 at 12:40 AM WEST, Matti Lehtimäki wrote:
> Recent change to handle platforms with only single power domain broke
> pronto-v3 which requires power domains and doesn't have fallback voltage
> regulators in case power domains are missing. Add a check to verify
> the number of fallback voltage regulators before using the code which
> handles single power domain situation.

Thanks!

I've tested this on MSM8953/SDM632 Fairphone 3 which is broken on
v6.15-rc5 without this patch! I've also heard of MSM8909 being broken in
v6.15-rc, and msm8976 also uses qcom,pronto-v3-pil.

Hopefully this can still go into the remaining rc's so v6.15 final works.

Tested-by: Luca Weiss <luca.weiss@fairphone.com> # sdm632-fairphone-fp3

Regards
Luca

>
> Fixes: 65991ea8a6d1 ("remoteproc: qcom_wcnss: Handle platforms with only single power domain")
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> ---
>  drivers/remoteproc/qcom_wcnss.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
> index 775b056d795a..2c7e519a2254 100644
> --- a/drivers/remoteproc/qcom_wcnss.c
> +++ b/drivers/remoteproc/qcom_wcnss.c
> @@ -456,7 +456,8 @@ static int wcnss_init_regulators(struct qcom_wcnss *wcnss,
>  	if (wcnss->num_pds) {
>  		info += wcnss->num_pds;
>  		/* Handle single power domain case */
> -		num_vregs += num_pd_vregs - wcnss->num_pds;
> +		if (wcnss->num_pds < num_pd_vregs)
> +			num_vregs += num_pd_vregs - wcnss->num_pds;
>  	} else {
>  		num_vregs += num_pd_vregs;
>  	}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (subset) [PATCH 1/1] remoteproc: qcom_wcnss: Fix on platforms without fallback regulators
  2025-05-11 23:40 [PATCH 1/1] remoteproc: qcom_wcnss: Fix on platforms without fallback regulators Matti Lehtimäki
  2025-05-12 14:09 ` Luca Weiss
@ 2025-05-13 20:42 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2025-05-13 20:42 UTC (permalink / raw)
  To: linux-arm-msm, Matti Lehtimäki
  Cc: ~postmarketos/upstreaming, phone-devel, Mathieu Poirier,
	Luca Weiss, linux-remoteproc, linux-kernel


On Mon, 12 May 2025 02:40:15 +0300, Matti Lehtimäki wrote:
> Recent change to handle platforms with only single power domain broke
> pronto-v3 which requires power domains and doesn't have fallback voltage
> regulators in case power domains are missing. Add a check to verify
> the number of fallback voltage regulators before using the code which
> handles single power domain situation.
> 
> 
> [...]

Applied, thanks!

[1/1] remoteproc: qcom_wcnss: Fix on platforms without fallback regulators
      commit: 4ca45af0a56d00b86285d6fdd720dca3215059a7

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-13 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-11 23:40 [PATCH 1/1] remoteproc: qcom_wcnss: Fix on platforms without fallback regulators Matti Lehtimäki
2025-05-12 14:09 ` Luca Weiss
2025-05-13 20:42 ` (subset) " Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®