Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp442353rdb; Thu, 5 Oct 2023 10:12:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2A6bME9jW92f+plQI+qQ6Ex3Wx46o3GqWN9lw+JX8KbVKoBL3nb86cKdWzCPUX9oM5w31 X-Received: by 2002:a17:90b:17d0:b0:276:4d97:7cbb with SMTP id me16-20020a17090b17d000b002764d977cbbmr5830063pjb.17.1696525975864; Thu, 05 Oct 2023 10:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696525975; cv=none; d=google.com; s=arc-20160816; b=U46H8Gzhlt84bvdHLoGSOz+DvNU1AX4W19cHi1GDeDncG/ZD0qXZDu5kvBDzR9IVNR OBpZpynCMmDmdfCmqQFQj1qKAagnzvDPvJV+OVJA++uM2RBD6JUX+s2Kz5PT2S4lHcbT Xx92O3Db2gbRw0OZTuAjiSJ2M/C0sqDWgyC3LO0kscupEttmVSybN7mABVcc61jO3n8P 4mkSS5MY/tgS+dBIK7JgTlFqxx14WZi98+81Lgkn8yPiweXES7ATMQ+COSRiZUZzePWI GcAYQ57TyCBgSSUTJ4zWjhYhVS+coT6hmI/siGue2+ZM6Q7gS+woo4WyMJlSQPbnxDEW KTuA== 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=tYOMOPUigmbfYCt5OayZrw7Q6Nj6YnXmfc6u+ehVwtE=; fh=2SeEX+jEJ0OR/UbhEOl77NxROnWOC8uwxH6UZ9LzEaI=; b=ElqyCWYHp8hZ9GhlMEz8mZqmob1WQmrZt7g3GrnWuitjdkL7XR6tKFJF3uqBj5kaqP bZqlu+PVlT/k0f0NHP7+nYc01b39xqnR2Z5EXXxrGD45y7AcfFWvVCm3P64a40mraPAv 7LqlPPfmF6V2fwLDMZHvScuLDW+oKMS0HoUdOwQGoNwN5ciCCmDSgjX/cimS/qBwZZUj deljVdSCmGz0ENM058wacqhZgHdS4tctGHKEywIpzaIUkHgWcHNgKljE3gVNcujv4+vq QC4Y18V0ZhhKmZNkpekoqX31vKgdIivg3BPalX5DD8Qf1f1Y7/zadWuBuQQoN0Mh/73e 7RBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fkzvrZcX; 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 y13-20020a17090a1f4d00b002792831692csi3903797pjy.58.2023.10.05.10.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 10:12:55 -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=fkzvrZcX; 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 C8BBF833816A; Thu, 5 Oct 2023 10:12:54 -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 S230007AbjJERMp (ORCPT + 99 others); Thu, 5 Oct 2023 13:12:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbjJERMA (ORCPT ); Thu, 5 Oct 2023 13:12:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2B55D7F for ; Thu, 5 Oct 2023 10:00:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F88DC433C7; Thu, 5 Oct 2023 17:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696525218; bh=86XiYA1FQuVR5BbSaxpdLp3LI/kn4PquHymjBZnaAGI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fkzvrZcXSuO6dkHKbfhmj2MQDc9eItvUA+dCBgFPijJKavlS3UZx6HzUyZrBCkzfe S68tUG/+EhoKPP46VVEVGDEyU/bQ+uwpK8ZXOq7WWO18q0sxfzSqLjKQWA2YJujXw6 3P9fKYItthZ6yeCLDGXIQnGLWBVvmbjvZrGzJvStigB2HwZyCOis5TCWv7TPS9zoyo 9konQVRUToAETGLHNem15eX/4HvTfI8NtT7ZJYAMJt9YOmdd9wurvAKfVBqtD2Ve6P ZBk/snSAaVbHwyXWg85gX0dQs14MZRGCYv2lnYQxgkM0VvqtSE6bLu+Pud7IlqYnQk xJBtXtwo9kLLg== Date: Thu, 5 Oct 2023 18:00:09 +0100 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="SLnAbS/VBTaPciER" Content-Disposition: inline In-Reply-To: <20231005133059.917577-1-naresh.solanki@9elements.com> X-Cookie: Avoid contact with eyes. 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]); Thu, 05 Oct 2023 10:12:55 -0700 (PDT) --SLnAbS/VBTaPciER Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 05, 2023 at 03:30:58PM +0200, Naresh Solanki wrote: > static int _notifier_call_chain(struct regulator_dev *rdev, > unsigned long event, void *data) > { > + const char *name; > + int ret; > + > /* call rdev chain first */ > - return blocking_notifier_call_chain(&rdev->notifier, event, data); > + ret = blocking_notifier_call_chain(&rdev->notifier, event, data); > + > + if (event & REGULATOR_EVENT_VOLTAGE_CHANGE) { > + name = dev_attr_microvolts.attr.name; > + sysfs_notify(&rdev->dev.kobj, NULL, name); > + } else { > + name = dev_attr_status.attr.name; > + sysfs_notify(&rdev->dev.kobj, NULL, name); > + } 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. --SLnAbS/VBTaPciER Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmUe65gACgkQJNaLcl1U h9DCfwf+LUhbXlkKauGCY8NjdxnbdbEs6qPtGac8GoQu/08ZVd20WijGczYB6m3I rDeSPqqkkzlC18VK2tWXRk7vjduLLYs8gTWDb1KC60000IKsDj6uI4SpzPq9d7UW p8dj2XRTOfo+mgvQVD8N7JXDixYNDAafKZema+7Lj3oBdvOaIpiCca430OOUYakQ WZwGIEcundZ9lietQKUVwXRNhS33htfUlGq9C+nVYi/hk0f8SlXaC0QubuHPiZME 2278Qlh56aIki9vMq7SLWWv1TBnHasAV3BVFINzCfYNaf2sDPFDEKSM4R9zxkv1U mbWfL4ZlYnuh0ZqS9t3EU71YK87zjQ== =az4C -----END PGP SIGNATURE----- --SLnAbS/VBTaPciER--