[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190206125545.GI21676@ulmo>
Date: Wed, 6 Feb 2019 13:55:45 +0100
From: Thierry Reding <thierry.reding@...il.com>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Fabrice Gasnier <fabrice.gasnier@...com>, jic23@...nel.org,
robh+dt@...nel.org, mark.rutland@....com, alexandre.torgue@...com,
mcoquelin.stm32@...il.com, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org,
vilhelm.gray@...il.com, linux-stm32@...md-mailman.stormreply.com,
Tomasz Duszynski <tduszyns@...il.com>
Subject: Re: [PATCH 2/4] pwm: stm32-lp: Add power management support
On Wed, Feb 06, 2019 at 09:54:05AM +0100, Uwe Kleine-König wrote:
> On Wed, Feb 06, 2019 at 09:42:48AM +0100, Fabrice Gasnier wrote:
> > If you agree with the current approach, I can send a V2 with Tomasz's
> > suggestion to remove the ifdefs and use __maybe_unused instead.
>
> I think the suspend callback should have something like:
>
> if (is_still_enabled) {
> /*
> * The consumer didn't stop us, so refuse to suspend.
> */
> dev_err(dev, "The consumer didn't stop us, so refuse to suspend.\n");
> return -EBUSY;
> }
>
> This way there are no bad surprises if the pwm is suspended before its
> consumer and it's obvious what is missing.
Something that just occurred to me: perhaps as part of pwm_get() we
should track where we were being requested from so that we could give
hints in situations like this as to where the consumer is that forgot
to suspend the PWM.
I suppose we already have pwm_device.label to help with this, but
perhaps we could improve things if we stored __builtin_return_address
during pwm_get() to help users pinpoint where they need to look.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists