From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0EED4778C; Mon, 1 Apr 2024 16:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711988099; cv=none; b=gogXM9NyToHh2pOhb4N+XvKoCfo0vgA4pk2Zh82bwR+47uKCVRhwDISbQ5lqE5vsPxrQrd4lFVxGX6uT9mX9qkRrTnBE0f9d4RklOhCAPgHhvR2C1a0eul2CEXKIa9pwYZvmnahexDB3rmAjrgo1bX8rxaOirb1aLRveli5WYyk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711988099; c=relaxed/simple; bh=wy671zdzdrawi+sqHMb6wU+2L8NYA8AMFaqvgRF0QQA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GT8SmhKyUj9eW8KOoepOwkfuuVFQ8BFNtsWeSmckLBGzJKmVhdGrROTxPGASOSDLBG+aXoRAJJRregwctnEwPtAnAdiqvrrqT5stxF8WtIU7g03ZKarvD7lZm96e+iQSVGBHXAfvAw3y0x/G84KRuJOgUwDbXM7Tt0AsqpdscNU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CWEkYtVF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CWEkYtVF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 067E3C433C7; Mon, 1 Apr 2024 16:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711988098; bh=wy671zdzdrawi+sqHMb6wU+2L8NYA8AMFaqvgRF0QQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CWEkYtVFGvO0LhcYUpAc793A4K2whIPtbMgpyqOgyyevjRliBD8cbUHG6AZifehUX Aca54K/a+XOxBaXcXcESK3/RnEfz49VoBby01+OpZdaraxSGxALXXM5C1enXSvgiTZ 1Rxxa89WQySXTx0yDcnAM/fouOLwPLN02j/qXGc8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dhruva Gole , Qingliang Li , Johan Hovold , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.7 084/432] PM: sleep: wakeirq: fix wake irq warning in system suspend Date: Mon, 1 Apr 2024 17:41:11 +0200 Message-ID: <20240401152555.625577667@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152553.125349965@linuxfoundation.org> References: <20240401152553.125349965@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qingliang Li [ Upstream commit e7a7681c859643f3f2476b2a28a494877fd89442 ] When driver uses pm_runtime_force_suspend() as the system suspend callback function and registers the wake irq with reverse enable ordering, the wake irq will be re-enabled when entering system suspend, triggering an 'Unbalanced enable for IRQ xxx' warning. In this scenario, the call sequence during system suspend is as follows: suspend_devices_and_enter() -> dpm_suspend_start() -> dpm_run_callback() -> pm_runtime_force_suspend() -> dev_pm_enable_wake_irq_check() -> dev_pm_enable_wake_irq_complete() -> suspend_enter() -> dpm_suspend_noirq() -> device_wakeup_arm_wake_irqs() -> dev_pm_arm_wake_irq() To fix this issue, complete the setting of WAKE_IRQ_DEDICATED_ENABLED flag in dev_pm_enable_wake_irq_complete() to avoid redundant irq enablement. Fixes: 8527beb12087 ("PM: sleep: wakeirq: fix wake irq arming") Reviewed-by: Dhruva Gole Signed-off-by: Qingliang Li Reviewed-by: Johan Hovold Cc: 5.16+ # 5.16+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/base/power/wakeirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c index 42171f766dcba..5a5a9e978e85f 100644 --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -313,8 +313,10 @@ void dev_pm_enable_wake_irq_complete(struct device *dev) return; if (wirq->status & WAKE_IRQ_DEDICATED_MANAGED && - wirq->status & WAKE_IRQ_DEDICATED_REVERSE) + wirq->status & WAKE_IRQ_DEDICATED_REVERSE) { enable_irq(wirq->irq); + wirq->status |= WAKE_IRQ_DEDICATED_ENABLED; + } } /** -- 2.43.0