lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6v4hny7hxjsdf6zvinhpagtbhluxbd6psq7wpx5ls6zdbnjtym@lnygnkav4ewk>
Date: Thu, 9 Oct 2025 18:53:41 +0200
From: Uwe Kleine-König <ukleinek@...nel.org>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	jic23@...nel.org, marcelo.schmitt1@...il.com, kernel test robot <lkp@...el.com>, 
	Trevor Gamblin <tgamblin@...libre.com>, Axel Haslam <ahaslam@...libre.com>
Subject: Re: [PATCH] pwm: Declare waveform stubs for when PWM is not reachable

Hello Marcelo,

On Tue, Oct 07, 2025 at 07:19:38PM -0300, Marcelo Schmitt wrote:
> Previously, the PWM waveform consumer API would not be declared if
> CONFIG_PWM was not reachable. That caused kernel builds to fail if a
> consumer driver was enabled but PWM disabled. Add stubs for PWM waveform
> functions so client drivers that use, but don't depend on PWM, can build if
> PWM is disabled.
> 
> Fixes: 6c5126c6406d ("pwm: Provide new consumer API functions for waveforms")

At the time 6c5126c6406d was applied, there was no user of the API that
doesn't depend on CONFIG_PWM, so I object adding this Fixes line.

> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202509272028.0zLNiR5w-lkp@intel.com/
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@...log.com>
> ---
> Cc: Jonathan Cameron <jic23@...nel.org>
> Hi Uwe,
> 
> This is a fix based on a report from 0-day bot [1].
> We need this for a sophisticated IIO device that makes direct use of a PWM
> waveform (in addition to indirect use of PWM through SPI_OFFLOAD_TRIGGER_PWM). 

Does the driver work in some configuration with the pwm stubs? If not,
the right thing to do is to let it depend on PWM. (Note the inverse
isn't necessarily a good idea.)

And I wonder how you could even compile your driver without PWM support
given that it selects SPI_OFFLOAD_TRIGGER_PWM which depends on PWM.

... some time later ...

OK, I tried to reproduce the problem that the kernel build bot run into.
There is a warning:

	WARNING: unmet direct dependencies detected for SPI_OFFLOAD_TRIGGER_PWM
	  Depends on [n]: SPI [=y] && SPI_OFFLOAD [=y] && PWM [=n]
	  Selected by [y]:
	  - AD4030 [=y] && IIO [=y] && SPI [=y] && GPIOLIB [=y]

This is the thing that needs fixing, i.e. don't select a symbol with
dependencies that the selecting symbol doesn't assert to be fulfilled.

Best regards
Uwe

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