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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 80DDFC433DF for ; Mon, 15 Jun 2020 15:20:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F08C2071A for ; Mon, 15 Jun 2020 15:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592234458; bh=ryDfxF1bs3YqUc1qqtTymk90GEgNTQKubfzELfw75cQ=; h=Subject:To:Cc:From:Date:List-ID:From; b=FY+AVZYly9mON6NLH8NoS9X9lAd8J1aZyEVKpP5j4K1zG9QEUT0MoBjd7UCFAxTlU o5RnWNTRdVkV/xxHylfp1YOOdyYM4ZoR+M6c+8PUOFP1UYMvXGYUiA/ai1eX1Yey0Y Fvo2Z/ntfLG4jVRA+GVGGJy+FaIeb/l27P2wViRE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730186AbgFOPU6 (ORCPT ); Mon, 15 Jun 2020 11:20:58 -0400 Received: from wforward5-smtp.messagingengine.com ([64.147.123.35]:45013 "EHLO wforward5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730147AbgFOPU5 (ORCPT ); Mon, 15 Jun 2020 11:20:57 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 372617B8; Mon, 15 Jun 2020 11:20:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 15 Jun 2020 11:20:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=HOC0Sa NyH+ZrWYbK5NZ+L0WuCpG8zjGqyEA5s7IWeb4=; b=NMJBK1blHfIObnrUrZ94ZZ ysYT1NR+av/OLHHSEnmzhDtXE0+lKYUfg1ELEfiFfgrEziC40Q6cp0xQjBk3f6zM IwhfyVLaJyhEvoP3QL9Icrg1J9yQqnEVp826+PMXgqxLqH5Ez6vKSxKQqNJTpF2a eJ9W4Bd5T0EOf2MPHrJOVrYwoaUX0RWQ6vZe0OmifIh50VQ1fIozK4kwptuZBO4J 8T6XryqPTUHLSf5Iz1m7F40VQFqh9wIzjRNq2JDtvMGCcXcC6JTLY4tCtepAiDkH UtLXsOfS0bVtK1n/eTHdvbG5C1APG3iZ/pr23YWfjZxvjrkYDUMGIk7senwT2B4Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeikedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuggftrfgrthhtvghrnhepleelledvgeefleeltdetgedugeffgffhudffudduke egfeelgeeigeekjefhleevnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphep keefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpe hmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 504D23280066; Mon, 15 Jun 2020 11:20:55 -0400 (EDT) Subject: FAILED: patch "[PATCH] spi: Fix controller unregister order" failed to apply to 4.19-stable tree To: lukas@wunner.de, broonie@kernel.org, linus.walleij@linaro.org Cc: From: Date: Mon, 15 Jun 2020 17:20:44 +0200 Message-ID: <159223444415976@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 84855678add8aba927faf76bc2f130a40f94b6f7 Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Fri, 15 May 2020 17:58:01 +0200 Subject: [PATCH] spi: Fix controller unregister order 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 diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 531d1de85f7f..25eb96d329ab 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2763,6 +2763,8 @@ void spi_unregister_controller(struct spi_controller *ctlr) struct spi_controller *found; int id = ctlr->bus_num; + device_for_each_child(&ctlr->dev, NULL, __unregister); + /* First make sure that this controller was ever added */ mutex_lock(&board_lock); found = idr_find(&spi_master_idr, id); @@ -2775,7 +2777,6 @@ void spi_unregister_controller(struct spi_controller *ctlr) list_del(&ctlr->list); mutex_unlock(&board_lock); - device_for_each_child(&ctlr->dev, NULL, __unregister); device_unregister(&ctlr->dev); /* free bus id */ mutex_lock(&board_lock);