From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796029893; b=MWisnz7vCNgPiJ92JcUqwEqFxY6t7cvZAC3M9hRHi3G58trLtf2pkHxj2uWrt/2udW43 fuF10t12zk+NL1Hd6kEtCRnyxYDrxKzm3uY4iURHOpVboXcXqXYLuZ5zf7RFlBSqPW7GP 9UIDr2uToBxxVb8/VojzYZElY1MF0dwTh3xB6bXTSll8ILUOsXaVOwXKKp1YRaRlNrJjR SL7Bfwc55aMWmPx4JZoEFlkblEsU/W0ZwKqakYEQgrkYqpzKYjbK3a95rPyajuAukNGHe pmwsk02NHn0305OBgpVsPXWpp4Xkm3AC7r8Ml6HcO0NZsih7bGK/JYJoOJje28zxy5g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796029893; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-GUID:X-Authority-Analysis: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Info:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=JBdu0ee2tmJfx5t3OA16RPpxsfswq4PIlcXwH6o5v+8=; b=AEkwGtkdTZvdWsVk4puD3fe5KBYWs7A9pElWD9pmRrMPn/+QdKDqLdErq/P/iDBFcRrg Q8LsaG4uyzJ8Ro8KnL2I5MLkDHczg/7tN+CbyMnny+N/7M6DLEuQicOZOlEfYxycrZVts pvi9WhWoS81g4WSmbDhfEdGRDqNigA985enSH4qTeV0eqzlz89qUL1UattjNLMa9C7vNk q2E+D8ULFkktXLRb8GzQK63eou8Y6adpxtYoJZCZyWL+7TxkTBszls7cdI8ldAKGQuU/t Wc/8nb3NsBM2Q4ODOBhexwCQCwK8fekYPhPp46yHODmypjysm8H2z9ieMiAk5kxzpZA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=JrdWes2M; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=fb3cytMC; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83AE2606A32E for ; Mon, 30 Nov 2026 09:11:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 83AE2606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=JrdWes2M; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=fb3cytMC Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU5GNLO2039637 for ; Mon, 30 Nov 2026 09:11:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JBdu0ee2tmJfx5t3OA16RPpxsfswq4PIlcXwH6o5v+8=; b=JrdWes2MOllXLm19 wrkACUzkxH0feFPtwD5+pxZD+ymrUizVM1mVMh4YkYqJXleg0xmjbNADpycdSn/7 bjNSmZ3uhIwRvH/rW3glznvn/xyuXxRZVfRt4FherTrWGr6aN/6K5/CAQ6juCYdw QV22vfKQblCbUzf4yIAg2pRqQDiPGQM+0PX7CfdCXEX2+rYpYaWiTnmf5kV9RycL z7Fm9Jo90V4Dt3Ea5UaFpBHYijNtcuKEbXsW8EARkcr5xl6efHq0Nxar31yXHbac +I0G2Byacxo06krfWbuR30p9XcmUOJXBawTy2lsLohoqcdPX2uTVOluYnZz3yzdS /vWXYQ== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j92qurw6n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 30 Nov 2026 09:11:32 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-38531c1a566so9157204eec.1 for ; Mon, 30 Nov 2026 01:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796029892; x=1796634692; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JBdu0ee2tmJfx5t3OA16RPpxsfswq4PIlcXwH6o5v+8=; b=fb3cytMCS9bCQBLBY2TeZF8KMZHofXaWYTEplC6HY2aY3DZ2UWDJKM+CusgB1CnlkQ xBhsVX+ecQ7yQFHLxRjjmSP4RXb0EjFdePzo1FsLWRifenrQT+gpRX22yAVK4f978/yL ss6WU7r+40yBenAYFmgpBxllPYBaYgiealr4+SeM8+gf5aWIB7KrRFY62gnKS28zlfC5 mMtKcvox3uiOcNljC4Sxy5Ha3l4gaCSn5q0tcAMZDyMCsDI5BEO9jH+N0e2ZuZOsjEt+ G8YZgh7evbst8w8iyALiTFWW1F0epFYr8rCv240uXy6sOvNm5XFk6PGu3sXvhXcDqVN8 H5Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796029892; x=1796634692; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JBdu0ee2tmJfx5t3OA16RPpxsfswq4PIlcXwH6o5v+8=; b=y9tOXbpFiJmY5nWerfySleGzH2XKSXVsvByQJ9c1gRuk4rZD2OxyMUR3dcqjzU+fcD fFQP5H5s7AHvEUPJ/tXMiIuPr2uJXWioaU5kAsc2haAF9MeMDQvr+zu2EAgQ6DhOuUX5 2SmWfthIxK+xJMgyreMp0FJBEC7oB+3Ic3c56pyGalQwAufm/f1NsuzcjyWSPJOS2U5/ +e3mnPmQAEG3Sbw8tFhS1LbrVGj5+SlV7UdOmzAvfTxShDq++C2HiUQRVsrcKcaRPRWS RB/JGzIh3bV+tMW6ZW+5p2GkrI24RkzrRTD0ZhQ1P+Ao6nCh6iRzoy8TBvpn4Xq5Pufl Vpsw== X-Forwarded-Encrypted: i=1; AL+hErHIVUFyTP6pclILyvvo6J13xrYguw7HFejigrS9VWHvc0a/vmyRr4YbYkqOI89QWfvomGdlLD2uJyz9KbU=@vger.kernel.org X-Gm-Message-State: APuU4Z9q0JALPIiLaLQPoG+0zDRSQjUeocE/nsgi9o5/1uc8Mj6FrDAM W7jhoCHHQ12I/rG2EMIS1A8dQoCzIvyGSCdnPPsPuz7P+HWTwwNkrPZr2qKsIbthtGNwK6OP5v1 91Z/AJpVcvUGWK+encjCEqaSFZaFljm4roqhtHv2KhqqECjnCMftsk/AJw58mRXJA4Nw= X-Gm-Gg: AZFdTZdYtxRiX53ABQB8+vbXniwpEW2MczXcNW4uhmNptYw7bFvShGmoFInKy1LTwUa PuWqI7EiwYLpnWhHRoAFifE7oVcRLF3sStkEqFE7M/0X+or8mQhUZpaES8gPl2gv3BIMVyfkEi9 gLM1YKTc70Q/8rm8WHfGoStdGcsC9aduuFDCrvuc1xFsqUCJboxrJeH1Yhx8Qnbl/N2UyeAlxlV sWriIxAAk8I+zgEaW2FCjWac/BhLSst9F9VgOJW0B9f5ZRiUL0wLEwnXIRkVMs8LVT5QB0dASGh rTMPeg86UzmeC+igp771XkoNxFWjBvvEUKi+760lxU7+ykE5LkbpZQ6R+X2uJcaw7n5nBFwMWZO kXUVEZZrYXYQO+WaQlp4uaqYS/+B9m9WzdBb0lHRE8zHLzgxp5OuvnN+lj5jV32yb50BnJF1xyd oUj34= X-Received: by 2002:a05:693c:87d2:10b0:386:b5a8:1c5b with SMTP id 5a478bee46e88-386b5a82496mr22756316eec.18.1796029891993; Mon, 30 Nov 2026 01:11:31 -0800 (PST) X-Received: by 2002:a05:693c:87d2:10b0:386:b5a8:1c5b with SMTP id 5a478bee46e88-386b5a82496mr22756294eec.18.1796029891458; Mon, 30 Nov 2026 01:11:31 -0800 (PST) Received: from [10.217.198.242] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38707b612cbsm21530614eec.4.2026.11.30.01.11.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 01:11:31 -0800 (PST) Message-ID: <154b04aa-8aa5-4110-b452-a5bb689471b8@oss.qualcomm.com> Date: Mon, 30 Nov 2026 14:41:23 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/2] irqchip: irq-qcom-mpm: Register MPM with cpu_pm for RPM notification To: Sneh Mankad , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Gleixner , Shawn Guo , Marc Zyngier , Catalin Marinas , Will Deacon , Anna-Maria Behnsen , Frederic Weisbecker Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20261118-b4-shikra_lpm_addition-v4-0-46ee87e22576@oss.qualcomm.com> <20261118-b4-shikra_lpm_addition-v4-1-46ee87e22576@oss.qualcomm.com> Content-Language: en-US From: Maulik Shah In-Reply-To: <20261118-b4-shikra_lpm_addition-v4-1-46ee87e22576@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: eAuGQkL0sDom0DT4HiP-iR5DZCRBqmCF X-Authority-Analysis: v=2.4 cv=C4d8WgP+ c=1 sm=1 tr=0 ts=6b0d3dc4 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=dHYe8hj7EUyGeaWijnYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDAzNiBTYWx0ZWRfXwlCX5s+hcnb7 /wmhqFFQHoQSDWBPk7o7ZZ8bhuX9e4BxK06TXuaZZRpdD3orgy7sfZ0J5y1Z15m3Nsc6mdJ5Z71 ojqLUipW/4HfqeAqgrwDnXKTeraIlDDLEWaaTU7elAyaKTF+KcKvztHqigziAu3kd/AnTM2YBdz 0f9ciqrwoWd7koqzVTcuoYfgsy17UPlPlzas5WLmpM+rQDRTTYSE7gDUZMj/Nxh1HOc3/Dyw8cP Mx9F1dQ8OsgN/xqIXURqP8MdG6eIFXzmCA+sY1JOVgT9iisyMTM6WlRiHCAcYJI1yZa0CRY302q VXyzQGY0zXZSyG+q7rCB9UTkkWv62+cyv5NsvFdNejcAiYpZac+/7ZmxbUGWgoqsxtlJpp6BZ8U Qdf8Mn0qTSXwoKvVwEwpjzGchH+h8MhIcioPpX+gHdYqcdGdElvQnIAmEYAujnze2ZoTdDaVc6P KtKk5FMScwRV9W205KA== X-Proofpoint-ORIG-GUID: eAuGQkL0sDom0DT4HiP-iR5DZCRBqmCF X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDAzNiBTYWx0ZWRfXyx/r+0rJ25IG yrKDMvtBEiVwwV/5w2Brb7OckHzB7z52bQmv+G/B71RYmNaW4SB2YtvSdSiYJCFzr1EXABZHfmT gVbz8C1jwSgF6RWbWkFhyPVXLbiOb7g= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_02,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 impostorscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300036 On 18-11-2026 11:36, Sneh Mankad wrote: > MPM irqchip needs to notify RPM (Resource Power Manager) processor to read > the latest wake up capable interrupts when the CPU cluster is entering the > deepest idle state. This is done by sending IPC interrupt to RPM and is > implemented as .power_off() callback by registering MPM as parent power > domain to CPU cluster. > [...] > + > +static int mpm_cpu_pm_callback(struct notifier_block *nfb, unsigned long action, void *v) > +{ > + struct qcom_mpm_priv *priv = container_of(nfb, struct qcom_mpm_priv, mpm_pm); > + int cpus_in_pm; > + > + switch (action) { > + case CPU_PM_ENTER: CPU's exit notification decrements cpus_in_pm without a matching entry, for the case when CPU is already in deeper idle state when the register for CPU PM callback happens via MPM irqchip. To avoid this, one possible way is to have additional cpus_entered_pm, to track.                 cpumask_set_cpu(cpu, &priv->cpus_entered_pm); > + cpus_in_pm = atomic_inc_return(&priv->cpus_in_pm); > + /* > + * NOTE: comments for num_online_cpus() point out that it's > + * only a snapshot so we need to be careful. It should be OK > + * for us to use, though. It's important for us not to miss > + * if we're the last CPU going down so it would only be a > + * problem if a CPU went offline right after we did the check > + * AND that CPU was not idle AND that CPU was the last non-idle > + * CPU. That can't happen. CPUs would have to come out of idle > + * before the CPU could go offline. > + */ > + if (cpus_in_pm < num_online_cpus()) > + return NOTIFY_OK; > + break; > + case CPU_PM_ENTER_FAILED: > + case CPU_PM_EXIT: > + atomic_dec(&priv->cpus_in_pm); > + return NOTIFY_OK; Decrement only if enter has tracked the CPU.                /* A CPU may have entered idle before notifier registration. */                if (cpumask_test_and_clear_cpu(cpu, &priv->cpus_entered_pm))                        atomic_dec(&priv->cpus_in_pm); Thanks, Maulik