public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean
@ 2026-04-29 11:42 Holger Brunck
  2026-04-29 11:42 ` [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove Holger Brunck
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Holger Brunck @ 2026-04-29 11:42 UTC (permalink / raw)
  To: netdev, linuxppc-dev; +Cc: andrew+netdev, chleroy, qiang.zhao, Holger Brunck

Unmapping of uf_regs is done from ucc_fast_free and doesn't need to be
done explicitly. If already unmapped ucc_fast_free will crash.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
---
 drivers/net/wan/fsl_ucc_hdlc.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 3bd57527b1be..8155e92af14e 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -773,11 +773,6 @@ static void uhdlc_memclean(struct ucc_hdlc_private *priv)
 	kfree(priv->tx_skbuff);
 	priv->tx_skbuff = NULL;
 
-	if (priv->uf_regs) {
-		iounmap(priv->uf_regs);
-		priv->uf_regs = NULL;
-	}
-
 	if (priv->uccf) {
 		ucc_fast_free(priv->uccf);
 		priv->uccf = NULL;
-- 
2.52.0.120.gb31ab939fe


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

* [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove
  2026-04-29 11:42 [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Holger Brunck
@ 2026-04-29 11:42 ` Holger Brunck
  2026-05-01 12:35   ` Simon Horman
  2026-05-01 12:27 ` [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Simon Horman
  2026-05-02 17:20 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 7+ messages in thread
From: Holger Brunck @ 2026-04-29 11:42 UTC (permalink / raw)
  To: netdev, linuxppc-dev; +Cc: andrew+netdev, chleroy, qiang.zhao, Holger Brunck

If the driver is used in a non tdm mode priv->utdm is a NULL pointer.
Therefore we need to check this pointer first before checking si_regs.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
---
 drivers/net/wan/fsl_ucc_hdlc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 8155e92af14e..15bfb78381d4 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -1250,12 +1250,12 @@ static void ucc_hdlc_remove(struct platform_device *pdev)
 
 	uhdlc_memclean(priv);
 
-	if (priv->utdm->si_regs) {
+	if (priv->utdm && priv->utdm->si_regs) {
 		iounmap(priv->utdm->si_regs);
 		priv->utdm->si_regs = NULL;
 	}
 
-	if (priv->utdm->siram) {
+	if (priv->utdm && priv->utdm->siram) {
 		iounmap(priv->utdm->siram);
 		priv->utdm->siram = NULL;
 	}
-- 
2.52.0.120.gb31ab939fe


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

* Re: [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean
  2026-04-29 11:42 [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Holger Brunck
  2026-04-29 11:42 ` [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove Holger Brunck
@ 2026-05-01 12:27 ` Simon Horman
  2026-05-02 17:14   ` Jakub Kicinski
  2026-05-04  5:58   ` Holger Brunck
  2026-05-02 17:20 ` patchwork-bot+netdevbpf
  2 siblings, 2 replies; 7+ messages in thread
From: Simon Horman @ 2026-05-01 12:27 UTC (permalink / raw)
  To: Holger Brunck; +Cc: netdev, linuxppc-dev, andrew+netdev, chleroy, qiang.zhao

On Wed, Apr 29, 2026 at 01:42:07PM +0200, Holger Brunck wrote:
> Unmapping of uf_regs is done from ucc_fast_free and doesn't need to be
> done explicitly. If already unmapped ucc_fast_free will crash.
> 
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>

As a fix for code present in net, this warrants a fixes tag
that cites the commit that introduced this bug.
Perhaps this one is appropriate.

Fixes: ca20e191eed0 ("net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove")

Also, as a fix for net it would be best to explicitly target that branch,
like this:

Subject: [PATCH net 1/2] ...

I don't think it's necessary to repost to just to address either of the
above.  But for reference more information on the Netdev development
process can be found here:

https://docs.kernel.org/process/maintainer-netdev.html

The above not withstanding, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

FTR, an AI generated review of this patch is available on sashiko.dev.
All the issues flagged there seem to be pre-existing and I do not
believe they should block progress of this patch. But you may want to
look into then in the context of follow-up.

...

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

* Re: [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove
  2026-04-29 11:42 ` [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove Holger Brunck
@ 2026-05-01 12:35   ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2026-05-01 12:35 UTC (permalink / raw)
  To: Holger Brunck; +Cc: netdev, linuxppc-dev, andrew+netdev, chleroy, qiang.zhao

On Wed, Apr 29, 2026 at 01:42:08PM +0200, Holger Brunck wrote:
> If the driver is used in a non tdm mode priv->utdm is a NULL pointer.
> Therefore we need to check this pointer first before checking si_regs.
> 
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>

Hi Holger,

I have the same feedback as for patch 1/2:

As a fix for code present in net, this warrants a fixes tag
that cites the commit that introduced this bug.
Perhaps this one is appropriate.

Fixes: ca20e191eed0 ("net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove")

Also, as a fix for net it would be best to explicitly target that branch,
like this:

Subject: [PATCH net 2/2] ...

I don't think it's necessary to repost to just to address either of the
above.  But for reference more information on the Netdev development
process can be found here:

https://docs.kernel.org/process/maintainer-netdev.html

The above not withstanding, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

FTR, an AI generated review of this patch is available on sashiko.dev.
All the issues flagged there seem to be pre-existing and I do not
believe they should block progress of this patch. But you may want to
look into then in the context of follow-up.

...

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

* Re: [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean
  2026-05-01 12:27 ` [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Simon Horman
@ 2026-05-02 17:14   ` Jakub Kicinski
  2026-05-04  5:58   ` Holger Brunck
  1 sibling, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2026-05-02 17:14 UTC (permalink / raw)
  To: Simon Horman
  Cc: Holger Brunck, netdev, linuxppc-dev, andrew+netdev, chleroy,
	qiang.zhao

On Fri, 1 May 2026 13:27:56 +0100 Simon Horman wrote:
> Fixes: ca20e191eed0 ("net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove")

This appears to be a SHA of the second patch in some local tree.
Supposedly the correct tag is:

Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC")

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

* Re: [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean
  2026-04-29 11:42 [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Holger Brunck
  2026-04-29 11:42 ` [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove Holger Brunck
  2026-05-01 12:27 ` [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Simon Horman
@ 2026-05-02 17:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-02 17:20 UTC (permalink / raw)
  To: Holger Brunck; +Cc: netdev, linuxppc-dev, andrew+netdev, chleroy, qiang.zhao

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 29 Apr 2026 13:42:07 +0200 you wrote:
> Unmapping of uf_regs is done from ucc_fast_free and doesn't need to be
> done explicitly. If already unmapped ucc_fast_free will crash.
> 
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> ---
>  drivers/net/wan/fsl_ucc_hdlc.c | 5 -----
>  1 file changed, 5 deletions(-)

Here is the summary with links:
  - [1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean
    https://git.kernel.org/netdev/net/c/1a57efe250a1
  - [2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove
    https://git.kernel.org/netdev/net/c/851bba8068d1

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] 7+ messages in thread

* RE: [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean
  2026-05-01 12:27 ` [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Simon Horman
  2026-05-02 17:14   ` Jakub Kicinski
@ 2026-05-04  5:58   ` Holger Brunck
  1 sibling, 0 replies; 7+ messages in thread
From: Holger Brunck @ 2026-05-04  5:58 UTC (permalink / raw)
  To: Simon Horman
  Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	andrew+netdev@lunn.ch, chleroy@kernel.org, qiang.zhao@nxp.com

> 
> On Wed, Apr 29, 2026 at 01:42:07PM +0200, Holger Brunck wrote:
> > Unmapping of uf_regs is done from ucc_fast_free and doesn't need to be
> > done explicitly. If already unmapped ucc_fast_free will crash.
> >
> > Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> 
> As a fix for code present in net, this warrants a fixes tag that cites the commit
> that introduced this bug.
> Perhaps this one is appropriate.
> 
> Fixes: ca20e191eed0 ("net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove")
> 
> Also, as a fix for net it would be best to explicitly target that branch, like this:
> 
> Subject: [PATCH net 1/2] ...
> 
> I don't think it's necessary to repost to just to address either of the above.  But for
> reference more information on the Netdev development process can be found
> here:
> 

ok I will take care of this next time.

> 
> The above not withstanding, this looks good to me.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>
> 
> FTR, an AI generated review of this patch is available on sashiko.dev.
> All the issues flagged there seem to be pre-existing and I do not believe they
> should block progress of this patch. But you may want to look into then in the
> context of follow-up.
>

Thanks, I will have a look at this.

Best regards
Holger


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

end of thread, other threads:[~2026-05-04  5:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29 11:42 [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Holger Brunck
2026-04-29 11:42 ` [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove Holger Brunck
2026-05-01 12:35   ` Simon Horman
2026-05-01 12:27 ` [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Simon Horman
2026-05-02 17:14   ` Jakub Kicinski
2026-05-04  5:58   ` Holger Brunck
2026-05-02 17:20 ` patchwork-bot+netdevbpf

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