Subject: Re: linux-next: build warnings after merge of the drivers-x86 tree

From: Mauro Carvalho Chehab <[email-masked]>
Date: Fri, 25 Mar 2022 06:27:35 +0100

Em Fri, 25 Mar 2022 08:55:22 +1100
Stephen Rothwell <[email-masked]> escreveu:

> Hi Hans,
> 
> On Thu, 24 Mar 2022 14:04:28 +0100 Hans de Goede <[email-masked]> wrote:
> >
> > So I did some digging and the trick for reproducing any ABI
> > related warnings is to touch the .rst file which has the
> > "kernel-abi" reST directive (1) for the ABI subdir you want
> > to regenerate the ABI docs for.
> > 
> > So in this case I did:
> > 
> > touch Documentation/admin-guide/abi-testing.rst
> > make htmldocs &> log  
> 
> Looks like missing dependencies :-(

Not sure if are there a way to fix this. See, Sphinx doesn't use Makefile 
dependencies, but, instead, it checks if the .rst file has changed or not.
So, those tags that include contents from non-rst files, like the ABI ones
and kernel-doc tags, are not considered by Sphinx when detecting the need
to re-parse the .rst files that contain such tags.

The safest way to ensure that Sphinx will process everything is running
is to run `make cleandocs` before building the documentation.

> Thanks for persisting ad discovering this.
> 
> > And now I can see the warnings. I'll prepare a fix for this.  
> 
> Excellent, thanks.
> 
> > Looking at Documentation/Makefile I also learned that you
> > can also do this:
> > 
> > scripts/get_abi.pl validate --dir Documentation/ABI

No need to pass Documentation/ABI directory, as it assumes it per
default:

	$ scripts/get_abi.pl validate 

Warning: /sys/bus/iio/devices/iio:deviceX/fault_ovuv is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-temperature-max31856:14  Documentation/ABI/testing/sysfs-bus-iio-temperature-max31865:0
Warning: /sys/bus/iio/devices/iio:deviceX/in_filter_notch_center_frequency is defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-temperature-max31865:12  Documentation/ABI/testing/sysfs-bus-iio:1943
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:91
Warning: /sys/devices/system/cpu/cpuX/topology/core_id is defined 2 times:  Documentation/ABI/testing/sysfs-devices-system-cpu:69  Documentation/ABI/stable/sysfs-devices-system-cpu:38

Btw, while here, you can also check if the new ABI definitions
are actually correct by running:

	$ ./scripts/get_abi.pl undefined

On a system where the new ABI "What:" definitions can be found.
This command converts the What: field into a regular expression,
and then check if the entries under sysfs actually match the 
location specified by the "What:" fields from the ABI files.

As there are currently many ones that are missing (or wrong), you
can limit the scope of the checks by adding --search-string <regex>,
like:

	$ ./scripts/get_abi.pl undefined --search-string hugepage
	/sys/kernel/mm/transparent_hugepage/defrag not found.
	/sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages not found.
	/sys/kernel/mm/hugepages/hugepages-1048576kB/demote_size not found.
	...
	/sys/kernel/mm/transparent_hugepage/khugepaged/full_scans not found.

> > Which results in a different set of warnings...  

Such warnings are also reported at build time, when the ABI file is
processed - e. g. if you either touch the files containing the ABI
.rst files or if you do a make cleandocs before building the 
documentation.

Thanks,
Mauro