From patchwork Thu Feb 2 04:47:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 9551019 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 5D6C260424 for ; Thu, 2 Feb 2017 04:49:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C9F02844A for ; Thu, 2 Feb 2017 04:49:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 402212845F; Thu, 2 Feb 2017 04:49:58 +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=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DFB742844A for ; Thu, 2 Feb 2017 04:49:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cZ9LH-0005wF-M1; Thu, 02 Feb 2017 04:49:55 +0000 Received: from mail-qt0-f174.google.com ([209.85.216.174]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZ9L7-0005Ee-6L for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2017 04:49:47 +0000 Received: by mail-qt0-f174.google.com with SMTP id w20so9817915qtb.1 for ; Wed, 01 Feb 2017 20:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=73qtmIJN7a4SoFgN593KttIT5pC13ELcPynEoytN7aU=; b=cj4C3TmJ8gvmfmhhKryLDJjfuPFYGokXd1f+YBvE3UqGjju9Ub2zHy2zFxf5CzwIve Aia+jjW0BW0A1L/Eft3vPko+RZSfNXgkkCDe6LjGE5NdHe0H2aJiHxqCFtnbuy/9j/hB ZtouPpORVQNjQdCXzlINWXo/N1egGZhOBJhYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=73qtmIJN7a4SoFgN593KttIT5pC13ELcPynEoytN7aU=; b=Quf5e5RX9Tdmfnw+cDv/EctcITh0gepZZ5YCiTzSZRlWeKl5N6OAdmvmQkyKlTdXAo 9Ctwc5ZFR5/FjuDPNmJZUjrCSExTP0yZovds8KlJ9erCO6TM/co/CRO8Dtgr+cZL6QkZ 8G/80cQFKJ8QxcNxnlgMHJHp56ceykX3sSP0M5Izlw42fMO+hUjoEq6UGajN5cP82RHf qIoFfo5nPTECVfUXMUzuJoQPq73VdQQ3iEIuWzCKSIqS1UpBWZ9lUihBS1igFIpbBXf+ LUAhFDvYcgNZCh+U2JrrxPvOXCYnOaUNE1NZFtdX0ftAz3MYXyobuq4C4mEzVq6E7OkG /8mg== X-Gm-Message-State: AIkVDXLyxDN1LVHODOraSxMxOQ1U6J5mHi0/Jp0ATyqcmhZfDKBk5dS+wHx5rspEkHRVIVY7 X-Received: by 10.55.191.6 with SMTP id p6mr6389887qkf.79.1486010906360; Wed, 01 Feb 2017 20:48:26 -0800 (PST) Received: from anup-HP-Compaq-8100-Elite-CMT-PC.dhcp.avagotech.net ([192.19.237.250]) by smtp.gmail.com with ESMTPSA id y189sm20532696qky.39.2017.02.01.20.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Feb 2017 20:48:25 -0800 (PST) From: Anup Patel To: Vinod Koul , Rob Herring , Mark Rutland , Herbert Xu , "David S . Miller" , Jassi Brar Subject: [PATCH 4/6] async_tx: Fix DMA_PREP_FENCE usage in do_async_gen_syndrome() Date: Thu, 2 Feb 2017 10:17:14 +0530 Message-Id: <1486010836-25228-5-git-send-email-anup.patel@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486010836-25228-1-git-send-email-anup.patel@broadcom.com> References: <1486010836-25228-1-git-send-email-anup.patel@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170201_204945_583053_D83A7DBB X-CRM114-Status: GOOD ( 12.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Anup Patel , Scott Branden , Jon Mason , Ray Jui , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-crypto@vger.kernel.org, Rob Rice , dmaengine@vger.kernel.org, Dan Williams , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The DMA_PREP_FENCE is to be used when preparing Tx descriptor if output of Tx descriptor is to be used by next/dependent Tx descriptor. The DMA_PREP_FENSE will not be set correctly in do_async_gen_syndrome() when calling dma->device_prep_dma_pq() under following conditions: 1. ASYNC_TX_FENCE not set in submit->flags 2. DMA_PREP_FENCE not set in dma_flags 3. src_cnt (= (disks - 2)) is greater than dma_maxpq(dma, dma_flags) This patch fixes DMA_PREP_FENCE usage in do_async_gen_syndrome() taking inspiration from do_async_xor() implementation. Signed-off-by: Anup Patel Reviewed-by: Ray Jui Reviewed-by: Scott Branden --- crypto/async_tx/async_pq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crypto/async_tx/async_pq.c b/crypto/async_tx/async_pq.c index 16c6526..947cf35 100644 --- a/crypto/async_tx/async_pq.c +++ b/crypto/async_tx/async_pq.c @@ -62,9 +62,6 @@ do_async_gen_syndrome(struct dma_chan *chan, dma_addr_t dma_dest[2]; int src_off = 0; - if (submit->flags & ASYNC_TX_FENCE) - dma_flags |= DMA_PREP_FENCE; - while (src_cnt > 0) { submit->flags = flags_orig; pq_src_cnt = min(src_cnt, dma_maxpq(dma, dma_flags)); @@ -83,6 +80,8 @@ do_async_gen_syndrome(struct dma_chan *chan, if (cb_fn_orig) dma_flags |= DMA_PREP_INTERRUPT; } + if (submit->flags & ASYNC_TX_FENCE) + dma_flags |= DMA_PREP_FENCE; /* Drivers force forward progress in case they can not provide * a descriptor