linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "remoteproc: core: Clear table_sz when rproc_shutdown"
@ 2025-05-13 15:52 Bjorn Andersson
  2025-05-15 17:21 ` Andrew Davis
  2025-05-15 19:16 ` Mathieu Poirier
  0 siblings, 2 replies; 4+ messages in thread
From: Bjorn Andersson @ 2025-05-13 15:52 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel, Bjorn Andersson

Clearing the table_sz on cleanup seemed reasonable, but further
discussions concluded that this merely working around the issue
and that the fix is incomplete.

As such, revert commit efdde3d73ab2 ("remoteproc: core: Clear table_sz
when rproc_shutdown") to avoid carrying a partial fix.

Signed-off-by: Bjorn Andersson <andersson@kernel.org>
---
 drivers/remoteproc/remoteproc_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 48d146e1fa560397c11eeb8f824ae0fb844a022b..81b2ccf988e852ac79cee375c7e3f118c2a4b41a 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -2025,7 +2025,6 @@ int rproc_shutdown(struct rproc *rproc)
 	kfree(rproc->cached_table);
 	rproc->cached_table = NULL;
 	rproc->table_ptr = NULL;
-	rproc->table_sz = 0;
 out:
 	mutex_unlock(&rproc->lock);
 	return ret;

---
base-commit: aa94665adc28f3fdc3de2979ac1e98bae961d6ca
change-id: 20250513-revert-rproc-table-sz-53ecf24726ae

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


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

* Re: [PATCH] Revert "remoteproc: core: Clear table_sz when rproc_shutdown"
  2025-05-13 15:52 [PATCH] Revert "remoteproc: core: Clear table_sz when rproc_shutdown" Bjorn Andersson
@ 2025-05-15 17:21 ` Andrew Davis
  2025-05-15 17:57   ` Mathieu Poirier
  2025-05-15 19:16 ` Mathieu Poirier
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Davis @ 2025-05-15 17:21 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel

On 5/13/25 10:52 AM, Bjorn Andersson wrote:
> Clearing the table_sz on cleanup seemed reasonable, but further
> discussions concluded that this merely working around the issue
> and that the fix is incomplete.
> 
> As such, revert commit efdde3d73ab2 ("remoteproc: core: Clear table_sz
> when rproc_shutdown") to avoid carrying a partial fix.
> 

Setting table_sz to 0 still seems like a good idea from a defensive
programming perspective. Both table_ptr and table_sz should be set
and cleared together in all spots.

In addition to this, another fix would be to also update
both table_ptr and table_sz to 0 when loading firmware without
a resource table. Both should be done, no need to revert this.

Andrew

> Signed-off-by: Bjorn Andersson <andersson@kernel.org>
> ---
>   drivers/remoteproc/remoteproc_core.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 48d146e1fa560397c11eeb8f824ae0fb844a022b..81b2ccf988e852ac79cee375c7e3f118c2a4b41a 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -2025,7 +2025,6 @@ int rproc_shutdown(struct rproc *rproc)
>   	kfree(rproc->cached_table);
>   	rproc->cached_table = NULL;
>   	rproc->table_ptr = NULL;
> -	rproc->table_sz = 0;
>   out:
>   	mutex_unlock(&rproc->lock);
>   	return ret;
> 
> ---
> base-commit: aa94665adc28f3fdc3de2979ac1e98bae961d6ca
> change-id: 20250513-revert-rproc-table-sz-53ecf24726ae
> 
> Best regards,

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

* Re: [PATCH] Revert "remoteproc: core: Clear table_sz when rproc_shutdown"
  2025-05-15 17:21 ` Andrew Davis
@ 2025-05-15 17:57   ` Mathieu Poirier
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2025-05-15 17:57 UTC (permalink / raw)
  To: Andrew Davis
  Cc: Bjorn Andersson, linux-arm-msm, linux-remoteproc, linux-kernel

On Thu, May 15, 2025 at 12:21:14PM -0500, Andrew Davis wrote:
> On 5/13/25 10:52 AM, Bjorn Andersson wrote:
> > Clearing the table_sz on cleanup seemed reasonable, but further
> > discussions concluded that this merely working around the issue
> > and that the fix is incomplete.
> > 
> > As such, revert commit efdde3d73ab2 ("remoteproc: core: Clear table_sz
> > when rproc_shutdown") to avoid carrying a partial fix.
> > 
> 
> Setting table_sz to 0 still seems like a good idea from a defensive
> programming perspective. Both table_ptr and table_sz should be set
> and cleared together in all spots.
> 
> In addition to this, another fix would be to also update
> both table_ptr and table_sz to 0 when loading firmware without
> a resource table. Both should be done, no need to revert this.
>

As mentioned by Bjorn, this is a partial fix.  I'm all good with setting
table_sz to 0, but as long as the real solution to the problem is part of the
same work.  Once the patch is reverted, which I'm about to apply, work can
continue.

> Andrew
> 
> > Signed-off-by: Bjorn Andersson <andersson@kernel.org>
> > ---
> >   drivers/remoteproc/remoteproc_core.c | 1 -
> >   1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> > index 48d146e1fa560397c11eeb8f824ae0fb844a022b..81b2ccf988e852ac79cee375c7e3f118c2a4b41a 100644
> > --- a/drivers/remoteproc/remoteproc_core.c
> > +++ b/drivers/remoteproc/remoteproc_core.c
> > @@ -2025,7 +2025,6 @@ int rproc_shutdown(struct rproc *rproc)
> >   	kfree(rproc->cached_table);
> >   	rproc->cached_table = NULL;
> >   	rproc->table_ptr = NULL;
> > -	rproc->table_sz = 0;
> >   out:
> >   	mutex_unlock(&rproc->lock);
> >   	return ret;
> > 
> > ---
> > base-commit: aa94665adc28f3fdc3de2979ac1e98bae961d6ca
> > change-id: 20250513-revert-rproc-table-sz-53ecf24726ae
> > 
> > Best regards,

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

* Re: [PATCH] Revert "remoteproc: core: Clear table_sz when rproc_shutdown"
  2025-05-13 15:52 [PATCH] Revert "remoteproc: core: Clear table_sz when rproc_shutdown" Bjorn Andersson
  2025-05-15 17:21 ` Andrew Davis
@ 2025-05-15 19:16 ` Mathieu Poirier
  1 sibling, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2025-05-15 19:16 UTC (permalink / raw)
  To: Bjorn Andersson; +Cc: linux-arm-msm, linux-remoteproc, linux-kernel

On Tue, May 13, 2025 at 04:52:46PM +0100, Bjorn Andersson wrote:
> Clearing the table_sz on cleanup seemed reasonable, but further
> discussions concluded that this merely working around the issue
> and that the fix is incomplete.
> 
> As such, revert commit efdde3d73ab2 ("remoteproc: core: Clear table_sz
> when rproc_shutdown") to avoid carrying a partial fix.
> 
> Signed-off-by: Bjorn Andersson <andersson@kernel.org>
> ---
>  drivers/remoteproc/remoteproc_core.c | 1 -
>  1 file changed, 1 deletion(-)
>

I have applied this patch.

Thanks,
Mathieu

> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 48d146e1fa560397c11eeb8f824ae0fb844a022b..81b2ccf988e852ac79cee375c7e3f118c2a4b41a 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -2025,7 +2025,6 @@ int rproc_shutdown(struct rproc *rproc)
>  	kfree(rproc->cached_table);
>  	rproc->cached_table = NULL;
>  	rproc->table_ptr = NULL;
> -	rproc->table_sz = 0;
>  out:
>  	mutex_unlock(&rproc->lock);
>  	return ret;
> 
> ---
> base-commit: aa94665adc28f3fdc3de2979ac1e98bae961d6ca
> change-id: 20250513-revert-rproc-table-sz-53ecf24726ae
> 
> Best regards,
> -- 
> Bjorn Andersson <andersson@kernel.org>
> 

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

end of thread, other threads:[~2025-05-15 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 15:52 [PATCH] Revert "remoteproc: core: Clear table_sz when rproc_shutdown" Bjorn Andersson
2025-05-15 17:21 ` Andrew Davis
2025-05-15 17:57   ` Mathieu Poirier
2025-05-15 19:16 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).