From: "Nuno Sá" <noname.nuno@gmail.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
jic23@kernel.org, marcelo.schmitt1@gmail.com,
kernel test robot <lkp@intel.com>,
Trevor Gamblin <tgamblin@baylibre.com>,
Axel Haslam <ahaslam@baylibre.com>
Subject: Re: [PATCH] pwm: Declare waveform stubs for when PWM is not reachable
Date: Fri, 10 Oct 2025 11:26:49 +0100 [thread overview]
Message-ID: <2e82eaf275b5c8df768c8b842167c3562991e50c.camel@gmail.com> (raw)
In-Reply-To: <6v4hny7hxjsdf6zvinhpagtbhluxbd6psq7wpx5ls6zdbnjtym@lnygnkav4ewk>
On Thu, 2025-10-09 at 18:53 +0200, Uwe Kleine-König wrote:
> 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@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202509272028.0zLNiR5w-lkp@intel.com/
> > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > ---
> > Cc: Jonathan Cameron <jic23@kernel.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.
>
Agreed. Seems to be one of those cases where we select a symbol that depends on
something.
However, this driver can indeed work without spi offload and hence PWM and
SPI_OFFLOAD (AFAIR) are optional so I wonder what's the right approach. Looking
at the new series I already see:
select SPI_OFFLOAD_TRIGGER_PWM if (SPI_OFFLOAD && PWM)
Which makes more sense but I guess we still need the stubs with the above. But
I would also expect stubs to be needed for spi/offload/consumer.h. Maybe I'm
missing something though...
I did not tested but I also wonder if 'imply SPI_OFFLOAD_TRIGGER_PWM' is not
similar to the above.
- Nuno Sá
> Best regards
> Uwe
next prev parent reply other threads:[~2025-10-10 10:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 22:19 [PATCH] pwm: Declare waveform stubs for when PWM is not reachable Marcelo Schmitt
2025-10-09 16:53 ` Uwe Kleine-König
2025-10-10 10:26 ` Nuno Sá [this message]
2025-10-10 19:01 ` Marcelo Schmitt
2025-10-10 18:51 ` Nuno Sá
2025-10-10 20:37 ` Marcelo Schmitt
2025-10-14 15:46 ` Nuno Sá
2025-10-13 9:12 ` Uwe Kleine-König
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=2e82eaf275b5c8df768c8b842167c3562991e50c.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=ahaslam@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marcelo.schmitt1@gmail.com \
--cc=marcelo.schmitt@analog.com \
--cc=tgamblin@baylibre.com \
--cc=ukleinek@kernel.org \
/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