public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Vijendar Mukunda <Vijendar.Mukunda@amd.com>, vkoul@kernel.org
Cc: alsa-devel@alsa-project.org, yung-chuan.liao@linux.intel.com,
	sanyog.r.kale@intel.com, Basavaraj.Hiregoudar@amd.com,
	Sunil-kumar.Dommati@amd.com, venkataprasad.potturu@amd.com,
	Mario.Limonciello@amd.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 3/7] soundwire: amd: add conditional for check for device resume
Date: Mon, 20 Jan 2025 09:30:30 -0600	[thread overview]
Message-ID: <7e363634-b80f-4ae7-8d09-1bb07225eecd@linux.dev> (raw)
In-Reply-To: <20250120101329.3713017-4-Vijendar.Mukunda@amd.com>

On 1/20/25 4:13 AM, Vijendar Mukunda wrote:
> Add a conditional check to resume SoundWire manager device, when the
> SoundWire manager instance is in the suspended state.
> 
> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> ---
>  drivers/soundwire/amd_manager.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
> index 60be5805715e..6831b3729db5 100644
> --- a/drivers/soundwire/amd_manager.c
> +++ b/drivers/soundwire/amd_manager.c
> @@ -850,7 +850,10 @@ static void amd_sdw_update_slave_status(u32 status_change_0to7, u32 status_chang
>  static void amd_sdw_process_wake_event(struct amd_sdw_manager *amd_manager)
>  {
>  	dev_dbg(amd_manager->dev, "SoundWire Wake event reported\n");
> -	pm_request_resume(amd_manager->dev);
> +	if (pm_runtime_suspended(amd_manager->dev)) {
> +		dev_dbg(amd_manager->dev, "Device is in suspend state\n");
> +		pm_request_resume(amd_manager->dev);
> +	}

Is this test actually doing something useful?

If the device is already active, presumably doing a pm_request_resume() is a no-op. If it's already suspended it does something.
Testing the device state is risky with all the asynchronous behavior in SoundWire, best to leave the state checks to be handled inside the pm_runtime core, no?

IIRC the only time when such a test in needed is in the system suspend callbacks where specific action needs to be taken if the device is in pm_runtime suspended mode with the clock_stop mode engaged.

  reply	other threads:[~2025-01-20 15:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20 10:13 [PATCH V2 0/7] soundwire: amd: code improvements and new platform support Vijendar Mukunda
2025-01-20 10:13 ` [PATCH V2 1/7] soundwire: amd: change the soundwire wake enable/disable sequence Vijendar Mukunda
2025-01-20 10:13 ` [PATCH V2 2/7] soundwire: amd: add debug log for soundwire wake event Vijendar Mukunda
2025-01-20 10:13 ` [PATCH V2 3/7] soundwire: amd: add conditional for check for device resume Vijendar Mukunda
2025-01-20 15:30   ` Pierre-Louis Bossart [this message]
2025-01-21  5:26     ` Mukunda,Vijendar
2025-01-20 10:13 ` [PATCH V2 4/7] soundwire: amd: add support for ACP7.0 & ACP7.1 platforms Vijendar Mukunda
2025-01-20 10:13 ` [PATCH V2 5/7] soundwire: amd: set device power state during suspend/resume sequence Vijendar Mukunda
2025-01-20 10:13 ` [PATCH V2 6/7] soundwire: amd: set ACP_PME_EN during runtime suspend sequence Vijendar Mukunda
2025-01-20 10:13 ` [PATCH V2 7/7] soundwire: amd: add soundwire host wake interrupt enable/disable sequence Vijendar Mukunda

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=7e363634-b80f-4ae7-8d09-1bb07225eecd@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=Basavaraj.Hiregoudar@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=sanyog.r.kale@intel.com \
    --cc=venkataprasad.potturu@amd.com \
    --cc=vkoul@kernel.org \
    --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