From patchwork Thu Nov 5 16:15:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1395092 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRpZx2MFgz9sSs for ; Fri, 6 Nov 2020 03:17:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CRpZx1X0mzDr1q for ; Fri, 6 Nov 2020 03:17:45 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=kaod.org (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=clg@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CRpXt6pYszDr2l for ; Fri, 6 Nov 2020 03:15:58 +1100 (AEDT) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A5G3GxH124596; Thu, 5 Nov 2020 11:15:55 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34mfdgcyty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 11:15:54 -0500 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0A5G3U28125506; Thu, 5 Nov 2020 11:15:54 -0500 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 34mfdgcyst-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 11:15:54 -0500 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0A5GDNRk007868; Thu, 5 Nov 2020 16:15:52 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma02fra.de.ibm.com with ESMTP id 34j6j424eb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 16:15:52 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0A5GFnk760686626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 Nov 2020 16:15:49 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C13005205F; Thu, 5 Nov 2020 16:15:49 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av21.portsmouth.uk.ibm.com (Postfix) with SMTP id 8AE0C5204F; Thu, 5 Nov 2020 16:15:49 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-56-135.uk.ibm.com [9.145.56.135]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 018A62201D0; Thu, 5 Nov 2020 17:15:48 +0100 (CET) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: skiboot@lists.ozlabs.org Date: Thu, 5 Nov 2020 17:15:42 +0100 Message-Id: <20201105161542.670165-9-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201105161542.670165-1-clg@kaod.org> References: <20201105161542.670165-1-clg@kaod.org> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-05_09:2020-11-05, 2020-11-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 clxscore=1034 phishscore=0 adultscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011050106 Subject: [Skiboot] [PATCH linux 4/4] powerpc/powernv: Add debugfs files to XIVE X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Cédric Le Goater --- arch/powerpc/sysdev/xive/xive-internal.h | 2 +- arch/powerpc/sysdev/xive/common.c | 8 -------- arch/powerpc/sysdev/xive/native.c | 23 ++++++++++++++++++++++- arch/powerpc/sysdev/xive/spapr.c | 9 ++++++++- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/sysdev/xive/xive-internal.h b/arch/powerpc/sysdev/xive/xive-internal.h index b7b901da2168..09205d2d48f1 100644 --- a/arch/powerpc/sysdev/xive/xive-internal.h +++ b/arch/powerpc/sysdev/xive/xive-internal.h @@ -64,7 +64,7 @@ struct xive_ops { bool xive_core_init(const struct xive_ops *ops, void __iomem *area, u32 offset, u8 max_prio); __be32 *xive_queue_page_alloc(unsigned int cpu, u32 queue_shift); -int xive_core_debug_init(void); +struct dentry *xive_core_debugfs_create(void); static inline u32 xive_alloc_order(u32 queue_shift) { diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index 1b1d3caebfac..9eacc26cb0ff 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -1681,11 +1681,3 @@ struct dentry *xive_core_debugfs_create(void) return xive_debug_dir; } - -int xive_core_debug_init(void) -{ - if (xive_enabled()) - xive_core_debugfs_create(); - - return 0; -} diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c index cb58ec7ce77a..1201f9ffeac5 100644 --- a/arch/powerpc/sysdev/xive/native.c +++ b/arch/powerpc/sysdev/xive/native.c @@ -548,6 +548,8 @@ EXPORT_SYMBOL_GPL(xive_native_default_eq_shift); unsigned long xive_tima_os; EXPORT_SYMBOL_GPL(xive_tima_os); +static struct device_node *xive_native_node; + bool __init xive_native_init(void) { struct device_node *np; @@ -628,6 +630,8 @@ bool __init xive_native_init(void) return false; } pr_info("Using %dkB queues\n", 1 << (xive_queue_shift - 10)); + + xive_native_node = np; return true; } @@ -854,4 +858,21 @@ int xive_native_get_vp_state(u32 vp_id, u64 *out_state) } EXPORT_SYMBOL_GPL(xive_native_get_vp_state); -machine_arch_initcall(powernv, xive_core_debug_init); +static int xive_native_debug_init(void) +{ + if (xive_enabled() && IS_ENABLED(CONFIG_DEBUG_FS)) { + struct device_node *child; + struct dentry *xive_dir; + struct dentry *xive_debug_dir; + + xive_dir = xive_core_debugfs_create(); + xive_debug_dir = debugfs_create_dir("debug", xive_dir); + + for_each_child_of_node(xive_native_node, child) + if (of_device_is_compatible(child, "ibm,opal-debug")) + opal_debug_create(child, xive_debug_dir); + } + return 0; +} + +machine_arch_initcall(powernv, xive_native_debug_init); diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index 1e3674d7ea7b..ea51967a4193 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -864,4 +864,11 @@ bool __init xive_spapr_init(void) return true; } -machine_arch_initcall(pseries, xive_core_debug_init); +static int xive_spapr_debug_init(void) +{ + if (xive_enabled() && IS_ENABLED(CONFIG_DEBUG_FS)) + xive_core_debugfs_create(); + return 0; +} + +machine_arch_initcall(pseries, xive_spapr_debug_init);