linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Fabrice Gasnier" <fabrice.gasnier@st.com>,
	"Linux Doc Mailing List" <linux-doc@vger.kernel.org>,
	"Gautham R. Shenoy" <ego@linux.vnet.ibm.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	"Javier González" <javier@javigon.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Alexandre Torgue" <alexandre.torgue@st.com>,
	"Andrew Donnellan" <ajd@linux.ibm.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Baolin Wang" <baolin.wang7@gmail.com>,
	"Benson Leung" <bleung@chromium.org>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Bruno Meneguele" <bmeneg@redhat.com>,
	"Chunyan Zhang" <zhang.lyra@gmail.com>,
	"Dan Murphy" <dmurphy@ti.com>,
	"Dan Williams" <dan.j.williams@intel.com>,
	"Enric Balletbo i Serra" <enric.balletbo@collabora.com>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Guenter Roeck" <groeck@chromium.org>,
	"Hanjun Guo" <guohanjun@huawei.com>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Johannes Thumshirn" <johannes.thumshirn@wdc.com>,
	"Juergen Gross" <jgross@suse.com>,
	"Konstantin Khlebnikov" <koct9i@gmail.com>,
	"Kranthi Kuntala" <kranthi.kuntala@intel.com>,
	"Lakshmi Ramasubramanian" <nramas@linux.microsoft.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Len Brown" <lenb@kernel.org>,
	"Leonid Maksymchuk" <leonmaxx@gmail.com>,
	"Ludovic Desroches" <ludovic.desroches@microchip.com>,
	"Mario Limonciello" <mario.limonciello@dell.com>,
	"Mark Gross" <mgross@linux.intel.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Mike Kravetz" <mike.kravetz@oracle.com>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	"Nayna Jain" <nayna@linux.ibm.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Niklas Cassel" <niklas.cassel@wdc.com>,
	"Oded Gabbay" <oded.gabbay@gmail.com>,
	"Oleh Kravchenko" <oleg@kaa.org.ua>,
	"Orson Zhai" <orsonzhai@gmail.com>, "Pavel Machek" <pavel@ucw.cz>,
	"Pawan Gupta" <pawan.kumar.gupta@linux.intel.com>,
	"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
	"Peter Rosin" <peda@axentia.se>, "Petr Mladek" <pmladek@suse.com>,
	"Philippe Bergheaud" <felix@linux.ibm.com>,
	"Richard Cochran" <richardcochran@gmail.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Thinh Nguyen" <Thinh.Nguyen@synopsys.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Tom Rix" <trix@redhat.com>,
	"Vaibhav Jain" <vaibhav@linux.ibm.com>,
	"Vineela Tummalapalli" <vineela.tummalapalli@intel.com>,
	"Vishal Verma" <vishal.l.verma@intel.com>,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-pm@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	netdev@vger.kernel.org, xen-devel@lists.xenproject.org,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Duplicated ABI entries - Was: Re: [PATCH v2 20/39] docs: ABI: testing: make the files compatible with ReST output
Date: Tue, 10 Nov 2020 08:26:58 +0100	[thread overview]
Message-ID: <20201110082658.2edc1ab5@coco.lan> (raw)
In-Reply-To: <20201108165621.4d0da3f4@archlinux>

Hi Jonathan,

Em Sun, 8 Nov 2020 16:56:21 +0000
Jonathan Cameron <jic23@kernel.org> escreveu:

> > PS.: the IIO subsystem is the one that currently has more duplicated
> > ABI entries:  
> > $ ./scripts/get_abi.pl validate 2>&1|grep iio
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_x_calibbias is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:0  Documentation/ABI/testing/sysfs-bus-iio:394
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_y_calibbias is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:1  Documentation/ABI/testing/sysfs-bus-iio:395
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_z_calibbias is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:2  Documentation/ABI/testing/sysfs-bus-iio:396
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibbias is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:3  Documentation/ABI/testing/sysfs-bus-iio:397
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibbias is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:4  Documentation/ABI/testing/sysfs-bus-iio:398
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibbias is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:5  Documentation/ABI/testing/sysfs-bus-iio:399
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_count0_preset is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:100  Documentation/ABI/testing/sysfs-bus-iio-lptimer-stm32:0
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_count0_quadrature_mode is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:117  Documentation/ABI/testing/sysfs-bus-iio-lptimer-stm32:14
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available is defined 3 times:  Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8:2  Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:111  Documentation/ABI/testing/sysfs-bus-iio-lptimer-stm32:8
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_frequency is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371:0  Documentation/ABI/testing/sysfs-bus-iio:599
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_powerdown is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371:36  Documentation/ABI/testing/sysfs-bus-iio:588
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_currentY_raw is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-light-lm3533-als:43  Documentation/ABI/testing/sysfs-bus-iio-health-afe440x:38
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010:0  Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc100x:0
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw_available is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010:1  Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc100x:1
> > Warning: /sys/bus/iio/devices/iio:deviceX/sensor_sensitivity is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-distance-srf08:0  Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935:8
> > Warning: /sys/bus/iio/devices/triggerX/sampling_frequency is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:92  Documentation/ABI/testing/sysfs-bus-iio:45  

