From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 38435358384 for ; Wed, 1 Jul 2026 15:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782919064; cv=none; b=NebBlgGxa3i78/S2ngnyuQnhn8XNbVZYMJjUYFExYjZ8HvzC2YjtYGsISHtpLJ+YuJLmuik1hcEpTPR7kyJdjjyds1hNXhhO8yIvFxO1/XuaXo6QcO9X0aXEKxt4xBrT3iJDmNPhNA4E+A7CqPsfw/2RkTeIzVjSyJN15PSrpGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782919064; c=relaxed/simple; bh=by58mvU1Sfixgvz9hF5W5LYNik9UGMcTUhzX33TMKjM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iAMx+fpRqPB3NIujwYebwkKTi/Rs5vwZlgXoHasGJyz2VpyAgPvcGInh7nj9y0hVsQs6VSjlk11MRdYbQzjXC4l7zNR8fyo79admPVq/JnUJ4IGldgsM+m2CvUlHvpbcKbM6ixtEnXags5RTLf5f7R7sdwrHReLTYKYzS9TxLvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=HQCscZHD; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=An5TBxXS; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject 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.b="HQCscZHD"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="An5TBxXS" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 661DL9HZ1080545 for ; Wed, 1 Jul 2026 15:17:40 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= eL8RzYtzz14uHHHZjdkg5Lcy+jo9dJN907wPOrw5Phw=; b=HQCscZHDsrpvDfg3 G0oD3d+Ry7j7w8ED7pDiRilXkTsnDxmcTuW1qRZDjPvFq4cQC7zKwehaXFAELj4D uHylXxH4GSes/yvWOKkQDiXVkT1Fo00dDiXjd5+RY/T5JSzCdBPXgWqlh6pkpxw2 RmCYoS6EmNPNShJtFtYh43JoJMOIZJ3l+19oh4AwBl0H3LthATxUfcl6dRLET5L3 p8SxIF2VUfDEl1S+tkPv6RTHUW68VsptxNyCH2JmokTcP6rBDxF5DmkxW6AlUdFS +xY3/BJeW7HGhoF2KmU+Nr9H0gPrfKlHA4fLigvyMcUU9vtKfOhp6pd7mnUdh2j6 rtZDnA== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f53q08fmr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Jul 2026 15:17:40 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-8478e9c4bd2so778872b3a.1 for ; Wed, 01 Jul 2026 08:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782919059; x=1783523859; 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=eL8RzYtzz14uHHHZjdkg5Lcy+jo9dJN907wPOrw5Phw=; b=An5TBxXSIJ9Y9+BlrlzK4OcL0mEUSTQNh6B94jfY066QgAQ1BlKtI3nLTVZ7/CFyfE xXxcYeK7x5d7CHLK//ut81xzVQMLDCOtXtt8GWzwZIAvNyPfd2DgVBS/RSKgPeNfxjOy Uv72JKWCQOax+Rg28bNnZYkqOn6dOuvvUEr/xmW4ACkrew332T4YFNAZZIKrNBiT3S7B jo61qOFaIhKA/wb16JHXFYhx0CmYInIzQ5caQynpKINMJDf4ChyjmTU5eAfMLCFe0i4x NuBiRBMH/kuyTWZd/QfJS6hTJYBKd4b/rrPgVPhe7nHG2Z0thniNuFst6T2MVwqB8GAA We2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782919059; x=1783523859; 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=eL8RzYtzz14uHHHZjdkg5Lcy+jo9dJN907wPOrw5Phw=; b=JUNLsQbfa/zXuRVJsBmS0Vhy9VECLVrQy1SRqrOFJM9E2IBc3i873LTravcm1Epk78 E3N1ZcUVDlbROJdxN/8XlU9KrXR9mz9445W1fzt90qYnHyF3QvLVz6RNlmLjoJCAo7qK e8UI3WgBp4YQLh3P9gctTLAhpKctcLV0/1IHp0TdDK4RkrpcMsG+Eq6reTpH02mtm6S+ eyM4UNP/VCa+f8QKjU+jRoSHQdk94yDNh5AazDSGXvSap0dycAGeh3IWbtJFloYGCrKM /WFbD+F2X/CxPzTPKdJSrRJrW5cToRDW5i/cB8c3SFLw1xqGJvPpp+eCelKG5vYf0FD7 0nUw== X-Forwarded-Encrypted: i=1; AHgh+RpuoDaMDn09Lw4K8Z+o/NgfYSwAKiFxl+fo+kjl1tUOvFnr4kU26zlME8TY0K4SF3Fyk8szqEsVfDLX6Mk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+VznYNdroQe5EXGMMcoYNc+i7R1r0iXVQv2938w8loP+5n+Gw a/MJafkvzQpDB0bui35L5fZx/JI8iq3UhV/GeqBorXdkMqG6gvkbrTJ2ZTU6EKeYoasuWluBDA9 liq39GULUaIDWshW0S/enJPCA/CfuSkdyOM9Ysqeo2g9TmUbDa26nZ4r+Z84MVrhDQEY= X-Gm-Gg: AfdE7clC9s0wTFnX1hh2bQrflb+n97WR/QhBD1OQMgG8VAGdSUwUOPlM+lsOZsVD2xR X26WqvQdc1bki3LwAz7wvsXifxJPERlOnhrRVR2mB+KJgitvoSTVbOGJJMYhN9XAr10TZKkt1Yz jzhSQ/b8n1D7wHoC6jq/OTsiH2i0aM+cBg4UVziR+3oyTJ8zYwfoeVavTzpj+hRzQ2pKp0HQ1v7 U1O1qWrhQo4MQaNV8fy9r/qzEaTq2gCLQ6oDRGlhnc4H2nmJGKSFoef/lOMnWxGKiZKxMzo/gFR ANbJbqfKVyUfAPGMoW+LOfBZczHxe4sfvrBN9kD6aZTwfL7hiYl7uLiDJFxSx12yLGxFA5CzXR4 KfvuM2xCe+6M1fFrFtTTY81TKLC784ija2+jwT5Ud2G5t3w== X-Received: by 2002:a05:6a00:4f95:b0:847:7128:ecf6 with SMTP id d2e1a72fcca58-847c512d7b4mr991678b3a.40.1782919059352; Wed, 01 Jul 2026 08:17:39 -0700 (PDT) X-Received: by 2002:a05:6a00:4f95:b0:847:7128:ecf6 with SMTP id d2e1a72fcca58-847c512d7b4mr991654b3a.40.1782919058882; Wed, 01 Jul 2026 08:17:38 -0700 (PDT) Received: from [192.168.1.8] ([106.222.232.144]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847a039f2afsm4262001b3a.53.2026.07.01.08.17.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2026 08:17:38 -0700 (PDT) Message-ID: <73243e36-175c-4fe3-a448-b30eef9c44ee@oss.qualcomm.com> Date: Wed, 1 Jul 2026 20:47:32 +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] serial: qcom-geni: add force suspend/resume to system sleep callbacks To: Praveen Talari , Greg Kroah-Hartman , Jiri Slaby , bjorn.andersson@oss.qualcomm.com, Konrad Dybcio Cc: aniket.randive@oss.qualcomm.com, chandana.chiluveru@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org References: <20260701-add_force_suspend_resume_to_system_sleep_callbacks-v1-1-38c9a721a462@oss.qualcomm.com> Content-Language: en-US From: Mukesh Savaliya In-Reply-To: <20260701-add_force_suspend_resume_to_system_sleep_callbacks-v1-1-38c9a721a462@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=dtnrzVg4 c=1 sm=1 tr=0 ts=6a452f94 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=1q2F+KrbvUZPNaeG7DbW0w==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=WaUktqV4Tl373BT39uoA:9 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-ORIG-GUID: QPxPlBO8B87u6YVt47CVNDUyVQuRGhue X-Proofpoint-GUID: QPxPlBO8B87u6YVt47CVNDUyVQuRGhue X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAxMDE2MSBTYWx0ZWRfX5KBpkaHGqPIG Fuy2OUUAzWrakdsfzueuHDhV+bHLhIRNcgvLWipLANzRQEyyGNzlGcjZ8kzH2pGqHGIySh4B8ZH vOyoz6+DU1jLLYsCex1/vj2cXrGmFHa/qEnk48FUWsZM6Tl7rSZ+SWjTEfNv9Sn4kN1rteroX57 9kFbGU21Rja+dcTNYcc3z12OJ2Wwiy5pLBcjMYxY/+OuMBtKF5UgnZgAb3yEJjGK5X65wkShkqY WX33RxX7XwAzya41UFW8Gy8hEvVPVBX+G+loLrPZDXcx2UZ5/5rJqM2umyfSKLr8cfqkxOaDS2U AOF4lE1Fz8AKMrOUPKWNJej0K8v9VuVIQFH/LI2Bof0g5NFUeHdAVOb4G+vRLkVsN6EdWsLqQad O1VEseY+4ujaE/yU6az8Io5uc2ViIs8xzARsIp8lyw0iYBYT/yPIkfDmEgXIruFQz8AU74BHrw1 69ugOa6hcb7+SrKTtgA== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAxMDE2MSBTYWx0ZWRfX7gE9QILedTRq hcqMutRaW0KcVSVuIQPtw92UHTg3b09eweAzLStZ6PhwQWklnid3PSIvX4T3MLNd6Ktps78es99 uVmHAKQ+CIBUejsgmKuCw5hTNRBYHGs= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-07-01_03,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607010161 On 7/1/2026 11:27 AM, Praveen Talari wrote: > During system sleep the hardware resources (clocks, interconnect) are > not gated because the runtime-suspend callback is never invoked from > the system sleep path. This prevents the platform from reaching its > lowest idle state. > > The system sleep callbacks qcom_geni_serial_suspend() and > qcom_geni_serial_resume() rely solely on uart_suspend_port() / > uart_resume_port() to manage power. uart_suspend_port() drives the > UART PM state machine to UART_PM_STATE_OFF, which in turn calls > pm_runtime_put_sync() and eventually the runtime-suspend callback. > However, if the runtime-PM usage count is still elevated at the time > of system sleep (e.g. the port is held active by an open file > descriptor), the runtime-suspend callback is never invoked and the > hardware resources (clocks, interconnect) remain enabled across > suspend, preventing the platform from reaching its lowest idle state. > > Fix this by calling pm_runtime_force_suspend() at the end of > qcom_geni_serial_suspend() so that the runtime-suspend callback is > always executed regardless of the usage count, and by calling > pm_runtime_force_resume() at the start of qcom_geni_serial_resume() > to restore those resources before uart_resume_port() re-opens the > port. > > Signed-off-by: Praveen Talari > --- [...] > @@ -1963,7 +1964,19 @@ static int qcom_geni_serial_suspend(struct device *dev) > geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ACTIVE_ONLY); > geni_icc_set_bw(&port->se); > } > - return uart_suspend_port(private_data->drv, uport); > + > + ret = uart_suspend_port(private_data->drv, uport); > + if (ret) > + return ret; > + > + /* > + * When no_console_suspend is set the console must remain active > + * across system sleep, so skip the force suspend path. > + */ > + if (uart_console(uport) && !uport->suspended) > + return 0; Rather use console_suspend_enabled and take action to go force suspend. Here, it sounds opposite, if port is resumed, you don't go to suspend within suspend function. > + > + return pm_runtime_force_suspend(dev); Is this really required ? if uart_suspend_port() successful, what will happen with this ? > } > [...]