mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Praveen Talari <praveen.talari@oss.qualcomm.com>
Cc: bjorn.andersson@oss.qualcomm.com,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>,
	aniket.randive@oss.qualcomm.com,
	chandana.chiluveru@oss.qualcomm.com
Subject: Re: [PATCH] spi: core: Abort active target transfer on controller suspend
Date: Thu, 25 Jun 2026 14:27:57 +0100	[thread overview]
Message-ID: <730c2055-b29f-419d-99f2-bc4df3b6a2f7@sirena.org.uk> (raw)
In-Reply-To: <20260625-abort_active_transfer_duirng_s2r-v1-1-7439e3585ad7@oss.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-06-25 13:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25  5:39 Praveen Talari
2026-06-25 13:27 ` Mark Brown [this message]
2026-06-25 14:59   ` Praveen Talari
2026-06-25 15:08     ` Mark Brown

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=730c2055-b29f-419d-99f2-bc4df3b6a2f7@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=aniket.randive@oss.qualcomm.com \
    --cc=bjorn.andersson@oss.qualcomm.com \
    --cc=chandana.chiluveru@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 \
    --cc=praveen.talari@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®