From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92B2A2101A0 for ; Wed, 30 Apr 2025 08:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746003429; cv=none; b=NSudDfTPWXNIiNFO0BCGFpBdSdk4Yes6/Kb5O/jRSzEHyZOABZ7KPt8thz0Ym7LhvMKjcUiQliJHOQpDUWoydKvPEWlreOa/NPU9HKeIiP9ndZVPge3HYkuPIq6pSYSmyHuiSOt1bcRKPx7jpDOIjzjWVOEHyw4nSKxSTpP0yyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746003429; c=relaxed/simple; bh=HmpObSFeO5UPNf7n0OOoutsgQy3EA21CQ+IzvXSYVJ0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aUEBeUNL62LzNubMtiptR9jjpTFIdIonxmw3Ct9GT56NbcNOYVVxik2R9ODehKJBO3dUDoXprIqWag+zh3M8iTXaB4o/rvB6tTMB9LcDCh6PaXCuZrx35WWNduCkbnJ5siRRqC5OrT/WQatT/+ycbXybKCERjHtdLPHhqO0S4zw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=j2tsedHj; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="j2tsedHj" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-39c0dfad22aso5425291f8f.2 for ; Wed, 30 Apr 2025 01:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746003425; x=1746608225; darn=lists.linux.dev; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=vsX5iZ0Xf1hk18vldFSG+c7ZzQ/lrYQmQz9RDMkRt9Q=; b=j2tsedHjDsLKWGXGimp0K4qVLGjlNLA/xs19LlIw1WM+t6H7E0ZOVxhq06fESqYHzH ByLB3K0qyqyiAo3cIWJbrw/3PsgsfLxYIA7vqmQMYDVq7ZiYXBTCZoxfCM0bP4MxYccc Hk6sA6p+7jBQ+OXULojXBhSiT+A6WNaNHbCumldSXPj6cXkQtunYenavhEVL9uyq1v83 C1nzYhuJf8LZxIFxSgm0LxS3fIIaKVYZWEnq3bJCTWPWOPLGadVulNsseJGc14EviyYw HCFrv3zWXn8CA3fZ4BNvG/s53jn3G1J0v+px6Qw178ZMS8xNqrmqAQPzXI6wY92T9bMQ ukBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746003425; x=1746608225; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vsX5iZ0Xf1hk18vldFSG+c7ZzQ/lrYQmQz9RDMkRt9Q=; b=qREbXPCAFNGhEXvrTrTamEIcmf1LHvZiIb+EsglzGbdy2bMqQyEO/SYbAzxto8Z1rs d8a4B5qykRpMvcPMD/QT/G7ptskjSGvnCFY+kGLMs5Ql4S/MzLHlEfVsxxc5XZWsR+ZY gDjpk/ql1Ek+0kmZ8CJsa9RIpBxOJhMvOBGOFTKteCpwIA5iDi6uBgiS5q9PuT2Qkd/A 3NJH7rTDTv0xY2rXJ1vGtUSaL/valwGhC2OA8wpqYdGapnsN82L7tlR3OHrdVn0pP2gX Nrlq+TNWf4qCnoUClH2cpxuvCUV7WhbI6uK1JZm5EI3F5+aMy+zEImJVyOSTe9k/4hSi 1qBQ== X-Forwarded-Encrypted: i=1; AJvYcCWMN37igmx3HAqwYRskUPianD/hqX+bACjiwcjTzSPl3TpcITre2OfgtWXGUsEjqLsrDj9QKrwCr12WBXJF60A=@lists.linux.dev X-Gm-Message-State: AOJu0YyOKoCgU06Z8wniJDRjKBfdXN4F2O0kdhUeShIPDLRkQZXx78Sy d5TJtpv/00H0aXLtV3cAt671OQnShseB1e+dL3ftP1dc5pKmfmzkDSgL8pAD8oI= X-Gm-Gg: ASbGnct+cxDoBt/Ifk5z7Mmpjajl/5eKn6S8jmiOuxCRdpo+hrLS73JFR4KRwtk8oml pyqmAC96BbiYaltaHcgabAzT2Q/rvvuGiFJa5NDZ1Ik9WZZsBZB+OuwdW2vgIprJBoZS2yJaSnO W1im9/2SozeXIOypesCy8MxnTcQbksFiPa49uMPvdM30Hphk66ljp0yoZROjhx0d/HIu/NXvSFj HE0vUxWOL42juN1quSWg6nWgMCrI9n54G5YH05zPQK4j77JzNNyZibc3ZUlPT53oxnJUwCJCooh 6XHMj/LMzv++6xGxSF6yQQKH4oYHxkLgKaxerTgBMVYC99qJNMhS2aU9Y95QS87IZxtR1H/RyK9 K8/o= X-Google-Smtp-Source: AGHT+IFBjJKadcBgfxEfVMoyFdea06C48IeyCLSwft1QGBmLuLkmOrJI0pimONPp/u0K6tmc6/97nw== X-Received: by 2002:a5d:584f:0:b0:3a0:6ac1:93a1 with SMTP id ffacd0b85a97d-3a08f7997f9mr2181857f8f.7.1746003424853; Wed, 30 Apr 2025 01:57:04 -0700 (PDT) Received: from mai.linaro.org (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a073ca5225sm16654910f8f.33.2025.04.30.01.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Apr 2025 01:57:04 -0700 (PDT) Date: Wed, 30 Apr 2025 10:57:02 +0200 From: Daniel Lezcano To: Oleksij Rempel Cc: Sebastian Reichel , Srinivas Kandagatla , Benson Leung , Tzung-Bi Shih , Matti Vaittinen , Mark Brown , kernel@pengutronix.de, linux-kernel@vger.kernel.org, Liam Girdwood , "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , linux-pm@vger.kernel.org, =?iso-8859-1?Q?S=F8ren?= Andersen , Guenter Roeck , Ahmad Fatoum , Andrew Morton , chrome-platform@lists.linux.dev Subject: Re: [PATCH v9 2/7] reboot: hw_protection_trigger: use standardized numeric shutdown/reboot reasons instead of strings Message-ID: References: <20250422085717.2605520-1-o.rempel@pengutronix.de> <20250422085717.2605520-3-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250422085717.2605520-3-o.rempel@pengutronix.de> On Tue, Apr 22, 2025 at 10:57:12AM +0200, Oleksij Rempel wrote: > Prepares the kernel for the Power State Change Reason (PSCR) recorder, > which will store shutdown and reboot reasons in persistent storage. > > Instead of using string-based reason descriptions, which are often too > large to fit within limited storage spaces (e.g., RTC clocks with only 8 > bits of battery-backed storage), we introduce `enum psc_reason`. This > enumerates predefined reasons for power state changes, making it > efficient to store and retrieve shutdown causes. > > Key changes: > - Introduced `enum psc_reason`, defining structured reasons for power state > changes. > - Replaced string-based shutdown reasons with `psc_reason` identifiers. > - Implemented `get_psc_reason()` and `set_psc_reason()` for tracking the > last shutdown cause. > - Added `psc_reason_to_str()` to map enum values to human-readable strings. > - Updated `hw_protection_trigger()` to use `psc_reason` instead of string > parameters. > - Updated all consumers of `hw_protection_trigger()` to pass an appropriate > `psc_reason` value instead of a string. > - All structured logs now go through a single `pr_emerg()` in > `__hw_protection_trigger()`, providing consistent output: > HARDWARE PROTECTION : () > > Signed-off-by: Oleksij Rempel > Reviewed-by: Matti Vaittinen > Acked-by: Mark Brown > Acked-by: Tzung-Bi Shih Acked-by: Daniel Lezcano Thanks! [ ... ] -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog