diff mbox series

[linux,2/4] powerpc/powernv: Add debugfs files to PHB4

Message ID 20201105161542.670165-7-clg@kaod.org
State Superseded
Headers show
Series None | expand

Commit Message

Cédric Le Goater Nov. 5, 2020, 4:15 p.m. UTC
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 2b4ceb5e6ce4..c81666ca5de1 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2400,6 +2400,9 @@  static void pnv_pci_ioda_create_dbgfs(void)
 	char name[16];
 
 	list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
+		struct device_node *child;
+		struct dentry *debug_dir;
+
 		phb = hose->private_data;
 
 		/* Notify initialization of PHB done */
@@ -2412,6 +2415,11 @@  static void pnv_pci_ioda_create_dbgfs(void)
 					   phb, &pnv_pci_diag_data_fops);
 		debugfs_create_file_unsafe("dump_ioda_pe_state", 0200, phb->dbgfs,
 					   phb, &pnv_pci_ioda_pe_dump_fops);
+
+		debug_dir = debugfs_create_dir("debug", phb->dbgfs);
+		for_each_child_of_node(hose->dn, child)
+			if (of_device_is_compatible(child, "ibm,opal-debug"))
+				opal_debug_create(child, debug_dir);
 	}
 #endif /* CONFIG_DEBUG_FS */
 }