Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp439564rdb; Thu, 2 Nov 2023 08:02:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbR/7bJyokyPhEUI3YndE0yaGp5TSLDo6yRySQlx8dcMASHZ/QsPYfuz8IPs06wgcRJnJR X-Received: by 2002:a05:6a21:7985:b0:181:24f1:55a5 with SMTP id bh5-20020a056a21798500b0018124f155a5mr6367868pzc.57.1698937337150; Thu, 02 Nov 2023 08:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698937337; cv=none; d=google.com; s=arc-20160816; b=Bu/uY5GABAvCsVys+DZiK90k/iCjNFbDx4RdxvtwM2aOE0icw4hG6DNtNSQ6UO7VdK Z0CUUMwu1z46PdlIg8EUEMllYTGjur461sec+1z/EgyuhslFiOEE783AaZskMoxFWySr oAeUp/M5lFawFEIvc3KKNBEMk75QPws7Qier+E28DVYZ366J7PhjVIi4gkCkjmKMIrAW j0fOPgF+skDOH3jkWZLI9PRCSAppSHkQ1KkGA8vt38JzU8O25+bUN8n0GecSAl5jaZ8a 2U+pOvpN917H9tGmSJyezdUozgvlNB5aDKaRABYcEdblseIwltH40BnLgO1p2AaNnNFn Q1fQ== 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=ywNHBNQ2sd0Uv5TVoVpRMg6oAq97Jiie0cWJuwYGKo4=; fh=2SeEX+jEJ0OR/UbhEOl77NxROnWOC8uwxH6UZ9LzEaI=; b=KRwHGQUdi6Deewx7rq/y5U3VAAcPR4YaEGDVlh8p4E+MlmvaHocey81zP6WdvoAse9 pfpK67iqgxgNuvShJ2RJ1+A/ML+JD6fwH87PcStnCwmjuIBn2sF9s498+TL7wKkPZAvF vgMGCN3R6UpiATH974/wtA84FWfbLv+pfulbSQEI7bQ0CSECLM28Z8/k5YDCJFIgbH9u XvEVLMS8g6dhmvPTHclxkdWxlLIRNn2WQkVKOWozGHC8juxJIODJCMa+aJQDrYmO1CGo liaZTNLSpm8ayCLe/OC7tjtrpB8lLMmGU9adrT4TYMb5JdNjQZp0SBldveMiA8NRR02t UhiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XIgkj/TT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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. [23.128.96.37]) by mx.google.com with ESMTPS id c68-20020a633547000000b005b8857bb156si2015590pga.463.2023.11.02.08.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 08:02:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XIgkj/TT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 EAD718239E81; Thu, 2 Nov 2023 08:01:59 -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 S1344209AbjKBPBq (ORCPT + 99 others); Thu, 2 Nov 2023 11:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234149AbjKBPBm (ORCPT ); Thu, 2 Nov 2023 11:01:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 009D9181 for ; Thu, 2 Nov 2023 08:01:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 272F2C433C9; Thu, 2 Nov 2023 15:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698937299; bh=fmOwJyB04PaoZH9ELzMtvpiRvHraTu/GpKJhuwh2U5U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XIgkj/TT5WWRVfeIeTiV1V5AkGmKYZ8swMn/7HNF5u94sKFRveZSfBPRGbv8ffbjA bwQRQ+r5Bw9brFk2Oq5pES4KLK/bFtnRyUM0844EhYzvxoSrzCr7e7ZV8ubO6iIC9V G0hz1LlIJ6mnasi7n+BJl+Snwpon78uz5otbVFRnpmEwG/NkH/DWSZHlCZLmsJVfg1 AAU+QkALFQDPMmd0VnlxGfUBWysfn7tFCvMcCx6RhHpzYKkrwc8URJvABjpC8mgbEW cPxYiZtzC/W0YTMu9XwMywscM84rHl3Knq7JWg1Z2Xa6jMTs3C28tGM8BTQ1s6AYLh 5+Nf1Z8DF++Lg== Date: Thu, 2 Nov 2023 15:01:34 +0000 From: Mark Brown To: Naresh Solanki Cc: zev@bewilderbeest.net, Liam Girdwood , Patrick Rudolph , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/regulator: Notify sysfs about status changes Message-ID: References: <20231005133059.917577-1-naresh.solanki@9elements.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WEH39aLhKbvS+56k" Content-Disposition: inline In-Reply-To: X-Cookie: A is for Apple. X-Spam-Status: No, score=-4.8 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,T_SCC_BODY_TEXT_LINE 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]); Thu, 02 Nov 2023 08:02:00 -0700 (PDT) --WEH39aLhKbvS+56k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 02, 2023 at 08:17:35PM +0530, Naresh Solanki wrote: > On Thu, 2 Nov 2023 at 18:36, Mark Brown wrote: > > On Thu, Nov 02, 2023 at 05:35:42PM +0530, Naresh Solanki wrote: > > > > We probably should filter the events more, there's events for pre and > > > > post voltage change for example which aren't status changes so would be > > > > spurious. It ought not to break anything but we should still avoid > > > > unneeded work. > > > Can you please provide me inputs on the additional filtering needed for this. > > > Like some list of events for notify on status? > > I think I'd start off with just reporting things that are obviously > > errors and not things that should ever go off during normal operation. > This is what I could come up with: > if (event & REGULATOR_EVENT_VOLTAGE_CHANGE) { > name = dev_attr_microvolts.attr.name; > sysfs_notify(&rdev->dev.kobj, NULL, name); > } else if (event & (REGULATOR_EVENT_DISABLE | REGULATOR_EVENT_ENABLE)){ > name = dev_attr_status.attr.name; > sysfs_notify(&rdev->dev.kobj, NULL, name); > } That's the opposite sense to what I was thinking of - we're reporting voltage changes and enables to userspace rather than just errors. My concern here is that this could generate an awful lot of notificaitons for normal operation on systems that don't use the uevents, I was expecting this to be used for errors. Could you remind me what the use case is here, I think I might've got myself confused sorry? --WEH39aLhKbvS+56k Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmVDuc4ACgkQJNaLcl1U h9AP2gf/T9vW4sXkzI9WXS9YG/AYUayuS/T91MPXRfPvenhWPwjUdUUeyVyPcmec coSmMfbdsWMvD+tqhlqdowUqqJfqiTsRtBzWi4Jk9+u4QId7wbPyGptXiNSMOh8l N/zipc8O/IFet9DaiWeIeqfvbSC2E68eesOR/sJ9wwHFqM4mcVQREZ+aRfU+0dpW uW+XSMgXOe2f1ibyEnkKw5doPNpiTo3/RFKI1X93j6PjNN9Fiy9Kjsypmr+UzKW9 1P4YiMZCw8TMLI3duKBRWFydSEalvzKoPjlzp+xYqabl/0K8ICyZ6KgZxvm+677Q 2YRB8g2o/fpnu/iDrkhlrhAHqF6jUg== =ipEo -----END PGP SIGNATURE----- --WEH39aLhKbvS+56k--