This is a note to let you know that I've just added the patch titled spi: unbinding slave before calling spi_destroy_queue 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-unbinding-slave-before-calling-spi_destroy_queue.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@xxxxxxxxxxxxxxx> know about it. >From yangerkun@xxxxxxxxxx Fri Oct 16 10:01:26 2020 From: yangerkun <yangerkun@xxxxxxxxxx> Date: Thu, 15 Oct 2020 22:38:34 +0800 Subject: spi: unbinding slave before calling spi_destroy_queue To: <sashal@xxxxxxxxxx>, <gregkh@xxxxxxxxxxxxxxxxxxx>, <broonie@xxxxxxxxxx> Cc: <linux-spi@xxxxxxxxxxxxxxx>, <stable@xxxxxxxxxxxxxxx>, <yangerkun@xxxxxxxxxx>, <yi.zhang@xxxxxxxxxx>, <chenwenyong2@xxxxxxxxxx> Message-ID: <20201015143834.1136778-1-yangerkun@xxxxxxxxxx> From: yangerkun <yangerkun@xxxxxxxxxx> 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@xxxxxxxxxx> --- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1917,13 +1917,13 @@ static int __unregister(struct device *d */ 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); Patches currently in stable-queue which might be from yangerkun@xxxxxxxxxx are queue-4.4/spi-unbinding-slave-before-calling-spi_destroy_queue.patch