From patchwork Tue May 30 11:15:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mehul Raninga X-Patchwork-Id: 687435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89452C77B7A for ; Tue, 30 May 2023 11:16:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbjE3LQX (ORCPT ); Tue, 30 May 2023 07:16:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231298AbjE3LQT (ORCPT ); Tue, 30 May 2023 07:16:19 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0281E5; Tue, 30 May 2023 04:16:18 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34UAxIDq006267; Tue, 30 May 2023 11:16:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id; s=qcppdkim1; bh=itfenvgDHTyxp1L5qxO18pecrhAyNG1011llMvDnQMU=; b=YhqObDpAwMPRrc76syfjTfcX/goGEoo00rty5aUl6IiaYQCy/AZ58KF7kRHgXuD+4BWs KD6BGE2uXv8C4uKYbKGDSI+jvmgvjvZ2t5XgHm+OwtPlV1bJSmj2yvzsCNqHzUSkeAog Plqs9Q7+jb7fFVLE6jsBvDZ3PrIoqC7+npYAhCQap1aGt6O0/s1E4JijddYacgVy3OQn 1uYu0HOsW5REg3iJNcBMP02Tgf7cKoAm7ZQG28ZI/xwUbZKUOxYIOslulGVIJMmZ9XVq XtB1rpqu16MhuQZmpv4BqrPzE2pMf5IhSZdHLArF9tr7ObfOadrLx1y812VKBGZGYqKt mw== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qwa34grdy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 May 2023 11:16:14 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 34UBG9BG007539; Tue, 30 May 2023 11:16:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3quaxka9pc-1; Tue, 30 May 2023 11:16:09 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34UBG93m007534; Tue, 30 May 2023 11:16:09 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-mraninga-hyd.qualcomm.com [10.213.107.117]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 34UBG9bC007533; Tue, 30 May 2023 11:16:09 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 4325269) id 690C65000AF; Tue, 30 May 2023 16:46:08 +0530 (+0530) From: Mehul Raninga To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: quic_vdadhani@quicinc.com, quic_vtanuku@quicinc.com, quic_vnivarth@quicinc.com, Mehul Raninga Subject: [PATCH] serial: qcom_geni_serial: Setup serial port after Deep sleep Date: Tue, 30 May 2023 16:45:57 +0530 Message-Id: <20230530111557.10944-1-quic_mraninga@quicinc.com> X-Mailer: git-send-email 2.17.1 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 5LvPNkpv05sofZel4uMjGzIOq26WjmVY X-Proofpoint-GUID: 5LvPNkpv05sofZel4uMjGzIOq26WjmVY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-30_08,2023-05-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 suspectscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305300093 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org While exiting deep sleep, serial port loses its configuration hence it prints garbage characters on console. Set serial port configuration while resume from deep sleep. Signed-off-by: Mehul Raninga --- drivers/tty/serial/qcom_geni_serial.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 8582479f0211..c04b8fec30ba 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1737,6 +1738,8 @@ static int qcom_geni_serial_sys_resume(struct device *dev) if (uart_console(uport)) { geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ALWAYS); geni_icc_set_bw(&port->se); + if (pm_suspend_via_firmware()) + qcom_geni_serial_port_setup(uport); } return ret; }