Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp430853rdb; Thu, 2 Nov 2023 07:48:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeHL8hhvcTfQDd3ji1zHGFKK7MStIb8h9dfZ83zG2Env/MwQVtQBe7PK8sWKDVDcjgVVvb X-Received: by 2002:a05:6a20:5497:b0:16b:f3b1:c040 with SMTP id i23-20020a056a20549700b0016bf3b1c040mr17601941pzk.38.1698936495333; Thu, 02 Nov 2023 07:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698936495; cv=none; d=google.com; s=arc-20160816; b=tS0eC3i2e6tBfBqRfiCSAM4weR5FtVbDb5/qEaZ5BZ3oe8SxMSLWV8bTS7VfVAMahv +FpHqOjlcxdnT17Klf1GWDQkZTaQj3sj/OiFsTj6k2Gw9MI8IrEYx1emv1ZTZNb2PZAl +qrI7eAp+YZsgKOk8xqmXrZeE6DcO2Wg+/vqnnePfDjj9/tqlTxBiyULRoglOz2UiiwC Fp3yQUOhM9Q5ILhbUlE93VMRwHzM3c79hLAMxy78zxLmA2BfH4SX/t2cy0UWwKOBdbQm ZuD3lR1WIJFEYj7y4zc3GcZNzFnUxCDOS8KOusLv9QoPDK8/w0YcDs+8FBMp0yO/oh1I qyzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BwaYXZPU1hQEMGgRdu2M9aQmHUJvo+2fE01ng2l9LSs=; fh=wbKEeW64hJsqEx/ZBCF8IO+YhW050p37spGEuTuU6Tg=; b=NOVdn9ni74QwHZHlcyORNrFy1n3P5P8nDiOz/9D/RmgV3pvvG/echOiPKLcVEzqd+s dZ3cY1u0gGycpy7iYSzv51t4Epi1zXGD/gWuPPLRDG5tVuy0mlG7B2FXPEaEDBnVBhHd HQ3gEaRUFDPOO8nNwkjAmorAMitWH2ZgcxEq82oQfWDa6NS5oGh/oJMtpEaD8uRnTFxB SC+M8SfLBDE4oJBhV+ZS8AYPaCPn0BQ3Q+LxwkQBmKFDliXmt05cQ3zKnnEKpbUVQ9C+ cC4uuOdIOn+3GZQUmgswfnjM5OweKeUBAkGH7jbi1hEf4AX81gKx3By9pd3Pj0tP88j9 Z9VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=KhJhhdY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id cl20-20020a056a02099400b0058a4883e6casi2322688pgb.225.2023.11.02.07.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:48:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=KhJhhdY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id EC31B80236FF; Thu, 2 Nov 2023 07:48:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbjKBOrx (ORCPT + 99 others); Thu, 2 Nov 2023 10:47:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjKBOrv (ORCPT ); Thu, 2 Nov 2023 10:47:51 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12042B7 for ; Thu, 2 Nov 2023 07:47:46 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5a9d8f4388bso707955a12.3 for ; Thu, 02 Nov 2023 07:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1698936465; x=1699541265; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BwaYXZPU1hQEMGgRdu2M9aQmHUJvo+2fE01ng2l9LSs=; b=KhJhhdY9DT0PqmgJ2oumKZFWrJGjEIEhgi7nxs7cZgybRtReS6jGSLn8ku4bUZdR6f 5om2rloiD6XGlvENi+eneoBA5q0Y9cFlz97NVLIhqHy2uzXufp3Hz1uEx29d1jlR6q/p gM6j0K5cdhxvEv1NgpOANk06kQr5t77v0MD57+hED6Z4bfGBBo7jfvZod54Iq9GskP57 jdytEHybyLK0OLz9NChhSJI6sRhkPsWIBgOvOgwKW41U31u5FFq6GJl0/SRDhiuKIlS5 GVE2p8aX2UWQ34s34OprcyPwLCJNNivY5G6dDNuifqr/Vwdtj8zNA4m2w+BnImzcfMl9 hwKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698936465; x=1699541265; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BwaYXZPU1hQEMGgRdu2M9aQmHUJvo+2fE01ng2l9LSs=; b=Cxuv54NW77qFe/IuuBwkvH/41Gdt1/7CFj9EE/oMv/mFI3AV0H/SE5ezgWhxWCcaSU HQQXYTpJv5M5vd2CInyLYyIPGs98TYSqbWz3SDPdzctdMBa6GbAYcjD3NQOdCesYRggu 6skohYdSDYno7FoojvaW2uOBWaYjMbC46NSVyKMsb96ZQabABcRQ/CIBWBc9IDhevVV/ 5LEABTYEsRoCHdXg2qs6Bf5YfmOuZ1m7mJvRpWss/vqK85WS0gLMXs5qmBuFtRMqZUhK ywcvsVQNvN6dsSqNJa253mx1giXYtoo0xFv+PtkAfE+jYbeKO9NXYE3/Q7OSbxIyXIji pR0g== X-Gm-Message-State: AOJu0YwzjbP9AvXVJLnxxhe35ooxs5NCGmg1CDpYurfca8us912apgK6 iQ6/jSgQe2SmyO1QMDkryCZ/ZWwqM14wGXQUSZ1IAQ== X-Received: by 2002:a17:90b:38c6:b0:280:1df1:cbc7 with SMTP id nn6-20020a17090b38c600b002801df1cbc7mr12800756pjb.19.1698936465526; Thu, 02 Nov 2023 07:47:45 -0700 (PDT) MIME-Version: 1.0 References: <20231005133059.917577-1-naresh.solanki@9elements.com> In-Reply-To: From: Naresh Solanki Date: Thu, 2 Nov 2023 20:17:35 +0530 Message-ID: Subject: Re: [PATCH] drivers/regulator: Notify sysfs about status changes To: Mark Brown Cc: zev@bewilderbeest.net, Liam Girdwood , Patrick Rudolph , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:48:09 -0700 (PDT) Hi Mark, On Thu, 2 Nov 2023 at 18:36, Mark Brown wrote: > > On Thu, Nov 02, 2023 at 05:35:42PM +0530, Naresh Solanki wrote: > > On Thu, 5 Oct 2023 at 22:30, Mark Brown wrote: > > > On Thu, Oct 05, 2023 at 03:30:58PM +0200, 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); } Regards, Naresh