* [PATCH v2] remoteproc: stm32: improve debug using dev_err_probe
@ 2020-12-17 14:41 Arnaud Pouliquen
2021-02-09 8:35 ` Arnaud POULIQUEN
2021-02-09 17:40 ` patchwork-bot+linux-remoteproc
0 siblings, 2 replies; 3+ messages in thread
From: Arnaud Pouliquen @ 2020-12-17 14:41 UTC (permalink / raw)
To: Bjorn Andersson, Ohad Ben-Cohen, Mathieu Poirier
Cc: linux-remoteproc, linux-kernel, linux-stm32, arnaud.pouliquen
From: Arnaud Pouliquen <arnaud.pouliquen@foss-st.com>
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error.
The benefit is that DEFER issue will be logged in the devices_deferred
debugfs file.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss-st.com>
---
V1 to V2: As suggested by Ahmad Fatoum use dev_err_probe to deal with
deferred cases
V1: https://www.spinics.net/lists/kernel/msg3765884.html
---
drivers/remoteproc/stm32_rproc.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index a180aeae9675..ccb3c14a0023 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -370,8 +370,13 @@ static int stm32_rproc_request_mbox(struct rproc *rproc)
ddata->mb[i].chan = mbox_request_channel_byname(cl, name);
if (IS_ERR(ddata->mb[i].chan)) {
- if (PTR_ERR(ddata->mb[i].chan) == -EPROBE_DEFER)
+ if (PTR_ERR(ddata->mb[i].chan) == -EPROBE_DEFER) {
+ dev_err_probe(dev->parent,
+ PTR_ERR(ddata->mb[i].chan),
+ "failed to request mailbox %s\n",
+ name);
goto err_probe;
+ }
dev_warn(dev, "cannot get %s mbox\n", name);
ddata->mb[i].chan = NULL;
}
@@ -592,15 +597,14 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
irq = platform_get_irq(pdev, 0);
if (irq == -EPROBE_DEFER)
- return -EPROBE_DEFER;
+ return dev_err_probe(dev, irq, "failed to get interrupt\n");
if (irq > 0) {
err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
dev_name(dev), pdev);
- if (err) {
- dev_err(dev, "failed to request wdg irq\n");
- return err;
- }
+ if (err)
+ return dev_err_probe(dev, err,
+ "failed to request wdg irq\n");
ddata->wdg_irq = irq;
@@ -613,10 +617,9 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
}
ddata->rst = devm_reset_control_get_by_index(dev, 0);
- if (IS_ERR(ddata->rst)) {
- dev_err(dev, "failed to get mcu reset\n");
- return PTR_ERR(ddata->rst);
- }
+ if (IS_ERR(ddata->rst))
+ return dev_err_probe(dev, PTR_ERR(ddata->rst),
+ "failed to get mcu_reset\n");
/*
* if platform is secured the hold boot bit must be written by
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] remoteproc: stm32: improve debug using dev_err_probe
2020-12-17 14:41 [PATCH v2] remoteproc: stm32: improve debug using dev_err_probe Arnaud Pouliquen
@ 2021-02-09 8:35 ` Arnaud POULIQUEN
2021-02-09 17:40 ` patchwork-bot+linux-remoteproc
1 sibling, 0 replies; 3+ messages in thread
From: Arnaud POULIQUEN @ 2021-02-09 8:35 UTC (permalink / raw)
To: Bjorn Andersson, Ohad Ben-Cohen, Mathieu Poirier
Cc: linux-remoteproc, linux-kernel, linux-stm32
Hi,
Gentle reminder, in case it has been forgotten.
Thanks,
Arnaud
On 12/17/20 3:41 PM, Arnaud Pouliquen wrote:
> From: Arnaud Pouliquen <arnaud.pouliquen@foss-st.com>
>
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error.
> The benefit is that DEFER issue will be logged in the devices_deferred
> debugfs file.
>
> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss-st.com>
> ---
> V1 to V2: As suggested by Ahmad Fatoum use dev_err_probe to deal with
> deferred cases
>
> V1: https://www.spinics.net/lists/kernel/msg3765884.html
> ---
>
> drivers/remoteproc/stm32_rproc.c | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
> index a180aeae9675..ccb3c14a0023 100644
> --- a/drivers/remoteproc/stm32_rproc.c
> +++ b/drivers/remoteproc/stm32_rproc.c
> @@ -370,8 +370,13 @@ static int stm32_rproc_request_mbox(struct rproc *rproc)
>
> ddata->mb[i].chan = mbox_request_channel_byname(cl, name);
> if (IS_ERR(ddata->mb[i].chan)) {
> - if (PTR_ERR(ddata->mb[i].chan) == -EPROBE_DEFER)
> + if (PTR_ERR(ddata->mb[i].chan) == -EPROBE_DEFER) {
> + dev_err_probe(dev->parent,
> + PTR_ERR(ddata->mb[i].chan),
> + "failed to request mailbox %s\n",
> + name);
> goto err_probe;
> + }
> dev_warn(dev, "cannot get %s mbox\n", name);
> ddata->mb[i].chan = NULL;
> }
> @@ -592,15 +597,14 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
>
> irq = platform_get_irq(pdev, 0);
> if (irq == -EPROBE_DEFER)
> - return -EPROBE_DEFER;
> + return dev_err_probe(dev, irq, "failed to get interrupt\n");
>
> if (irq > 0) {
> err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
> dev_name(dev), pdev);
> - if (err) {
> - dev_err(dev, "failed to request wdg irq\n");
> - return err;
> - }
> + if (err)
> + return dev_err_probe(dev, err,
> + "failed to request wdg irq\n");
>
> ddata->wdg_irq = irq;
>
> @@ -613,10 +617,9 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
> }
>
> ddata->rst = devm_reset_control_get_by_index(dev, 0);
> - if (IS_ERR(ddata->rst)) {
> - dev_err(dev, "failed to get mcu reset\n");
> - return PTR_ERR(ddata->rst);
> - }
> + if (IS_ERR(ddata->rst))
> + return dev_err_probe(dev, PTR_ERR(ddata->rst),
> + "failed to get mcu_reset\n");
>
> /*
> * if platform is secured the hold boot bit must be written by
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] remoteproc: stm32: improve debug using dev_err_probe
2020-12-17 14:41 [PATCH v2] remoteproc: stm32: improve debug using dev_err_probe Arnaud Pouliquen
2021-02-09 8:35 ` Arnaud POULIQUEN
@ 2021-02-09 17:40 ` patchwork-bot+linux-remoteproc
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2021-02-09 17:40 UTC (permalink / raw)
To: Arnaud POULIQUEN; +Cc: linux-remoteproc
Hello:
This patch was applied to andersson/remoteproc.git (refs/heads/for-next):
On Thu, 17 Dec 2020 15:41:25 +0100 you wrote:
> From: Arnaud Pouliquen <arnaud.pouliquen@foss-st.com>
>
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error.
> The benefit is that DEFER issue will be logged in the devices_deferred
> debugfs file.
>
> [...]
Here is the summary with links:
- [v2] remoteproc: stm32: improve debug using dev_err_probe
https://git.kernel.org/andersson/remoteproc/c/cf34838d591f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-09 17:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 14:41 [PATCH v2] remoteproc: stm32: improve debug using dev_err_probe Arnaud Pouliquen
2021-02-09 8:35 ` Arnaud POULIQUEN
2021-02-09 17:40 ` patchwork-bot+linux-remoteproc
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.