From patchwork Tue Aug 23 04:48:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9294901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 03668608A7 for ; Tue, 23 Aug 2016 04:48:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC0C128BA2 for ; Tue, 23 Aug 2016 04:48:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0C4828BA8; Tue, 23 Aug 2016 04:48:46 +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=-6.9 required=2.0 tests=BAYES_00,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 5F87D28BA7 for ; Tue, 23 Aug 2016 04:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932818AbcHWEsj (ORCPT ); Tue, 23 Aug 2016 00:48:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50149 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932638AbcHWEsg (ORCPT ); Tue, 23 Aug 2016 00:48:36 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EFC2D61CC5; Tue, 23 Aug 2016 04:48:35 +0000 (UTC) Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1B60561789; Tue, 23 Aug 2016 04:48:34 +0000 (UTC) From: Sinan Kaya To: dmaengine@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, vinod.koul@intel.com, jcm@redhat.com Cc: agross@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Dan Williams , Lars-Peter Clausen , Andy Shevchenko , Dave Jiang , linux-kernel@vger.kernel.org Subject: [PATCH V3 2/3] dmaengine: qcom_hidma: report transfer errors with new interface Date: Tue, 23 Aug 2016 00:48:10 -0400 Message-Id: <1471927691-28827-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1471927691-28827-1-git-send-email-okaya@codeaurora.org> References: <1471927691-28827-1-git-send-email-okaya@codeaurora.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pass the DMA errors to the client by passing a result argument. The HW only supports a generic error when something goes wrong. That's why, using DMA_TRANS_ABORTED all the time. Signed-off-by: Sinan Kaya --- drivers/dma/qcom/hidma.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c index b8493ba..ea24863 100644 --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c @@ -126,6 +126,7 @@ static void hidma_process_completed(struct hidma_chan *mchan) list_for_each_entry_safe(mdesc, next, &list, node) { enum dma_status llstat; struct dmaengine_desc_callback cb; + struct dmaengine_result result; desc = &mdesc->desc; @@ -141,10 +142,15 @@ static void hidma_process_completed(struct hidma_chan *mchan) spin_lock_irqsave(&mchan->lock, irqflags); list_move(&mdesc->node, &mchan->free); - spin_unlock_irqrestore(&mchan->lock, irqflags); if (llstat == DMA_COMPLETE) - dmaengine_desc_callback_invoke(&cb, NULL); + result.result = DMA_TRANS_NOERROR; + else + result.result = DMA_TRANS_ABORTED; + + spin_unlock_irqrestore(&mchan->lock, irqflags); + + dmaengine_desc_callback_invoke(&cb, &result); } }