From: Fabrice Gasnier <fabrice.gasnier@st.com>
To: "Thierry Reding" <thierry.reding@gmail.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alexandre.torgue@st.com, linux-pwm@vger.kernel.org,
linux-iio@vger.kernel.org, Tomasz Duszynski <tduszyns@gmail.com>,
linux-kernel@vger.kernel.org, vilhelm.gray@gmail.com,
robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org,
mcoquelin.stm32@gmail.com,
linux-stm32@st-md-mailman.stormreply.com, jic23@kernel.org
Subject: Re: [PATCH 2/4] pwm: stm32-lp: Add power management support
Date: Wed, 6 Feb 2019 15:54:50 +0100 [thread overview]
Message-ID: <ddb93754-2734-e4c2-a209-517984c6d814@st.com> (raw)
In-Reply-To: <20190206125545.GI21676@ulmo>
On 2/6/19 1:55 PM, Thierry Reding wrote:
> 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.
Thierry, Uwe,
When the pwm is suspended before its consumer, the bad surprise is the
suspend request will fail... I'm not sure a new attempt may be better.
So, it looks like the only way to have this clean is by implementing the
device link e.g. via pwm_get() ?
>
> 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.
The current approach handles the situation where the consumer forgot to
suspend the PWM... I can add some warning about that in the suspend
routine, incl the label.
What do you think? What's the best approach ?
Please advise,
BR,
Fabrice
>
> 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
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-02-06 14:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-05 12:40 [PATCH 0/4] Add PM support to STM32 LP Timer drivers Fabrice Gasnier
2019-02-05 12:40 ` [PATCH 1/4] dt-bindings: pwm-stm32-lp: document pinctrl sleep state Fabrice Gasnier
2019-02-05 12:40 ` [PATCH 2/4] pwm: stm32-lp: Add power management support Fabrice Gasnier
2019-02-05 18:30 ` Tomasz Duszynski
2019-02-06 8:42 ` Fabrice Gasnier
2019-02-05 20:47 ` Uwe Kleine-König
2019-02-05 22:25 ` Thierry Reding
2019-02-06 8:42 ` Fabrice Gasnier
2019-02-06 8:54 ` Uwe Kleine-König
2019-02-06 12:55 ` Thierry Reding
2019-02-06 14:54 ` Fabrice Gasnier [this message]
2019-02-05 12:40 ` [PATCH 3/4] dt-bindings: iio: stm32-lptimer-counter: document pinctrl sleep state Fabrice Gasnier
2019-02-05 12:40 ` [PATCH 4/4] iio: counter: stm32-lptimer: Add power management support Fabrice Gasnier
2019-02-09 16:21 ` Jonathan Cameron
2019-02-10 21:33 ` Uwe Kleine-König
2019-02-11 13:21 ` Fabrice Gasnier
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=ddb93754-2734-e4c2-a209-517984c6d814@st.com \
--to=fabrice.gasnier@st.com \
--cc=alexandre.torgue@st.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mark.rutland@arm.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=robh+dt@kernel.org \
--cc=tduszyns@gmail.com \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vilhelm.gray@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).