From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0880AC433DF for ; Sat, 10 Oct 2020 09:07:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B49E12078B for ; Sat, 10 Oct 2020 09:07:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729850AbgJJJGR (ORCPT ); Sat, 10 Oct 2020 05:06:17 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59352 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728466AbgJJI7H (ORCPT ); Sat, 10 Oct 2020 04:59:07 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B5ADD2E292EE0F96B498; Sat, 10 Oct 2020 16:41:16 +0800 (CST) Received: from [10.174.179.106] (10.174.179.106) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Sat, 10 Oct 2020 16:41:10 +0800 Subject: Re: Patch "spi: Fix controller unregister order" has been added to the 4.4-stable tree To: , , , CC: , "zhangyi (F)" References: <20200616015646.AC54E2074D@mail.kernel.org> From: yangerkun Message-ID: <8c7683cc-ca73-6883-8e45-613de68fa665@huawei.com> Date: Sat, 10 Oct 2020 16:41:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200616015646.AC54E2074D@mail.kernel.org> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.106] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 know about it. > > > > commit af9adff04d45f726c49bc1be4a401877e627adf3 > Author: Lukas Wunner > 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 > Cc: stable@vger.kernel.org # v3.4+ > Cc: Linus Walleij > Link: https://lore.kernel.org/r/8aaf9d44c153fe233b17bc2dec4eb679898d7e7b.1589557526.git.lukas@wunner.de > Signed-off-by: Mark Brown > Signed-off-by: Sasha Levin > > 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); > > . >