From patchwork Mon Mar 16 11:52:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 6017251 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 71E9BBF910 for ; Mon, 16 Mar 2015 11:52:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 971FE20382 for ; Mon, 16 Mar 2015 11:52:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A905020481 for ; Mon, 16 Mar 2015 11:52:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940AbbCPLwx (ORCPT ); Mon, 16 Mar 2015 07:52:53 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:36645 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445AbbCPLww (ORCPT ); Mon, 16 Mar 2015 07:52:52 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id A24654608DE; Mon, 16 Mar 2015 11:52:51 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0bqwXMw8yHfh; Mon, 16 Mar 2015 11:52:51 +0000 (GMT) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.2.99]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 7220F4608CF; Mon, 16 Mar 2015 11:52:48 +0000 (GMT) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.84) (envelope-from ) id 1YXTZf-0002dh-Tf; Mon, 16 Mar 2015 11:52:47 +0000 From: Ben Dooks To: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, jassisinghbrar@gmail.com, linux-kernel@lists.codethink.co.uk Cc: Ben Dooks Subject: [PATCH 3/3] dmaengine: pl330: fix return status on pending transfers Date: Mon, 16 Mar 2015 11:52:45 +0000 Message-Id: <1426506765-10085-4-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426506765-10085-1-git-send-email-ben.dooks@codethink.co.uk> References: <1426506765-10085-1-git-send-email-ben.dooks@codethink.co.uk> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pl330_tx_status() function returns the desc->status if the dma_cookie_status() call does indicate the cookie completed, however the desc->status is not look directly compatible. Sparse throws the following warning: pl330.c:2262:35: warning: mixing different enum types pl330.c:2262:35: int enum desc_status versus pl330.c:2262:35: int enum dma_status Attempt to fix this by adding a switch statement to turn the desc->status into a dma_status. Note, this has only been tested with the dmatest suite. Signed-off-by: Ben Dooks --- Vinod Koul Dan Williams DMA List Maxime Ripard Jassi Brar Liviu Dudau Linux ARM Kernel --- drivers/dma/pl330.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index d6f677e..a7d9d30 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2259,7 +2259,17 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie, transferred = 0; residual += desc->bytes_requested - transferred; if (desc->txd.cookie == cookie) { - ret = desc->status; + switch (desc->status) { + case DONE: + ret = DMA_COMPLETE; + break; + case PREP: + case BUSY: + ret = DMA_IN_PROGRESS; + break; + default: + WARN_ON(1); + } break; } if (desc->last)