* [PATCH] soc: ti: knav_qmss_queue: free resources in remove callback
@ 2025-11-05 1:30 Md Shofiqul Islam
2025-11-06 13:49 ` Nishanth Menon
2025-11-08 22:17 ` Md Shofiqul Islam
0 siblings, 2 replies; 4+ messages in thread
From: Md Shofiqul Islam @ 2025-11-05 1:30 UTC (permalink / raw)
To: nm; +Cc: ssantosh, linux-arm-kernel, linux-kernel, Md Shofiqul Islam
Implement the TODO in knav_queue_remove() by stopping PDSPs and
freeing queue regions and queue ranges before disabling runtime PM,
mirroring the allocations performed in the probe path.
This ensures resources are released on driver unbind and avoids
leaking queue/region state.
Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
---
drivers/soc/ti/knav_qmss_queue.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 6e56e7609ccd..1e5f3e9faa99 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1884,9 +1884,14 @@ static int knav_queue_probe(struct platform_device *pdev)
static void knav_queue_remove(struct platform_device *pdev)
{
- /* TODO: Free resources */
- pm_runtime_put_sync(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
+ struct knav_device *kdev = platform_get_drvdata(pdev);
+
+ knav_queue_stop_pdsps(kdev);
+ knav_queue_free_regions(kdev);
+ knav_free_queue_ranges(kdev);
+
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
}
static struct platform_driver keystone_qmss_driver = {
--
2.51.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] soc: ti: knav_qmss_queue: free resources in remove callback
2025-11-05 1:30 [PATCH] soc: ti: knav_qmss_queue: free resources in remove callback Md Shofiqul Islam
@ 2025-11-06 13:49 ` Nishanth Menon
2025-11-08 22:17 ` Md Shofiqul Islam
1 sibling, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2025-11-06 13:49 UTC (permalink / raw)
To: Md Shofiqul Islam; +Cc: ssantosh, linux-arm-kernel, linux-kernel
On 03:30-20251105, Md Shofiqul Islam wrote:
> Implement the TODO in knav_queue_remove() by stopping PDSPs and
> freeing queue regions and queue ranges before disabling runtime PM,
> mirroring the allocations performed in the probe path.
>
> This ensures resources are released on driver unbind and avoids
> leaking queue/region state.
>
> Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
> ---
> drivers/soc/ti/knav_qmss_queue.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
> index 6e56e7609ccd..1e5f3e9faa99 100644
> --- a/drivers/soc/ti/knav_qmss_queue.c
> +++ b/drivers/soc/ti/knav_qmss_queue.c
> @@ -1884,9 +1884,14 @@ static int knav_queue_probe(struct platform_device *pdev)
>
> static void knav_queue_remove(struct platform_device *pdev)
> {
> - /* TODO: Free resources */
> - pm_runtime_put_sync(&pdev->dev);
> - pm_runtime_disable(&pdev->dev);
> + struct knav_device *kdev = platform_get_drvdata(pdev);
> +
> + knav_queue_stop_pdsps(kdev);
> + knav_queue_free_regions(kdev);
> + knav_free_queue_ranges(kdev);
> +
> + pm_runtime_put_sync(&pdev->dev);
> + pm_runtime_disable(&pdev->dev);
> }
>
> static struct platform_driver keystone_qmss_driver = {
> --
> 2.51.1
>
Please follow linux coding conventions about usage of tabs - this should
be exposed by running checkpatch.pl --strict on the patch.
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] soc: ti: knav_qmss_queue: free resources in remove callback
2025-11-05 1:30 [PATCH] soc: ti: knav_qmss_queue: free resources in remove callback Md Shofiqul Islam
2025-11-06 13:49 ` Nishanth Menon
@ 2025-11-08 22:17 ` Md Shofiqul Islam
2025-11-10 12:26 ` Nishanth Menon
1 sibling, 1 reply; 4+ messages in thread
From: Md Shofiqul Islam @ 2025-11-08 22:17 UTC (permalink / raw)
To: nm; +Cc: ssantosh, linux-arm-kernel, linux-kernel, Md Shofiqul Islam
Implement the TODO in knav_queue_remove() by stopping PDSPs and
freeing queue regions and queue ranges before disabling runtime PM,
mirroring the allocations performed in the probe path.
This ensures resources are released on driver unbind and avoids
leaking queue/region state.
Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
---
drivers/soc/ti/knav_qmss_queue.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 6e56e7609ccd..1e5f3e9faa99 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1884,9 +1884,14 @@ static int knav_queue_probe(struct platform_device *pdev)
static void knav_queue_remove(struct platform_device *pdev)
{
- /* TODO: Free resources */
- pm_runtime_put_sync(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
+ struct knav_device *kdev = platform_get_drvdata(pdev);
+
+ knav_queue_stop_pdsps(kdev);
+ knav_queue_free_regions(kdev);
+ knav_free_queue_ranges(kdev);
+
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
}
static struct platform_driver keystone_qmss_driver = {
--
2.51.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] soc: ti: knav_qmss_queue: free resources in remove callback
2025-11-08 22:17 ` Md Shofiqul Islam
@ 2025-11-10 12:26 ` Nishanth Menon
0 siblings, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2025-11-10 12:26 UTC (permalink / raw)
To: Md Shofiqul Islam; +Cc: ssantosh, linux-arm-kernel, linux-kernel
On 00:17-20251109, Md Shofiqul Islam wrote:
> Implement the TODO in knav_queue_remove() by stopping PDSPs and
> freeing queue regions and queue ranges before disabling runtime PM,
> mirroring the allocations performed in the probe path.
>
> This ensures resources are released on driver unbind and avoids
> leaking queue/region state.
>
> Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
> ---
> drivers/soc/ti/knav_qmss_queue.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
> index 6e56e7609ccd..1e5f3e9faa99 100644
> --- a/drivers/soc/ti/knav_qmss_queue.c
> +++ b/drivers/soc/ti/knav_qmss_queue.c
> @@ -1884,9 +1884,14 @@ static int knav_queue_probe(struct platform_device *pdev)
>
> static void knav_queue_remove(struct platform_device *pdev)
> {
> - /* TODO: Free resources */
> - pm_runtime_put_sync(&pdev->dev);
> - pm_runtime_disable(&pdev->dev);
> + struct knav_device *kdev = platform_get_drvdata(pdev);
> +
> + knav_queue_stop_pdsps(kdev);
> + knav_queue_free_regions(kdev);
> + knav_free_queue_ranges(kdev);
> +
> + pm_runtime_put_sync(&pdev->dev);
> + pm_runtime_disable(&pdev->dev);
> }
>
> static struct platform_driver keystone_qmss_driver = {
> --
> 2.51.1
>
Did you happen to send the same patch as previous? it has the exact same
formatting issues that i flagged.
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-10 12:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 1:30 [PATCH] soc: ti: knav_qmss_queue: free resources in remove callback Md Shofiqul Islam
2025-11-06 13:49 ` Nishanth Menon
2025-11-08 22:17 ` Md Shofiqul Islam
2025-11-10 12:26 ` Nishanth Menon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox