[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210106055901.GL2771@vkoul-mobl>
Date: Wed, 6 Jan 2021 11:29:01 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Bard Liao <yung-chuan.liao@...ux.intel.com>, broonie@...nel.org
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
tiwai@...e.de, gregkh@...uxfoundation.org, jank@...ence.com,
srinivas.kandagatla@...aro.org, rander.wang@...ux.intel.com,
ranjani.sridharan@...ux.intel.com, hui.wang@...onical.com,
pierre-louis.bossart@...ux.intel.com, sanyog.r.kale@...el.com,
bard.liao@...el.com
Subject: Re: [PATCH v2 5/9] regmap: sdw: use _no_pm functions in
regmap_read/write
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@...ux.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
Powered by blists - more mailing lists