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 E2A5A477984 for ; Fri, 21 Aug 2026 15:56:22 +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=1787327791; cv=none; b=rDFOaAoEgXThzxf/Tq/K7/gUHu2SirobMzyzePfZex4S77ZpB9qFYQQOrRlof5MqNCeozds1zAnboFx5YlnY5KjmP+thJigEqIx+Hck2AXqHEsXMiIXlaFKWlCBLaMDZ8Ns262ICTbqv93XF1qYCl4q6udQdfvPaUqOlZ93hZj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327791; c=relaxed/simple; bh=fyZaGRup6hPdizM0Mte1GZ6esSt8erN7rKBIRrNrYC8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FJR9532z/OYuodnRS2p+EPAYJKMbnPo8bVTdXsAy8UjDC0N1jbI2TTE7JKb+/FcoBFzukzo2xQS71GML3GzFxRNiM+XhL5gqpxEr7n4vTD1DfLGTNO4iGLZOPfbHcKgBzsyGWZkN8YIP4x0Vp+R3d7Gipa7kwim9E/OJSk/rAIk= 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=eeKHTRYy; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Buelvu5o; 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="eeKHTRYy"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Buelvu5o" 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 67LFmVPM1641181 for ; Fri, 21 Aug 2026 15:56:20 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= SG9NDd2LgAPZDinHwmDiEH0f0DghPC3ZLUoy0BE5OTo=; b=eeKHTRYyR8aXSPqf 3TwqidDz6pmBBqFByP+f9gDvNj7lU29tTGRIAJaXcCkMxdKqupmgwiCTPfLF9QWw F9JVvk/LrH39/PSu4jJ+4rKyxKSr0jprX6Vd/LD3Tzvt1gpzO29LtEe14M5xoqhM H84NUoBdtETDQTDs4H/PnrQGe23QJbfxvhaV3AzluayIcvVBBeyW4V+iR1VgLL/1 h9F6ZOMP9yWSUr8+IlOVSdwGK1u3j8Jaji1Luft+Wo41pg5mcI5g2h5xAMJgS8Nk ElpS7dvGCpgvXZ15ohVbpKgHDnYa8qs7v2HTwuILVm31CBKUqxat1HXXFyc4NRxx FcDJdQ== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g6ebutrjg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 21 Aug 2026 15:56:20 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-90c4da3d504so7079716d6.0 for ; Fri, 21 Aug 2026 08:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787327780; x=1787932580; 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=SG9NDd2LgAPZDinHwmDiEH0f0DghPC3ZLUoy0BE5OTo=; b=Buelvu5oEdzczpDENCF6wtE48dIgO5MfoGGbmpEoJn6SbQUV0J/0aWOkAwBB/d/Ojn NV3jtkaafQWzrfgF/qGsh/pFV40UEz2CyiJZXQi6Z1y6lHrSuPGIArRaT2vIe+4sU2VU o90IRxF0peQvzFZNGZsSPC8T+nUyM5heqcPtEaVWSzN4PSKEvt2pGikZwGAAIY1ar0Fc 3p4usV9N2RxBc/Y8vIGvIW0V7w0mObod/Tqr+jvYJJjYEpTqSnj1iM8KTmbKbJt7hH// /JyEQcIHSWrPxDL1ddvCPUzvxRwf12Pp6HousMEYklbrLYNcWv1hAVxPqCfKf1m4NdqA iIwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787327780; x=1787932580; 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=SG9NDd2LgAPZDinHwmDiEH0f0DghPC3ZLUoy0BE5OTo=; b=aV2qVf6dF/u9wYk61CgLih9cV8n4SpuHTL+4oJmyDbT98Pe8xNrgJObeA2RLQC75/T 1/h3Fv54uRPziEdBzQJZBjTsll+hSFoKjDZdSHBkgVhMnfvSu+LdteMOlMd6K2bp2oyu FqkMUfXbcZWMLtJ2XHRs86ymtG3UDEa5XO4J8qgIlj1LUFS0MRHFsj+T2rxezNQMO9BG 1CfEskkeSYqMWHQkjFxoX7YqIub7mafIEKptJ6gYFVfwg1eyIj8MqTiDeB0neP6cxIg2 MYLxX6hq1Fo9HjhmS5I3rDdwvLkF60GMfSadwbAZJYH0LHN7uXHtCq0bzx7WRKGC7N92 kO8A== X-Forwarded-Encrypted: i=1; AHgh+RpN4TVuHZIuVmg2bcBHmuH4QakBomOHzBuXLJMlvNngorU6kB6wYugmaFbze8/DMm/DJY+eWDXHTWh8Nfk=@vger.kernel.org X-Gm-Message-State: AFuF++nTDRZb3A4+G4fGvYBUXnvO4Q6ggE8KUBifLtB9h8omh9tS0I55 TDFiqyghB7gS/iayu3sV6hfEH940pQRzT1RD7FWN0ZTLasadhkqkhElv1BUNOp3eKtVU45E71uY njSqjgGMKysqlkvqaeN9VANfen4saR0H8ZA8wDYOogxvPZ+euYm8Xy695dDOp2/BX94I= X-Gm-Gg: AR+sD109D2z1lAp2CSKJnXJiQWUIT1OcPuEhXWGZdTHQlMfxmd7p0KL2DT4mXdiyG+m JbKpSJANNUk9e3JFIy2ZJIpGDn1QQuokn8sakIjo38loiiu8yfEW3Ek337X67Q/aSgHyCAyjTm8 a6L0KUlChdY3JGD3kdBcmuQzPF5ef3EzqKIVzblCiPqKm2xnjb6X+jaJOOzc+Vs9gG2qpogiSei n6ohGhK7VWOoJZ6kyOdYXU1ZNp+6sjQb7YNIULFlULlYLj+C2yoFdtOvcaCoqa822NAH4VPdKPI C+iVtgjgq4pDExLP6yZpnup3hlfr1uHzDRgpSk85hScefmd/Avx8vfLoIoLHfMXSaZ0i7PdNxk9 K+4xC7nBoaYtBXf9JpkXQ0wZ0OCILMMkH X-Received: by 2002:a05:6214:8002:b0:90c:87e7:e2b6 with SMTP id 6a1803df08f44-90c87e7e436mr42803746d6.5.1787327779631; Fri, 21 Aug 2026 08:56:19 -0700 (PDT) X-Received: by 2002:a05:6214:8002:b0:90c:87e7:e2b6 with SMTP id 6a1803df08f44-90c87e7e436mr42803176d6.5.1787327778984; Fri, 21 Aug 2026 08:56:18 -0700 (PDT) Received: from [192.168.0.5] ([49.204.109.127]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90c5edb4f75sm65109296d6.1.2026.08.21.08.56.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Aug 2026 08:56:18 -0700 (PDT) Message-ID: Date: Fri, 21 Aug 2026 21:26:13 +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 v3 1/2] spi: qcom-geni: Add shutdown callback to quiesce hardware on reboot To: Jyothi Kumar Seerapu , konrad.dybcio@oss.qualcomm.com, Mark Brown Cc: mukesh.savaliya@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, chandana.chiluveru@oss.qualcomm.com References: <20260818-add-shutdown-and-panic-notifier-for-spi-v3-0-8b62c4bc2d21@oss.qualcomm.com> <20260818-add-shutdown-and-panic-notifier-for-spi-v3-1-8b62c4bc2d21@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: tZ_GoY3miFhLvMUOX5VP4h3rW0IW8ucF X-Proofpoint-ORIG-GUID: tZ_GoY3miFhLvMUOX5VP4h3rW0IW8ucF X-Proofpoint-Spam-Info: AW1haW4tMjYwODIxMDEyNSBTYWx0ZWRfX45vuwCmQ3RNy G6RiaJnK+KrVUh4y6c9T9xkSoPIFrsABpAm8IZCkbC0Timc+ApDnLPhtahQR9eEMIyT863lHklv V97ADnoHoM8SLNkUNbnjj9keuJR7ih8= X-Authority-Analysis: v=2.4 cv=QJlYgALL c=1 sm=1 tr=0 ts=6a887524 cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=6P0G4DzZkXptpLBtTzfX8g==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=2n5QlrmeVAYuqZsnN-IA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=iYH6xdkBrDN1Jqds4HTS:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODIxMDEyNSBTYWx0ZWRfXzjfByOLAZTHN MPHdvM0nXm2u2/bf3QtsU6GmBMrUTKY/8eSL4vRN3o4AzkDauSTyZLKuVOoj3PGF2OnOMnEmq5J katKp2wnfpVZRrE/e3XrIoNWle7sMzB/18j74FU62q3Ppbx2HpW/wpXWHTSxRYZBSvC9h+VDMIL WstvKiUWnR+HZm7Se42Lu3Hou/Dm9R39CZCG7fol5cnGtS3Ckh7JtUwh292SLT6JK41+kfjWeJs iWazrbPvVK7Z99t5P1Kt63dRne0cVfRn/CrFtZ83bQ/RlrVwBIdRwP9214vKFz24sfhfQD23Sd/ AtSb7OkroPIDGiih2EJviSoxL/T7KDjEAvyy1iny1ZENoBSJbSH8wyRM7AW0jetsGHopCdY7VQJ V/S9OPYfX3fxwFNCq/1faCxhhlqDs6QBw1auxwdaIZyy66cvkX2OJa80h1Aeesxmgzt/7qoUKW4 aRXk3lZMlQ+PmXXNHxg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-21_05,2026-08-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 suspectscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608210125 Hi Jyothi On 21-08-2026 15:59, Jyothi Kumar Seerapu wrote: > > > On 8/18/2026 6:58 PM, Praveen Talari wrote: >> During system reboot, an active SPI 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 suspend the SPI controller and abort any >> in-progress transfer, ensuring the DMA engine is idle and all IOVA >> mappings are retired before the system resets. >> >> Signed-off-by: Praveen Talari >> --- >>   drivers/spi/spi-geni-qcom.c | 10 +++++++++- >>   1 file changed, 9 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c >> index 6c57f8309a3b..c65c1788325d 100644 >> --- a/drivers/spi/spi-geni-qcom.c >> +++ b/drivers/spi/spi-geni-qcom.c >> @@ -1066,6 +1066,13 @@ static int spi_geni_target_abort(struct >> spi_controller *spi) >>       return 0; >>   } >>   +static void spi_geni_shutdown(struct platform_device *pdev) >> +{ >> +    struct spi_controller *spi = platform_get_drvdata(pdev); >> + >> +    spi_controller_suspend(spi); > Hi Praveen, > > Don't we also need to power off the SE resources here (e.g. via > pm_runtime_force_suspend(), like spi_geni_suspend() does)? As-is, > spi_controller_suspend() only stops the message queue — it doesn't > quiesce the hardware/clocks. The primary goal of this shutdown callback is to ensure that any in-progress transfer is aborted before VM/system teardown, preventing DMA transactions from accessing IOVAs after they have been invalidated. In this path, spi_controller_suspend() invokes the controller's suspend callback, which aborts any active transfer and drains the message queue. The issue being addressed here is not related to runtime power management state or resource leakage, but rather ensuring that the transfer engine is quiesced before reboot. Thanks, Praveen Kumar > > Thanks, > JyothiKumar >> +} >> + >>   static int spi_geni_probe(struct platform_device *pdev) >>   { >>       int ret, irq; >> @@ -1241,7 +1248,8 @@ static const struct of_device_id >> spi_geni_dt_match[] = { >>   MODULE_DEVICE_TABLE(of, spi_geni_dt_match); >>     static struct platform_driver spi_geni_driver = { >> -    .probe  = spi_geni_probe, >> +    .probe    = spi_geni_probe, >> +    .shutdown = spi_geni_shutdown, >>       .driver = { >>           .name = "geni_spi", >>           .pm = pm_ptr(&spi_geni_pm_ops), >> >