Re: [PATCH 2/2] spi: qcom-geni: Add panic notifier to suspend controller during panic
From: Mark Brown
Date: Tue Aug 11 2026 - 10:42:27 EST
On Wed, Aug 05, 2026 at 04:12:10PM +0530, Praveen Talari wrote:
> When a VM crashes with an active SPI 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.
> +static int spi_geni_panic_notifier(struct notifier_block *nb,
> + unsigned long action, void *data)
> +{
> + struct spi_geni_master *mas = container_of(nb, struct spi_geni_master, panic_nb);
> + struct spi_controller *spi = dev_get_drvdata(mas->dev);
> +
> + spi_controller_suspend(spi);
This will take locks - are you sure that's OK in a panic handler?
> - return devm_spi_register_controller(dev, spi);
> + ret = devm_spi_register_controller(dev, spi);
> + if (ret)
> + return ret;
> +
> + mas->panic_nb.notifier_call = spi_geni_panic_notifier;
> + ret = atomic_notifier_chain_register(&panic_notifier_list, &mas->panic_nb);
> + if (ret)
> + return ret;
> +
> + return devm_add_action_or_reset(dev, spi_geni_unregister_notifiers, mas);
Should we have the notifier in place before registation, what happens if
we panic while probing a SPI device which is probing as a result of
registering the controller?
Attachment:
signature.asc
Description: PGP signature