From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 B515D3CC323 for ; Thu, 2 Jul 2026 09:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782983863; cv=none; b=W9fGLXS7LFQnfPLG8ZDC+MEIUc4svB6bohdG1yD8AkzOpswDXgCgdsiLLXY9mGElhwGtw2izr3SRh+qeQT2ZC7TkZl4gMSqt1GRkymWac6JbZnxYsNPBlWjH3ENwTw1XOaUvhiBKQE/2CuFafmPerU13z27epnkLWlLQben9fnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782983863; c=relaxed/simple; bh=oVUVN33KyAA+G7ySmu0T5BL6MDa6QNPyaXVhOB1tb9Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jONnhrtQ3oR23laBaqj6IOP7ZS35ZHnPVZy4r/5JHsSnGl3bDfw5J8+JhAH+Yq9qiaTZL1moG1wF23z61DzIzOR0wM0tQQITZxZ8pXIv1xuS/WOBdJsETonkdsK948d7Z6W9SbRGP9SVZdcmcEBwrhrM2ay3wu3Q6xtCW+0iXAw= 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=P6mErtn9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UNKTyjhH; arc=none smtp.client-ip=205.220.180.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="P6mErtn9"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UNKTyjhH" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6627UDw53965252 for ; Thu, 2 Jul 2026 09:17:38 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= HGwAednzqeRxCB22QWUBlMswoWJYl0ScI1kF4jRrqA0=; b=P6mErtn9yGlDXT0w FViNbJJbGHV8lHYlsMLHX18MF8KBThtrzNY8FWomtV/dSMN6EfyAodarTlQGlwCh xXPskHUq1FYORoAHUMlwKtFi+h896VcN4rFptqsj6iG7s+3m4cMIus47x9+nGEMX OY2YELNxhPxq4GB3Hte3Lq+/iT1Jc70cw37nuVA3dzPsHhjjMslo6qIml8UxCKud 1o8aKL22WaTiVnnmXuu7tr1sjno+Ih/8sLXq71dlBQY8FvDcjl/PVZ6OWhuchT/D +SjfBCodvvwT5wS42b000jpO1xj1H/O9zc6Y21gUen3L20sbUD3DSVCKZZr7xezX ssgrkQ== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f5knc0e4w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 02 Jul 2026 09:17:37 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-8478e9c4bd2so1776468b3a.1 for ; Thu, 02 Jul 2026 02:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782983857; x=1783588657; 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=HGwAednzqeRxCB22QWUBlMswoWJYl0ScI1kF4jRrqA0=; b=UNKTyjhHY8GEa2YcOfRqIuxigrO2c54+MiuGqYL2KVEd3O8yzipIlFpmzsKnGgO+6o RCE9PY0CaY3UrIpUDXUJCTbaTvs1xu8zjsmUV3M8sXQwwZXhmoIWvyl3Mz+tpG7PDwMv 8OradjHLbxPidOUYLhga+XrKfftUeUAQiEiY5WZoEXAgnwlVMpq7gDIiWNmfVXzGMVBq dM/vf2IFBbZ+BAEPK4de6ziwx4wIIRsHExcOuSzx1GwHy4UZVvPNm/i9QqtlmyAEx5Vx qEgiqX42lsA/klo+yPSR0UtnIO1IlMvWDz1veJ0yUCN/Mb4YezWjthudQzAlYDjYdRoG CElQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782983857; x=1783588657; 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=HGwAednzqeRxCB22QWUBlMswoWJYl0ScI1kF4jRrqA0=; b=BVWjl0n0l2VaOELCEUWez47wt2hhLnX2BBYvwswYtQUdC1Z5MZ/1ppHEXFkg88+GKq CySAQXdfIfyuXsc0gPi1ltbDrOPbtYiFSELvN1mA7cVb2l4R/7pbiQImWbd55h01aVb8 I0zTjlQ8j0v4mbvH5GyctvS0X1xnn+nXXjZqt5ly0z4rXFkuO4lNpIP7o04p+YT4tkuN g9/eWvvUve32AZ9V0+EYaBvaBNZQnKS2ocfhNG3xdA/CSKjAun7qhxV0w26sjwSJdq4w 4oXokIla/XUYPN2NdECI00QwNrtGhGM9nFYjD+BDkheCqM328nLNhO6SDmF+D7K2YnY7 2iIA== X-Forwarded-Encrypted: i=1; AHgh+RpIMUBLaZoQ+wB4wInmR4i26j4BLobeIHISim8BwfVUNdTvjAnUkMFTpRqm4tYcYPbMhmfv7XVB0IFboUo=@vger.kernel.org X-Gm-Message-State: AOJu0Yzg7mmbBliz83gL7bbAhz4tiM1tfedOTIA05waZZjYxQh4PCp91 6fu6wSPPiTybRD2rwe7mrneh9ZXfLW/qR4KAvZHOR4RklHXliAhm4GpMUSGRUPwwmuZim+SKmnP wpKtzurWdYf5QTYHFHh+MD1BM4qacS/jUlsveF8/32cEOOn6/vMB/8AHmYbySxWVkRqI= X-Gm-Gg: AfdE7cnm1I38mQ03IHnpb6vjSSjLZ+xrtjiJot3g+pQsJGsegs7pYMZUPPTDZP/lAw5 7geJjapkSwX2JF0bwA06WJ7S1Ru93zy4ODBL0N4XSMyanpX7XYIX77VQX18/k7G3MQdIsFwjk9P 6LP3TxcgT4FZj7tk8wVLZ/qsyEncr5Ntb/vO04mEyrOo5sL0BHFqEEdVTsdictSfbd+li4OxkaN IZbH6MGSxh06tOdvivL7qTGxIPDuIY6bpwrZxc9DgsjCCOzVme2NO4jkHIZThvE7KfYzXVz9xdg Sn9cpmQE9vpfz9zrg5hQBeNocrcX16o35UDIeIWyd64hbY7/g2C8f0lo82Bo3k/EjRdDSgNwoiJ 62VycGQWNs/tqikW009AgbRnath12c/UG0GxJYcxuXFnW X-Received: by 2002:a05:6a00:2e9b:b0:845:d274:c021 with SMTP id d2e1a72fcca58-847c51dad17mr4176470b3a.58.1782983856823; Thu, 02 Jul 2026 02:17:36 -0700 (PDT) X-Received: by 2002:a05:6a00:2e9b:b0:845:d274:c021 with SMTP id d2e1a72fcca58-847c51dad17mr4176424b3a.58.1782983856203; Thu, 02 Jul 2026 02:17:36 -0700 (PDT) Received: from [10.217.219.87] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847cb985420sm1046311b3a.43.2026.07.02.02.17.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2026 02:17:35 -0700 (PDT) Message-ID: Date: Thu, 2 Jul 2026 14:47:31 +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> <73243e36-175c-4fe3-a448-b30eef9c44ee@oss.qualcomm.com> <4fa2a2ef-90ec-4f06-8611-c508ce0bbec8@oss.qualcomm.com> Content-Language: en-US From: Mukesh Savaliya In-Reply-To: <4fa2a2ef-90ec-4f06-8611-c508ce0bbec8@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: LQNNMJ-dt6I684btQvPZPM93gAvqhVpK X-Authority-Analysis: v=2.4 cv=a4kAM0SF c=1 sm=1 tr=0 ts=6a462cb1 cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=ve0Vv3Uji7OJGmRhxeIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAyMDA5NSBTYWx0ZWRfXxxWxRXVtxeDn +0Zs/rMcDk6iK38nn37dyrbcdMjb+jOxpj/Y83QhwZVdG+gUSBoICknWi5N9q/A+PXPqfoM1LRY tJpq9LANkpjggVP9Xl/7o3NznYla19+jxr4rQ5OBf1mgNCrvTFQYrM3AwFKRzomzYlpoQR/NxMK oQct6BDsJo1Dnh4LgVUOElIrqSBUkYLcHHLWWS6RVS1EUV76DGEUBXAJsJbZKsAM0rzTNpKkJoI ehgMBbKVmk5rJgLuZtAxig/TBAIYKTgsz8XeMOcrV7gPIUJbtZ7C8Yskh/FmH3TVC9XhKEZoVLp Uwf2HO8BTsam7fEMLuURG45gJiSoV/1vMMXVOt/N5+JhY9VTCl2y3OUZ7Iwp0ZYSqkHzpjJpoAR bYthVhE86b5TPKYLMpKExcDiyjXB5EhcNfVy4GRYYBtUkH+7I0TVTp6lHcKpj1rU3GAHGPlu51Q l6ask8ZwryV+Qpqjuxg== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAyMDA5NSBTYWx0ZWRfX0EePHrEz90XT rd2JpeVAWQO6FEMGD57STeRNWP2RGd4kFHOdstLtI4cWin/HbuHx3YjNrgHPMN0pYd1GjYibOfs AXdYXhOW0g9WCGV0RuQtgnVMBg9H0Sc= X-Proofpoint-GUID: LQNNMJ-dt6I684btQvPZPM93gAvqhVpK 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-02_01,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 spamscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607020095 Hi Praveen, On 7/2/2026 8:18 AM, Praveen Talari wrote: [...] >>> +     * 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. > In uart_suspend_port(), uport->suspended is updated only after the > console_suspend_enabled check. Therefore, its value directly reflects > whether the console suspend path was taken: > > uport->suspended == 0 → the console was not suspended. > uport->suspended == 1 → the console was suspended. > > Looking at the code below, when console_suspend_enabled is disabled for > a console port, the function returns before setting uport->suspended = > 1. As a result, uport->suspended remains 0, which accurately indicates > that the console was not suspended. > Therefore, I believe using uport->suspended is the more appropriate > check here. Please let me know your thoughts. > I think it would be good to use console_suspend_enabled and take action. Not to depend on after effect of the primary decision maker variable. > Code snippet from core layer > > int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) > { > [...] > >     /* >      * Nothing to do if the console is not suspending >      * except stop_rx to prevent any asynchronous data >      * over RX line. However ensure that we will be >      * able to Re-start_rx later. >      */ >     if (!console_suspend_enabled && uart_console(uport)) { >         if (uport->ops->start_rx) { >             guard(uart_port_lock_irq)(uport); >             uport->ops->stop_rx(uport); >         } >         device_set_awake_path(uport->dev); >         return 0; >     } > >     uport->suspended = 1; > >     if (tty_port_initialized(port)) { > [...] > } > >> Here, it sounds opposite, if port is resumed, you don't go to suspend >> within suspend function. > It is straightforward: uport->suspended remains 0 even after > uart_suspend_port() is called, which indicates that the console has not > been suspended. >>> + >>> +    return pm_runtime_force_suspend(dev); >> Is this really required ? if  uart_suspend_port() successful, what >> will happen with this ? > > Yes, this is covered in the commit message. The key point is that > uart_suspend_port() may not trigger the runtime suspend callback if the > runtime-PM usage count remains non-zero. In such cases, > pm_runtime_force_suspend() is needed to ensure that the hardware > resources are properly suspended during system sleep like our i2c/spi > supported. > I hardly see any other uart serial driver using pm_runtime_force_suspend(), any do not see serial driver using runtime PM ops directly. That being said, let's covered all use cases/testing with this change. >> [...] >> >>