From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E4C5C54E41 for ; Wed, 28 Feb 2024 06:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KpycW4j0YFE9RMZ4xvdKQ6O9MyKlpXC3ojYKCEIslGU=; b=gEJl+ZH4pS3bAM wTCcoi/I8m/92JwKJuADfKI/pPchM5gFymJSHCSAq/Urzp42k+68GE25ZMXMOE6pJ0jyiHMEYvjpy V86VD/TYAgzDpk5eXpFUkd1AibVc8RaEwazD2cYdTHbFBYG9Z7vy9P0QEoAWnHimI7cDOw7Gigwzy +sozGttDFCpru8wHYSM2q1HFrB5xbyqs+oxIzk4IK5UB9cJdV0DAfY9BBF7sARoMSgR5NDOut65L1 GoPtEnbdiJzCPqY/FwdHBBHJ++AEsJBhKMfp7wXY85k/eaSNriU2YnvubtMZEaGtimYhiB4ZDdAjJ /YWmvBGCkAcFvxrY8TuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfD3j-000000088gJ-2TJX; Wed, 28 Feb 2024 06:04:51 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfD3g-000000088f7-2kWT; Wed, 28 Feb 2024 06:04:50 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41S64T3S055457; Wed, 28 Feb 2024 00:04:29 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1709100269; bh=dlFX39e4Le6PT/fbfEe1U4Pxl4yfCvn/ID1DA6HRvSk=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=GtWFzRk9RjdIo1EqAe+uxMjXXCgkL8SCURhE2rKK+g1fRXleQnQYwFIpfgvGQjBC7 E4YStneUeimUG2Z806Dq+VReRykRKQ2bCMOQyMvRzo9F9uQJnNVkunBWGjLSjWhSqf XfxroEYiojgz8po2EUSuERBof8qZdyF5Fy3xBOVE= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41S64Taw097518 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Feb 2024 00:04:29 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 28 Feb 2024 00:04:28 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 28 Feb 2024 00:04:28 -0600 Received: from [172.24.227.68] (dhruva.dhcp.ti.com [172.24.227.68]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 41S64O8F115774; Wed, 28 Feb 2024 00:04:25 -0600 Message-ID: <1390e743-2216-4435-b2ef-7d92a55605b1@ti.com> Date: Wed, 28 Feb 2024 11:34:23 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] PM: wakeirq: fix wake irq warning in system suspend stage To: Qingliang Li , "Rafael J . Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , Matthias Brugger , AngeloGioacchino Del Regno , Johan Hovold , Tony Lindgren , Dhruva Gole CC: , , , References: <20240228020040.25815-1-qingliang.li@mediatek.com> Content-Language: en-US From: Dhruva Gole In-Reply-To: <20240228020040.25815-1-qingliang.li@mediatek.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240227_220448_817965_24AED869 X-CRM114-Status: GOOD ( 19.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 28/02/24 07:30, Qingliang Li wrote: > When driver 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. The wake irq will be > enabled in both dev_pm_enable_wake_irq_complete() and 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. Just trying to understand, why not in dev_pm_arm_wake_irq ? Is it cuz it's called much after dev_pm_enable_wake_irq_complete ? Not sure what's the exact call order, but I am assuming dev_pm_enable_wake_irq_complete is more of a runtime thing and dev_pm_arm_wake_irq happens finally at system suspend? > > Fixes: 8527beb12087 ("PM: sleep: wakeirq: fix wake irq arming") > Signed-off-by: Qingliang Li > --- $subject: Most recent convention used for this file is: "PM: sleep: wakeirq: ..." > 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 42171f766dcb..5a5a9e978e85 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; > + } But this does make sense to make sure status is updated, You can pick my R-by. Reviewed-by: Dhruva Gole -- Thanks and Regards, Dhruva Gole _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel