From: yangerkun <yangerkun@huawei.com>
To: <sashal@kernel.org>, <gregkh@linuxfoundation.org>, <broonie@kernel.org>
Cc: <linux-spi@vger.kernel.org>, <stable@vger.kernel.org>,
<yangerkun@huawei.com>, <yi.zhang@huawei.com>,
<chenwenyong2@huawei.com>
Subject: [PATCH 4.4.y] spi: unbinding slave before calling spi_destroy_queue
Date: Thu, 15 Oct 2020 22:38:34 +0800 [thread overview]
Message-ID: <20201015143834.1136778-1-yangerkun@huawei.com> (raw)
We make a mistake while backport 'commit 84855678add8 ("spi: Fix
controller unregister order")'. What we should do is call __unreigster
for each device before spi_destroy_queue. This problem exist in
linux-4.4.y/linux-4.9.y.
Signed-off-by: yangerkun <yangerkun@huawei.com>
---
drivers/spi/spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index fe03771da5124..18031b755c376 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1957,13 +1957,13 @@ static int __unregister(struct device *dev, void *null)
*/
void spi_unregister_master(struct spi_master *master)
{
+ device_for_each_child(&master->dev, NULL, __unregister);
+
if (master->queued) {
if (spi_destroy_queue(master))
dev_err(&master->dev, "queue remove failed\n");
}
- device_for_each_child(&master->dev, NULL, __unregister);
-
mutex_lock(&board_lock);
list_del(&master->list);
mutex_unlock(&board_lock);
--
2.25.4
next reply other threads:[~2020-10-15 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-15 14:38 yangerkun [this message]
2020-10-16 8:02 ` [PATCH 4.4.y] spi: unbinding slave before calling spi_destroy_queue 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=20201015143834.1136778-1-yangerkun@huawei.com \
--to=yangerkun@huawei.com \
--cc=broonie@kernel.org \
--cc=chenwenyong2@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-spi@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).