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 BF8412E62C; Mon, 8 Apr 2024 13:07:36 +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=1712581656; cv=none; b=JelMRf/DYIzKiWUhO0uItDJbYDnGJ3PRoJwWx97xzCZXvIBJrh+XBhkifvWdtLnNCL/WiTw38meHCZhXzBQp4r4RJK3hS8OO+pCkNmKc9zUYLH9+kQtppROlvM3HUFCC7yS6jExCXqR0g210txr1OYD3qA644r52WHbrvSCiP+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712581656; c=relaxed/simple; bh=pMxXvSTz3Xe73W1rQkAqaOzira12XfuY6fUvaKyE1X4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F0l+B3C9o/vHfGQIwji7XzsQ7AtMTF+8jrjt58O1OPpfvOzLGtGdQJKVkLBKX9l8/6wkICadaIU7/Rgwx8Xx/EcvIAovFfMzUrmExQu5LJYPc5Z6R6fUUUUobWC+MuXIyK04EaMggas07QVgq0BW5z/Lp1UdS0nHZU3NGkpufRw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=k2kUSzWj; 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="k2kUSzWj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F21BC433F1; Mon, 8 Apr 2024 13:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712581656; bh=pMxXvSTz3Xe73W1rQkAqaOzira12XfuY6fUvaKyE1X4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2kUSzWj42Ef1XNww3UCCTfuLC9sMpQhZx4uAgmWF8HVI6SC9h/qX0WZ+XJkYfM94 B9RthPB6iJJ3kU+5Wcd+av60mnD2RezQeC58Pg7kpcuYL+5qP466o9xZKEzXtytH6r kUF3xrr/ccXboPnOIEtVM5WohrTUSRzDdzEeIy0E= 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 5.15 052/690] PM: sleep: wakeirq: fix wake irq warning in system suspend Date: Mon, 8 Apr 2024 14:48:38 +0200 Message-ID: <20240408125401.409034287@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240408125359.506372836@linuxfoundation.org> References: <20240408125359.506372836@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 5.15-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 6f2cdd8643afa..ab6eced7f5762 100644 --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -362,8 +362,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