From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
mikey@neuling.org, hbabu@us.ibm.com, linuxppc-dev@ozlabs.org,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 2/4] powerpc/vas: Fix cleanup when VAS is not configured
Date: Fri, 9 Feb 2018 19:49:25 -0800 [thread overview]
Message-ID: <1518234567-24869-2-git-send-email-sukadev@linux.vnet.ibm.com> (raw)
In-Reply-To: <1518234567-24869-1-git-send-email-sukadev@linux.vnet.ibm.com>
When VAS is not configured in the system, make sure to remove
the VAS debugfs directory and unregister the platform driver.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/vas-debug.c | 5 +++++
arch/powerpc/platforms/powernv/vas.c | 5 ++++-
arch/powerpc/platforms/powernv/vas.h | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/vas-debug.c b/arch/powerpc/platforms/powernv/vas-debug.c
index b4de4c6..e6e4067 100644
--- a/arch/powerpc/platforms/powernv/vas-debug.c
+++ b/arch/powerpc/platforms/powernv/vas-debug.c
@@ -207,3 +207,8 @@ void vas_init_dbgdir(void)
if (IS_ERR(vas_debugfs))
vas_debugfs = NULL;
}
+
+void vas_cleanup_dbgdir(void)
+{
+ debugfs_remove_recursive(vas_debugfs);
+}
diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c
index aebbe95..f83e27d8 100644
--- a/arch/powerpc/platforms/powernv/vas.c
+++ b/arch/powerpc/platforms/powernv/vas.c
@@ -169,8 +169,11 @@ static int __init vas_init(void)
found++;
}
- if (!found)
+ if (!found) {
+ platform_driver_unregister(&vas_driver);
+ vas_cleanup_dbgdir();
return -ENODEV;
+ }
pr_devel("Found %d instances\n", found);
diff --git a/arch/powerpc/platforms/powernv/vas.h b/arch/powerpc/platforms/powernv/vas.h
index ae0100f..2645613 100644
--- a/arch/powerpc/platforms/powernv/vas.h
+++ b/arch/powerpc/platforms/powernv/vas.h
@@ -406,6 +406,7 @@ extern struct mutex vas_mutex;
extern struct vas_instance *find_vas_instance(int vasid);
extern void vas_init_dbgdir(void);
+extern void vas_cleanup_dbgdir(void);
extern void vas_instance_init_dbgdir(struct vas_instance *vinst);
extern void vas_window_init_dbgdir(struct vas_window *win);
extern void vas_window_free_dbgdir(struct vas_window *win);
--
2.7.4
next prev parent reply other threads:[~2018-02-10 3:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-10 3:49 [PATCH RESEND 1/4] powerpc/vas: Fix order of cleanup in debugfs dir Sukadev Bhattiprolu
2018-02-10 3:49 ` Sukadev Bhattiprolu [this message]
2018-02-12 5:23 ` [PATCH 2/4] powerpc/vas: Fix cleanup when VAS is not configured Michael Ellerman
2018-02-12 20:25 ` Sukadev Bhattiprolu
2018-02-13 3:17 ` Michael Ellerman
2018-02-10 3:49 ` [PATCH RESEND 3/4] powerpc/vas: Remove a stray line in Makefile Sukadev Bhattiprolu
2018-02-10 3:49 ` [PATCH 4/4] powerpc/vas: Add a couple of trace points Sukadev Bhattiprolu
2018-03-19 22:22 ` [4/4] " Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1518234567-24869-2-git-send-email-sukadev@linux.vnet.ibm.com \
--to=sukadev@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=hbabu@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).