From patchwork Fri Nov 16 00:14:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10685323 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 DDF2014D6 for ; Fri, 16 Nov 2018 00:14:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C39CF2D407 for ; Fri, 16 Nov 2018 00:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B767F2D411; Fri, 16 Nov 2018 00:14:50 +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 56CA22D407 for ; Fri, 16 Nov 2018 00:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726518AbeKPKYy (ORCPT ); Fri, 16 Nov 2018 05:24:54 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:55456 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbeKPKYy (ORCPT ); Fri, 16 Nov 2018 05:24:54 -0500 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=8jJOo+mF6n9FNOwyATULaZyzkRXKdgXySNWspRF7MzE=; b=k8W+U+7bZt30cz+83Qy0dJw3Q GTLxRToVqCHHAImh4EcVzf3Dti5BzYCrkrVbLIoPXdTA5/emFgsqmY7OSagsD6k01USddLJ4fqJm2 942i6gNfsvXaW3KPNTgnkKRvfIcdQz3aVbASt0mvd3+iOq+E4Mp2Kt9lBPEEp2+Layo9o=; Received: from [64.114.255.97] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gNRmY-0006dc-6O; Fri, 16 Nov 2018 00:14:46 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id ADA07440078; Fri, 16 Nov 2018 00:14:39 +0000 (GMT) From: Mark Brown To: Tony Lindgren , Lubomir Rintel Cc: linux-spi@vger.kernel.org, Pavel Machek , Geert Uytterhoeven , Mark Brown Subject: [PATCH] spi: Fix core transfer waits after slave support Date: Thu, 15 Nov 2018 16:14:35 -0800 Message-Id: <20181116001435.20465-1-broonie@kernel.org> X-Mailer: git-send-email 2.19.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 The refactoring done as part of adding the core support for handling waiting for slave transfer dropped a conditional which meant that we started waiting for completion of all transfers, not just those that the controller asked for. This caused hangs and massive delays on platforms that don't need the core delay. Re-add the delay to fix this. Fixes: 810923f3bf06c11 (spi: Deal with slaves that return from transfer_one() unfinished) Reported-by: Tony Lindgren Tested-by: Tony Lindgren Signed-off-by: Mark Brown Reviewed-by: Geert Uytterhoeven --- drivers/spi/spi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 498d3b9bf3ae..430ad637c643 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1114,9 +1114,11 @@ static int spi_transfer_one_message(struct spi_controller *ctlr, goto out; } - ret = spi_transfer_wait(ctlr, msg, xfer); - if (ret < 0) - msg->status = ret; + if (ret > 0) { + ret = spi_transfer_wait(ctlr, msg, xfer); + if (ret < 0) + msg->status = ret; + } } else { if (xfer->len) dev_err(&msg->spi->dev,