From patchwork Thu Mar 16 14:18:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 9628299 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 F01466048C for ; Thu, 16 Mar 2017 14:19:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF1FE285E3 for ; Thu, 16 Mar 2017 14:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D04382864C; Thu, 16 Mar 2017 14:19:50 +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 6215E285E3 for ; Thu, 16 Mar 2017 14:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752478AbdCPOTu (ORCPT ); Thu, 16 Mar 2017 10:19:50 -0400 Received: from mga05.intel.com ([192.55.52.43]:64120 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751993AbdCPOTu (ORCPT ); Thu, 16 Mar 2017 10:19:50 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 16 Mar 2017 07:19:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,172,1486454400"; d="scan'208";a="1143310721" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 16 Mar 2017 07:19:47 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7903114F; Thu, 16 Mar 2017 16:18:46 +0200 (EET) From: Andy Shevchenko To: Vinod Koul , dmaengine@vger.kernel.org, Alexandre Bailon Cc: Andy Shevchenko Subject: [PATCH v1 1/2] dmaengine: cppi41: fix cppi41_dma_tx_status() logic Date: Thu, 16 Mar 2017 16:18:44 +0200 Message-Id: <20170316141845.83101-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.11.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It makes sense to set residue when channel is in progress. Otherwise it should be 0 since transfer is completed. Meanwhile this patch doesn't prevent to set residue value anyway. Signed-off-by: Andy Shevchenko --- - it has not be tested drivers/dma/cppi41.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 675de6a27e39..a583c644a7bc 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -420,11 +420,9 @@ static enum dma_status cppi41_dma_tx_status(struct dma_chan *chan, struct cppi41_channel *c = to_cpp41_chan(chan); enum dma_status ret; - /* lock */ ret = dma_cookie_status(chan, cookie, txstate); - if (txstate && ret == DMA_COMPLETE) - txstate->residue = c->residue; - /* unlock */ + + dma_set_residue(txstate, c->residue); return ret; }