From: yangerkun <yangerkun@huawei.com>
To: <linux-kernel@vger.kernel.org>, <lukas@wunner.de>,
<sashal@kernel.org>, <chenwenyong2@huawei.com>
Cc: <stable-commits@vger.kernel.org>, "zhangyi (F)" <yi.zhang@huawei.com>
Subject: Re: Patch "spi: Fix controller unregister order" has been added to the 4.4-stable tree
Date: Sat, 10 Oct 2020 16:41:09 +0800 [thread overview]
Message-ID: <8c7683cc-ca73-6883-8e45-613de68fa665@huawei.com> (raw)
In-Reply-To: <20200616015646.AC54E2074D@mail.kernel.org>
在 2020/6/16 9:56, Sasha Levin 写道:
> This is a note to let you know that I've just added the patch titled
>
> spi: Fix controller unregister order
>
> to the 4.4-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> spi-fix-controller-unregister-order.patch
> and it can be found in the queue-4.4 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
>
>
> commit af9adff04d45f726c49bc1be4a401877e627adf3
> Author: Lukas Wunner <lukas@wunner.de>
> Date: Fri May 15 17:58:01 2020 +0200
>
> spi: Fix controller unregister order
>
> [ Upstream commit 84855678add8aba927faf76bc2f130a40f94b6f7 ]
>
> When an SPI controller unregisters, it unbinds all its slave devices.
> For this, their drivers may need to access the SPI bus, e.g. to quiesce
> interrupts.
>
> However since commit ffbbdd21329f ("spi: create a message queueing
> infrastructure"), spi_destroy_queue() is executed before unbinding the
> slaves. It sets ctlr->running = false, thereby preventing SPI bus
> access and causing unbinding of slave devices to fail.
>
> Fix by unbinding slaves before calling spi_destroy_queue().
>
> Fixes: ffbbdd21329f ("spi: create a message queueing infrastructure")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: stable@vger.kernel.org # v3.4+
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Link: https://lore.kernel.org/r/8aaf9d44c153fe233b17bc2dec4eb679898d7e7b.1589557526.git.lukas@wunner.de
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index e5460d84ed08..57001f8f727a 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -1922,11 +1922,12 @@ void spi_unregister_master(struct spi_master *master)
> dev_err(&master->dev, "queue remove failed\n");
> }
>
> + device_for_each_child(&master->dev, NULL, __unregister);
> +
Hi,
This is a wrong patch. We should move this line before
spi_destroy_queue, but we didn't. 4.9 stable exists this
problem too.
Thanks,
Kun.
> mutex_lock(&board_lock);
> list_del(&master->list);
> mutex_unlock(&board_lock);
>
> - device_for_each_child(&master->dev, NULL, __unregister);
> device_unregister(&master->dev);
> }
> EXPORT_SYMBOL_GPL(spi_unregister_master);
>
> .
>
next parent reply other threads:[~2020-10-10 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200616015646.AC54E2074D@mail.kernel.org>
2020-10-10 8:41 ` yangerkun [this message]
2020-12-05 17:42 ` Lukas Wunner
2020-12-06 9:47 ` Greg KH
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=8c7683cc-ca73-6883-8e45-613de68fa665@huawei.com \
--to=yangerkun@huawei.com \
--cc=chenwenyong2@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=sashal@kernel.org \
--cc=stable-commits@vger.kernel.org \
--cc=yi.zhang@huawei.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
all inboxes | Powered by JetHome®