From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org
Cc: lukas@wunner.de, broonie@kernel.org, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] spi: bcm2835: Fix controller unregister order" failed to apply to 4.19-stable tree
Date: Mon, 15 Jun 2020 20:05:49 -0400 [thread overview]
Message-ID: <20200616000549.GI1931@sasha-vm> (raw)
In-Reply-To: <1592234520147134@kroah.com>
On Mon, Jun 15, 2020 at 05:22:00PM +0200, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.19-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 9dd277ff92d06f6aa95b39936ad83981d781f49b Mon Sep 17 00:00:00 2001
>From: Lukas Wunner <lukas@wunner.de>
>Date: Fri, 15 May 2020 17:58:02 +0200
>Subject: [PATCH] spi: bcm2835: Fix controller unregister order
>
>The BCM2835 SPI driver uses devm_spi_register_controller() on bind.
>As a consequence, on unbind, __device_release_driver() first invokes
>bcm2835_spi_remove() before unregistering the SPI controller via
>devres_release_all().
>
>This order is incorrect: bcm2835_spi_remove() tears down the DMA
>channels and turns off the SPI controller, including its interrupts
>and clock. The SPI controller is thus no longer usable.
>
>When the SPI controller is subsequently unregistered, it unbinds all
>its slave devices. If their drivers need to access the SPI bus,
>e.g. to quiesce their interrupts, unbinding will fail.
>
>As a rule, devm_spi_register_controller() must not be used if the
>->remove() hook performs teardown steps which shall be performed
>after unbinding of slaves.
>
>Fix by using the non-devm variant spi_register_controller(). Note that
>the struct spi_controller as well as the driver-private data are not
>freed until after bcm2835_spi_remove() has finished, so accessing them
>is safe.
>
>Fixes: 247263dba208 ("spi: bcm2835: use devm_spi_register_master()")
>Signed-off-by: Lukas Wunner <lukas@wunner.de>
>Cc: stable@vger.kernel.org # v3.13+
>Link: https://lore.kernel.org/r/2397dd70cdbe95e0bc4da2b9fca0f31cb94e5aed.1589557526.git.lukas@wunner.de
>Signed-off-by: Mark Brown <broonie@kernel.org>
more work around master -> controller rename. Queued for 4.19, 4.14,
4.9, and 4.4.
--
Thanks,
Sasha
next prev parent reply other threads:[~2020-06-16 0:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 15:22 FAILED: patch "[PATCH] spi: bcm2835: Fix controller unregister order" failed to apply to 4.19-stable tree gregkh
2020-06-16 0:05 ` Sasha Levin [this message]
2020-06-16 3:27 ` Lukas Wunner
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=20200616000549.GI1931@sasha-vm \
--to=sashal@kernel.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=lukas@wunner.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.