From patchwork Fri Jun 9 14:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 13274049 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 629B3C7EE2E for ; Fri, 9 Jun 2023 14:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=CbrwAg/ZMEJA3Ir5kxgGomS15hupZpegoEzEUhRSXk0=; b=p+0OYOdThh5/8n 7R5Y0tWikwM+liscS4OnER3tIR+H4ySUeXWOI0rtuOJgRrTu1R9Llkn6hdyjEEwO6+t1ECXKb+nPH rR2ZrWODMvEcdvGjz0B5iTF4C6rARg2gtfqiojihXs2Qx2V2AbwyayrisKVhl7BEZ/5Q+2Psy789K wGY5gVQmli+ftawdVUcXkYRqfIwkLE51NoBaw5qEJIU01oe76SIoGmK8OnWqouH2BWNMnGpqDPumB I3y8YuDybO1V9yQtmWfb3/fW3Leoke7ch2G9ApwRXVTrHxnhr20Jk5ZFLOAYOjYQS1SUSCqSvljWt xNzuLXUfyc2FjKDDA46g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7dGy-00DIFK-25; Fri, 09 Jun 2023 14:39:28 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7dGr-00DIBE-2e for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 14:39:24 +0000 X-GND-Sasl: miquel.raynal@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686321555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+5iuQIstEtDJEg7gekNXIRCPhM+FCXeq/OlIFGESoiE=; b=LavNs/BZU4t+UhNZnxd3ATjI29/dD7MdKyM+g5RbvWPYNmm2j95f8OxqUuNHnzOXq6RJbr nekM99xq2ecV7n5waBir65xEpQL5kqb6TkKl5WP23CsqKcrOGrOTKIejcwfXbprD2Mn6Jl ScWPQbcLb6ICiz1s1nfFl28G2UUGse1Sbn0Y3M58qosRBjHE4Oe7nst+mUiUK5li6Va3NG tcMFqZ930zb+5yp9f0VuQB/cq8KjRkDnV7H1spd1NtGk0hyZMrqudTxzYk7JJIzcXS4cmG hv1Kf5r/sAey/sYLAn7zWY6LmrhCnse0VusJmDhXM9d0m98Njes/+vGVPKjJZg== X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 5DE396000B; Fri, 9 Jun 2023 14:39:13 +0000 (UTC) From: Miquel Raynal To: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: , , linux-pm@vger.kernel.org, Thomas Petazzoni , Miquel Raynal Subject: [PATCH 0/2] Expose reset reason through sysfs Date: Fri, 9 Jun 2023 16:39:10 +0200 Message-Id: <20230609143912.849995-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_073922_181644_F96B5008 X-CRM114-Status: GOOD ( 10.43 ) 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 Hello, Back in 2019, my colleague Kamel did try to upstream a small change in the at91 reset driver, in order to expose the reset reason through sysfs instead of expecting userland to grep through dmesg to get it. There was basically no strong reason opposed to it, besides minor changes which needed fixing. 4 years ago I am seeing again the need for such exposure, so here is Kamel's patch with the minor comments addressed, as well as a small cleanup just before. Link: https://lore.kernel.org/lkml/00f4e9a2-f6bd-9242-cafd-9c0c4f4dc619@microchip.com/T/ Cheers, Miquèl Changes in v2: * Collected Nicolas' Acked-by * Dropped the Xtal frequency information (as this may change between platforms of course). Kamel Bouhara (1): power: reset: at91-reset: add sysfs interface to the power on reason Miquel Raynal (1): power: reset: at91-reset: use driver structure as status parameter .../testing/sysfs-platform-power-on-reason | 10 +++++ drivers/power/reset/at91-reset.c | 45 +++++++++++++------ include/linux/power/power_on_reason.h | 19 ++++++++ 3 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-platform-power-on-reason create mode 100644 include/linux/power/power_on_reason.h