From patchwork Wed Oct 19 17:51:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9385031 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 4F0BA60487 for ; Wed, 19 Oct 2016 17:53:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4298028BCB for ; Wed, 19 Oct 2016 17:53:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3767828BE1; Wed, 19 Oct 2016 17:53:35 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 EA5B428BCD for ; Wed, 19 Oct 2016 17:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939765AbcJSRxB (ORCPT ); Wed, 19 Oct 2016 13:53:01 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38041 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938599AbcJSRw6 (ORCPT ); Wed, 19 Oct 2016 13:52:58 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 21F2861B29; Wed, 19 Oct 2016 17:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476899577; bh=w6//+fpJg3Wyunjz7LPIAhk/267Xgrvy4O885oM99kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eB967wm4JqO4CkO8bGsQwNBpK1XfO0snveXiccGnjmPrYj+ccEOU5QjwuxJ8xhLsA Ug/vssq0zFFEh3ggmKTEAPtJV1qcqPRGjHIodpm9/xVUUPoAc898235ZlS7jFlc7Eq h1yJweROigQs8mWq59uixEIXJheg3fQNq4oGHJpU= 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 A1264605A2; Wed, 19 Oct 2016 17:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476899574; bh=w6//+fpJg3Wyunjz7LPIAhk/267Xgrvy4O885oM99kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T12vGk/wWn3g8e8nDrmN83JqSdc/8Pidpcv7sqzVo7uFoVGbYrFcoY8ozzMsp+Hp3 y717JlxdgejRsLH8Rp4TCmBYLE1X4P2xpAM5VDKBBIkXACKFYRx6vB2gzokhFabukL YzPqjPCO6IC3Mq+JC9D+QvaVNaR/FYH3sD6s35+w= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org A1264605A2 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, devicetree@vger.kernel.org, cov@codeaurora.org, vinod.koul@intel.com, jcm@redhat.com Cc: agross@codeaurora.org, arnd@arndb.de, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Dan Williams , linux-kernel@vger.kernel.org Subject: [PATCH V6 09/10] dmaengine: qcom_hidma: break completion processing on error Date: Wed, 19 Oct 2016 13:51:51 -0400 Message-Id: <1476899512-20431-10-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476899512-20431-1-git-send-email-okaya@codeaurora.org> References: <1476899512-20431-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 We try to consume as much successful transfers as possible. Now that we support MSI interrupts, an error interrupt might be observed by another processor while we are finishing the successful ones. Try to abort successful processing if this is the case. Signed-off-by: Sinan Kaya --- drivers/dma/qcom/hidma_ll.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dma/qcom/hidma_ll.c b/drivers/dma/qcom/hidma_ll.c index 62cdd42..999abda 100644 --- a/drivers/dma/qcom/hidma_ll.c +++ b/drivers/dma/qcom/hidma_ll.c @@ -291,6 +291,13 @@ static int hidma_handle_tre_completion(struct hidma_lldev *lldev) evre_write_off = readl_relaxed(lldev->evca + HIDMA_EVCA_WRITE_PTR_REG); num_completed++; + + /* + * An error interrupt might have arrived while we are processing + * the completed interrupt. + */ + if (!hidma_ll_isenabled(lldev)) + break; } if (num_completed) {