Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: musb: mpfs: fix phy unregister in remove()
@ 2026-09-14 11:09 Felix Gu
  2026-09-15 18:18 ` Conor Dooley
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-09-14 11:09 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara, Bin Liu, Greg Kroah-Hartman
  Cc: linux-riscv, linux-usb, linux-kernel, Felix Gu

mpfs_remove() passed the glue platform device instead of the
registered generic PHY to usb_phy_generic_unregister(). This
unregistered the glue device from within its own remove
callback and leaked glue->phy.

Pass glue->phy instead.

Fixes: 7a96b6ea90a4 ("usb: musb: Add support for PolarFire SoC's musb controller")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/usb/musb/mpfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/musb/mpfs.c b/drivers/usb/musb/mpfs.c
index 587127abd30a..6cc2909b8ae3 100644
--- a/drivers/usb/musb/mpfs.c
+++ b/drivers/usb/musb/mpfs.c
@@ -357,7 +357,7 @@ static void mpfs_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(glue->clk);
 	platform_device_unregister(glue->musb);
-	usb_phy_generic_unregister(pdev);
+	usb_phy_generic_unregister(glue->phy);
 }
 
 #ifdef CONFIG_OF

---
base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a
change-id: 20260914-mpfs-086b7d22f8e5

Best regards,
--  
Felix Gu <ustc.gu@gmail.com>


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

* Re: [PATCH] usb: musb: mpfs: fix phy unregister in remove()
  2026-09-14 11:09 [PATCH] usb: musb: mpfs: fix phy unregister in remove() Felix Gu
@ 2026-09-15 18:18 ` Conor Dooley
  0 siblings, 0 replies; 2+ messages in thread
From: Conor Dooley @ 2026-09-15 18:18 UTC (permalink / raw)
  To: Felix Gu
  Cc: Conor Dooley, Daire McNamara, Bin Liu, Greg Kroah-Hartman,
	linux-riscv, linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

On Mon, Sep 14, 2026 at 07:09:13PM +0800, Felix Gu wrote:
> mpfs_remove() passed the glue platform device instead of the
> registered generic PHY to usb_phy_generic_unregister(). This
> unregistered the glue device from within its own remove
> callback and leaked glue->phy.
> 
> Pass glue->phy instead.
> 
> Fixes: 7a96b6ea90a4 ("usb: musb: Add support for PolarFire SoC's musb controller")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  drivers/usb/musb/mpfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/mpfs.c b/drivers/usb/musb/mpfs.c
> index 587127abd30a..6cc2909b8ae3 100644
> --- a/drivers/usb/musb/mpfs.c
> +++ b/drivers/usb/musb/mpfs.c
> @@ -357,7 +357,7 @@ static void mpfs_remove(struct platform_device *pdev)
>  
>  	clk_disable_unprepare(glue->clk);
>  	platform_device_unregister(glue->musb);
> -	usb_phy_generic_unregister(pdev);
> +	usb_phy_generic_unregister(glue->phy);
>  }
>  
>  #ifdef CONFIG_OF
> 
> ---
> base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a
> change-id: 20260914-mpfs-086b7d22f8e5
> 
> Best regards,
> --  
> Felix Gu <ustc.gu@gmail.com>
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2026-09-15 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14 11:09 [PATCH] usb: musb: mpfs: fix phy unregister in remove() Felix Gu
2026-09-15 18:18 ` Conor Dooley

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