From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68D21C77B7C for ; Wed, 2 Jul 2025 16:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fQKROXfxs33PHk+Cr8HhpZ1AjAMIFXF2Lud88fwu7KA=; b=jxrEuzGVs6EAD20JemabNbMgrz BK4wuUN97pZRPIkzhLqgfmBX4BX6x46pYW+A94S0CTlBNRcyp2P1TUcisURXk4Pc/XhlguIDH/bNZ YN7TZCN50avlVickrRgcc6AgYxaunWPvSwPnCeuhpT+JtCPzGyHUsRH3znHc4L5BA3ta7U5/SHKjv ITJHWn8TQSQsZRI/1aJOxwYX2VteTiGh5hwD/FIxY/miTLUyfXfON9rGMKInooXZkzyXb7C9+e123 wZ9ZOLubxRr/vl0s4VQfe8//Pcn8kGm3um1lk6+v4/sLbSK4LukD6grjufJ9B1tlDnWsJeRBeasSv omMq/M2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uX0QT-00000008xpK-28Cs; Wed, 02 Jul 2025 16:35:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uWzIS-00000008m00-1UEz for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2025 15:22:53 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EFB511424; Wed, 2 Jul 2025 08:22:36 -0700 (PDT) Received: from bogus (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E58C13F6A8; Wed, 2 Jul 2025 08:22:49 -0700 (PDT) Date: Wed, 2 Jul 2025 16:22:47 +0100 From: Sudeep Holla To: Peng Fan Cc: Cristian Marussi , Shawn Guo , Sudeep Holla , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , , , , Subject: Re: [PATCH 7/7] firmware: imx: sm-misc: Dump syslog and system info Message-ID: <20250702-berserk-paper-uakari-74a8bd@sudeepholla> References: <20250627-sm-misc-api-v1-v1-0-2b99481fe825@nxp.com> <20250627-sm-misc-api-v1-v1-7-2b99481fe825@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250627-sm-misc-api-v1-v1-7-2b99481fe825@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250702_082252_432057_8BFBEEA3 X-CRM114-Status: GOOD ( 17.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 27, 2025 at 02:03:50PM +0800, Peng Fan wrote: > Add sysfs interface to read System Manager syslog and system info > > Signed-off-by: Peng Fan > --- > drivers/firmware/imx/sm-misc.c | 97 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 97 insertions(+) > > diff --git a/drivers/firmware/imx/sm-misc.c b/drivers/firmware/imx/sm-misc.c > index fc3ee12c2be878e0285183e3381c9514a63d5142..55485a3c4a5c615102a377f41025a6911d746770 100644 > --- a/drivers/firmware/imx/sm-misc.c > +++ b/drivers/firmware/imx/sm-misc.c > @@ -44,6 +44,100 @@ static int scmi_imx_misc_ctrl_notifier(struct notifier_block *nb, > return 0; > } > > +static ssize_t syslog_show(struct device *device, struct device_attribute *attr, > + char *buf) > +{ > + struct scmi_imx_misc_sys_sleep_rec *rec; > + struct scmi_imx_misc_syslog *syslog; > + int ret; > + size_t len = 0; > + > + if (!ph) > + return 0; > + > + syslog = kmalloc(sizeof(*syslog), GFP_KERNEL); > + if (!syslog) > + return -ENOMEM; > + > + ret = imx_misc_ctrl_ops->misc_syslog(ph, sizeof(*syslog), syslog); > + if (ret) { > + kfree(syslog); > + return ret; > + } > + > + rec = &syslog->syssleeprecord; > + > + len += sysfs_emit_at(buf, len, "Wake Vector = %u\n", rec->wakesource); > + len += sysfs_emit_at(buf, len, "Sys sleep mode = %u\n", rec->syssleepmode); > + len += sysfs_emit_at(buf, len, "Sys sleep flags = 0x%08x\n", rec->syssleepflags); > + len += sysfs_emit_at(buf, len, "MIX power status = 0x%08x\n", rec->mixpwrstat); > + len += sysfs_emit_at(buf, len, "MEM power status = 0x%08x\n", rec->mempwrstat); > + len += sysfs_emit_at(buf, len, "PLL power status = 0x%08x\n", rec->pllpwrstat); > + len += sysfs_emit_at(buf, len, "Sleep latency = %u\n", rec->sleepentryusec); > + len += sysfs_emit_at(buf, len, "Wake latency = %u\n", rec->sleepexitusec); > + len += sysfs_emit_at(buf, len, "Sleep count = %u\n", rec->sleepcnt); > + Why can't this be individual files and values ? -- Regards, Sudeep