Re: [PATCH] spi: core: Abort active target transfer on controller suspend

From: Mark Brown

Date: Thu Jun 25 2026 - 09:28:06 EST


On Thu, Jun 25, 2026 at 11:09:35AM +0530, Praveen Talari wrote:
> When an SPI controller operating in target mode has a transfer in
> progress at the time of system suspend, the suspend path proceeds
> without aborting the ongoing transfer. This can leave the hardware in
> an inconsistent state, potentially causing the system to hang or fail
> to resume cleanly.
>
> Fix this by invoking the controller's target_abort callback from
> spi_controller_suspend() when the controller is in target mode and the
> callback is registered. This ensures any active target transfer is
> cleanly terminated before the controller is suspended.

>
> + if (spi_controller_is_target(ctlr) && ctlr->target_abort)
> + ctlr->target_abort(ctlr);
> +

We need to check for an active message here, drivers are going to
assume there's an in progress operation to cancel - for example the
pxa2xx driver unconditionally sets cur_msg->status during abort which is
going to go badly without a cur_msg.

Attachment: signature.asc
Description: PGP signature