From: Vinod Koul <vkoul@kernel.org>
To: Bard Liao <yung-chuan.liao@linux.intel.com>, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
tiwai@suse.de, gregkh@linuxfoundation.org, jank@cadence.com,
srinivas.kandagatla@linaro.org, rander.wang@linux.intel.com,
ranjani.sridharan@linux.intel.com, hui.wang@canonical.com,
pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com,
bard.liao@intel.com
Subject: Re: [PATCH v2 5/9] regmap: sdw: use _no_pm functions in regmap_read/write
Date: Wed, 6 Jan 2021 11:29:01 +0530 [thread overview]
Message-ID: <20210106055901.GL2771@vkoul-mobl> (raw)
In-Reply-To: <20201209053459.5515-6-yung-chuan.liao@linux.intel.com>
HeY Mark,
On 09-12-20, 13:34, Bard Liao wrote:
> sdw_update_slave_status will be invoked when a codec is attached,
> and the codec driver will initialize the codec with regmap functions
> while the codec device is pm_runtime suspended.
>
> regmap routines currently rely on regular SoundWire IO functions,
> which will call pm_runtime_get_sync()/put_autosuspend.
>
> This causes a deadlock where the resume routine waits for an
> initialization complete signal that while the initialization complete
> can only be reached when the resume completes.
>
> The only solution if we allow regmap functions to be used in resume
> operations as well as during codec initialization is to use _no_pm
> routines. The duty of making sure the bus is operational needs to be
> handled above the regmap level.
You okay these going thru sdw tree..?
>
> Fixes: 7c22ce6e21840 ('regmap: Add SoundWire bus support')
> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> ---
> drivers/base/regmap/regmap-sdw.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/regmap/regmap-sdw.c b/drivers/base/regmap/regmap-sdw.c
> index c92d614b4943..4b8d2d010cab 100644
> --- a/drivers/base/regmap/regmap-sdw.c
> +++ b/drivers/base/regmap/regmap-sdw.c
> @@ -11,7 +11,7 @@ static int regmap_sdw_write(void *context, unsigned int reg, unsigned int val)
> struct device *dev = context;
> struct sdw_slave *slave = dev_to_sdw_dev(dev);
>
> - return sdw_write(slave, reg, val);
> + return sdw_write_no_pm(slave, reg, val);
> }
>
> static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val)
> @@ -20,7 +20,7 @@ static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val)
> struct sdw_slave *slave = dev_to_sdw_dev(dev);
> int read;
>
> - read = sdw_read(slave, reg);
> + read = sdw_read_no_pm(slave, reg);
> if (read < 0)
> return read;
>
> --
> 2.17.1
--
~Vinod
next prev parent reply other threads:[~2021-01-06 5:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 5:34 [PATCH v2 0/9] soundwire/regmap: use _no_pm routines Bard Liao
2020-12-09 5:34 ` [PATCH v2 1/9] soundwire: bus: use sdw_update_no_pm when initializing a device Bard Liao
2020-12-09 5:34 ` [PATCH v2 2/9] soundwire: bus: use sdw_write_no_pm when setting the bus scale registers Bard Liao
2020-12-09 5:34 ` [PATCH v2 3/9] soundwire: bus: use no_pm IO routines for all interrupt handling Bard Liao
2020-12-09 5:34 ` [PATCH v2 4/9] soundwire: export sdw_write/read_no_pm functions Bard Liao
2020-12-09 5:34 ` [PATCH v2 5/9] regmap: sdw: use _no_pm functions in regmap_read/write Bard Liao
2021-01-06 5:59 ` Vinod Koul [this message]
2020-12-09 5:34 ` [PATCH v2 6/9] regmap: sdw: use no_pm routines for SoundWire 1.2 MBQ Bard Liao
2020-12-09 5:34 ` [PATCH v2 7/9] regmap: sdw-mbq: use MODULE_LICENSE("GPL") Bard Liao
2020-12-09 5:34 ` [PATCH v2 8/9] soundwire: bus: fix confusion on device used by pm_runtime Bard Liao
2020-12-09 5:34 ` [PATCH v2 9/9] soundwire: bus: clarify dev_err/dbg device references Bard Liao
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=20210106055901.GL2771@vkoul-mobl \
--to=vkoul@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=bard.liao@intel.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hui.wang@canonical.com \
--cc=jank@cadence.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.de \
--cc=yung-chuan.liao@linux.intel.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
all inboxes | Powered by JetHome®