mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	"Liao, Bard" <bard.liao@intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
	"vkoul@kernel.org" <vkoul@kernel.org>
Cc: "vinod.koul@linaro.org" <vinod.koul@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"peter.ujfalusi@linux.intel.com" <peter.ujfalusi@linux.intel.com>,
	Richard Fitzgerald <Richard.Fitzgerald@cirrus.com>
Subject: Re: [PATCH 2/2] soundwire: Intel: stop sdw clock in system suspend
Date: Tue, 30 Jun 2026 13:50:09 +0100	[thread overview]
Message-ID: <e326c51a-4690-44c4-bf3d-0870591b1eed@opensource.cirrus.com> (raw)
In-Reply-To: <46af3cdf-d704-4cd2-bb24-cbe9fb1303db@linux.dev>

On 30/06/2026 1:36 pm, Pierre-Louis Bossart wrote:
> 
>>>>> --- a/drivers/soundwire/intel_auxdevice.c
>>>>> +++ b/drivers/soundwire/intel_auxdevice.c
>>>>> @@ -669,7 +669,8 @@ static int __maybe_unused intel_suspend(struct
>>>> device *dev)
>>>>>            return 0;
>>>>>        }
>>>>>
>>>>> -    ret = sdw_intel_stop_bus(sdw, false);
>>>>> +    /* No need to keep the SoundWire clock active in system suspend */
>>>>> +    ret = sdw_intel_stop_bus(sdw, true);
>>>>
>>>> erm, are you sure about this change?
>>>>
>>>> What this does is stop the SoundWire clock before entering system suspend.
>>>> Is this needed? The whole point of system suspend is that the host will stop
>>>> operating completely.
>>
>> Not necessarily. There are multiple types of system suspend, like
>> suspend-to-RAM. The system doesn't always shut down.
> 
> Let's be clear: all types of system suspend do not use the clock stop mode, at least on Intel platforms.
> 
> The clock stop mode is ONLY used in the pm_runtime suspend.
> 
> The main reason for this is that the host cannot keep a detector alive to restart the bus at the request of a peripheral.
> As a result, the jack detection only works in pm_runtime suspend and NOT in system suspend. It's been the default since we introduced support of clock stop...
> 
> Note that in case where the peripheral is not capable of generating a wake, the clock stop is not used either. No need to keep that detector alive on the host if it's never going to see a wake.
> 
>> Also depends on the OS: Android seems to use system suspend as a deep
>> sleep state.
>>
>>>
>>> Yes, that's what we need. The purpose is to inform the Peripheral to go
>>> into the deserved clock stop mode before system suspend.
> 
> Sorry but this isn't what this patch does.
> 
> I think you are confusing power savings in clock stop mode with the ability for the codec to enter a lower power in system suspend.
> 
> If you do need the ability to put the peripheral in a lower power mode, it's perfectly acceptable, but that can be done in the system suspend routine of the peripheral driver. You do not need or want to piggy-back on the clock stop mechanism which isn't used in system suspend.
> 
>>>> There is in theory no need to stop the clock because the clock restart capability
>>>> will not be used.
>>
>> As Bard says, the peripherals should be informed that the clock will be
>> stopped. They at least should have the opportunity to act on that. And
>> they could still be powered across one of the lighter forms of system
>> suspend.
> 
> Again it'd be fine to reach a lower power for the peripheral or keep some power rails active, but that's orthogonal to the clock stop.
> 
>>>> Think for example of jack detection, it's supported in pm_runtime suspend
>>>> with the SoundWire interrupt capability, but not in system suspend.
>>>
>>> An example that we need clock stop1 in system suspend is to keep the amp's
>>> firmware in system suspend. In other words, we don't want to reload the
>>> firmware after system resume
> 
> If you want to use lower power modes in system suspend, that's fine. The suspend/resume routines can be modified to introduce lower power modes on the peripheral side.
> I am not disagreeing with the concept of lowering power consumption in system suspend, just on the mechanisms that you trying to use.
> 
> But keeping the context on the peripheral is one bridge too far I am afraid. Intel platforms perform a bus reset in all cases, including in clock-stop modes, that was the hardware guidance. That means that no matter what you do prior to pm_runtime and system suspend the peripheral WILL lose context.
> 
> To rehash the different points:
> - The only significant difference between pm_runtime and system suspend is the wake detection capability which is only supported in the former case.
> - On Intel platforms, context is lost on the peripheral in all resume routines because of the bus reset, the latency on resume is pretty much the same in both cases
> - The peripheral driver can introduce a lower-power mode in system suspend by changing the system suspend routine.
> 

If the Manager doesn't send a clock-stop, the peripherals don't get a
notification that they can enter a lower-power mode. The clock suddenly
disappears without warning and without the peripherals being notified
why, so they don't have any information to know what is happening.

The Manager should send a clock-stop notification before stopping the
clock.

  reply	other threads:[~2026-06-30 12:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 14:44 [PATCH 0/2] soundwire: bus: re-enable CLOCK_STOP_MODE1 support Bard Liao
2026-06-29 14:44 ` [PATCH 1/2] soundwire: bus: add CLOCK_STOP_MODE1 support back Bard Liao
2026-06-30  9:42   ` Pierre-Louis Bossart
2026-07-29 15:39   ` Richard Fitzgerald
2026-06-29 14:44 ` [PATCH 2/2] soundwire: Intel: stop sdw clock in system suspend Bard Liao
2026-06-30  9:33   ` Pierre-Louis Bossart
2026-06-30 10:35     ` Liao, Bard
2026-06-30 10:51       ` Richard Fitzgerald
2026-06-30 12:36         ` Pierre-Louis Bossart
2026-06-30 12:50           ` Richard Fitzgerald [this message]
2026-07-01 11:55             ` Pierre-Louis Bossart
2026-07-01 12:00               ` Pierre-Louis Bossart
2026-07-01 12:30                 ` Liao, Bard
2026-07-01 12:36                 ` Richard Fitzgerald
2026-07-01 12:15               ` Richard Fitzgerald
2026-07-01 14:09                 ` Pierre-Louis Bossart
2026-07-01 14:59                   ` Richard Fitzgerald
2026-07-02 10:09                     ` Pierre-Louis Bossart

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=e326c51a-4690-44c4-bf3d-0870591b1eed@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=Richard.Fitzgerald@cirrus.com \
    --cc=bard.liao@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=vinod.koul@linaro.org \
    --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

all inboxes | Powered by JetHome®