From patchwork Fri Jun 16 13:52:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 13282802 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 BD33EEB64DA for ; Fri, 16 Jun 2023 13:53: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: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=jHK5UmzbG/cEB3nsoivd+QtT0ah6JbgBLDhzGiW+ifU=; b=WB6Yxk1zGe6DHf 7YeEhVM63+j2Er2JjyXnshMRWQuGlJ0aonjGB3G18bUoCFtyzR9nnd+qCx2D1rs1I1RHp/+1dKmyl kSzrevRYGx2zDBLcjT8MWP4pr0j/8dRh+njJ39wQKkW4QnatHQNoF6cvPgvcnA50GAjnrVTBiLon+ GmJhAtGwV5OZJvhMRKzGvjuQhMtOLDIym6ZbuynGt8OHW6KvuAEBk9SmtZ7iLvMJZwQ10XUAjDsda mPNUjnBWtU1ucRCgwjYNOkTW88l5j10VSYFjKpx4a6jI/zaYFVI39smeZh+WDmtX35XRRQSFU2ODG kbPVBaXyRAxRKfqaAmdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA9ss-000imv-0D; Fri, 16 Jun 2023 13:53:02 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA9sp-000ilW-0Z for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 13:53:01 +0000 X-GND-Sasl: miquel.raynal@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686923574; 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=nbku+YnB5H9MPK26K0KvbKk71EIPTIq7b5qzzY44c58=; b=jfBuzTqcE1ZKPnC3/UebYfv2CEcRJ0HXZvFJBw+b7/935cOM23ELTYkpev1RIOFEwVMTSF VqOOI82JUkGLIxKZsFQOZ4yMd1SA3LO2HWChQDx8L/muyA56waqExf8+ctgqqRJkHiAWR/ Jzptt5XbJ9lVQBm2mbICBSnFI3cdW5EdzE9gOVFZDi2g+Wh+oqvKU8mibC0DaigZVyiKcb 5TgCIoZBcmE7sTpAP/rFVKvKGcqzNHrCOEzuB1OxHjDZC7pCAyFljokX5mmD4xxEvKdGI6 nQ8sD7eb/s6P3ExQ8ijtKL/JZQKx971Cw2XkOB8MwZr6FPBsBKRSI5BaCc2g3A== 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 4279C40009; Fri, 16 Jun 2023 13:52:53 +0000 (UTC) From: Miquel Raynal To: Sebastian Reichel Subject: [PATCH v3 0/2] Expose reset reason through sysfs Date: Fri, 16 Jun 2023 15:52:50 +0200 Message-Id: <20230616135252.2787679-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-20230616_065259_391756_DA5C7F53 X-CRM114-Status: GOOD ( 12.03 ) 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: , Cc: Alexandre Belloni , linux-pm@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , Claudiu Beznea , linux-arm-kernel@lists.infradead.org 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 v3: * Made the series bisectable. * Updated the date and kernel version for this new feature. * Changed a few definitions as discussed with Sebastian. 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: change the power on reason prototype .../testing/sysfs-platform-power-on-reason | 12 +++++ drivers/power/reset/at91-reset.c | 44 +++++++++++++------ include/linux/power/power_on_reason.h | 19 ++++++++ 3 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-platform-power-on-reason create mode 100644 include/linux/power/power_on_reason.h