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 CA0D5C433E0 for ; Mon, 15 Jun 2020 15:21:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A535F2078E for ; Mon, 15 Jun 2020 15:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592234464; bh=5BnQErhdFUMn4pUyE/MKNvLHUQBiOcfAIUT0FbU0gmI=; h=Subject:To:Cc:From:Date:List-ID:From; b=BxxSOnQ4rlGm5wit3ql67DkG35JYOF5hRhGfg3kEfU9mhGPqJFvuNYnjwf/LHrwvI xxMG/Ahg+Xa+fw3Y836UaReudbPPhIK4lqzX//TeCTGGg/JeweiNioZXfpbiC3e3EH e1d4yg09sqv4+NYQFK31DBiOktIl+xVe2ToevjUk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730269AbgFOPVC (ORCPT ); Mon, 15 Jun 2020 11:21:02 -0400 Received: from wforward5-smtp.messagingengine.com ([64.147.123.35]:46563 "EHLO wforward5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730235AbgFOPVC (ORCPT ); Mon, 15 Jun 2020 11:21:02 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 6C21B7B2; Mon, 15 Jun 2020 11:21:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 15 Jun 2020 11:21:01 -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=RyVMZl gM8Z0ZnQ1oZdZTo9LzWdcKSnJNq2PrQchD/1M=; b=WP1sAUcBbglHujXxQeUBcF GxnYZ55klcXsIAN30OjDvF1LoM7TVSH8UdzkD5wydap6GL4iDulq4PvK/mwBb6ho 5EsQ41V/27toHZFufhlfeddI3GbQTBa61ZATRxTwvs4zJxjIe+EMqvAJSHb7CCtR Zv01txKn8KaAH93Tiss/9pUZMKXUgbq3RnMIvh755SWD/zmimVcl7u72Fy1Nr3CJ 4tE+iy8FUFIKLr4xyMwlkdKOwGiq1Yp5qJKSvlJG0XPnwptcXD4YdXuQU+NmE2Vx E9apVytLE3H6yAdsl+yYOChtGkb8mS6BGA1dvRdXxaQcwfq3ssCcxU0ACZE0cSuQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeikedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuggftrfgrthhtvghrnhepleelledvgeefleeltdetgedugeffgffhudffudduke egfeelgeeigeekjefhleevnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphep keefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpe 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 B59A63280063; Mon, 15 Jun 2020 11:21:00 -0400 (EDT) Subject: FAILED: patch "[PATCH] spi: Fix controller unregister order" failed to apply to 4.9-stable tree To: lukas@wunner.de, broonie@kernel.org, linus.walleij@linaro.org Cc: From: Date: Mon, 15 Jun 2020 17:20:46 +0200 Message-ID: <159223444611250@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.9-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);