From patchwork Fri Oct 7 05:25:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9365651 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 7E3BC60752 for ; Fri, 7 Oct 2016 05:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7137F292F8 for ; Fri, 7 Oct 2016 05:36:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65FCF292FA; Fri, 7 Oct 2016 05:36:45 +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 152E3292F8 for ; Fri, 7 Oct 2016 05:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327AbcJGFgo (ORCPT ); Fri, 7 Oct 2016 01:36:44 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33368 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751516AbcJGFgk (ORCPT ); Fri, 7 Oct 2016 01:36:40 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C52EF61AC2; Fri, 7 Oct 2016 05:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475817977; bh=zKtYAvFPsRezFx2sVyyzz8VN/beBldzELIZt/AAuLeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kL1Cf+l4MZ9xQp9fcovDL/EyeFK2SXxK/fK4DkT0IpHeA4FBlYow13Z6uHjtqUmUa t+IqRWPWURUUcFtcGyoFaJ6z+q7gXh84VqkTiimuZ9RFkV1eZN44bv8au+45JPtKPN ZF+HGQhrSKR6QIIaqKqq4DRC7VRCtrbQ41V3Hyos= 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 91E1761AC2; Fri, 7 Oct 2016 05:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475817977; bh=zKtYAvFPsRezFx2sVyyzz8VN/beBldzELIZt/AAuLeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kL1Cf+l4MZ9xQp9fcovDL/EyeFK2SXxK/fK4DkT0IpHeA4FBlYow13Z6uHjtqUmUa t+IqRWPWURUUcFtcGyoFaJ6z+q7gXh84VqkTiimuZ9RFkV1eZN44bv8au+45JPtKPN ZF+HGQhrSKR6QIIaqKqq4DRC7VRCtrbQ41V3Hyos= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 91E1761AC2 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 V5 09/10] dmaengine: qcom_hidma: break completion processing on error Date: Fri, 7 Oct 2016 01:25:14 -0400 Message-Id: <1475817915-11976-10-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475817915-11976-1-git-send-email-okaya@codeaurora.org> References: <1475817915-11976-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 c4e8b64..aa76ec1 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) {