From: sashiko-bot@kernel.org
To: "Gopi Chandra Sekhar Reddy Kanala" <gopi.kanala@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH v2 2/2] soundwire: qcom: force runtime suspend across system sleep
Date: Mon, 30 Nov 2026 07:33:44 +0000 [thread overview]
Message-ID: <sashiko-outbox-240601@kernel.org> (raw)
In-Reply-To: <20261130-qcom-swr-system-sleep-v2-2-4f65a868813d@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] soundwire: qcom: swrm_suspend() leaves wake_irq active while
RPM is disabled
--
commit 660479a3c82c5cbb7c7d353f0e3789a080e66108
Author: Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>
soundwire: qcom: force runtime suspend across system sleep
This commit adds system sleep callbacks that force the Qualcomm SoundWire
controller into runtime suspend across system sleep when clock stop is
supported and no streams are set up, and restore it on resume.
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index 4cd9093c303d3..954acb4993280 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
[ ... ]
> @@ -1901,7 +1902,44 @@ static int swrm_runtime_suspend(struct device *dev)
> return 0;
> }
>
> +static int swrm_suspend(struct device *dev)
> +{
> + struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(dev);
> + bool stream_set_up;
> + int ret;
> +
> + if (pm_runtime_status_suspended(dev))
> + return 0;
> +
> + scoped_guard(mutex, &ctrl->bus.bus_lock)
> + stream_set_up = !list_empty(&ctrl->bus.m_rt_list);
> +
> + if (ctrl->clock_stop_not_supported || stream_set_up)
> + return 0;
> +
> + ret = pm_runtime_force_suspend(dev);
> + if (ret)
> + return ret;
> +
> + ctrl->sleep_forced = true;
> +
> + return 0;
> +}
> +
> +static int swrm_resume(struct device *dev)
> +{
> + struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(dev);
> +
> + if (!ctrl->sleep_forced)
> + return 0;
> +
> + ctrl->sleep_forced = false;
> +
> + return pm_runtime_force_resume(dev);
> +}
[Severity: Medium]
Can an in-band peripheral wake after pm_runtime_force_suspend() leave
ctrl->wake_irq permanently disabled and the controller suspended?
pm_runtime_force_suspend() disables runtime PM on dev and runs
swrm_runtime_suspend(), which enables ctrl->wake_irq. If a peripheral
asserts a wake before suspend_device_irqs(), or during system sleep so
the level-high wake IRQ fires when resume_device_irqs() runs before
swrm_resume(), qcom_swrm_wake_irq_handler() runs while runtime PM is
disabled:
drivers/soundwire/qcom.c:qcom_swrm_wake_irq_handler() {
...
ret = pm_runtime_get_sync(ctrl->dev);
if (ret < 0 && ret != -EACCES) {
...
return ret;
}
if (ctrl->wake_irq > 0) {
if (!irqd_irq_disabled(irq_get_irq_data(ctrl->wake_irq)))
disable_irq_nosync(ctrl->wake_irq);
}
...
}
pm_runtime_get_sync() returns -EACCES because runtime PM is disabled, and
qcom_swrm_wake_irq_handler() ignores -EACCES and disables ctrl->wake_irq
without resuming the controller.
When dev had no active children at swrm_suspend() (for example, during the
3-second autosuspend window after child devices have suspended),
pm_runtime_force_suspend() leaves dev->power.needs_force_resume false, so
pm_runtime_force_resume() in swrm_resume() skips swrm_runtime_resume().
The controller then remains runtime-suspended with the bus clock stopped,
the peripheral alert unserviced, and ctrl->wake_irq disabled.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130-qcom-swr-system-sleep-v2-0-4f65a868813d@oss.qualcomm.com?part=2
prev parent reply other threads:[~2026-11-30 7:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 7:10 [PATCH v2 0/2] soundwire: qcom: force runtime suspend across system sleep Gopi Chandra Sekhar Reddy Kanala
2026-11-30 7:10 ` [PATCH v2 1/2] soundwire: qcom: use the current PM macros Gopi Chandra Sekhar Reddy Kanala
2026-11-30 7:10 ` [PATCH v2 2/2] soundwire: qcom: force runtime suspend across system sleep Gopi Chandra Sekhar Reddy Kanala
2026-11-30 7:33 ` sashiko-bot [this message]
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=sashiko-outbox-240601@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gopi.kanala@oss.qualcomm.com \
--cc=linux-sound@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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