* [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD
@ 2026-08-06 6:05 Hongyan Xu
2026-08-06 6:16 ` Greg Kroah-Hartman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Hongyan Xu @ 2026-08-06 6:05 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, linux-usb,
linux-arm-kernel, jianhao.xu, Hongyan Xu
usb_put_hcd() drops the driver's HCD reference and can free the HCD and its
private data. The remove callback then calls atmel_stop_ehci(), which
obtains that HCD from platform data and dereferences its private data to
disable the clocks.
Stop the controller clocks before dropping the HCD reference so that
atmel_stop_ehci() cannot access an already freed HCD.
Fixes: 501c9c0802d9 ("USB: at91: Add USB EHCI driver for at91sam9g45 series")
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
---
drivers/usb/host/ehci-atmel.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 65747270fd88..bcd56f888ec9 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -177,9 +177,8 @@ static void ehci_atmel_drv_remove(struct platform_device *pdev)
struct usb_hcd *hcd = platform_get_drvdata(pdev);
usb_remove_hcd(hcd);
- usb_put_hcd(hcd);
-
atmel_stop_ehci(pdev);
+ usb_put_hcd(hcd);
}
static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev)
--
2.50.1.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD
2026-08-06 6:05 [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD Hongyan Xu
@ 2026-08-06 6:16 ` Greg Kroah-Hartman
2026-08-06 6:16 ` Greg Kroah-Hartman
2026-08-06 13:50 ` Alan Stern
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-08-06 6:16 UTC (permalink / raw)
To: Hongyan Xu
Cc: Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, linux-usb,
linux-arm-kernel, jianhao.xu
On Thu, Aug 06, 2026 at 02:05:57PM +0800, Hongyan Xu wrote:
> usb_put_hcd() drops the driver's HCD reference and can free the HCD and its
> private data. The remove callback then calls atmel_stop_ehci(), which
> obtains that HCD from platform data and dereferences its private data to
> disable the clocks.
>
> Stop the controller clocks before dropping the HCD reference so that
> atmel_stop_ehci() cannot access an already freed HCD.
>
> Fixes: 501c9c0802d9 ("USB: at91: Add USB EHCI driver for at91sam9g45 series")
> Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
> ---
> drivers/usb/host/ehci-atmel.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
You just sent a bunch of obviously-llm-helped patches without properly
attributing that. Please resend new versions with the correct
information, AND correctly cc: the stable tree for when you have Fixes:
tags like this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD
2026-08-06 6:05 [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD Hongyan Xu
2026-08-06 6:16 ` Greg Kroah-Hartman
@ 2026-08-06 6:16 ` Greg Kroah-Hartman
2026-08-06 13:50 ` Alan Stern
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-08-06 6:16 UTC (permalink / raw)
To: Hongyan Xu
Cc: Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, linux-usb,
linux-arm-kernel, jianhao.xu
On Thu, Aug 06, 2026 at 02:05:57PM +0800, Hongyan Xu wrote:
> usb_put_hcd() drops the driver's HCD reference and can free the HCD and its
> private data. The remove callback then calls atmel_stop_ehci(), which
> obtains that HCD from platform data and dereferences its private data to
> disable the clocks.
>
> Stop the controller clocks before dropping the HCD reference so that
> atmel_stop_ehci() cannot access an already freed HCD.
>
> Fixes: 501c9c0802d9 ("USB: at91: Add USB EHCI driver for at91sam9g45 series")
> Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
> ---
> drivers/usb/host/ehci-atmel.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
> index 65747270fd88..bcd56f888ec9 100644
> --- a/drivers/usb/host/ehci-atmel.c
> +++ b/drivers/usb/host/ehci-atmel.c
> @@ -177,9 +177,8 @@ static void ehci_atmel_drv_remove(struct platform_device *pdev)
> struct usb_hcd *hcd = platform_get_drvdata(pdev);
>
> usb_remove_hcd(hcd);
> - usb_put_hcd(hcd);
> -
> atmel_stop_ehci(pdev);
> + usb_put_hcd(hcd);
> }
>
> static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev)
> --
> 2.50.1.windows.1
>
>
How was this tested?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD
2026-08-06 6:05 [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD Hongyan Xu
2026-08-06 6:16 ` Greg Kroah-Hartman
2026-08-06 6:16 ` Greg Kroah-Hartman
@ 2026-08-06 13:50 ` Alan Stern
2 siblings, 0 replies; 4+ messages in thread
From: Alan Stern @ 2026-08-06 13:50 UTC (permalink / raw)
To: Hongyan Xu
Cc: Greg Kroah-Hartman, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, linux-usb, linux-arm-kernel, jianhao.xu
On Thu, Aug 06, 2026 at 02:05:57PM +0800, Hongyan Xu wrote:
> usb_put_hcd() drops the driver's HCD reference and can free the HCD and its
> private data. The remove callback then calls atmel_stop_ehci(), which
> obtains that HCD from platform data and dereferences its private data to
> disable the clocks.
>
> Stop the controller clocks before dropping the HCD reference so that
> atmel_stop_ehci() cannot access an already freed HCD.
>
> Fixes: 501c9c0802d9 ("USB: at91: Add USB EHCI driver for at91sam9g45 series")
> Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> drivers/usb/host/ehci-atmel.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
> index 65747270fd88..bcd56f888ec9 100644
> --- a/drivers/usb/host/ehci-atmel.c
> +++ b/drivers/usb/host/ehci-atmel.c
> @@ -177,9 +177,8 @@ static void ehci_atmel_drv_remove(struct platform_device *pdev)
> struct usb_hcd *hcd = platform_get_drvdata(pdev);
>
> usb_remove_hcd(hcd);
> - usb_put_hcd(hcd);
> -
> atmel_stop_ehci(pdev);
> + usb_put_hcd(hcd);
> }
>
> static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev)
> --
> 2.50.1.windows.1
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-06 13:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 6:05 [PATCH] usb: host: ehci-atmel: stop clocks before releasing HCD Hongyan Xu
2026-08-06 6:16 ` Greg Kroah-Hartman
2026-08-06 6:16 ` Greg Kroah-Hartman
2026-08-06 13:50 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox