From: Breno Leitao <leitao@debian.org>
To: Mark Brown <broonie@debian.org>, arnd@arndb.de
Cc: Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Sowjanya Komatineni <skomatineni@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
linux-tegra@vger.kernel.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, rmikey@meta.com,
kernel-team@meta.com, gregkh@linuxfoundation.org,
noodles@earth.li, jarkko@kernel.org, peterhuewe@gmx.de,
jgg@ziepe.c
Subject: Re: [PATCH 1/3] spi: tegra210-quad: use device_reset_optional() instead of device_reset()
Date: Tue, 18 Mar 2025 11:32:40 -0700 [thread overview]
Message-ID: <20250318-psychedelic-thundering-guppy-22bba2@leitao> (raw)
In-Reply-To: <20250318-boisterous-adorable-chowchow-cea03b@leitao>
On Tue, Mar 18, 2025 at 11:29:26AM -0700, Breno Leitao wrote:
> On Tue, Mar 18, 2025 at 05:34:55PM +0000, Mark Brown wrote:
> > On Tue, Mar 18, 2025 at 10:02:47AM -0700, Breno Leitao wrote:
> >
> > > Makes sense. Another question, for platforms like this one that doesn't
> > > have the device reset methods, what can we do to stop the bleed?
> >
> > > Basically every message that is sent to the SPI controller will fail,
> > > which will trigger the device_reet() which is a no-op, but the device
> > > will continue to be online. Should we disable the device after some
> > > point?
> >
> > The SPI controller is only going to be doing something because some
> > driver for an attached SPI device is trying to do something. Presumably
> > whatever driver that is won't be having a good time and can hopefully
> > figure something out, though given that SPI is simple and not
> > hotpluggable this isn't really something that comes up a lot in
> > production so I'd be unsurprised to see things just keep on retrying.
> > I'd expect to see any substantial error handling in the driver for the
> > device rather than in the controller.
>
> Good point. In my specific case, this is coming from tpm_tis,
> which is not aware that the device is totally dead, and continues to ask
> for random numbers:
>
> tegra_qspi_transfer_one_message
> __spi_pump_transfer_message
> __spi_sync
> spi_sync
> tpm_tis_spi_transfer
> tpm_tis_spi_read_bytes
> tpm_tis_request_locality
> tpm_chip_start
> tpm_try_get_ops
> tpm_find_get_ops
> tpm_get_random
> tpm_hwrng_read
> hwrng_fillfn
> kthread
> ret_from_fork
>
> Looking at tpm_tis, it seems it doesn't care if the the SPI is dead, and
> just forward through the requests, which never complete. Adding Arnd to
> see if he has any idea about this.
>
> Arnd,
>
> Summary of the proiblem: tpm_tis is trying to read random numbers
> through a dead SPI controller. That causes infinite amounts of warnings
> on the kernel, given that the controller is WARNing on time outs (which
> is being fixed in one of the patches in this patchset).
>
> Question: Should tpm_tis be aware that the underneath SPI controller is
> dead, and eventually get unplugged?
Adding Arnd to the email.
next prev parent reply other threads:[~2025-03-18 18:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 15:44 [PATCH 0/3] spi: tegra210-quad: Improve reset and tx failures Breno Leitao
2025-03-17 15:44 ` [PATCH 1/3] spi: tegra210-quad: use device_reset_optional() instead of device_reset() Breno Leitao
2025-03-17 16:45 ` Mark Brown
2025-03-17 16:56 ` Breno Leitao
2025-03-17 17:24 ` Mark Brown
2025-03-18 10:36 ` Breno Leitao
2025-03-18 12:48 ` Mark Brown
2025-03-18 17:02 ` Breno Leitao
2025-03-18 17:34 ` Mark Brown
2025-03-18 18:29 ` Breno Leitao
2025-03-18 18:32 ` Breno Leitao [this message]
2025-03-18 19:00 ` Arnd Bergmann
2025-03-18 19:13 ` Mark Brown
2025-03-18 20:07 ` Arnd Bergmann
2025-03-19 10:09 ` Breno Leitao
2025-03-19 18:26 ` Thierry Reding
2025-03-19 18:53 ` Breno Leitao
2025-03-21 12:40 ` Thierry Reding
2025-03-21 16:28 ` Breno Leitao
2025-03-24 13:17 ` Thierry Reding
2025-03-25 16:56 ` Breno Leitao
2025-03-25 17:05 ` Thierry Reding
2025-03-28 13:18 ` Breno Leitao
2025-03-19 13:11 ` Mark Brown
2025-03-18 18:35 ` Mark Brown
2025-03-18 19:08 ` Breno Leitao
2025-03-18 19:16 ` Mark Brown
2025-03-17 15:44 ` [PATCH 2/3] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts Breno Leitao
2025-03-17 15:44 ` [PATCH 3/3] spi: tegra210-quad: add rate limiting and simplify timeout error message Breno Leitao
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=20250318-psychedelic-thundering-guppy-22bba2@leitao \
--to=leitao@debian.org \
--cc=arnd@arndb.de \
--cc=broonie@debian.org \
--cc=gregkh@linuxfoundation.org \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.c \
--cc=jonathanh@nvidia.com \
--cc=kernel-team@meta.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=noodles@earth.li \
--cc=peterhuewe@gmx.de \
--cc=rmikey@meta.com \
--cc=skomatineni@nvidia.com \
--cc=thierry.reding@gmail.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