> 
> That was intentional.  Often these provide more information on the
> ABI for a particular device than is present in the base ABI doc.

FYI, right now, there are 20 duplicated entries, being 16 of them
from IIO, on those files:

	$ ./scripts/get_abi.pl validate 2>&1|perl -ne 'if (m,(Documentation/\S+)\:,g) { print "$1\n" }'|sort|uniq
	Documentation/ABI/stable/sysfs-driver-w1_ds28e04
	Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8
	Documentation/ABI/testing/sysfs-bus-iio-distance-srf08
	Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371
	Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010
	Documentation/ABI/testing/sysfs-bus-iio-icm42600
	Documentation/ABI/testing/sysfs-bus-iio-light-lm3533-als
	Documentation/ABI/testing/sysfs-bus-iio-timer-stm32
	Documentation/ABI/testing/sysfs-class-backlight-adp8860
	Documentation/ABI/testing/sysfs-class-led-trigger-pattern
	Documentation/ABI/testing/sysfs-kernel-iommu_groups

> 
> A bit like when we have additional description for dt binding properties
> for a particular device, even though they are standard properties.
> 
> Often a standard property allows for more values than the specific
> one for a particular device.  There can also be obscuring coupling
> between sysfs attributes due to hardware restrictions that we would
> like to provide some explanatory info on.
> 
> I suppose we could add all this information to the parent doc but
> that is pretty ugly and will make that doc very nasty to read.

I understand what you meant to do, but right now, it is is actually
a lot uglier than merging into a single entry ;-)

Let's view ABI from the PoV of a system admin that doesn't know
yet about a certain ABI symbol.

He'll try to seek for the symbol, more likely using the HTML 
documentation. Only very senior system admins might try to take
a look at the Kernel.

This is what happens when one would seek for a duplicated symbol
via command line:

	$ ./scripts/get_abi.pl search /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_frequency$
	
	/sys/bus/iio/devices/iio:deviceX/out_altvoltageY_frequency
	----------------------------------------------------------
	
	Kernel version:		3.4.0
	Contact:		linux-iio@vger.kernel.org
	Defined on file(s):	Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371 Documentation/ABI/testing/sysfs-bus-iio
	
	Description:
	
	Stores the PLL frequency in Hz for channel Y.
	Reading returns the actual frequency in Hz.
	The ADF4371 has an integrated VCO with fundamendal output
	frequency ranging from 4000000000 Hz 8000000000 Hz.
	
	out_altvoltage0_frequency:
	        A divide by 1, 2, 4, 8, 16, 32 or circuit generates
	        frequencies from 62500000 Hz to 8000000000 Hz.
	out_altvoltage1_frequency:
	        This channel duplicates the channel 0 frequency
	out_altvoltage2_frequency:
	        A frequency doubler generates frequencies from
	        8000000000 Hz to 16000000000 Hz.
	out_altvoltage3_frequency:
	        A frequency quadrupler generates frequencies from
	        16000000000 Hz to 32000000000 Hz.
	
	Note: writes to one of the channels will affect the frequency of
	all the other channels, since it involves changing the VCO
	fundamental output frequency.
	
	Output frequency for channel Y in Hz. The number must always be
	specified and unique if the output corresponds to a single
	channel.

As the "What:" field is identical on both sysfs-bus-iio-frequency-adf4371
and sysfs-bus-iio, those entries are merged, which produces an ABI
documentation mixing both the generic one and the board specific one
into a single output.

Worse than that, the "generic" content is at the end.

