Due to perf_debugfs_setup called only if the top level perf_debugfs_dir
was not created, only the first NTB would be added to debugfs.
Instead, call perf_debugfs_setup for every NTB. Check that
perf_debugfs_dir exists in perf_debugfs_setup, and if necessary, create
it there.
Signed-off-by: Allen Hubbe <
Allen...@emc.com>
---
Dave, if you like, you can just fix up your patch with this.
drivers/ntb/test/ntb_perf.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index dcf903584c43..5d60d59bd2d6 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -636,9 +636,16 @@ static int perf_debugfs_setup(struct perf_ctx *perf)
{
struct pci_dev *pdev = perf->ntb->pdev;
- if (!perf_debugfs_dir)
+ if (!debugfs_initialized())
return -ENODEV;
+ if (!perf_debugfs_dir) {
+ perf_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
+
+ if (!perf_debugfs_dir)
+ return -ENODEV;
+ }
+
perf->debugfs_node_dir = debugfs_create_dir(pci_name(pdev),
perf_debugfs_dir);
if (!perf->debugfs_node_dir)
@@ -691,15 +698,9 @@ static int perf_probe(struct ntb_client *client, struct ntb_dev *ntb)
ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO);
ntb_link_event(ntb);
- if (debugfs_initialized() && !perf_debugfs_dir) {
- perf_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
- if (!perf_debugfs_dir)
- goto err_ctx;
-
- rc = perf_debugfs_setup(perf);
- if (rc)
- goto err_ctx;
- }
+ rc = perf_debugfs_setup(perf);
+ if (rc)
+ goto err_ctx;
return 0;
--
2.5.3