Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Linus Walleij <linusw@kernel.org>
Cc: linux-integrity@vger.kernel.org, stable@vger.kernel.org,
	Stefan Wahren <wahrenst@gmx.net>, Peter Huewe <peterhuewe@gmx.de>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: tpm_tis_spi: Use wait_woken() in wait_for_tmp_stat()
Date: Sat, 16 May 2026 01:41:39 +0300	[thread overview]
Message-ID: <agehI06xyfq4SxXV@kernel.org> (raw)
In-Reply-To: <CAD++jLke5Net94=JUCJAyn5YxMx0raCWTUx+Nk6hKhcXxfU-kw@mail.gmail.com>

On Mon, May 11, 2026 at 10:10:21AM +0200, Linus Walleij wrote:
> On Sat, May 9, 2026 at 8:51 PM Jarkko Sakkinen <jarkko@kernel.org> wrote:
> 
> > wait_event_interruptible_timeout() evaluates its condition after setting
> > the current task state to TASK_INTERRUPTIBLE.
> >
> > With CONFIG_DEBUG_ATOMIC_SLEEP this triggers a warning when the IRQ wait
> > path is used:
> >
> >     tpm_tis_status()
> >       tpm_tis_spi_read_bytes()
> >         tpm_tis_spi_transfer_full()
> >           spi_bus_lock()
> >             mutex_lock()
> >
> > Address this with the following measures:
> >
> > 1. Call wait_tpm_stat_cond() only while tasking is running.
> > 2. Use wait_woken() to wait for changes.
> >
> > Cc: stable@vger.kernel.org # v4.19+
> > Cc: Linus Walleij <linusw@kernel.org>
> > Reported-by: Stefan Wahren <wahrenst@gmx.net>
> > Closes: https://lore.kernel.org/linux-integrity/6964bec7-3dbb-453b-89ef-9b990217a8b9@gmx.net/
> > Fixes: 1a339b658d9d ("tpm_tis_spi: Pass the SPI IRQ down to the driver")
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> > ---
> > Linus' change only unmasked a pre-existing bug but it is the change
> > realizes it in tpm_tis_spi.
> 
> Took me a while to understand this but looks right to me!
> Reviewed-by: Linus Walleij <linusw@kernel.org>

Thank you.

> 
> Yours,
> Linus Walleij

BR, Jarkko

      reply	other threads:[~2026-05-15 22:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09 18:51 [PATCH] tpm: tpm_tis_spi: Use wait_woken() in wait_for_tmp_stat() Jarkko Sakkinen
2026-05-10 20:45 ` Stefan Wahren
2026-05-15 22:40   ` Jarkko Sakkinen
2026-05-11  8:10 ` Linus Walleij
2026-05-15 22:41   ` Jarkko Sakkinen [this message]

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=agehI06xyfq4SxXV@kernel.org \
    --to=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linusw@kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=stable@vger.kernel.org \
    --cc=wahrenst@gmx.net \
    /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