From patchwork Sat Apr 13 18:24:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 10899589 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 A841C17EF for ; Sat, 13 Apr 2019 18:25:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 906EE285A7 for ; Sat, 13 Apr 2019 18:25:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84F7828C52; Sat, 13 Apr 2019 18:25:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 6337628678 for ; Sat, 13 Apr 2019 18:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726922AbfDMSZI (ORCPT ); Sat, 13 Apr 2019 14:25:08 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:38907 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727044AbfDMSZI (ORCPT ); Sat, 13 Apr 2019 14:25:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=2Ehwa75Md1cc+/iOnHSvQN/8BQVqmYHDJqCcpoJD9p4=; b=bCXCBBp2hC5L5fnBUpw0XtFcU0oAYfgxtnOg44DgIMV0iQhxD84C27m+kzkEqDHkoePctEBH5+K+jPXlzI4XhX28gPdjqO66nyRS24dyC2PCb2nC9rIQGFwPeDvyDCm4gSkF64jRk1b4RAS0526EXjRuk3paJNJrFIvaTQcxbgoAohpnqk9Ayjpgq2imNkJWCxRFsl8hrq7G41smM30c8wLBHQNhR+YnmDFhg0VDCDdcBo8voSpBGZKEWHK8cDhrzxaT7gnVD+bTVPDRAMceexAQvCkO/KBqM2AwCs2DUEu1QFJOXWQ5QLvmQ7+81dR/Nyevq5puDHnebiNA19V09w==; Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:48766 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1hFNKs-0005SF-1E; Sat, 13 Apr 2019 20:25:06 +0200 From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: linux-spi@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: broonie@kernel.org, eric@anholt.net, stefan.wahren@i2se.com, kernel@martin.sperl.org, meghana.madhyastha@gmail.com, lukas@wunner.de, linux-rpi-kernel@lists.infradead.org, =?utf-8?q?Noralf_Tr=C3=B8nnes?= Subject: [PATCH v5 2/4] spi: Release spi_res after finalizing message Date: Sat, 13 Apr 2019 20:24:13 +0200 Message-Id: <20190413182415.38543-3-noralf@tronnes.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190413182415.38543-1-noralf@tronnes.org> References: <20190413182415.38543-1-noralf@tronnes.org> 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 spi_split_transfers_maxsize() can be used to split a transfer. This function uses spi_res to lifetime manage the added transfer structures. So in order to finalize the current message while it contains the split transfers, spi_res_release() must be called after finalizing. Signed-off-by: Noralf Trønnes --- 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 05875e63be43..35939ffdeebe 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1162,10 +1162,10 @@ static int spi_transfer_one_message(struct spi_controller *ctlr, if (msg->status && ctlr->handle_err) ctlr->handle_err(ctlr, msg); - spi_res_release(ctlr, msg); - spi_finalize_current_message(ctlr); + spi_res_release(ctlr, msg); + return ret; }