From: Tzung-Bi Shih <tzungbi@google.com>
To: Mark Brown <broonie@kernel.org>
Cc: ALSA development <alsa-devel@alsa-project.org>,
Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH] ASoC: dmic: Allow GPIO operations to sleep
Date: Wed, 22 Apr 2020 17:24:54 +0800 [thread overview]
Message-ID: <CA+Px+wUFgz0MP0vwkJ+5L5V5G6AK7-6iDbRuUerFBmwnm-CYFA@mail.gmail.com> (raw)
In-Reply-To: <20200422083550.50711-1-broonie@kernel.org>
On Wed, Apr 22, 2020 at 4:37 PM Mark Brown <broonie@kernel.org> wrote:
>
> If there is a power GPIO provided we control it from DAPM context so there
> is no problem with a sleeping GPIO, use the _cansleep() version of the API
> to allow this.
Compared gpiod_set_value_cansleep() vs. gpiod_set_value().
gpiod_set_value_cansleep()
+ might_sleep_if(extra_checks);
gpiod_set_value()
+ /* Should be using gpiod_set_value_cansleep() */
+ WARN_ON(desc->gdev->chip->can_sleep);
And the extra_checks is:
#ifdef DEBUG
#define extra_checks 1
#else
#define extra_checks 0
#endif
Looks like it only changes behavior when DEBUG.
Wondering about:
- Did you get any warning message to inspire you to use _cansleep() version?
- Does that imply in any _can sleep_ context, it is more encouraged to
call _cansleep() version? (e.g.
https://elixir.bootlin.com/linux/v5.7-rc2/source/sound/soc/codecs/max98357a.c#L41)
next prev parent reply other threads:[~2020-04-22 9:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 8:35 [PATCH] ASoC: dmic: Allow GPIO operations to sleep Mark Brown
2020-04-22 9:24 ` Tzung-Bi Shih [this message]
2020-04-22 9:27 ` Mark Brown
2020-04-22 9:59 ` Tzung-Bi Shih
2020-04-22 12:16 ` Mark Brown
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=CA+Px+wUFgz0MP0vwkJ+5L5V5G6AK7-6iDbRuUerFBmwnm-CYFA@mail.gmail.com \
--to=tzungbi@google.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@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).