From patchwork Thu May 9 02:30:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10936593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CDB41575 for ; Thu, 9 May 2019 02:30:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071D5285B8 for ; Thu, 9 May 2019 02:30:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEFF428732; Thu, 9 May 2019 02:30:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C69D285B8 for ; Thu, 9 May 2019 02:30:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbfEICaX (ORCPT ); Wed, 8 May 2019 22:30:23 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:54786 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbfEICaX (ORCPT ); Wed, 8 May 2019 22:30:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ex0qKgiOTe6Vg9vk/qKVNw3/6lYKgjLD06DnzhbEcqM=; b=b4naVgpS98tlkDVyu69qK8HrR Z/0r9hkqDoPegvIKE32iZfNI/0xQzsF68o18fCjcDrH2F0g3FbEUnxc4rscfHCW8s+WGpqTjn3GY5 TIFrUvTweBXs2T8gwpgZcNtCv7qMaOf4/L9VmbCnGJx8GkJUjBdj+nOFsi28x2y0k0API=; Received: from [2001:268:c0e3:9e6d:fb20:4124:5afd:9c02] (helo=finisterre.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hOYp4-0001Qt-VG; Thu, 09 May 2019 02:30:15 +0000 Received: by finisterre.sirena.org.uk (Postfix, from userid 1000) id 684B544000C; Thu, 9 May 2019 03:30:10 +0100 (BST) From: Mark Brown To: =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Nicolas Saenz Julienne , Stefan Wahren , Martin Sperl Cc: linux-spi@vger.kernel.org, Mark Brown Subject: [PATCH] spi: Fix Raspberry Pi breakage Date: Thu, 9 May 2019 11:30:05 +0900 Message-Id: <20190509023005.19290-1-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit c9ba7a16d0f1 (Release spi_res after finalizing message) which causes races during cleanup. Reported-by: Nicolas Saenz Julienne Signed-off-by: Mark Brown --- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 5e75944ad5d1..8eb7460dd744 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1181,10 +1181,10 @@ static int spi_transfer_one_message(struct spi_controller *ctlr, if (msg->status && ctlr->handle_err) ctlr->handle_err(ctlr, msg); - spi_finalize_current_message(ctlr); - spi_res_release(ctlr, msg); + spi_finalize_current_message(ctlr); + return ret; }