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 27E674C8FF7 for ; Thu, 2 Jul 2026 09:49:59 +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=1782985802; cv=none; b=fDMjBQ9xIqVX5Hlb0lk9EJy34k5BJeDeAaEsmneeT3YFlcKNCwUmODQNGOjOXzNlFgx5SXj1g2yA2VnNpIy46GGBMETQVNwkhqjLscouvcflKw82HM+AFygYkfMm9fZTHZjAFtzYJDg3/mfGFORg2IvlkHkaXlfSGu1rWJvzLAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782985802; c=relaxed/simple; bh=+aEA+WL+lhQ8/LMNDDj+Ae2GqHVXWUMR4IxffTyTgo8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nGoxHYrdzPNrhPdwfM/4mGrV7nz79Th08b+tPyqm1MacCFYutdkINeKgpS6KIYlyLRveTOTBrYZQQ7Kwfxf2AjLANVjzXvXHB/jiZc8XOcMcKKCjM/0ogFxTkpiPzClgkV/q3bEk5bCIwEK51SXEGRhBPuIHGb52N/UiiFxDtRE= 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=RF+6P1/o; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iVLIA4AA; 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="RF+6P1/o"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iVLIA4AA" 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 6628sJRV4172117 for ; Thu, 2 Jul 2026 09:49:59 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= BFEvju+fHqbHwUz13O0lBoZLeevj7Pcr7HLGdvh0MNY=; b=RF+6P1/ont/PO4u8 7o7Zhtz5CBzlMZ6LpioPqYb0kWUTr0zNflvRM37NSe0z+p4hNZ4W7Uuf5VJcCWwD pvkiEUSLYk51kx4NArMSJjpXNA42nNnGxsO2M0vPMVr6/zNhBP/SabXFwxUq18+F iGQsVIJjG3egiZi4AVQolRT4j8ty+QmV9WxSVyDBSA1lfIzuIuJOIYug3N8addZS OU/MPb92RDCu+JN2tMcbeflVLSGv/cMGGU1J2bD007027Q2khnPs7+8uzQV1LiBw 5GxCcr1/jzFKX3A8gLwNtgRdgVHpCGUdiGXQRHn3ouQF14LxBK9MGxZl94pDflAe iqmCPA== 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 4f5mvwr7gr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 02 Jul 2026 09:49:59 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-8478e603285so573484b3a.0 for ; Thu, 02 Jul 2026 02:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782985799; x=1783590599; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=BFEvju+fHqbHwUz13O0lBoZLeevj7Pcr7HLGdvh0MNY=; b=iVLIA4AAPgUvY+c6C23CGAgnoJaDrLpwvEXzEd2U/jLp934AvG3RJ1WDJ59ndaNf4U G3gg3mLCqWrY3LzRUEp8KMqmwpp+bG7016Gm5gRn2N6/8in+iE/ZN4aKQGzgbzi7gDb3 wbymuV7E/JxlvA2fMbIKCDnMVz5lIvK/9OFGqeVSD3eZmgbXQfDFBZ/eLPz8B37QK992 I15k3OZ1i/c2+7WfNXoLaSuoDWUjiH+QayZ9bb2zflRUsN3gmaQgNVnb4f+Uhl/DGpwS ddqw8CGuJrn5/xlafs8KPs5efRcwh6Ef7VgQZVlFaq4vvZbGtKbgoUY8kg3Vl50e1EgH cPbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782985799; x=1783590599; h=content-transfer-encoding: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; bh=BFEvju+fHqbHwUz13O0lBoZLeevj7Pcr7HLGdvh0MNY=; b=S5AEcieghcJil97srZz6dPgPlgWKapSngjXjgoG3055M4AnuIZPU2/T9lavmDZZbD7 AZ5ponJ+kRAThSdJdnjoQFqVwqgHIny2KnaZ57Ru7ymKTp+L5VryKuHbsEBjD4ERbBQp CIl8jy/ki8PBQU/xWwQ6ru/7synVhSOHN1bvk9RMh4llsVoCGr9TSmBxkFOPTRxyxopG r85zoyEKNODl4+kQUfRc/eALZsT41nnZ3VVIsCKgYNSt2eUIBJWNwTHZULoMq2QpE5TS rO6VFvd6DedCYREvRchkto9TpT97DrZYal5rYKVIg+rVPJlnP7wNGCGhcqD0c2iQENZj 1XZw== X-Forwarded-Encrypted: i=1; AFNElJ9jyB3xeCK5VLjsAe8RBX7QO/XoZMsY29WENnKjE+Qf59UZg7kTRSA86gyqAAd14QFwyQhHxKbASEOykCM=@vger.kernel.org X-Gm-Message-State: AOJu0YwwH+APX7BHvfLljlXUKs0lvH6uEswAlKVxYO3A+IBh4gJWdH6g yGxNwMQ29pOvOG9f4QoDvucw0KOcpBX5whihLiB2GxZ6pYnl9424/DlbrIInt47RZ5hxSsAOUA0 eTTOWFOTFja0CIzjtOo76vcFwwFGy14f1Lx4rscrhDhpQ/jQhxW9e6HP6ii37ZLsKrZlsN+1djY Q= X-Gm-Gg: AfdE7ckAUV9B5OdKOYjFULQPxBgQ/mbnlKFXG9oJajqoQccxMDtb+jJ3Wly/ax9SoI6 WYSQzMVeOdWxvxikrLowQDCRZsxmyYq8vKI+q53JmawgJAKW+/49WuBzbrnyupxOFbY8U0+Tvq6 o9tjyihzzdUszT/V+X0p5wzIw8KHYEYanKviCxizHcJMD49LNNY5+oAQTHfXA6rtNZmCiWHvQBw rCYcJ8UZPM1KeV+QGsfX+N4jHw5TQs/Nn1VaLbVqU7joRDaq01y8RC6wPYpPeYJfAZxYh276fgi IlyLnzSMNBr+zHptCgaMjPc2wmxpv4a4ncEzMEiwd9FZab6UkfBjGyfwFumVVHl3OduxLfvdk/V jwjTRyrWUDNBmlI17+9Ul9Io6J88Z80h/vgJnhZv7pbU= X-Received: by 2002:a05:6a00:9283:b0:847:8f33:b159 with SMTP id d2e1a72fcca58-847bf8231acmr4258562b3a.10.1782985798341; Thu, 02 Jul 2026 02:49:58 -0700 (PDT) X-Received: by 2002:a05:6a00:9283:b0:847:8f33:b159 with SMTP id d2e1a72fcca58-847bf8231acmr4258543b3a.10.1782985797676; Thu, 02 Jul 2026 02:49:57 -0700 (PDT) Received: from [192.168.0.4] ([49.204.106.248]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847cb94b3d0sm1097629b3a.36.2026.07.02.02.49.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2026 02:49:57 -0700 (PDT) Message-ID: Date: Thu, 2 Jul 2026 15:19:52 +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: Mukesh Savaliya , 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: Praveen Talari In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: Vukk0aP_hueVZfBOQVYRmvpLXxm6FE6C X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAyMDEwMSBTYWx0ZWRfX9bkE514KlNQS dbJbI9uuRttBfZOkxUatGqsQbz7i1tuwRSDBhrWnUB0plHH5uKZLohm/gIJMtpaQklsdt2LXXOv D1wUNvtLeXofpQijxBxk1SqKHoTgsSoytlWnayCvf5banL1naaH3E+oGgs1IDlKyAwDIY7ZW6CY LUtLmLorXAdsniUM27DCTXBgdHiG0NOI+OGKDCdWTzx93v9Dxt4QT9GD+qwVs9z490jGKgRSHjz UHSjH7fT7uT1VxEBaeyoZNul2I5qXK0Ram3QKwF98IeXY0JKn8zCbbP0uY8ROVvJrjmIEbPev8V EHCIdSLHPTL4V0L67SqaoyT1Y0N7ffLQX+lttN+ehdm3FUJzOweFRMI0pU7/G5UKYne/GXsmdmP N/VpoqGEQv9oV7gJeHVT00P9ztIxvoq+h5its3hdrv/cLYVXH7mhd/95Z0Nv1u6qEzuK4mkc8HL rpsbHNooMLojNhZrxeg== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAyMDEwMSBTYWx0ZWRfXyq6G7sFn7L6N KOvTRdLO8YrEiMTEfh2mbTZF3r/Foa7xbcmb/jE5hC2ZRWZ+yLVmauWEfLt2Rp3BdR6WGXz4j1X 07hkAJ8Skf5ejcnCJkkQyPy7hZFLbZE= X-Authority-Analysis: v=2.4 cv=N+UZ0W9B c=1 sm=1 tr=0 ts=6a463447 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=ZY8+d+ilh5AZ8AQMB2/tOA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=wcYNnAJ3XbtdpYK58FUA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-ORIG-GUID: Vukk0aP_hueVZfBOQVYRmvpLXxm6FE6C 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 impostorscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 spamscore=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607020101 Hi Mukesh On 02-07-2026 14:47, Mukesh Savaliya wrote: > 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. Yes but i don't see strong reason not to use uport->suspended. > >> 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. It depends on driver design and using of PM runtime framework usage. This change was tested two devices like system suspend and wakeup irq functionality. Thanks, Praveen Talari > >>> [...] >>> >>> >