Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1000283rdb; Fri, 19 Jan 2024 05:27:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5bgM3bKfAwaVMK+WIyQCG4kqVzeqsVrAMaIe0xKzsY6z1zJXLx4ZqDc2Q5eI6J5Tr9wZn X-Received: by 2002:a2e:bcc2:0:b0:2cd:fb1a:d1e0 with SMTP id z2-20020a2ebcc2000000b002cdfb1ad1e0mr606783ljp.5.1705670824018; Fri, 19 Jan 2024 05:27:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705670823; cv=pass; d=google.com; s=arc-20160816; b=N7p7bKnAD0rRhVyFKFvX8zKJ/C7CV1P4yXko1KI6KuDebA2dzisTM+y3bwU2eW3dPW jHzYdBXWT6CaKuZ3rx14ZPKc6Gonen4qg089rawb3G/coepIRBLEZYsVW6/fngqNh3MW El1dNRqpKbaKnW3yB1+Eon5gskVhUXk4MqFRQ/7WwRRCoLJM4GZiJb0yD9RJHY+MJcvv ouZ8W+M+fVkmsYE8hTWWzxWlvszlhwDrFkQyMPDzajNSjxDbMVA5trQKOFCdhIeOsfmm 2DcEDuQ5s4oNe6pMmbm1g/oraNmytLhOY1A88mF+ObgkNFJb9H0X7N2YIi5nqnGRZkyY pEBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=tQ31rQSdZphmwy1fH7OSWKSnmWWJtQvJOx37nZ6bnmI=; fh=cTOyeHIiotxFveWD397Up69SLR8Dqpy9YboYIfW0A00=; b=PzkNz/R2aBjSI4glNK4dV0J+z+H2hw9V4+8qu7RXygHMWrYyrGk429NkXcsMdCLM9I AD9g4JRo/ZtyeZTODvEQXK8EqUleXt3Ue2RUxgn4b4FYW2uiRrVbjA70uIXoSZmI+10M iFqZ3y9fHEcL4CS5RncsTYhv3A+sIRxwx2QMuCS96H17MpR45VdCZCktC9W3eusWA4Oh m9l0rdtnxrAwkDWAJ6COea+pvkKAopNcjXIvA9jIK8KDDchkVMVEgNb2/Gs+FPhhBJrx /wIbMWS9zyc9tJDzrRiG7zJojRkvpFlvNPNSIs2x7gI746sgw6b9q/A8WxdtXHdqHbL0 0m8w== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-31197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31197-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dz22-20020a0564021d5600b0055949f6cbd8si5073501edb.586.2024.01.19.05.27.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 05:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-31197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31197-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BDBD11F21A50 for ; Fri, 19 Jan 2024 13:27:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5858554BC3; Fri, 19 Jan 2024 13:25:43 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 522CD5380E for ; Fri, 19 Jan 2024 13:25:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670742; cv=none; b=n5TbJ4XAKt8T+yGfjFkXVStLcEoS94jKgSaXe4OuiRV1BMsflV+g/FZAmPFMxj8tXaryhiEHHaQuTUigrPhmsXvotlbg1wbrOh0GHDDYurL6HjPmFKhWdJDUwSUwy9Y9Dyuh5/kDm+oJnYBC6bdT2fHI1eAsYJH8JBz78l09p8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670742; c=relaxed/simple; bh=SnlmRY4YzKLUEZW36LRtIOn/V1xJIwJfrgcpZ0DRfw0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=u2ko5MTKCTKUAJqpLNGCtwFAya41Ho6qac8x4R+ErKdGxVbuXEyhvH7cURmIYUKaAzQi6VDlImKSumGqo9R/qe4eJu2sWD4wxejDpKPjPJcMy/Qa/2VGZICOIvJsTBJIiKfXpYmeiqDEq4BIQBtvIMXAszeuW/c2padTg9wPnoM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rQos7-00074E-C1; Fri, 19 Jan 2024 14:25:23 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rQos6-000viF-4D; Fri, 19 Jan 2024 14:25:22 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rQos6-00F97X-0B; Fri, 19 Jan 2024 14:25:22 +0100 From: Oleksij Rempel To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Srinivas Kandagatla Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, =?UTF-8?q?S=C3=B8ren=20Andersen?= Subject: [RFC PATCH v1 0/7] Introduction of PSCR Framework and Related Components Date: Fri, 19 Jan 2024 14:25:14 +0100 Message-Id: <20240119132521.3609945-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Hello all, This patch series introduces the Power State Change Reasons (PSCR) tracking framework and its related components into the kernel. The PSCR framework is designed for systems where traditional methods of storing power state change reasons, like PMICs or watchdogs, are inadequate. It provides a structured way to store reasons for system shutdowns and reboots, such as under-voltage or software-triggered events, in non-volatile hardware storage. These changes are critical for systems requiring detailed postmortem analysis and where immediate power-down scenarios limit traditional storage options. The framework also assists bootloaders and early-stage system components in making informed recovery decisions. Oleksij Rempel (7): dt-bindings: power: reset: add generic PSCR binding trackers power: reset: Introduce PSCR Tracking Framework for Non-Volatile Storage dt-bindings: power: reset: add bindings for NVMEM hardware storing PSCR Data nvmem: provide consumer access to cell size metrics power: reset: add PSCR NVMEM Driver for Storing Power State Change Reasons regulator: set Power State Change Reason before hw_protection_shutdown() thermal: core: set Power State Change Reason before hw_protection_shutdown() .../bindings/power/reset/pscr-nvmem.yaml | 54 ++++ .../devicetree/bindings/power/reset/pscr.yaml | 51 ++++ drivers/nvmem/core.c | 25 ++ drivers/power/reset/Kconfig | 30 ++ drivers/power/reset/Makefile | 2 + drivers/power/reset/pscr-nvmem.c | 100 +++++++ drivers/power/reset/pscr.c | 259 ++++++++++++++++++ drivers/regulator/core.c | 6 + drivers/thermal/thermal_core.c | 2 + include/linux/nvmem-consumer.h | 7 + include/linux/pscr.h | 40 +++ 11 files changed, 576 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml create mode 100644 Documentation/devicetree/bindings/power/reset/pscr.yaml create mode 100644 drivers/power/reset/pscr-nvmem.c create mode 100644 drivers/power/reset/pscr.c create mode 100644 include/linux/pscr.h -- 2.39.2