Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3701146pxb; Mon, 24 Jan 2022 15:46:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxd9Ela1tuGyD3h9OVVuWwPhibGQK6mqhSi4/c04+JiZpV8ZKurE9OeBnE9sFBRL6l9TjVV X-Received: by 2002:a17:90b:3106:: with SMTP id gc6mr627875pjb.77.1643067970336; Mon, 24 Jan 2022 15:46:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067970; cv=none; d=google.com; s=arc-20160816; b=vgN+2sOhswBG/vWGcqPTIe6Yo8hjXODIP9L1xtYukevxiD7VbSN1ZWMwXKx+0ZtUaG /G4GnKvpfLCBpp9weDOSItNwLy0AdP4xGcFPD1MhbJRrq9CF2kObiJnHSmBV24d/nefC TiZCSjFwlHUHCjYassn3eyBFW+EkuW7aPoFTeYXx7+xc33Ai3fH4tGM84gOIKAE0dWwj EmzpKkDYzFpt8Fs63cq03a7TmYI5cElE1GA+DQi49cdN2yxgjMqbGDVcHoHojqGksIv5 Lvv1MQjGKUbM68KMvjBCJulY0OpJTjkL7cKt/KSQl0c+yRLwVFBISZiDt5gkwiQfh2MB +NBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6AFwvXDYi8OKK60h/M3f7zpH+w7Ulr9NWRuVALqEBDk=; b=AAUaXcgj1cuPgcJYGnARy5HZqPMx8gfJqiDo0sWMT+RTiTxxlkS9VAewAtrJS9rAWz vMnpy/oOu4D+E+L/2dJuzZit2+gaPcIWSZSz+4jd523R4pl2QrsZXn91eVGCUgeW/SFc 365bokuHMCKzPR88pzOrw3Zft2nQJcVxhwN28VrvZcCvL2z6YQDS1euXgHY4H1TqAGcR SxTf0kXgoeMMV1vx9+/BA5R10DCUv6Eb7h50JW6jrgDe3GpL8vzpABR90al0px5i2jGc 7AYmvTbwfwzSlHsDnS0uG4QmLe0QBppwDFCH+JvZ73tOCeMqBN7jjdZUQQ4KzcPI5nIe zuTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kzA2Qvwq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g63si3992591pfb.179.2022.01.24.15.45.58; Mon, 24 Jan 2022 15:46:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kzA2Qvwq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386223AbiAXXiq (ORCPT + 99 others); Mon, 24 Jan 2022 18:38:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382562AbiAXW6F (ORCPT ); Mon, 24 Jan 2022 17:58:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B0EC02B742; Mon, 24 Jan 2022 13:13:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AFD5FB8122A; Mon, 24 Jan 2022 21:13:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6214C340E5; Mon, 24 Jan 2022 21:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058791; bh=1nFGUXS5uHMg5lFL3K/RPXk6Rgm9bRxx6BTr9LD/yQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kzA2QvwqLtIk8l6BmVKnZPvCQqBt2LTV9cFtLXACODwAsScw6msWlZwMVc5/7Cf9O UEoMfNwMzkNewsbnmhQyQz/XMdD5NWJctgVrkFLteFuDvNl6SbuZIgD6uywYgLJkbn Os9INxLbbQe37LSWI5cytpc6ME/JH0rGbwrkaqzI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Koul , Douglas Anderson , Mark Brown , Sasha Levin Subject: [PATCH 5.16 0402/1039] spi: qcom: geni: set the error code for gpi transfer Date: Mon, 24 Jan 2022 19:36:31 +0100 Message-Id: <20220124184138.825523450@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinod Koul [ Upstream commit 74b86d6af81be73bb74995ebeba74417e84b6b6f ] Before we invoke spi_finalize_current_transfer() in spi_gsi_callback_result() we should set the spi->cur_msg->status as appropriate (0 for success, error otherwise). The helps to return error on transfer and not wait till it timesout on error Fixes: b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma") Signed-off-by: Vinod Koul Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20220103071118.27220-1-vkoul@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-geni-qcom.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index e2affaee4e769..69e71aac85129 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -350,17 +350,21 @@ spi_gsi_callback_result(void *cb, const struct dmaengine_result *result) { struct spi_master *spi = cb; + spi->cur_msg->status = -EIO; if (result->result != DMA_TRANS_NOERROR) { dev_err(&spi->dev, "DMA txn failed: %d\n", result->result); + spi_finalize_current_transfer(spi); return; } if (!result->residue) { + spi->cur_msg->status = 0; dev_dbg(&spi->dev, "DMA txn completed\n"); - spi_finalize_current_transfer(spi); } else { dev_err(&spi->dev, "DMA xfer has pending: %d\n", result->residue); } + + spi_finalize_current_transfer(spi); } static int setup_gsi_xfer(struct spi_transfer *xfer, struct spi_geni_master *mas, -- 2.34.1