From da67f89f1575b512bdf0a27d60fc4fbed0d8dd54 Mon Sep 17 00:00:00 2001 From: Joshua Cha Date: Tue, 25 Feb 2025 13:16:11 +0900 Subject: [PATCH] nvsciipc: add shutdown callback print kernel message during system shutdown JIRA NVIPC-3318 Change-Id: Ib6025c4058fc2f03d89d44e0c6f2ee90073ba8e2 Signed-off-by: Joshua Cha Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3309294 Reviewed-by: Jeungwoo Yoo GVS: buildbot_gerritrpt Reviewed-by: Simon Je Reviewed-by: svcacv --- drivers/misc/nvsciipc/nvsciipc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/misc/nvsciipc/nvsciipc.c b/drivers/misc/nvsciipc/nvsciipc.c index 23017fb5..5d43b08d 100644 --- a/drivers/misc/nvsciipc/nvsciipc.c +++ b/drivers/misc/nvsciipc/nvsciipc.c @@ -916,7 +916,7 @@ static int nvsciipc_remove(struct platform_device *pdev) nvsciipc_cleanup(ctx); exit: - INFO("Unloaded module\n"); + ERR("Unloaded module\n"); return 0; } @@ -933,6 +933,11 @@ static int nvsciipc_remove_wrapper(struct platform_device *pdev) } #endif +static void nvsciipc_shutdown(struct platform_device *pdev) +{ + dev_err(&pdev->dev, "nvipc: Shutting down"); + nvsciipc_remove(pdev); +} #ifdef CONFIG_PM static int nvsciipc_suspend(struct platform_device *pdev, pm_message_t state) @@ -953,6 +958,7 @@ static int nvsciipc_resume(struct platform_device *pdev) static struct platform_driver nvsciipc_driver = { .probe = nvsciipc_probe, .remove = nvsciipc_remove_wrapper, + .shutdown = nvsciipc_shutdown, .driver = { .name = MODULE_NAME, },