From patchwork Wed Aug 31 15:10:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9307357 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 025BD601C0 for ; Wed, 31 Aug 2016 15:11:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E793E28F69 for ; Wed, 31 Aug 2016 15:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9EA328F78; Wed, 31 Aug 2016 15:11:36 +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 6482F28F69 for ; Wed, 31 Aug 2016 15:11:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935106AbcHaPLf (ORCPT ); Wed, 31 Aug 2016 11:11:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38593 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934123AbcHaPLe (ORCPT ); Wed, 31 Aug 2016 11:11:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EBED9616B5; Wed, 31 Aug 2016 15:11:00 +0000 (UTC) Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 119AE60159; Wed, 31 Aug 2016 15:10:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 119AE60159 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=okaya@codeaurora.org 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 , Dave Jiang , Lars-Peter Clausen , Andy Shevchenko , linux-kernel@vger.kernel.org Subject: [PATCH V4 2/3] dmaengine: qcom_hidma: report transfer errors with new interface Date: Wed, 31 Aug 2016 11:10:28 -0400 Message-Id: <1472656229-12955-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472656229-12955-1-git-send-email-okaya@codeaurora.org> References: <1472656229-12955-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); } }