All of lore.kernel.org
 help / color / mirror / Atom feed
From: Praveen Talari <praveen.talari@oss.qualcomm.com>
To: Jyothi Kumar Seerapu <jyothi.seerapu@oss.qualcomm.com>,
	konrad.dybcio@oss.qualcomm.com, Mark Brown <broonie@kernel.org>
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
Subject: Re: [PATCH v3 1/2] spi: qcom-geni: Add shutdown callback to quiesce hardware on reboot
Date: Fri, 21 Aug 2026 21:26:13 +0530	[thread overview]
Message-ID: <e76ec63f-db1e-433b-882a-4d25d9a0cc98@oss.qualcomm.com> (raw)
In-Reply-To: <d1dc6098-65a7-45da-a8eb-109e42f5f178@oss.qualcomm.com>

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 <praveen.talari@oss.qualcomm.com>
>> ---
>>   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),
>>
>

  reply	other threads:[~2026-08-21 15:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 13:28 [PATCH v3 0/2] spi: qcom-geni: Add shutdown and panic notifier support Praveen Talari
2026-08-18 13:28 ` [PATCH v3 1/2] spi: qcom-geni: Add shutdown callback to quiesce hardware on reboot Praveen Talari
2026-08-19 18:46   ` Mukesh Savaliya
2026-08-21 10:29   ` Jyothi Kumar Seerapu
2026-08-21 15:56     ` Praveen Talari [this message]
2026-08-18 13:28 ` [PATCH v3 2/2] spi: qcom-geni: Add panic notifier to cancel and reset DMA during panic Praveen Talari
2026-08-19 19:32   ` Mukesh Savaliya
2026-08-21  9:55     ` Praveen Talari
2026-08-21 10:49   ` Jyothi Kumar Seerapu
2026-08-21 15:51     ` Praveen Talari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e76ec63f-db1e-433b-882a-4d25d9a0cc98@oss.qualcomm.com \
    --to=praveen.talari@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=chandana.chiluveru@oss.qualcomm.com \
    --cc=jyothi.seerapu@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mukesh.savaliya@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.