The same happens when generating the HTML output.

See, entries at the HTML output are ordered by the What: field,
which is considered within the script as an unique key, as it is
unique (except for IIO and a couple of other cases).

-

As I commented on an e-mail I sent to Greg, I see a few ways
to solve it.

The most trivial one (which I used to solve a few conflicts on
other places), is to place driver-specific details on a separate
file under Documentation/driver-api, and mention it at the
generic entries. The docs building system will generate cross
references for Documentation/.../foo.rst files, so, everything
should be OK.

The second alternative that I also used on a couple of places
is to modify the generic entry for it to contain the generic
definition first, followed by per-device details.

There is a third possible alternative: add a new optional field
(something like Scope:) which would be part of the unique key,
if present. Implementing support for it could be tricky, as the
produced output would likely need to create cross-references
between the generic field (if present) and the per-device details.

Thanks,
Mauro

PS.: I'm taking a few days of PTO during this week. So, it
could take a while for me to reply again to this thread.

  reply	other threads:[~2020-11-10  7:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1604042072.git.mchehab+huawei@kernel.org>
     [not found] ` <58cf3c2d611e0197fb215652719ebd82ca2658db.1604042072.git.mchehab+huawei@kernel.org>
     [not found]   ` <5326488b-4185-9d67-fc09-79b911fbb3b8@st.com>
2020-10-30 10:09     ` [PATCH v2 20/39] docs: ABI: testing: make the files compatible with ReST output Mauro Carvalho Chehab
2020-11-02 11:04       ` Fabrice Gasnier
2020-11-02 12:46         ` Greg Kroah-Hartman
2020-11-02 14:42           ` Mauro Carvalho Chehab
2020-11-08 16:56             ` Jonathan Cameron
2020-11-10  7:26               ` Mauro Carvalho Chehab [this message]
2020-11-10 18:18                 ` Duplicated ABI entries - Was: " Randy Dunlap
2020-11-14 15:27                 ` Jonathan Cameron
2020-10-30 17:26   ` Frederic Barrat
     [not found] ` <5bc78e5b68ed1e9e39135173857cb2e753be868f.1604042072.git.mchehab+huawei@kernel.org>
2020-10-30  8:27   ` [PATCH v2 31/39] docs: ABI: cleanup several ABI documents Rojewski, Cezary
2020-10-30  9:49   ` Suzuki K Poulose
2020-10-30 11:11   ` Ilya Dryomov
2020-10-30 16:42   ` Mathieu Poirier
2020-10-30 23:23   ` Peter Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201110082658.2edc1ab5@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=ajd@linux.ibm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@st.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=balbi@kernel.org \
    --cc=baolin.wang7@gmail.com \
    --cc=bleung@chromium.org \
    --cc=bmeneg@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=corbet@lwn.net \
    --cc=dan.j.williams@intel.com \
    --cc=dmurphy@ti.com \
    --cc=ego@linux.vnet.ibm.com \
    --cc=enric.balletbo@collabora.com \
    --cc=fabrice.gasnier@st.com \
    --cc=fbarrat@linux.ibm.com \
    --cc=felix@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=guohanjun@huawei.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=javier@javigon.com \
    --cc=jgross@suse.com \
    --cc=jic23@kernel.org \
    --cc=johannes.thumshirn@wdc.com \
    --cc=koct9i@gmail.com \
    --cc=kranthi.kuntala@intel.com \
    --cc=lars@metafoo.de \
    --cc=lenb@kernel.org \
    --cc=leonmaxx@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=mario.limonciello@dell.com \
    --cc=martin.petersen@oracle.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mgross@linux.intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=mike.kravetz@oracle.com \
    --cc=mpe@ellerman.id.au \
    --cc=nayna@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=niklas.cassel@wdc.com \
    --cc=nramas@linux.microsoft.com \
    --cc=oded.gabbay@gmail.com \
    --cc=oleg@kaa.org.ua \
    --cc=orsonzhai@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peda@axentia.se \
    --cc=pmeerw@pmeerw.net \
    --cc=pmladek@suse.com \
    --cc=richardcochran@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sre@kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=trix@redhat.com \
    --cc=vaibhav@linux.ibm.com \
    --cc=vineela.tummalapalli@intel.com \
    --cc=vishal.l.verma@intel.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zhang.lyra@gmail.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).