2021-04-07 21:29:30

by Suman Anna

[permalink] [raw]
Subject: [PATCH v2 0/3] PRU firmware event/interrupt mapping fixes

Hi All,

The following is a minor revised version of the series [1] that includes fixes
for various different issues associated with the PRU firmware event/interrupt
mapping configuration logic. Please see the v1 cover-letter [1] for additional
details.

There are currently no in-kernel dts nodes yet in mainline kernel (first
nodes will appear in v5.13-rc1) so these can be picked up for either v5.13
merge window or the current -rc cycle.

Changes in v2:
- Picked up Reviewed-by tags on Patches 1 and 2
- Revised Patch 3 to address additional error cleanup paths as
pointed out by Mathieu.

regards
Suman

[1] https://patchwork.kernel.org/project/linux-remoteproc/cover/[email protected]/

Suman Anna (3):
remoteproc: pru: Fixup interrupt-parent logic for fw events
remoteproc: pru: Fix wrong success return value for fw events
remoteproc: pru: Fix and cleanup firmware interrupt mapping logic

drivers/remoteproc/pru_rproc.c | 41 ++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 9 deletions(-)

--
2.30.1


2021-04-07 22:40:17

by Suman Anna

[permalink] [raw]
Subject: [PATCH v2 2/3] remoteproc: pru: Fix wrong success return value for fw events

The irq_create_fwspec_mapping() returns a proper virq value on success
and 0 upon any failure. The pru_handle_intrmap() treats this as an error
and disposes all firmware event mappings correctly, but is returning
this incorrect value as is, letting the pru_rproc_start() interpret it
as a success and boot the PRU.

Fix this by returning an error value back upon any such failure. While
at this, revise the error trace to print some meaningful info about the
failed event.

Fixes: c75c9fdac66e ("remoteproc: pru: Add support for PRU specific interrupt configuration")
Signed-off-by: Suman Anna <[email protected]>
Reviewed-by: Mathieu Poirier <[email protected]>
---
v2:
- No changes, picked up Reviewed-by tag
v1: https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/

drivers/remoteproc/pru_rproc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c
index a9d07c0751be..87b43976c51b 100644
--- a/drivers/remoteproc/pru_rproc.c
+++ b/drivers/remoteproc/pru_rproc.c
@@ -339,8 +339,10 @@ static int pru_handle_intrmap(struct rproc *rproc)

pru->mapped_irq[i] = irq_create_fwspec_mapping(&fwspec);
if (!pru->mapped_irq[i]) {
- dev_err(dev, "failed to get virq\n");
- ret = pru->mapped_irq[i];
+ dev_err(dev, "failed to get virq for fw mapping %d: event %d chnl %d host %d\n",
+ i, fwspec.param[0], fwspec.param[1],
+ fwspec.param[2]);
+ ret = -EINVAL;
goto map_fail;
}
}
--
2.30.1

2021-04-14 05:24:36

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] PRU firmware event/interrupt mapping fixes

Hi Bjorn,

On 4/7/21 10:56 AM, Suman Anna wrote:
> Hi All,
>
> The following is a minor revised version of the series [1] that includes fixes
> for various different issues associated with the PRU firmware event/interrupt
> mapping configuration logic. Please see the v1 cover-letter [1] for additional
> details.
>
> There are currently no in-kernel dts nodes yet in mainline kernel (first
> nodes will appear in v5.13-rc1) so these can be picked up for either v5.13
> merge window or the current -rc cycle.
>
> Changes in v2:
> - Picked up Reviewed-by tags on Patches 1 and 2
> - Revised Patch 3 to address additional error cleanup paths as
> pointed out by Mathieu.

All patches are reviewed now, so can you please pick these up for the next merge
window if not already in your queue.

regards
Suman

>
> regards
> Suman
>
> [1] https://patchwork.kernel.org/project/linux-remoteproc/cover/[email protected]/
>
> Suman Anna (3):
> remoteproc: pru: Fixup interrupt-parent logic for fw events
> remoteproc: pru: Fix wrong success return value for fw events
> remoteproc: pru: Fix and cleanup firmware interrupt mapping logic
>
> drivers/remoteproc/pru_rproc.c | 41 ++++++++++++++++++++++++++--------
> 1 file changed, 32 insertions(+), 9 deletions(-)
>