From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12D28C83F2C for ; Sun, 3 Sep 2023 13:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239895AbjICNjh (ORCPT ); Sun, 3 Sep 2023 09:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239681AbjICNjf (ORCPT ); Sun, 3 Sep 2023 09:39:35 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E5E3123 for ; Sun, 3 Sep 2023 06:39:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C7F3ECE0AF1 for ; Sun, 3 Sep 2023 13:39:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95427C433CA; Sun, 3 Sep 2023 13:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693748356; bh=vFZrypYTdTZY4tH9j+WcacU5AKW83DdoognQj/JAc8k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gCPkZvE7ldUL3WJIJmsPh+Tn+4v0Rc2sZ6UJZO9I+VaqmSOmQQ8O3znzFfBDFwAcP Cm7ESrHhJtdBHRB7Pn+7Avfvnj0u7CTtm1FBXwJe6G46kpjQV539XBXcxqQdk5uHSG 1uGtxxX7fVRgaD2SPDTcgd5AqfQA2rRCvyxOH5EM= Date: Sun, 3 Sep 2023 15:04:23 +0200 From: Greg Kroah-Hartman To: Zev Weiss Cc: Naresh Solanki , broonie@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] Documentation: ABI: sysfs-driver-regulator-output Message-ID: <2023090330-bling-mammary-3177@gregkh> References: <20230831121412.2359239-1-Naresh.Solanki@9elements.com> <20230831121412.2359239-3-Naresh.Solanki@9elements.com> <90b1af83-cb03-476f-9147-eb06247bf09c@hatter.bewilderbeest.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90b1af83-cb03-476f-9147-eb06247bf09c@hatter.bewilderbeest.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 01, 2023 at 02:13:23AM -0700, Zev Weiss wrote: > Adding Greg re: sysfs ABI design... > > On Thu, Aug 31, 2023 at 05:14:10AM PDT, Naresh Solanki wrote: > > Adds sysfs-driver-regulator-output > > > > Signed-off-by: Naresh Solanki > > --- > > .../ABI/testing/sysfs-driver-regulator-output | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > create mode 100644 Documentation/ABI/testing/sysfs-driver-regulator-output > > > > diff --git a/Documentation/ABI/testing/sysfs-driver-regulator-output b/Documentation/ABI/testing/sysfs-driver-regulator-output > > new file mode 100644 > > index 000000000000..f9b0a8f810fa > > --- /dev/null > > +++ b/Documentation/ABI/testing/sysfs-driver-regulator-output > > @@ -0,0 +1,11 @@ > > +What: /sys/bus/platform/drivers/regulator-output/*/events > > +Date: August 2023 > > +Description: Provided regulator events. > > + > > + Read provides various events the regulator associated with the > > + driver has encountered. All REGULATOR_EVENT_* are > > + defined in include/uapi/linux/regulator.h > > + > > + e.g. > > + cat /sys/bus/platform/drivers/regulator-output/ssb_rssd32/events > > + 0x0 > > If we really are going to proceed with a "read with side-effects" > (clear-on-read) design, that should absolutely be loudly and clearly > documented, since it's very different from how sysfs files typically work > and hence a somewhat glaring principle-of-least-surprise violation. Also, > since from the code it looks like it's intended to be used via poll(2), that > should be described here as well. Poll? Ick, but that can happen. But yes, reading a sysfs should almost never cause a side affect at all. But what do you mean by "clear events?" sysfs is only "one value per file", so you are only returning a single event, right? It can't be a list of events, sorry, that's not ok, use a different api for that please (like a char device node.) thanks, greg k-h