From patchwork Wed Jun 26 00:41:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keiji Hayashibara X-Patchwork-Id: 167766 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp218917ilk; Tue, 25 Jun 2019 17:42:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNRztWkhRicxNGaQDH9WMI87/e7eZrkqL+0Y90zeRCJAZ/+T0jyd3jBBG01H9dfX2nL3/R X-Received: by 2002:a17:902:112c:: with SMTP id d41mr1666700pla.33.1561509721848; Tue, 25 Jun 2019 17:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561509721; cv=none; d=google.com; s=arc-20160816; b=IcZ/J3FbybYmSJlUMvKQjgDlDf8Qg2o12ukn7/Q2ZMmI39Kmi3DuAceMFRAZt+Lnl4 gPV3tINGpAopWVAA0Hvf26llRm3ZxVfpxl+lD6nFTB69Es6YwyIDzmoT8EtwmrBhBC5O I6znVZpcHPzepz9QD8GgNLi3GBDDxpuBsi5WiwJba00Irc+Qfp2NCiqCbI7XRmO50gY2 hjltRvsvCRlmlmJGO6hdGN4PPNtZzWso0PxqsFoDNG9cdkz7/YXtgMUB7Dak0AQ97tG2 yXKf5hEG/ToeBodSAR1sSLCvEd+XdaT/GB/VFhXZE4d8rnkzajfQ8Sdm7dAisltI7Bbv jneA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=nkg2T3h94hPWYl0rkHbJ01FKNN+iELLVSrBX0bVGMsU=; b=EEqQJeFDhr1/JCbsOiiALw9whv0y1OqDidlKN4MFhkl9sm/GmfANnmWE9UHTAy+A2j rZh/GFQDXGml/hr+y3D3FB7ymtQqgnqvvvwyTh+jhWbT3xPxmCl7xS7oODimNvYGtdt+ Fn2O2SPKdqDeej0im0ujM0YlJfCLWiQFOgoIykzjuH+nCQl0Lkrzfc9MPp24eOuykCwZ 3U4f0qursNpdqbroTqz+HqaD20HHtVIc63YlhLeZwQdOHKquo+B0HBwlgBKYL93O86/v ZxvGV1YAO+wNArzYJntI8bGfS5hyG1Yt4LkHBXrOAbp1GrRaamDoqiJlIQolD0nTIOsG RNvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si14007121pgw.246.2019.06.25.17.42.01; Tue, 25 Jun 2019 17:42:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726498AbfFZAmA (ORCPT + 30 others); Tue, 25 Jun 2019 20:42:00 -0400 Received: from mx.socionext.com ([202.248.49.38]:7014 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726425AbfFZAl6 (ORCPT ); Tue, 25 Jun 2019 20:41:58 -0400 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 26 Jun 2019 09:41:55 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id F38CC60629; Wed, 26 Jun 2019 09:41:55 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 26 Jun 2019 09:41:55 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by kinkan.css.socionext.com (Postfix) with ESMTP id A99A21A14E3; Wed, 26 Jun 2019 09:41:55 +0900 (JST) Received: from hamster.e01.socionext.com (unknown [10.213.134.20]) by yuzu.css.socionext.com (Postfix) with ESMTP id 7F157120138; Wed, 26 Jun 2019 09:41:55 +0900 (JST) From: Keiji Hayashibara To: broonie@kernel.org, yamada.masahiro@socionext.com, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: masami.hiramatsu@linaro.org, jaswinder.singh@linaro.org, linux-kernel@vger.kernel.org, hayashibara.keiji@socionext.com Subject: [PATCH 2/2] spi: uniphier: fix zero-length transfer Date: Wed, 26 Jun 2019 09:41:48 +0900 Message-Id: <1561509708-4175-3-git-send-email-hayashibara.keiji@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561509708-4175-1-git-send-email-hayashibara.keiji@socionext.com> References: <1561509708-4175-1-git-send-email-hayashibara.keiji@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The zero-length transfer results in timeout error because the transfer doesn't start. This commit modified to return success in this case. Signed-off-by: Keiji Hayashibara --- drivers/spi/spi-uniphier.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.4 diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c index c3c35c0..b32c77d 100644 --- a/drivers/spi/spi-uniphier.c +++ b/drivers/spi/spi-uniphier.c @@ -331,6 +331,10 @@ static int uniphier_spi_transfer_one(struct spi_master *master, struct device *dev = master->dev.parent; unsigned long time_left; + /* Terminate and return success for 0 byte length transfer */ + if (!t->len) + return 0; + uniphier_spi_setup_transfer(spi, t); reinit_completion(&priv->xfer_done);