From: Mark Brown <broonie@kernel.org>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, nsaenz@kernel.org,
linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, jgg@ziepe.ca,
p.rosenberger@kunbus.com, linux-integrity@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] spi: bcm2835: do not unregister controller in shutdown handler
Date: Tue, 28 Sep 2021 21:08:43 +0100 [thread overview]
Message-ID: <20210928200843.GM4199@sirena.org.uk> (raw)
In-Reply-To: <20210928195657.5573-1-LinoSanfilippo@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]
On Tue, Sep 28, 2021 at 09:56:57PM +0200, Lino Sanfilippo wrote:
> Do not unregister the SPI controller in the shutdown handler. The reason
> to avoid this is that controller unregistration results in the slave
> devices remove() handler being called which may be unexpected for slave
> drivers at system shutdown.
>
> One example is if the BCM2835 driver is used together with the TPM SPI
> driver:
> At system shutdown first the TPM chip devices (pre) shutdown handler
> (tpm_class_shutdown) is called, stopping the chip and setting an operations
> pointer to NULL.
> Then since the BCM2835 shutdown handler unregisters the SPI controller the
> TPM SPI remove function (tpm_tis_spi_remove) is also called. In case of
> TPM 2 this function accesses the now nullified operations pointer,
> resulting in the following NULL pointer access:
>
> [ 174.078277] 8<--- cut here ---
> [ 174.078288] Unable to handle kernel NULL pointer dereference at virtual address 00000034
> [ 174.078293] pgd = 557a5fc9
> [ 174.078300] [00000034] *pgd=031cf003, *pmd=00000000
> [ 174.078317] Internal error: Oops: 206 [#1] SMP ARM
> [ 174.078323] Modules linked in: tpm_tis_spi tpm_tis_core tpm spidev gpio_pca953x mcp320x rtc_pcf2127 industrialio regmap_i2c regmap_spi 8021q garp stp llc ftdi_sio6
Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative (it often is
for search engines if nothing else) then it's usually better to pull out
the relevant sections.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-09-28 20:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 19:56 [PATCH] spi: bcm2835: do not unregister controller in shutdown handler Lino Sanfilippo
2021-09-28 20:08 ` Mark Brown [this message]
2021-09-29 8:38 ` Aw: " Lino Sanfilippo
2021-10-01 17:54 ` Mark Brown
2021-10-03 15:25 ` Lino Sanfilippo
2021-10-04 12:49 ` Mark Brown
2021-10-04 13:17 ` Jason Gunthorpe
2021-10-04 14:12 ` Mark Brown
2021-10-04 15:44 ` Jason Gunthorpe
2021-10-04 16:31 ` Mark Brown
2021-10-04 16:36 ` Florian Fainelli
2021-10-04 16:51 ` Jason Gunthorpe
2021-10-04 16:55 ` Florian Fainelli
2021-10-04 17:13 ` Jason Gunthorpe
2021-10-04 17:27 ` Mark Brown
2021-10-04 17:35 ` Jason Gunthorpe
2021-10-04 17:44 ` Florian Fainelli
2021-10-04 17:56 ` Mark Brown
2021-10-04 17:05 ` Mark Brown
2021-10-04 16:52 ` Mark Brown
2021-10-04 16:57 ` Florian Fainelli
2021-10-04 18:30 ` Lino Sanfilippo
2021-10-04 18:37 ` Jason Gunthorpe
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=20210928200843.GM4199@sirena.org.uk \
--to=broonie@kernel.org \
--cc=LinoSanfilippo@gmx.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=f.fainelli@gmail.com \
--cc=jgg@ziepe.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=nsaenz@kernel.org \
--cc=p.rosenberger@kunbus.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).