mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: James Schulman <james.schulman@cirrus.com>,
	David Rhodes <david.rhodes@cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Stefan Binding <sbinding@opensource.cirrus.com>,
	alsa-devel@alsa-project.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, kernel@collabora.com
Subject: Re: [PATCH 9/9] ASoC: cs35l41: Use devm_pm_runtime_enable()
Date: Tue, 5 Sep 2023 22:15:46 +0300	[thread overview]
Message-ID: <953eb242-4d52-4cdc-8f7d-71af003778c5@collabora.com> (raw)
In-Reply-To: <20230905094535.GK103419@ediswmail.ad.cirrus.com>

On 9/5/23 12:45, Charles Keepax wrote:
> On Sun, Sep 03, 2023 at 12:06:21AM +0300, Cristian Ciocaltea wrote:
>> Simplify runtime PM during probe by converting pm_runtime_enable() to
>> the managed version.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> @@ -1376,7 +1379,6 @@ void cs35l41_remove(struct cs35l41_private *cs35l41)
>>  	cancel_work_sync(&cs35l41->mdsync_up_work);
>>  
>>  	pm_runtime_get_sync(cs35l41->dev);
>> -	pm_runtime_disable(cs35l41->dev);
>>  
>>  	regmap_write(cs35l41->regmap, CS35L41_IRQ1_MASK1, 0xFFFFFFFF);
>>  	if (cs35l41->hw_cfg.bst_type == CS35L41_SHD_BOOST_PASS ||
> 
> Are we sure this is safe? The remove handler appears to be
> written to disable pm_runtime at the start presumably to stop the
> resume/suspend handler running during the remove callback.
> Whereas after this change the pm_runtime isn't disabled until
> after the remove callback has run. Does this open a window were
> we could get an erroneous pm_runtime suspend after the
> pm_runtime_put_noidle?

I've just made a test adding a 6s sleep before returning from the remove 
handler: 

[14444.894316] cs35l41 spi-VLV1776:00: Runtime resume
[14444.894469] cs35l41 spi-VLV1776:00: sleep 6s before return of cs35l41_remove()
[14448.338994] cs35l41 spi-VLV1776:00: Runtime suspend
[14451.079649] cs35l41 spi-VLV1776:00: return from cs35l41_remove()
[14451.080129] cs35l41 spi-VLV1776:00: Runtime resume
[14451.080165] cs35l41 spi-VLV1776:00: ASoC: Unregistered DAI 'cs35l41-pcm'
[14451.080181] cs35l41 spi-VLV1776:00: Runtime suspend
[14451.813639] acp5x_i2s_playcap acp5x_i2s_playcap.0: ASoC: Unregistered DAI 'acp5x_i2s_playcap.0'

As expected, suspend triggered, but a resume was issued later, before DAI
got unregistered.

I didn't notice any issues while repeating the test several times, hence 
I wonder what would be the reason to prevent getting suspend/resume events 
at this point?

Thanks,
Cristian

  reply	other threads:[~2023-09-05 19:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02 21:06 [PATCH 0/9] Improve CS35l41 ALSA SoC audio driver Cristian Ciocaltea
2023-09-02 21:06 ` [PATCH 1/9] ASoC: cs35l41: Handle mdsync_down reg write errors Cristian Ciocaltea
2023-09-05  9:19   ` Charles Keepax
2023-09-02 21:06 ` [PATCH 2/9] ASoC: cs35l41: Handle mdsync_up " Cristian Ciocaltea
2023-09-05  9:23   ` Charles Keepax
2023-09-02 21:06 ` [PATCH 3/9] ASoC: cs35l41: Initialize completion object before requesting IRQ Cristian Ciocaltea
2023-09-05  9:23   ` Charles Keepax
2023-09-02 21:06 ` [PATCH 4/9] ASoC: cs35l41: Fix broken shared boost activation Cristian Ciocaltea
2023-09-05 10:29   ` Charles Keepax
2023-09-05 18:11     ` Rhodes, David
2023-09-05 20:05       ` Cristian Ciocaltea
2023-09-05 20:25         ` Rhodes, David
2023-09-02 21:06 ` [PATCH 5/9] ASoC: cs35l41: Rename pll_lock to pll_lock_done Cristian Ciocaltea
2023-09-05  9:35   ` Charles Keepax
2023-09-02 21:06 ` [PATCH 6/9] ASoC: cs35l41: Make use of dev_err_probe() Cristian Ciocaltea
2023-09-05  9:36   ` Charles Keepax
2023-09-02 21:06 ` [PATCH 7/9] ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler Cristian Ciocaltea
2023-09-05  9:37   ` Charles Keepax
2023-09-02 21:06 ` [PATCH 8/9] ASoC: cs35l41: Use modern pm_ops Cristian Ciocaltea
2023-09-05  9:37   ` Charles Keepax
2023-09-02 21:06 ` [PATCH 9/9] ASoC: cs35l41: Use devm_pm_runtime_enable() Cristian Ciocaltea
2023-09-05  9:45   ` Charles Keepax
2023-09-05 19:15     ` Cristian Ciocaltea [this message]
2023-09-06 16:37       ` Charles Keepax
2023-09-06 19:55         ` Cristian Ciocaltea
2023-09-07  8:37           ` Charles Keepax

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=953eb242-4d52-4cdc-8f7d-71af003778c5@collabora.com \
    --to=cristian.ciocaltea@collabora.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=david.rhodes@cirrus.com \
    --cc=james.schulman@cirrus.com \
    --cc=kernel@collabora.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=sbinding@opensource.cirrus.com \
    --cc=tiwai@suse.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®