Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp293306rdg; Tue, 10 Oct 2023 10:20:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTomIifE2TjSpVUOvBeMJzGxNyK3B/MZ+oBEMKdX06M3gXznjOa+k/5w/RcHy7npVxTgrU X-Received: by 2002:a05:6a20:3d90:b0:15f:faab:1bd3 with SMTP id s16-20020a056a203d9000b0015ffaab1bd3mr19828048pzi.19.1696958413698; Tue, 10 Oct 2023 10:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696958413; cv=none; d=google.com; s=arc-20160816; b=pMAnf70UHPhUfAHEIrl0aQNo/W42IwtcQAldFZiRcqpIyj4l8tkrE/oPN9vjDgRG4v h+V2abeM2OEYwUez4WPnkkUVyBSvYqibyeG4ahsGSdpmZRr6v+lMpgDf8RWzKxgGIyK3 LPM2iJKQ94lcFLPBfm/JhHIb5HgG8Hzs4PGu43/as0XzX4cdEBvnkGoxiM79M3VupXbG cNxikKHNu4viB23RQCWx0GtCIaK+92DdBCfbjsLTrSP/WDe3TO3LkF89XWVqSOPpoJsW bWbz/hyyupqDWxR3Gpxd1J0/We518E/TIfW3rquvc/Yf9tvbMFWYi86KYCGzGdl0785D 54tA== 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:dkim-signature; bh=6ua77pWMA4a/BGLWAAw6bb+MSvd241dSIvO1nZyyWxY=; fh=cSFvPLKhWAn209sjsaVydDG8WBPXxBvpg/esH97vTvo=; b=J0fGLfuYxVDbuooKcmy4r/uJfY/owobfzqsBx9tWUOJgrmjSvNeEjpIqsOlf7jt0dk G1pQTcypk/SkkSmUZK5D5RNmwfV4cUUbdYvldyt6/LFMR9hsLMT3wtXI+AjQAafk3G/O MxLnJN+MXhMLfNCLjXDd5QuRdx+cMUqWqRSNUFHKE9gyNog9j5IGZuaUWEZLkNNmnY8J IRJfDr3BcqQkt9OCra1jvug5cjpQK3nXaUnsb/zAf1BwezbQM/QlBbcuvApv227TIFQh uhEMrB2Bakut7x4wn8I7/wcRju4DjO9NJyLk+hJSLOfjPEJGte37/oI5k1s6lGPqRxSn nYiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d4AoOsv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k4-20020a056a00168400b00690fc88e4acsi10792469pfc.228.2023.10.10.10.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d4AoOsv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 47C44804E898; Tue, 10 Oct 2023 10:20:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233895AbjJJRUI (ORCPT + 99 others); Tue, 10 Oct 2023 13:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232756AbjJJRUI (ORCPT ); Tue, 10 Oct 2023 13:20:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A147F93; Tue, 10 Oct 2023 10:20:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39426C433C7; Tue, 10 Oct 2023 17:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696958406; bh=qCJusQWtmT7cmM9tukUxP7rBW0qd61lclOqkdLABC9Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d4AoOsv5XE1vd2PTasKy09QSiUySWg/qOeHiXxYa5Hl8L6f4B268VJ4FHQf5uDN+f OuGGGEdLfwRgw/dhsgHIKHIE0ZIBtbC3iWsrnib0rEbWvT2YeP8WSr1tA75Scm7m76 rHLrobj6O8lSI2Urs9u2QZifRiXuAR3H+YqMgSXNWz9IDi45GgEzIhs2tT16vwiIUM +dwZTd2PFqrHVXzQSxVTXljAbuRTOzZzCZjmFsndVhQgZ0ZbTzwgSMOmc5X9bNUVbK Qq5L8uYim+az0tUwbMzBxbIsB1Pdf6ZQAOatqmrJZ/Pzk+illVXcyf/NQ7fSnUYGkc VsFGGOpovrRiQ== Date: Tue, 10 Oct 2023 18:19:59 +0100 From: Mark Brown To: Oleksij Rempel Cc: 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ih8Qo3EanWX6jsWc" Content-Disposition: inline In-Reply-To: <20231010125531.GA3268051@pengutronix.de> X-Cookie: I feel partially hydrogenated! X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:20:11 -0700 (PDT) --ih8Qo3EanWX6jsWc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 10, 2023 at 02:55:31PM +0200, Oleksij Rempel wrote: > The hardware I am working with has an under-voltage sensor on the 24V > supply regulator and some backup capacitors to run SoC for 100ms. I want > to forward under-voltage events across a chain of different regulators > to a designated consumer. For instance, to the mmc driver, enabling it > to initiate shutdown before power loss occurs. Additionally, a bit can > be set in the volatile memory of a scratch pad in an RTC clock to record > sudden power loss, which can be checked on the next system start. So it sounds like the underlying need is to flag the notifications from one of the regulators as being system wide and then take action based on those notifications somewhere basically disconnected? That does seem like a good use case. The MMC doesn't specifically care that it is handling a regulator notification, it more wants to know that the system is dying and doesn't really care how we figured that out so if we can hook it into a system level notificaiton it'd be happy and would also be able to handle other critical faults. I would have thought that we should have some mechanisms for this already for RAS type stuff but I'm drawing a blank on what it actually is if there is an existing abstraction. It could potentially go through userspace though there's latency concerns there which might not be ideal, there should at least be some policy for userspace. For the regulator itself we probably want a way to identify regulators as being system critical so they start notifying. It would be tempting 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 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 depends on specific hardware design... 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. I've also coped in Naresh and Zev who've been discussing something vaugely similar with userspace notifications for the userspace consumer - it's not the same thing given that you don't specifically need userspace to be involved here but it feels like it might have something of a similar shape, or at least there might be some shared interest. --ih8Qo3EanWX6jsWc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmUlh74ACgkQJNaLcl1U h9BF5Af/cNLrd9suEh0YQRnHMcZMOu5P6+gEvdfAYSXg0loxTuDLopt6elxYJCv2 zmqJiVW40ro7MaAB0jXUOtx24Pmq9+Bk6fzfMLa7VXbXagJWATmiyQSnSkppCyWM 92lTC3Q4ki1/ESroIxYQRWk7UMCPN+S4GC3qgOuRxrVhLjPJ+GcT9HFUeq8batZf 7ublB0wmAYUM4qZiTDMhxlxC0emAgob7u4qJXaeNOPk/26mksiuJTdeiDhMTx5b3 Ud3mzW+o8ErnRwNGAVAZ/kM+MH5idQAb6U1Kgu2XzDc6znqCie4e46XmekD0WeIT q7CtZrlu1/m46hXmiF9WVnGe4p4UfQ== =EDr0 -----END PGP SIGNATURE----- --ih8Qo3EanWX6jsWc--