Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2422685rbb; Wed, 28 Feb 2024 00:58:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7HYdzPsnq8SUmeaTPj0L9kFFD8lxRAOk204RM2IrcN5Eb5iEAtqqyCA6cHQ/ETZJzOahiTPUuPFY0i64aWdOS/1ldCF7O/o71R6G/yA== X-Google-Smtp-Source: AGHT+IEg/J2Ap8qBA0js31HTeoqJyWWKuLL69ALKYbVIkKCTPuSpjizSUjXlP9gSPKiDxkFzpTK7 X-Received: by 2002:a17:906:fac5:b0:a43:a7:c67b with SMTP id lu5-20020a170906fac500b00a4300a7c67bmr7077844ejb.28.1709110726325; Wed, 28 Feb 2024 00:58:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709110726; cv=pass; d=google.com; s=arc-20160816; b=lGC5xqou1ZvrDg0kYGdtD/6LE+f+xzFfOD7726bgZ5tgVs7CiGALKiEdppEZVBK+pu H80KZoSTBExgsKc9kUluoHHMRAtxHOc3EjVhD5xWPssBHfjiE7i2M2VRfm42J/MELLnj xIQY3UTFqH8TUhbXilkuLBaP/wipcnzFZgaOXrKInyfwJJ6VvKr+Jf9AAbhaNsJZnZuI qa8HzPZ/JFFgHG83LOOM89qoPIbatLoi7jSMtAp+dg0AAM8jZ1Cb76oJfO0bTx8BB1GN q1G1JIIMLTloZkER+YajpEyD/p53kdpuoqMvI32IqQoRROUyoRV7VXkkxtwERFuhKLzF 1Imw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=zRcCiO8CqojQK0c4Re3HNYJ/sU9ZKURFUS1XX0WG8kQ=; fh=4AhiPF5encZCDA6hsfvhjVxJAOalKENJcPageBHqDwo=; b=l45sE0XEaDoJBRtatNAZf/Haso1F5s87UVMUEmRrm2JKFoIGTi0no/gOXxYp4qr6t1 CN22vFrQpbxacItM3K3F6dBZW7pQDquuQMXi4OzL3xL2w2wSlLaa6F38DbKgkST2Qaba krEZKoPSITzrfyNGv6tMY//ORwyJ/rF9XvHM8A4LSKkr/awqIxeFCVQr7X+0QhPNyjrL JZX/GahonvY2LPckWwXlUi2CN7ecTrcE8PikP6SvBWTv6s3ArifqRh77JMTRrCXP9OzZ y1+kYwtltl//MKsnEQEASeJjqiPZoyKL8HalfUSK/28vAlkhgaGzMI04TU2+X46kCOEB vDIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pn3BXlWU; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-84712-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p25-20020a170906141900b00a3e740dc90fsi1535496ejc.442.2024.02.28.00.58.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 00:58:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84712-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pn3BXlWU; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-84712-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1C3921F24530 for ; Wed, 28 Feb 2024 08:58:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BB5F2D627; Wed, 28 Feb 2024 08:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="pn3BXlWU" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 CE42F2D056; Wed, 28 Feb 2024 08:58:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709110717; cv=none; b=MexnUWODZJ7hJYSp/wQwNuAoHlAcVTmEsOek/kyMpZnoD00rNWRekr8OmLXMKwXHPePwWI6l7P9Nk3dgAE6Xi9cEcGNUzngTm3EY3EmK/fSG7+RXCS3eD5CPKl/rmDG+ah4VmKgKvDKRWJtHxHMkb5PUGCPxw3cQFHne9nlsY58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709110717; c=relaxed/simple; bh=pLxQnlIYQRFIqzP2dygI2ETILFtthWcncOGTSYn9w4A=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=IO+qyqWcpx1teHx/83sa2J2gNM8soIrwzvwPTxxqQzG2jD93ju1W9lgl1w8iPBFdfrF1UorcY80fQUMf5NdfJN4Ojx8pepnuSkRlZfeTXaGtfjMwbR8xvsLD5TnI5ft4JpuGJhLyHiQwFCB9Ybv9vnNf4YYxujGizaGEPpeArEg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=pn3BXlWU; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41S8wGXZ102099; Wed, 28 Feb 2024 02:58:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1709110696; bh=zRcCiO8CqojQK0c4Re3HNYJ/sU9ZKURFUS1XX0WG8kQ=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=pn3BXlWUfuCHrH7o+y/Mf/mETlFrdYHKRymO6U+/mmgRHF3yOpKR9ChZuegmXvkcm +/LYITnB0fvFUxcBIxxQ4P0MkCiOFs8e4bhg4pquDrIKfRypAGJIxs7EMtUWayTJS4 fcGtLxuDdgiOxSevMwJdcbHfCbWwNaSZt1DYpNuU= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41S8wGfh116555 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Feb 2024 02:58:16 -0600 Received: from DFLE112.ent.ti.com (10.64.6.33) 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 02:58:16 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE112.ent.ti.com (10.64.6.33) 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 02:58:16 -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 41S8wBb5090151; Wed, 28 Feb 2024 02:58:12 -0600 Message-ID: Date: Wed, 28 Feb 2024 14:28:11 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] PM: wakeirq: fix wake irq warning in system suspend stage Content-Language: en-US To: =?UTF-8?B?UWluZ2xpYW5nIExpICjpu47mmbTkuq4p?= , "johan+linaro@kernel.org" , "pavel@ucw.cz" , "gregkh@linuxfoundation.org" , "tony@atomide.com" , "len.brown@intel.com" , "rafael@kernel.org" , "matthias.bgg@gmail.com" , "angelogioacchino.delregno@collabora.com" , =?UTF-8?B?QXhlIFlhbmcgKOadqOejiik=?= CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "linux-pm@vger.kernel.org" References: <20240228020040.25815-1-qingliang.li@mediatek.com> <1390e743-2216-4435-b2ef-7d92a55605b1@ti.com> <0c1e972cf506b22cb1de73c8509bf2b917c0806b.camel@mediatek.com> From: Dhruva Gole In-Reply-To: <0c1e972cf506b22cb1de73c8509bf2b917c0806b.camel@mediatek.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hello, On 28/02/24 14:03, Qingliang Li (黎晴亮) wrote: > On Wed, 2024-02-28 at 11:34 +0530, Dhruva Gole wrote: >> >> External email : Please do not click links or open attachments until >> you have verified the sender or the content. >> 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? > > You are right, the involvement of 'dev_pm_enable_wake_irq_complete' is > due to the driver selecting 'pm_runtime_force_suspend' as the callback > function for system suspend. In this scenario, the call sequence during > system suspend is as follows: > dpm_suspend_start -> dpm_run_callback -> pm_runtime_force_suspend -> > dev_pm_enable_wake_irq_check/complete > suspend_enter -> dpm_suspend_noirq -> dev_pm_arm_wake_irq OK this is what I expected, thanks for clarifying! > > Based on the above, if the driver (i) chooses pm_runtime_force_suspend > as the system suspend callback function and (ii) registers wake irq > with reverse enable ordering, the wake irq will be enabled twice during > system suspend. Yep, makes sense > >> >>> >>> 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: ..." > > I'm sorry, but what is the problem with the description of the "Fixed" > field? I didn't get your point and I wrote it according to the previous > patches. I am not talking about your "Fixed", I am taking about the subject line of the patch. You've used "PM: wakeirq: fix wake ..." Instead use "PM: sleep: wakeirq: fix wake ..." No strong objections here, it's just a nit. [..snip..] -- Thanks and Regards, Dhruva Gole