From nobody Sat Jul 25 18:09:54 2026 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 6C13A3B27C3 for ; Wed, 15 Jul 2026 04:25:27 +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=1784089529; cv=none; b=dHok8suIrWfHaUPxEgcOCQpEGOiFbqSUXO2NU2201Ae52/w8m3WmkWJ8ckpQOxr4bl0Xd18Eg70GbCDsE5m5nCptsyAHWejP5CcqgAtaH7trsFhXylMgLFtEw19MvBxewWCZs7K+Ii/00nEafa52SuRBp16owGl6K+son1izOos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784089529; c=relaxed/simple; bh=isgiWVv8eg/ry/KcN3nqJ0LarhMHhngG7XuTjJOZypE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dx688FQ9zyyukTwRCTjQrxtooPXqBPQMz3Pnjg2yJa+vyy+27lGbFBVly57ZMkMOXnbYw0RdBTv7lLaSJywNoTXYreNHtitV6KSxSqBmfGka/fyUSqXDn35uHF91iWbAiiG/BT9kW/sg/VWkFaYYc5x4NIMnD1aJeAdfPHoHrcA= 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=mD2zyW2H; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NkPnTSzk; 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="mD2zyW2H"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NkPnTSzk" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66F3l6lT2596255 for ; Wed, 15 Jul 2026 04:25:26 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= o0bZJn+gd5gr14r1blwfsd9DGfSKmSKm7GbYkCSyCzQ=; b=mD2zyW2HgatxMajV NJmn+UpwTYMg27cdlJxG23lx5EX3tEUa59xgi9ijC2eDL+DmBJv9bem5sy8d2jnN Psvjwp/qCMLe98V5r7wRstJyPQEyzYcIsEPlM+9WW2vlMwOA+itJCTel6nq55kfo M+JNTB8Mb4fIFiaSoAMWoZddSgpqBGppOdt93T8g11aRRdWAF587IPiK8GRdWqse 3aYK3OburKT8SlRbyREabOP5WUNQc8GhABI0ooeZ3Z6BTVpHWPz0lEpDsZ1hfQAn uSZNqRGaawS3m2/8EXuK4/lquAC4XpK71Qawol1Bg/IQsY5pDWM1pDAPo6AsoPcV WF+XFA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fdmjq3790-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 04:25:26 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cc77a6943eso39708755ad.0 for ; Tue, 14 Jul 2026 21:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784089526; x=1784694326; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=o0bZJn+gd5gr14r1blwfsd9DGfSKmSKm7GbYkCSyCzQ=; b=NkPnTSzk5eSrz721sp5PT6qHnBcA87+ZgDwIGPFvW8Ryfdo3UGIOYxJY+Mz3e1SLJK AVst36ubYHwCLxhYTQtJPxyxDvkaxkzG66iEcJCuq4gUcieftVlET0jG2gQkgagyHajs D6njs+l/Jx0eMyKaL0Nvgvr4FtCrg+ndlQnkfElVJCpTexphwTl/OqoiGva3ks/bT18t 6cssAyBTotgEF3zMTOQecmpoOAScnIBZpDFqD4LTx+qYdTg/3w9weq8PROMzSV6FRT8s SlHbJvcCxdi/g8HiTIpKlE/c2IutG/XiEULLSjlDAB3WZs482VXnuH5MyPhMMfZ5a0nM KKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784089526; x=1784694326; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=o0bZJn+gd5gr14r1blwfsd9DGfSKmSKm7GbYkCSyCzQ=; b=UjMxQ5tAOW/2jpqGQczIittAmI31dJTPX3IvQRDtGhctbXuKXakwfk9JLfRbyb6O8w ZcUL0Nm4XL8Fp2YPcS976WVv7qYmqFrrBUvCHbbZ8ysg0EgDTxDi1b/dh7PYEkD5f29H oUXvojHZR6sl94p2PTHlOTqGZeC2YzLdxYPosv/NxgE/96cKlI+yKF15dMJn+IXQ8Wz6 oFn8n8HHaCUByxUx31/hjfVJ58tCMVwE2zx8yOmQb+k37twHxSerXHUkv4UnHB2rWd1d KS2GcAZR/zyebn2/vgYx/O2XtSlQD7U6K+PyJ5K7bMml1gj9wGjRNSIIrPOfUtOtH+QO QuSg== X-Forwarded-Encrypted: i=1; AHgh+RovlK/bGiI08xQjtF/KJq/ixl76nCfRqQnLqMYxyMuNlwFXTeRGAre3xQBybDaivFm6sZ1Xttsqs/4xLFw=@vger.kernel.org X-Gm-Message-State: AOJu0YyjjSTEiynUpqVII+JQODBQ5a/Dr1cd+/6L6/sQ4VAbjZ0AZfCA 7M8gjYYUZXBAEPQVU4cvuwhf4CMcZw4PWrUQs1KTMbWSF3cK1DfT2rx3DFj0GnxsqcyNSHMrZJG boSVrlo55gV1Qwg8dFCgI9Xe2/ywH6RQllEfp1qHwjijoI21uYyCVDzq5ZUYNjVytV6+sA4Leri g= X-Gm-Gg: AfdE7cmXKF5ZHTZnCXfbUNWq3bGHZzaIW7B3y7yKRDmaeeICGpVCRwZT5qKsk/s3ooG H/5KtRofOluaiQFg4/N0FFOYxIQCX522YTWEVa0aDBIVn87qW1Zcehtch2Vqd2SfsHV4P8EOkWC /4gyzfzzV0UhYlAzCqUtzdfcu/YKWpia2zkCO1moSSYfVU81+YmHJ2eTHi5KGq6KqwPvRlOQ/5T gTJdN/59H99kbQhCeZfBapHCJp9RTNj/oJDnk05YT0Roa/1Z7VW9iVHVbKi/RCgY8QZSGCtDoDl D1IWEPokUiXFhUYxMEqEkcBXqcZx1xUbSigvAtDYgEaVbkhZeFeQ07DgNueSvBW27QJ8JAVo3sF 6n9ZWBzBK3A6FeOA+joCWAehehjRHTQrLjmPUryGG6NfL X-Received: by 2002:a05:6a21:a346:b0:3bf:9e25:1a19 with SMTP id adf61e73a8af0-3c1108c014dmr17974643637.52.1784089525937; Tue, 14 Jul 2026 21:25:25 -0700 (PDT) X-Received: by 2002:a05:6a21:a346:b0:3bf:9e25:1a19 with SMTP id adf61e73a8af0-3c1108c014dmr17974621637.52.1784089525426; Tue, 14 Jul 2026 21:25:25 -0700 (PDT) Received: from hu-ptalari-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311935fd091sm62395491eec.24.2026.07.14.21.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 21:25:25 -0700 (PDT) From: Praveen Talari Date: Wed, 15 Jul 2026 09:55:14 +0530 Subject: [PATCH 1/2] serial: qcom_geni: Add shutdown callback to quiesce hardware on reboot Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-add_shutdown_and_panic_notifier_serial-v1-1-23e3787c7109@oss.qualcomm.com> References: <20260715-add_shutdown_and_panic_notifier_serial-v1-0-23e3787c7109@oss.qualcomm.com> In-Reply-To: <20260715-add_shutdown_and_panic_notifier_serial-v1-0-23e3787c7109@oss.qualcomm.com> To: Greg Kroah-Hartman , Jiri Slaby , bjorn.andersson@oss.qualcomm.com, Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Mukesh Kumar Savaliya , aniket.randive@oss.qualcomm.com, chandana.chiluveru@oss.qualcomm.com, Praveen Talari X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784089517; l=2248; i=praveen.talari@oss.qualcomm.com; s=20251114; h=from:subject:message-id; bh=isgiWVv8eg/ry/KcN3nqJ0LarhMHhngG7XuTjJOZypE=; b=S5lzLJH9S+DrJtBka7ar3f2lcL0ZYQmESc1NUaGbusqnVF+KveRaDeZS4RfYpNeTqsyTrqkZ1 ZEdjky2QGUXDvYxjvSxivAem6prHs0971X+eRg7VgQARgOmz8jLnLju X-Developer-Key: i=praveen.talari@oss.qualcomm.com; a=ed25519; pk=NGK/88fjyHXgfhIKwag7+uIytOmyOypvZ/hDFaYPEss= X-Authority-Analysis: v=2.4 cv=LqmiDHdc c=1 sm=1 tr=0 ts=6a570bb6 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=yFGuIqwZ_iH4-3sRbD8A:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: 6jETflc1B75Mx46x6kPJi8YnuCa4oPK- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDAzNiBTYWx0ZWRfXxItSpgdM9TEU KeTYkkt+dLDIpOhPvFO7/XedDZI+pdOdc7vHEz7WUU6CSgFzjHyXawSuzOBMDSiIQ1x1TTvzVDY C+BC2jUrOgMa3Hs9dfGL2php4NZ76eaTkdVe36wy4xs0LVRBKj51X98qmDX0hqbV6tWTbytwB6S DKE2yw9dplcF26K0YzvP0s+WIzZQy113V9MtanMqpicG4CR0xBm9X48DLhcu8JrfzG9DKuy5v84 5ceKIU2Jhx3JoYrhVOysSHM+ckON9RRPX/ZowwZzKEDb/qSrJCr1wD5raZBz27s5SDSuSE2wlvQ NA+AeJQBbr2+ae4JQLICrj5HXrIQCbSod3iCeY5Iit5wyzZhZII9vaWL+CZIFM7+41384aOj5JM wRmZI/2J2J4mBZhHg5NaeYVU474ixZS8F8MFk+Q7v1+3RjCeM56btvVU6THSmzyExkdeNzabWgi pXx7j/ld4HNOEXY1nYA== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDAzNiBTYWx0ZWRfX3Si/lNHGj3SR g6fMwCOMcWN8JbP/OgJW8nXmhga4gB2AcUWbbgYVv5nlXw/cO5SiGk+qMfkOPjsvJNc7dvNtwpq 64+Lk92vef9TQLkcPFqgD5Q3+zGr28E= X-Proofpoint-ORIG-GUID: 6jETflc1B75Mx46x6kPJi8YnuCa4oPK- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_02,2026-07-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150036 During system reboot, an active UART DMA transfer can leave the GENI Serial Engine in an indeterminate state. On VM-based platforms, if a DMA transfer is in progress when the VM is shut down, the SMMU can raise context faults as the DMA engine continues to access IOVAs that have already been invalidated during VM teardown. Add a shutdown callback to stop TX and RX and bring the hardware to idle before the system resets, preventing both hardware state corruption on reboot and SMMU faults during VM shutdown. The port lock is not taken here since shutdown runs from process context with the device already quiesced from the UART core's perspective; instead, the runtime PM status is checked so that TX/RX are only stopped while clocks and resources are still active, avoiding any register access once the device is runtime suspended. Signed-off-by: Praveen Talari --- drivers/tty/serial/qcom_geni_serial.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qco= m_geni_serial.c index 7ead87b4eb65..21ac2e3bad81 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -2049,6 +2049,18 @@ static const struct dev_pm_ops qcom_geni_serial_pm_o= ps =3D { SYSTEM_SLEEP_PM_OPS(qcom_geni_serial_suspend, qcom_geni_serial_resume) }; =20 +static void qcom_geni_serial_sys_shutdown(struct platform_device *pdev) +{ + struct qcom_geni_serial_port *port =3D platform_get_drvdata(pdev); + struct uart_port *uport =3D &port->uport; + + if (pm_runtime_status_suspended(uport->dev)) + return; + + qcom_geni_serial_stop_tx(uport); + qcom_geni_serial_stop_rx(uport); +} + static const struct of_device_id qcom_geni_serial_match_table[] =3D { #if IS_ENABLED(CONFIG_SERIAL_QCOM_GENI_CONSOLE) { @@ -2075,6 +2087,7 @@ MODULE_DEVICE_TABLE(of, qcom_geni_serial_match_table); static struct platform_driver qcom_geni_serial_platform_driver =3D { .remove =3D qcom_geni_serial_remove, .probe =3D qcom_geni_serial_probe, + .shutdown =3D qcom_geni_serial_sys_shutdown, .driver =3D { .name =3D "qcom_geni_serial", .of_match_table =3D qcom_geni_serial_match_table, --=20 2.34.1 From nobody Sat Jul 25 18:09:54 2026 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 478CF399892 for ; Wed, 15 Jul 2026 04:25:31 +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=1784089532; cv=none; b=uQUrALIgvvdKRNa7dw3VkvRnNABJIAySCM8mR1rb/I46U01lwnyYxh6XQgxPRwlRa52NRgfJ+By+dFfzVuiC+L8JV2TBMkfj0O65Q2hvl2CnEAnzi/J+q8O5pnJLTwTxlXVM1/07KQ5a5Hy0a5cznpbQG3Lz+aXKt8NG87iD4wk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784089532; c=relaxed/simple; bh=M/jaYR7j9UthLpJUySZjlR5s6kZp/Ge02rMFeHjDwBA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nTipcnqs4xSDrwxJByYsXI5A+CZ0XtFXRQyu6TvIAojLyMdk0UyeFe+PO7k8MGT99+dVLqg9MSoefLlHQWZP7f2/jiNtfx/P5tHTjxydWrbRQ/+DthDFMTFmqbSMIP5aLpKml5dA7lV52/qWAtMgpWSMhADdnbarGfTiXdgwSds= 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=Xfd603fs; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=fP7g4ybW; 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="Xfd603fs"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="fP7g4ybW" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66F3ldHA2405550 for ; Wed, 15 Jul 2026 04:25:30 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= v1P/fLkE6F8tcPrtF1OrZRY/cE4+HmmdGOkOOsEvtPs=; b=Xfd603fsO5J+2RZF /+XK3fa6ZkeNXhM7fcS0oMpoOconTk+Yh9CpO4HlcryUK6hoqjzr+63WXw3uXEVF kQ4qUXY3lcXrz6EYgq00MJHudFuk0Jpk0LzhRY2AXDi6il68KYMqfDlpPKtt01KN K9iitYVveutRP45pMNKws/j4ovg8jgQJXqoBreGVtYlMYtq0Xye5EiEhTZ5m9/zd dfWZaNzydcrcdqTrmoPpeQ4ZdchbQVn27chIwry0m4nc4PdrDSebDPoZrqCdUgwl xPay2eiZ6tpv3g7TjWBuH8/xqofyiWGGbcl82ZeFEsYUN6lKpAVNoQC+URJKNnWO Awu+WA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fdnp0jykd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 04:25:30 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2ca5d2474c7so46188005ad.2 for ; Tue, 14 Jul 2026 21:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784089530; x=1784694330; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=v1P/fLkE6F8tcPrtF1OrZRY/cE4+HmmdGOkOOsEvtPs=; b=fP7g4ybWEQhxIowIN7bmISSMJUnUlZlymvx1M04umeMuKL9+Tm1OfVGebW4HzTewEy DOmGkB1PDW9ljQr6BY/9xWHkrELiTXZcISd1YKgqDN7AKExJoHrhIq+ajNH+ewfoYujS fy4vt1LjufqjOqrU/ZrivR4WoNy4JO3DA8CG38FA8RJvLRa60qh3FssYaXO6CZbqHqSv gdmX+aXtzMJxUzFC2m0FgFKGLFcwHSN0dypVlX8NJ3lX2k1X4mzBbEtS7onZCMVj9srg OMOXNwKkHzTQVNPVlsqoR8JidUPKt/eY1KcPOclYnWEg2/LNVvfrschNjqFGl3Or4rqP tqDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784089530; x=1784694330; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=v1P/fLkE6F8tcPrtF1OrZRY/cE4+HmmdGOkOOsEvtPs=; b=RmSGaUrEeyUc/76yMm41AdT1NfoH5vwPpMizFns3m72Nu6xxXiePuK4dMNFliIK0R4 7PxT6b6DCWk9X3FfEmLQyQPkL+SKO/pBiQm9yygqDzEW7uIV/B739JlGoQwjzvy84U3/ mqx2nvvnqsFeH1dwGDbOeEA42zIZYqBSeGUkhe5o7sGXyjyCE0sfrIQLWgA+ARP++bDE lLZc7AxhbtE4OGQMc+Z0dNevAizLlcEI1q+P56asQMQCAyI96lWaBWZ/HgTghnlOHiyq ri5frW2Kr1epGUdlZDGflBdLk1MvBgfG32fCfeAc4qPjcfStlxIdgz2Al+XShCjeoAnq jHEA== X-Forwarded-Encrypted: i=1; AHgh+Rq6VZ3Xu3oZCOk+TdL4a2MvR7rXjIeBHhajltThMAfB5/UQk79Bn2rtCAcpxgKz20G44TLNn48ez3fZMJM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/SltH0DS3Y1eH8aD8TBApQveYw7Eb35uGc0v4UYAjvTbLRO8l h4EUwFrIX5fkP56iafxkaf2jGgMGlW3oaIYWFFUj4uE+2PBACmUKD4M2dIrCBO7ZwrUWyZMc7K2 dEk4Z6AEg2aiD+YgZfv9KP9CGxfchx8c3lxmdCL0UjSk1q5NlF0cN9JMhmJgunyTh9HrKOT1tMk Y= X-Gm-Gg: AfdE7cl/Cs71Vft/nMQqSREiYtk/DwsJB95rGnVCkSO5sqgshIYyC7NvcUfKqV8aBx5 NLUuw+0FI6BJKr8H33bQ1HNAsPKuaVMZppKUqnIiLu7Vxi/j/3zCyPkDrICB3mEKYysJp4lVB8J y7AQpaTflPEuDhdXUbTKzkPzaQ5TUzY0w94FnhpDF3oydD99JjcOAzwQ2T7fePwHN9AP1RCONwA BTY4hTGJ3LPDz90JZMnwRttiEnEAOvITQ/fZNlSSw9OU5cC8FNB0FHURZs9DMAHIW/EkkkPZQNU jfCB59dbaV0XOOm3IlWa2JGQfhx79OSXP0Z1L/bDn7C0qBV1Vqk+otixHW3ENkY+UWGm+Cf9Kqx 2R6CBaHaGQAyrh3DYzuJeYgcZ/V77O2gHKghha2y2dRyp X-Received: by 2002:a05:6a20:3d0c:b0:3c0:9c1b:d0be with SMTP id adf61e73a8af0-3c110a24bb4mr18619312637.73.1784089529858; Tue, 14 Jul 2026 21:25:29 -0700 (PDT) X-Received: by 2002:a05:6a20:3d0c:b0:3c0:9c1b:d0be with SMTP id adf61e73a8af0-3c110a24bb4mr18619289637.73.1784089529346; Tue, 14 Jul 2026 21:25:29 -0700 (PDT) Received: from hu-ptalari-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311935fd091sm62395491eec.24.2026.07.14.21.25.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 21:25:29 -0700 (PDT) From: Praveen Talari Date: Wed, 15 Jul 2026 09:55:15 +0530 Subject: [PATCH 2/2] serial: qcom_geni: Add panic notifier to stop UART on panic Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-add_shutdown_and_panic_notifier_serial-v1-2-23e3787c7109@oss.qualcomm.com> References: <20260715-add_shutdown_and_panic_notifier_serial-v1-0-23e3787c7109@oss.qualcomm.com> In-Reply-To: <20260715-add_shutdown_and_panic_notifier_serial-v1-0-23e3787c7109@oss.qualcomm.com> To: Greg Kroah-Hartman , Jiri Slaby , bjorn.andersson@oss.qualcomm.com, Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Mukesh Kumar Savaliya , aniket.randive@oss.qualcomm.com, chandana.chiluveru@oss.qualcomm.com, Praveen Talari X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784089517; l=3135; i=praveen.talari@oss.qualcomm.com; s=20251114; h=from:subject:message-id; bh=M/jaYR7j9UthLpJUySZjlR5s6kZp/Ge02rMFeHjDwBA=; b=8/v4ddZSDsW1zK8ciIQ+OIndpi/sjAtfuGbO67QzviH8xwds6jf24ioUxJYxzAYiMatidSBfD Y79SMB9RDwDC9smhj5MUPklSlNiiAx7ITDz7gTbTg01pbpDkSxCpUOc X-Developer-Key: i=praveen.talari@oss.qualcomm.com; a=ed25519; pk=NGK/88fjyHXgfhIKwag7+uIytOmyOypvZ/hDFaYPEss= X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDAzNiBTYWx0ZWRfXyCAEJLwhbJVP zDKIYiRclAC3CTKpbSvApLr7aHwyAf7Rv3LQhfQRGBDpFfwm6vR8PuJ37qg88w+QJyvUoEn8hPI OfUl/Gf13o3hY7Ogrf1IrTZz65aSdXM= X-Proofpoint-GUID: Pog9B52lGrDhLcDqp4ghsLutod-SElrk X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDAzNiBTYWx0ZWRfX92Kr9eLsmzPh /19yVPag9tAGftimDz7Mom+/RVX4Nn7RWM2O5y6JDO0ON4DGqqXtI6+4dPJYFSQzPu1caeeq0rl iA6x7dqvIIoiRxfxKdcl5HT6/aOZJyDFzPEo27DrxPP/p5Gottr3JbO+YSi8aGk4wDlFpWIz6iy 2KkmMxlX1UrvQqIl9P4dlE47k9PzDt8UJO/FCoGoG+pefs/CxO4T9qdI2BHABYiwBFRWEUdT+Dq YnMT1DFrrXa2nTScFdxs/6PJTcKIXyTU8y2t/LCThyv/KZT0mjHQyUPXWLql1fAayQZ8O6OHM0b GZ2yGE8YmpIaGICLDicm8k2JlVDHB+rx0g8mCmQI+uV0lHIgRS8wbxqicaMoQ+JpkUs9BsysZwy ctg42s690QmjDX3DzCYJCBQhj+oCTPPaaeqcaf6hZjrHrsQ38ru1HvfvwhlfneAzc/h7nDOMUcb 2RD1vSFqm7dcMT2LXqw== X-Authority-Analysis: v=2.4 cv=FtM1OWrq c=1 sm=1 tr=0 ts=6a570bba cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=UOgn0oEsbzYv5hq0nPQA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: Pog9B52lGrDhLcDqp4ghsLutod-SElrk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_02,2026-07-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 priorityscore=1501 bulkscore=0 phishscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150036 When a VM crashes with an active UART DMA transfer in progress, the SMMU raises context faults as the DMA engine continues to access IOVAs that are invalidated when the VM's memory context is torn down. These faults can affect other VMs sharing the same SMMU instance and obscure the root cause of the crash. Additionally, a stuck TX transfer on the panic console UART can cause the panic handler to stall, dropping the panic output. Register a panic notifier to stop TX and RX. The notifier does not take the port lock, since panic can be entered with the lock already held by the interrupted context, and there is no safe way to detect that here; instead, the device's runtime PM status is checked first so that TX/RX are only stopped while the hardware is still clocked and accessible, and the register accesses are skipped entirely once the device is runtime suspended. Signed-off-by: Praveen Talari --- drivers/tty/serial/qcom_geni_serial.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qco= m_geni_serial.c index 21ac2e3bad81..c4caea0aa6d1 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -151,6 +152,7 @@ struct qcom_geni_serial_port { struct qcom_geni_private_data private_data; const struct qcom_geni_device_data *dev_data; struct dev_pm_domain_list *pd_list; + struct notifier_block panic_nb; }; =20 static const struct uart_ops qcom_geni_console_pops; @@ -1798,6 +1800,22 @@ static const struct uart_ops qcom_geni_uart_pops =3D= { .pm =3D qcom_geni_serial_pm, }; =20 +static int qcom_geni_serial_panic_notifier(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct qcom_geni_serial_port *port =3D + container_of(nb, struct qcom_geni_serial_port, panic_nb); + struct uart_port *uport =3D &port->uport; + + if (pm_runtime_status_suspended(uport->dev)) + return NOTIFY_OK; + + qcom_geni_serial_stop_tx(uport); + qcom_geni_serial_stop_rx(uport); + + return NOTIFY_OK; +} + static int qcom_geni_serial_probe(struct platform_device *pdev) { int ret =3D 0; @@ -1925,6 +1943,9 @@ static int qcom_geni_serial_probe(struct platform_dev= ice *pdev) if (ret) goto error; =20 + port->panic_nb.notifier_call =3D qcom_geni_serial_panic_notifier; + atomic_notifier_chain_register(&panic_notifier_list, &port->panic_nb); + return 0; =20 error: @@ -1938,6 +1959,8 @@ static void qcom_geni_serial_remove(struct platform_d= evice *pdev) struct uart_port *uport =3D &port->uport; struct uart_driver *drv =3D port->private_data.drv; =20 + atomic_notifier_chain_unregister(&panic_notifier_list, &port->panic_nb); + dev_pm_clear_wake_irq(&pdev->dev); device_init_wakeup(&pdev->dev, false); ida_free(&port_ida, uport->line); --=20 2.34.1