From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org
Cc: lukas@wunner.de, andriy.shevchenko@linux.intel.com,
broonie@kernel.org, kitakar@gmail.com, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] spi: pxa2xx: Fix controller unregister order" failed to apply to 4.19-stable tree
Date: Mon, 15 Jun 2020 19:54:32 -0400 [thread overview]
Message-ID: <20200615235432.GH1931@sasha-vm> (raw)
In-Reply-To: <1592234478161121@kroah.com>
On Mon, Jun 15, 2020 at 05:21:18PM +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 32e5b57232c0411e7dea96625c415510430ac079 Mon Sep 17 00:00:00 2001
>From: Lukas Wunner <lukas@wunner.de>
>Date: Mon, 25 May 2020 14:25:02 +0200
>Subject: [PATCH] spi: pxa2xx: Fix controller unregister order
>
>The PXA2xx SPI driver uses devm_spi_register_controller() on bind.
>As a consequence, on unbind, __device_release_driver() first invokes
>pxa2xx_spi_remove() before unregistering the SPI controller via
>devres_release_all().
>
>This order is incorrect: pxa2xx_spi_remove() disables the chip,
>rendering the SPI bus inaccessible even though the SPI controller is
>still registered. When the SPI controller is subsequently unregistered,
>it unbinds all its slave devices. Because their drivers cannot access
>the SPI bus, e.g. to quiesce interrupts, the slave devices may be left
>in an improper state.
>
>As a rule, devm_spi_register_controller() must not be used if the
>->remove() hook performs teardown steps which shall be performed after
>unregistering the controller and specifically after unbinding of slaves.
>
>Fix by reverting to the non-devm variant of spi_register_controller().
>
>An alternative approach would be to use device-managed functions for all
>steps in pxa2xx_spi_remove(), e.g. by calling devm_add_action_or_reset()
>on probe. However that approach would add more LoC to the driver and
>it wouldn't lend itself as well to backporting to stable.
>
>The improper use of devm_spi_register_controller() was introduced in 2013
>by commit a807fcd090d6 ("spi: pxa2xx: use devm_spi_register_master()"),
>but all earlier versions of the driver going back to 2006 were likewise
>broken because they invoked spi_unregister_master() at the end of
>pxa2xx_spi_remove(), rather than at the beginning.
>
>Fixes: e0c9905e87ac ("[PATCH] SPI: add PXA2xx SSP SPI Driver")
>Signed-off-by: Lukas Wunner <lukas@wunner.de>
>Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>Cc: stable@vger.kernel.org # v2.6.17+
>Cc: Tsuchiya Yuto <kitakar@gmail.com>
>Link: https://bugzilla.kernel.org/show_bug.cgi?id=206403#c1
>Link: https://lore.kernel.org/r/834c446b1cf3284d2660f1bee1ebe3e737cd02a9.1590408496.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
prev parent reply other threads:[~2020-06-15 23:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 15:21 FAILED: patch "[PATCH] spi: pxa2xx: Fix controller unregister order" failed to apply to 4.19-stable tree gregkh
2020-06-15 23:54 ` Sasha Levin [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=20200615235432.GH1931@sasha-vm \
--to=sashal@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kitakar@gmail.com \
--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.