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: 151262 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7664290ljp; Thu, 15 Nov 2018 16:14:50 -0800 (PST) X-Google-Smtp-Source: AJdET5eS+VAN0kCERpHGcDFGVf9q5nEBhUYCfcwZmEzL/f1srLk/mOdYUiHDZepq3GogLrHKdmko X-Received: by 2002:a17:902:9a04:: with SMTP id v4-v6mr8248993plp.247.1542327290420; Thu, 15 Nov 2018 16:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542327290; cv=none; d=google.com; s=arc-20160816; b=lpQK/Ho4SrSZsu7KRXRhjr/ISJbfEdjoPRa7UOtDAQTO5c4zgiwFZsVxZwQJrLsV+3 1goq6HV7dD4EumORw9KmSaDi+3XLjUHxcS9JC6s0LPryuTXMXgGj5gwR4Fu9XZCpkL+b alyX972oZWVRQwmhAqcG2eVRDIYbVgMnTsWuVn5lc2IKxCprJiXbRsLWOe69+jNkPc4X HDesFb0ZawNKKvhWHkAY33hj5tH+o4evHwOYt/ZXB4KSZMlEruZGuWPmeXQGvJQp+13R AcuNKcqa/azXXg0oa+tvh8g+ZnLOdvVa8S8sUzACPhwaB3n2dizxrfJCmzpghwn9k4pU Y/CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8jJOo+mF6n9FNOwyATULaZyzkRXKdgXySNWspRF7MzE=; b=dHxUAphpzWJuqRa2o3UbkhTIz1Oziy1IZ0kG/FAGZ9xNyZ8wV+LX9NoNTfRgrp//yj wVg7soTjcQInFSpq4N5PQnl19GDI95jcdGIp1lYk2E1Nu6gnmCcBRC010TDyICvz2J7V 8ubr5554Erl6QhpbhpL9Ytqe+zhpFfhtGZzZzfFOyhmweXue7naUOxy55ecdE2Z1DJ1C S2fmep/2lrTmkeffqeP4iMpFjfDrRKVVpSep7AjRVu6NYJ6G8MJgoL/u1Rh7P0wdN3bB flkVg4c7XxvRtTMjEyevYRXT5b3WH/VzIN6kO8B8WRUQexq73cG/iGCfwiNL+5MjzPa/ imaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=k8W+U+7b; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f66-v6si11793853pfc.223.2018.11.15.16.14.50; Thu, 15 Nov 2018 16:14:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=k8W+U+7b; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726518AbeKPKYy (ORCPT + 1 other); 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 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 --- drivers/spi/spi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.19.1 Reviewed-by: Geert Uytterhoeven 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,