Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp124050rdg; Thu, 12 Oct 2023 00:09:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8uxHC8i3Rfdddm+Oo3mpJPF4LgkNz5RylK3+8WfT+G1HdUcJNi6Fi1vI8MVB+kL7JZl5m X-Received: by 2002:a05:6a20:244f:b0:152:be08:b013 with SMTP id t15-20020a056a20244f00b00152be08b013mr24635782pzc.42.1697094553920; Thu, 12 Oct 2023 00:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697094553; cv=none; d=google.com; s=arc-20160816; b=CFeFc7Trg3FP1C3TJx7ImM9t0Q04D58MbDQYdXGK/gHqAErb49J0PbZG3P7Lpy40Kj SSmttP8sVp8/54VEShuB2mzEjCvjpSOvQOag8ANcZIrhPKuwDcvRcrwZPR1kXBxvUu7J FMWSdWr+w1kelMtnU4+DQswitR94snGzg4sLiyFRWmRHReGpAbgQUYyMQnzeBfFpdRF5 XmIKDclafLiZOoMKa6X9wsXe1CYapDkhbfO/XrjYxPFLj5QMzweXHHo8hJhB7W8RzYK7 Z7iqPioWFXKDcLvRZKxOibo/IJtpINhhoCKK0p496lUbiRiShbT+E4Mbc62FZSCiGqKr 2udg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=TpSfoJwDtnAsoTPya6J4WKkXULjEB6HnzhqPzwoz4os=; fh=9tL9dDT2PBBf4XdoWe/8XqMtymsBnL3IX+io4dEStrY=; b=JjxahtwxwNZHkQnN3yC6PtsdjMZ8tVyon3fMsFzp2GT2rWxr8HizDIhznbn+rrRCk2 cLaPzdVobfiFag1jNrsmnNMUgIwP8S2QNpAlnALOuSz9CyXVAWKbQxAMyKOEG2uVpytP DsmP687YznzzK+WHsvuHeJNVnn5OOc3HIISnzVDVlVdsFCrGTCjrpNN70ECrRiQlRwv7 fiivO5tSMBFmODzry5Ujb5VoGMgANrz/H38ZCoeQBvGAcpbEkfxJp8u1u4/47q4OuUaZ yxCwuLA2W92lM3zL8LPI0yo5vyfGcz9CNB6oNM45rEWV6YV/O8wzs2xH44R4UBufTmEA 5XIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id t7-20020a170902a5c700b001c9d7a75ab9si1496022plq.444.2023.10.12.00.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 00:09:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 431388211427; Thu, 12 Oct 2023 00:09:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343609AbjJLHJD (ORCPT + 99 others); Thu, 12 Oct 2023 03:09:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231828AbjJLHJC (ORCPT ); Thu, 12 Oct 2023 03:09:02 -0400 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB4A9D; Thu, 12 Oct 2023 00:09:00 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5045cb9c091so934615e87.3; Thu, 12 Oct 2023 00:09:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697094539; x=1697699339; h=in-reply-to: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=TpSfoJwDtnAsoTPya6J4WKkXULjEB6HnzhqPzwoz4os=; b=KhYpNwrSN9qG88SjqCplJa9WOav8/ZsRBEQ6s13uEWxWB5usom/87pBHRImc6YjXFf yqhjt8HEd+xROBKBYmS/ddE8ndhKMuTYCPD274N+C6aLcpKcA0trbzHB0y0d9Gqx93Br 7BYbYrYZXJF9HnEi4VUZbz9HYUqnPArNT5bydSxcMt9qRRpff0OaoQjpnK3D8Rmu2z8L IFiTpsylo/Xq76H05LM70iMQGSCvhHjaAIq/C2xS8UE1aONB00RCDKTrXUo9tCBFm4Ur 2MeYg/ROv1egJSNr/iJxV4TtYYbd9/4rzVv6xne1B91af3Z3uySk8PSIFQXzmN1AvEa9 dgSw== X-Gm-Message-State: AOJu0Ywuf27eVTara/etf+Ttf9L8PC+6qhRidLgIlf7LSGVM5Xdr93pW TZk9R35cccFbRS27tjtL26o= X-Received: by 2002:a05:6512:280d:b0:503:a9c:af83 with SMTP id cf13-20020a056512280d00b005030a9caf83mr23404209lfb.41.1697094538523; Thu, 12 Oct 2023 00:08:58 -0700 (PDT) Received: from dc78bmyyyyyyyyyyyyydt-3.rev.dnainternet.fi (dc78bmyyyyyyyyyyyyydt-3.rev.dnainternet.fi. [2001:14ba:16f8:1500::7]) by smtp.gmail.com with ESMTPSA id v23-20020ac25597000000b0050306259d8asm2646893lfg.215.2023.10.12.00.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 00:08:57 -0700 (PDT) Date: Thu, 12 Oct 2023 10:08:40 +0300 From: Matti Vaittinen To: Mark Brown Cc: Oleksij Rempel , Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , kernel@pengutronix.de, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Naresh Solanki , zev@bewilderbeest.net, Sebastian Reichel , linux-pm@vger.kernel.org Subject: Re: [PATCH v1 3/3] regulator: fixed: forward under-voltage events Message-ID: References: <20231010085906.3440452-1-o.rempel@pengutronix.de> <20231010085906.3440452-3-o.rempel@pengutronix.de> <5e51792a-cc93-4364-a51b-c2b116d89369@sirena.org.uk> <20231010125531.GA3268051@pengutronix.de> <20231011075931.GA3305420@pengutronix.de> <2d14fd22-c37b-4c15-a2ea-a2fd2c201adb@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zTBIn7qXME7IwVru" Content-Disposition: inline In-Reply-To: <2d14fd22-c37b-4c15-a2ea-a2fd2c201adb@sirena.org.uk> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 12 Oct 2023 00:09:11 -0700 (PDT) --zTBIn7qXME7IwVru Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 11, 2023 at 12:38:19PM +0100, Mark Brown wrote: > On Wed, Oct 11, 2023 at 09:59:31AM +0200, Oleksij Rempel wrote: >=20 > > Configuration through the device tree and kernel defaults is preferable. > > For instance, having a default kernel governor that doesn=E2=80=99t req= uire user > > space configuration aligns with the project=E2=80=99s objectives. >=20 > That's policy though... >=20 > >=20 > > > For the regulator itself we probably want a way to identify regulators > > > as being system critical so they start notifying. It would be tempti= ng Can the "criticality" could be determined by the severity (ERROR vs WARNING= )? > > > to just do that by default but that would likely cause some issues for > > > example with regulators for things like SD cards which are more likely > > > to get hardware problems that don't comprimise the entire system. We "comprimise the entire system" sounds (to my ears) exactly the difference between WARNING and ERROR notifications. > > > could do that with DT, either a property or some sort of runtime > > > consumer, but it might be better to have a control in sysfs that > > > userspace can turn on? OTOH the ability do something about this depe= nds > > > on specific hardware design... > > >=20 > > > I've copied in Sebastian since this sounds like the sort of thing that > > > power supplies might have some kind of handling for, or at least if we > > > need to add something we should make it so that the power supplies can > > > be joined up to it. I do see temperature and capacity alerts in the > > > sysfs ABI for power supplies, but nothing for voltage. > >=20 > > Thank you for pointing towards the power supply framework. Given the ha= rdware > > design of my project, I can envision mapping the following states and > > properties within this framework: >=20 > There's also hw_failure_emergency_poweroff() which looks like exactly > what you're trying to trigger here. There is already a path from regulator notification handling to the hw_failure_emergency_poweroff() - although only when handling the IRQs fail and this failure is marked as fatal. > > Considering the above mapping, my initial step would be to create a sim= ple > > regulator coupled (if regulator is still needed in this casr) with a De= vice > > Tree (DT) based power supply driver. This setup would align with the e= xisting > > power supply framework, with a notable extension being the system-wide > > notification for emergency shutdown upon under-voltage detection. >=20 > It sounds like this is actually a regulator regardless of if it also > appears via some other API. I wonder if it would make sense to add a 'protector' in regulator core. The 'protector' could register to listen the notifications from those regulators which have some 'regulator-fatal-notifications =3D ;' -property defined in device-tree. In my eyes the device-tree is correct place for this information because whether an "anomaly" in regulator output compromises the system is a property of hardware. Yours, -- Matti --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --zTBIn7qXME7IwVru Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmUnm20ACgkQeFA3/03a ocWoBAgAvt694sDu7d/r9CyhNbd/uDFnCTQ6LVK2CakUfO4JsjW/x+Pe1YrvRlQc EZkpcaH0TKhQEc1jS+E8pYuX9YVjmAmmRJKQVe3PhK3lRc8WwqX2iWgALbHI0A/b GudY8ngHDk1ShNLZfwMFLRghRSc+kBIEs/ZnsWG0dJDr2l/Tr6n6uAtgkWZC3i6X vuAoq7g9NQRXBD0kBctmmWJfWcUSc0tFPN+fAqvQuUERms8opu95YFpIpBuFx8Hi yw2JiMPrwVOrHeIb5ZhJuVho41BcmnFcU2bCKYXdrXfS1QX5b3mbUHdC3nrBfI0V HtUJ12Ohl3YkW1euY/4rfDrL7lYHTw== =JFJH -----END PGP SIGNATURE----- --zTBIn7qXME7IwVru--