Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp464031rdb; Thu, 2 Nov 2023 08:35:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkRDK+OOljSb9xzMlFIWS8yFgW5tt7wL6hvHRn0zKbMmbd/tTaM1R3Smv+l6CPOhkM2ITH X-Received: by 2002:a05:6a20:b790:b0:17f:8f9f:14c2 with SMTP id fh16-20020a056a20b79000b0017f8f9f14c2mr11452223pzb.27.1698939358202; Thu, 02 Nov 2023 08:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698939358; cv=none; d=google.com; s=arc-20160816; b=tWq1ykDr2KjVBXEXvgJfVDAgaXF6sF8kq6Av556oRfE+rxUsnQ8Jx1jkqm3mH2l0pj gOZWpzBsJ9qSnXr3MEJTjOrT7tioRfXRTV1Np93MhC7qtxyKqB9OoBR/mDK8Ns5o7ZXm Q6duqMI5KAiULxZ936pKiKFfKS5XSAuSSV8gZsmVSM6YQLnoeq3vLuNwPH7sffw8Vu/B dTa7v5qXrhxzPQ/BWKoxYFzl2epsap2KXNnN2omAivtSaUyeAZfNcXqL0w2qohub5HG1 /HeaXughS00VXKeKYX1R4hZQb4e1cH9yfjcpmYSTxlSIDJxmpNeTK/j1UKcf/7YYzEvN olpw== 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=jGrzac9Ke25hyD7VfuBtsDHZigqOcYObR1W1e8Hntzg=; fh=wbKEeW64hJsqEx/ZBCF8IO+YhW050p37spGEuTuU6Tg=; b=RLOwG1P+823jpnJEFH6KnX3h0wzT/sNDrg5APo09Hj6qd32EhaABAraSW1sRNKuQT8 LdRukhLxnHQqkl9JXe1weptzg++KDCYHJVAIYdnGmdX07kuGjbEsEELrg5iuPhW4lDlU TujGVf6wF5YwOJAV3CghnLbcQyAIN7BDbp7QdolbxmKw6bxi0KMIzKS23RbPkHyWPD7K lpmGBxVvv2o2n6xhH/A/txHCoSiQ48engZ15rMvvIILi8G9DI8TXPT0g+iSrXPv2qDc6 9sD5m8AJ4Ju44GvlZcgsepQhyEeutyomp8Zo6Ha0JKgO/x1QRq1t8nD805MyN9dTmWua jN6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=Gyne+yRS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h7-20020a056a00218700b0069100706960si24410pfi.116.2023.11.02.08.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 08:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=Gyne+yRS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 8675580907BA; Thu, 2 Nov 2023 08:35:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376846AbjKBPeG (ORCPT + 99 others); Thu, 2 Nov 2023 11:34:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376845AbjKBPd5 (ORCPT ); Thu, 2 Nov 2023 11:33:57 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C8E413D for ; Thu, 2 Nov 2023 08:33:50 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-5b9a456798eso734121a12.3 for ; Thu, 02 Nov 2023 08:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1698939230; x=1699544030; 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=jGrzac9Ke25hyD7VfuBtsDHZigqOcYObR1W1e8Hntzg=; b=Gyne+yRSUFJHNI5jLRJSkgUTRUSbk8Zy/1fJCdEkqgBg6ZmE6HBqWnWCgr2BuP3e1G wT38rmmGMDOfWrXFqKEuH+826tm/c8p86RTjqHqzdoSDWX578GH8OVmrbfB9KOXMCVIC b8xOqJuYYcV2VDNTh3X5AUm0SDut868Phq8hyGw41dk9t5630+sPoZ1vC/AmCZfMmtlk wZEwAynHbs9QvrPNKxr+78ZFMHGNWmK1XJYIQ8O0sdZLAgX35qDecPhy2rX+LkJ6s4dX /NZoeeTm6RAuPmz+suUqBfUr6rxqJ7NLnEzdWgoiiUKzct2WFCUqPpv6X7cclmThNeLU 39Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698939230; x=1699544030; 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=jGrzac9Ke25hyD7VfuBtsDHZigqOcYObR1W1e8Hntzg=; b=BGjmodc0vRiO1DqNExPNzxFQrKRxP4i3GnQoFA0X6pdYfw4fpqFFuZugJS3zhjLBfX jxE71PJrkyCpbGEBJuOzvyuPbDV/A3do5FFgcs7OPou7dbgcSj+DkwZcnJ/xS2kdGewO z5FBdd5QUz8N86ak472KcHazHdsINGQ8HHgyvi5EO5cw0Y1QCdwQsmLAMlQVFYq9gCm2 EXYxwaXEoC62qA4PS6T/Te8mrjCMaAjMmfjXnk3SshSCc+eyR9CyO9gqLg0IVU/EuuVR VVZY3E377dMw7TAKR1OXakwy6LPM6ALzbyv2xzB6iuz6/8ej4sQY6byou5AjDvEvnhp+ EqtQ== X-Gm-Message-State: AOJu0YwOhLBMgi2DACQwCSr4pIsdHQALiwdwmC7b+f5QcF4ray7Ad1hh wYomZU+IJgmwZuAt5c1BM0w9HCrYhSXCXOBBq4u6dQ== X-Received: by 2002:a17:90a:fd8e:b0:27d:1c70:23d4 with SMTP id cx14-20020a17090afd8e00b0027d1c7023d4mr15158905pjb.44.1698939229731; Thu, 02 Nov 2023 08:33:49 -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 21:03:40 +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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 08:35:45 -0700 (PDT) Hi Mark, On Thu, 2 Nov 2023 at 20:31, Mark Brown wrote: > > 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? Sorry for confusion caused because I should first described my application requirements. Currently my application is interested in know regulator status i.e., ENABLE, DISABLE or ERROR. Also events are needed specifically to get them logged like UNDER_VOLTAGE, OVER_CURRENT, REGULATION_OUT, OVER_TEMP. Regards, Naresh