Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3796971pxb; Mon, 9 Nov 2020 23:29:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCpRG//shs9y3JN0Yau8EjlBWuhRpEsk9sgrs4NK8cqGmqROhRAAcKWVxA2ONb4Dorid4I X-Received: by 2002:a50:8a88:: with SMTP id j8mr19650280edj.179.1604993369129; Mon, 09 Nov 2020 23:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604993369; cv=none; d=google.com; s=arc-20160816; b=w8x2ONhn0pqLeT6+2cKK29yrONlhdfzNXmWeJsq6LRs1LwQ4Wf2PzE1YPsPYhTVlhA 97AFS3JIvAnkWbHdils8pyxwoEoJ6XVpCFqqsZRybbkffJk6hUojzMPtUt/DraYPN6ro M8eWwUm3FdRGAk9ib4WaYUbBT1XMs8gb9mzKsfim3PR1oCFzt/0yZBcfCGhIiwkf38p3 JqsIjcRpB1sjskNvaJwXmEShMfRuHNoKNwPqW4Q87kEZ49q1CSOa2zOoFSKxWmcKxv6w LkUpBBnXJOz7L6hRRMPdiRPJaLHhAC6wJ9ttq8IIJV+vYAlCR6rvn2QKgTrkf3hZpaIg D1gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kKIsrxKrrSpjQ6Hx5zm7cIyJhk8Nv7gxdsBSrPkL2BU=; b=mQnHAeEdAjIJ5xdIboMFRHkN2WFtJKhA6YrN/u8i7pZ+ReudfBi/D9xd6dcQuo2A0m elrR97OMvyLIa3sXABvSdnLGyy5mqfQWlodhbpq4yWYulpapsKc4BqR65QmRgB+6htUI HuxJ7opS6EBd6bjbPPcH81unPhTCWRLGDOlgQ1FqTdGUcfRf1r6sfOSDR4bghpizyjbA yDLzGdQ0+JXJwZUZSEYt550hho6isa1+33p7Mvdd5Ec66ugvVkY32jwv097LXD7vWiFr CmG46vN43M2o5cYw78pcX4Pac1ZAC8BdLefV7IlXa1JOfFBmFlTnSfFUWJK8Kv+bNKXm 41rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TUH5+tNa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si8815674ejd.632.2020.11.09.23.29.04; Mon, 09 Nov 2020 23:29:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TUH5+tNa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727658AbgKJH1X (ORCPT + 99 others); Tue, 10 Nov 2020 02:27:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:46026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgKJH1W (ORCPT ); Tue, 10 Nov 2020 02:27:22 -0500 Received: from coco.lan (ip5f5ad5a8.dynamic.kabel-deutschland.de [95.90.213.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB0E3206E3; Tue, 10 Nov 2020 07:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604993241; bh=S1o4qj80GoZoWAAm6f5WIdZgKYNgEyeuOMYKs01dOuI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TUH5+tNazhJ/XJzAl/Wd+cQEsRpNMchPxEmOCv92clZjPMpMMVpFOqsyNGQ8qQlVK vt54VFkbwQr8J7ito6H7c5ALBnYlEng06bYHpBTDo7H35Y6tiYwfUYlrrC4pXGTnLL ZqjZgHifCGhcsQ6FCeSyPXsZrR60Wop4+ME3S5hM= Date: Tue, 10 Nov 2020 08:26:58 +0100 From: Mauro Carvalho Chehab To: Jonathan Cameron Cc: Greg Kroah-Hartman , Fabrice Gasnier , Linux Doc Mailing List , "Gautham R. Shenoy" , "Jason A. Donenfeld" , Javier =?UTF-8?B?R29uesOhbGV6?= , Jonathan Corbet , "Martin K. Petersen" , "Rafael J. Wysocki" , Alexander Shishkin , Alexandre Belloni , Alexandre Torgue , Andrew Donnellan , Andy Shevchenko , Baolin Wang , Benson Leung , Boris Ostrovsky , Bruno Meneguele , Chunyan Zhang , Dan Murphy , Dan Williams , Enric Balletbo i Serra , Felipe Balbi , Frederic Barrat , Guenter Roeck , Hanjun Guo , Heikki Krogerus , Jens Axboe , Johannes Thumshirn , Juergen Gross , Konstantin Khlebnikov , Kranthi Kuntala , Lakshmi Ramasubramanian , Lars-Peter Clausen , Len Brown , Leonid Maksymchuk , Ludovic Desroches , Mario Limonciello , Mark Gross , Maxime Coquelin , Michael Ellerman , Mika Westerberg , Mike Kravetz , Mimi Zohar , Nayna Jain , Nicolas Ferre , Niklas Cassel , Oded Gabbay , Oleh Kravchenko , Orson Zhai , Pavel Machek , Pawan Gupta , Peter Meerwald-Stadler , Peter Rosin , Petr Mladek , Philippe Bergheaud , Richard Cochran , Sebastian Reichel , Sergey Senozhatsky , Stefano Stabellini , Thinh Nguyen , Thomas Gleixner , Tom Rix , Vaibhav Jain , Vineela Tummalapalli , Vishal Verma , 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 Subject: Duplicated ABI entries - Was: Re: [PATCH v2 20/39] docs: ABI: testing: make the files compatible with ReST output Message-ID: <20201110082658.2edc1ab5@coco.lan> In-Reply-To: <20201108165621.4d0da3f4@archlinux> References: <58cf3c2d611e0197fb215652719ebd82ca2658db.1604042072.git.mchehab+huawei@kernel.org> <5326488b-4185-9d67-fc09-79b911fbb3b8@st.com> <20201030110925.3e09d59e@coco.lan> <20201102124641.GA881895@kroah.com> <20201102154250.45bee17f@coco.lan> <20201108165621.4d0da3f4@archlinux> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jonathan, Em Sun, 8 Nov 2020 16:56:21 +0000 Jonathan Cameron 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.