From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796024025; b=tC36gU+Bcjj7/BWcQdCQRQq94qpqzLgZsycZEVOijL8+FnCUh/RgkDG0m+M5sKtMYcOb gwIfq7eoR9yTLqqwz2HfraudFvkVFwa3bBhcgao6jiKB3U0qe4S9h8tetBXhJQ/DTuoUb kTnBNti7uWDCgMW8EkxEUcKQpIoded6WxIIzISqknAY9yM6kcs+8RCAQVncSQJDyM/VLe tJdEczf/GhvGUbhgxr5b/N+HnzcvA+XEXqI7zJRtQA6DRWgXiB8f7fFHYhOFyZq2OZ6uA 6UT7XtLiiqTZJksXCIPCnHhWwvzmmHuiHklxzkqTB6/Lrd4H7XikFg2VVF5eYykpk+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796024025; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=2TozihOl8f20ZQ8XTHe4Sa9wU9/+6jT9v61OMEoodl0=; b=OScTN/0HDfxU6plzFXLRIY3MeqhT1c3tR/HdQukRyX8OQfKR93xIyMfg6vOCny6aF743 zRYiCxAP88msjnAAZ/x/F4nl11n02H1lXh5KBtM85tz5eV3uQt3gsYUka+PazxQytrabp 5HkkN7ZCQNUx2RxQ67UPQ+YHfOSmraimv2hu1afqOYrNk7VOSEQ/hWx6EpLSE93Xdavwq cfDUqWhNLQmtN3UJxGAHyg3qJoczQrFwNbySMbz8rwhnWS9CoI014lWSy/dm3FB5q4uzg WaUIC+zRwTxDTbLsaG85V9zzHseZvyGLqoe/Tn7gtOx3z3h4zOhZc7nAg1DALUM2u6Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GbnM+ccm; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B9E4606A320 for ; Mon, 30 Nov 2026 07:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GbnM+ccm Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8D921F00896; Mon, 30 Nov 2026 07:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796024025; bh=2TozihOl8f20ZQ8XTHe4Sa9wU9/+6jT9v61OMEoodl0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=GbnM+ccmCIHu1mBjUb1sAUegk68oWYwPnKdIPdtXvz6Ex5ZgYGqk1/MTmCoOpw3wG 9a1FDf89wo605gk/vKupaCZnwYqQCoiEI5UV5rxz8kzUMW0lhJopgAFqDOabAAh5wC wtWAs5iaUOJ87Eg080lR631ttpbvv4M5gjkfkmI9OITkW3tagQDCy/Mv8KpDpTeuZS z5XM8i++wfT7mOrp6Ky29VYEvkMgwE8iaJsdzAoveihy++jwG6cLsu3ldu0GfGfeyD hAToitxu9N7BW8jCAHw+xUExFCJyPK7RwK8RCxbDbyKqnYJs5DaCKjYtXHY13hx2Jp LSmLlxYxqTVlw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 2/2] soundwire: qcom: force runtime suspend across system sleep Reply-To: sashiko-reviews@lists.linux.dev To: "Gopi Chandra Sekhar Reddy Kanala" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261130-qcom-swr-system-sleep-v2-2-4f65a868813d@oss.qualcomm.com> References: <20261130-qcom-swr-system-sleep-v2-0-4f65a868813d@oss.qualcomm.com> <20261130-qcom-swr-system-sleep-v2-2-4f65a868813d@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 07:33:44 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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; > } > =20 > +static int swrm_suspend(struct device *dev) > +{ > + struct qcom_swrm_ctrl *ctrl =3D 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 =3D !list_empty(&ctrl->bus.m_rt_list); > + > + if (ctrl->clock_stop_not_supported || stream_set_up) > + return 0; > + > + ret =3D pm_runtime_force_suspend(dev); > + if (ret) > + return ret; > + > + ctrl->sleep_forced =3D true; > + > + return 0; > +} > + > +static int swrm_resume(struct device *dev) > +{ > + struct qcom_swrm_ctrl *ctrl =3D dev_get_drvdata(dev); > + > + if (!ctrl->sleep_forced) > + return 0; > + > + ctrl->sleep_forced =3D 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 =3D pm_runtime_get_sync(ctrl->dev); if (ret < 0 && ret !=3D -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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130-qcom-swr-s= ystem-sleep-v2-0-4f65a868813d@oss.qualcomm.com?part=3D2