2022-11-18 10:09:57

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 1/2] remoteproc: qcom_q6v5_pas: disable wakeup on probe fail or remove

Leaving wakeup enabled during probe fail (-EPROBE_DEFER) or remove makes
the subsequent probe fail.

[ 3.749454] remoteproc remoteproc0: releasing 3000000.remoteproc
[ 3.752949] qcom_q6v5_pas: probe of 3000000.remoteproc failed with error -17
[ 3.878935] remoteproc remoteproc0: releasing 4080000.remoteproc
[ 3.887602] qcom_q6v5_pas: probe of 4080000.remoteproc failed with error -17
[ 4.319552] remoteproc remoteproc0: releasing 8300000.remoteproc
[ 4.332716] qcom_q6v5_pas: probe of 8300000.remoteproc failed with error -17

Fix this by disabling wakeup in both cases so the driver can properly
probe on the next try.

Fixes: a781e5aa5911 ("remoteproc: core: Prevent system suspend during remoteproc recovery")
Fixes: dc86c129b4fb ("remoteproc: qcom: pas: Mark devices as wakeup capable")
Reviewed-by: Mukesh Ojha <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
---
Changes in v2:
* move new line before rproc_free which frees 'adsp' as well
* pick up tags

drivers/remoteproc/qcom_q6v5_pas.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index 6afd0941e552..67f5152e2398 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -556,6 +556,7 @@ static int adsp_probe(struct platform_device *pdev)
detach_proxy_pds:
adsp_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
free_rproc:
+ device_init_wakeup(adsp->dev, false);
rproc_free(rproc);

return ret;
@@ -572,6 +573,7 @@ static int adsp_remove(struct platform_device *pdev)
qcom_remove_sysmon_subdev(adsp->sysmon);
qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev);
qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev);
+ device_init_wakeup(adsp->dev, false);
rproc_free(adsp->rproc);

return 0;
--
2.38.1



2022-11-18 14:28:21

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] remoteproc: qcom_q6v5_pas: disable wakeup on probe fail or remove



On 18/11/2022 09:08, Luca Weiss wrote:
> Leaving wakeup enabled during probe fail (-EPROBE_DEFER) or remove makes
> the subsequent probe fail.
>
> [ 3.749454] remoteproc remoteproc0: releasing 3000000.remoteproc
> [ 3.752949] qcom_q6v5_pas: probe of 3000000.remoteproc failed with error -17
> [ 3.878935] remoteproc remoteproc0: releasing 4080000.remoteproc
> [ 3.887602] qcom_q6v5_pas: probe of 4080000.remoteproc failed with error -17
> [ 4.319552] remoteproc remoteproc0: releasing 8300000.remoteproc
> [ 4.332716] qcom_q6v5_pas: probe of 8300000.remoteproc failed with error -17
>
> Fix this by disabling wakeup in both cases so the driver can properly
> probe on the next try.
>
> Fixes: a781e5aa5911 ("remoteproc: core: Prevent system suspend during remoteproc recovery")
> Fixes: dc86c129b4fb ("remoteproc: qcom: pas: Mark devices as wakeup capable")
> Reviewed-by: Mukesh Ojha <[email protected]>
> Signed-off-by: Luca Weiss <[email protected]>

Reviewed-by: Caleb Connolly <[email protected]>
> ---
> Changes in v2:
> * move new line before rproc_free which frees 'adsp' as well
> * pick up tags
>
> drivers/remoteproc/qcom_q6v5_pas.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index 6afd0941e552..67f5152e2398 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -556,6 +556,7 @@ static int adsp_probe(struct platform_device *pdev)
> detach_proxy_pds:
> adsp_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
> free_rproc:
> + device_init_wakeup(adsp->dev, false);
> rproc_free(rproc);
>
> return ret;
> @@ -572,6 +573,7 @@ static int adsp_remove(struct platform_device *pdev)
> qcom_remove_sysmon_subdev(adsp->sysmon);
> qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev);
> qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev);
> + device_init_wakeup(adsp->dev, false);
> rproc_free(adsp->rproc);
>
> return 0;
> --
> 2.38.1
>

--
Kind Regards,
Caleb (they/them)

2022-12-07 16:24:59

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 1/2] remoteproc: qcom_q6v5_pas: disable wakeup on probe fail or remove

On Fri, 18 Nov 2022 10:08:15 +0100, Luca Weiss wrote:
> Leaving wakeup enabled during probe fail (-EPROBE_DEFER) or remove makes
> the subsequent probe fail.
>
> [ 3.749454] remoteproc remoteproc0: releasing 3000000.remoteproc
> [ 3.752949] qcom_q6v5_pas: probe of 3000000.remoteproc failed with error -17
> [ 3.878935] remoteproc remoteproc0: releasing 4080000.remoteproc
> [ 3.887602] qcom_q6v5_pas: probe of 4080000.remoteproc failed with error -17
> [ 4.319552] remoteproc remoteproc0: releasing 8300000.remoteproc
> [ 4.332716] qcom_q6v5_pas: probe of 8300000.remoteproc failed with error -17
>
> [...]

Applied, thanks!

[1/2] remoteproc: qcom_q6v5_pas: disable wakeup on probe fail or remove
commit: 9a70551996e699fda262e8d54bbd41739d7aad6d
[2/2] remoteproc: qcom_q6v5_pas: detach power domains on remove
commit: 34d01df00b84127be04c914fc9f8e8be1fcdf851

Best regards,
--
Bjorn Andersson <[email protected]>