Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2649099pxu; Sat, 10 Oct 2020 02:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnCiflh0lpV4UmUJIVtcx11A7ZETYsXdUOPTe173+Uzwm+LPTk5pOHok9ZZBGK+TsEdSXG X-Received: by 2002:a05:6402:c84:: with SMTP id cm4mr3681746edb.270.1602323306241; Sat, 10 Oct 2020 02:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602323306; cv=none; d=google.com; s=arc-20160816; b=c+FIN/PlwfBydziiecKgBGz57jDcYQACaawbs4p3WPlVy65NYWsyjEpcHE4HdFuKSX caC1iNLvodgMuNgtLDgeBniUOx9K7aI02R9gV4MogSPxbFu51iueeZ6JizpsszwlumUM 0bUqRYqcCyFUQuI2x1xiODx3cO3sjikk0G7jfrjutVCfiAcAvR3pXbZBaxeS44QWrjfp z3RO/uB+TteEKvjVr2/CMGFhUY6jxkIS4XQ5xBxR2Lr//48rj1F7tani5oGpaiCJ5nx5 QUXthFtCsA+ddZny4ufkWkLyNqwIa23frjBCAmNV/iSOPUHaPzF5ADIDf/zVmRtkBLZ9 ZxTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=RDGHR37HQHecSbNQNESpS8f4+F2o3BFD51Dgudb9Mjs=; b=TNlDhimNNFFk5lTk3/+d1j/XdudMaWCC7/nOZPIIZOIe1ayctzNPVAdb30eqdJtccA v/SwTWkt6p3DiWFAjdS7Re/twnKIcLdJAQd0AOguQwMPMJoC+GfRuPjiQK1Y4lRRagkO w6DEdMGV/1F9lCmZ/OBNrBDnWdxCHqLym+4SWJtErs+QmYpYn0KGbkCf1HjoQadl/qsN L5Boq8ziwCRN2yIFAdH9qFBFlJ2hQRZdI0kBlXL+hUfKGc+Lo/0C7/Ho/DSuX0GoCx2P TZDfzVOwuSrOW0Zf5fq7FqXP5LeWxl9NEmqM3fsP+WGpePoP57qcf+N6mO06HDK91rVN bPYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si8257283edg.439.2020.10.10.02.48.03; Sat, 10 Oct 2020 02:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728815AbgJJJFJ (ORCPT + 99 others); Sat, 10 Oct 2020 05:05:09 -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); > > . >