Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5641295img; Wed, 27 Mar 2019 12:15:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmQjziWzQB1wMoBTmNl/FpGiKW2aC7G9Xt2vjTu3YATlXdExI5fTrBfjjHMqFICi/Hb5pf X-Received: by 2002:a65:5249:: with SMTP id q9mr15175406pgp.104.1553714150629; Wed, 27 Mar 2019 12:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714150; cv=none; d=google.com; s=arc-20160816; b=GlcdLwIsfi7PlRGPC16vyW4g5evaiagjBYIf9f0jTMiCRngrnuCaCbjy+bDKR0lYe9 wvtOaB3MwINSqOiIHRE/27MdePn4DkmiGRko9JKKnXV3B7RYOGovZUXj1UR2J+q12QJT bcB1FBckzCRrveyAr+OIkbv1RBc4NW7Sc1VPRW67Q/k5k2si+b0teGP7rVmenGSlfz3r dcCMdgHk6t92ZrKcuRZpcfNd9U0lipAHrXX5ynU+RE8GokdRn6YbfPyh/oN26h+IP2Zr uqqht+7F6Q/I0hCsxuh8JK/bd2CFCO6wKx/Jk9o8QKrDsJ3juXCLC/yxPQG1h8fEokJL htJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ntBK9EvXEftNR5FBBUwjVmlobKqGtxfhuYLTBuj6k2I=; b=pOtL/hgErHqTP0ZBLAKkbaGK81WA7iEXDfgAG+H43YCwyt0yp9n4oY3+WAVda8cKY1 CjUATyXHYBNqh5q+p3Wfw/z+9yPhGuLrFOC7CCr46Lu/KxEWXhtMgiQ6evtUGEUAW1og Oy85NgY7t398x5sQI7ZitUm9UMzfB49R0jTSFgJDCNcFujEXUBGJlgXf+WcnyRNEYlM5 suI5ad6DYGnvy0lMPv0o9UB41z6OmDe6qBLMZpi40JodFkjnRd3t75u8FkdvlseICTW5 4Y9O6Vn55uoVCfW2V/PMvFkZ1DwkSwRcpHRZOX61JnJuczujpu/lvYPcCjefdd150wxy 34mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s0PdMydS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn11si3590957plb.205.2019.03.27.12.15.35; Wed, 27 Mar 2019 12:15:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s0PdMydS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388218AbfC0TPD (ORCPT + 99 others); Wed, 27 Mar 2019 15:15:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:51322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388575AbfC0SJa (ORCPT ); Wed, 27 Mar 2019 14:09:30 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC16F21738; Wed, 27 Mar 2019 18:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710169; bh=bQA4rep4aoj+gAR143fIhWCpWxLbReAsPfQHlFROyJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0PdMydSrTQU+kt0uyo7sQLr7McLBCJj5bBAlcV/5Lj+kG0Nb87YAaCGFZf7z//H2 e1KO9N402bplm+WXz+NMZs8PAwDkDaJ9jn1RZvnzrBwLYEPH7q7DmW3nfKMIf4Xben H/MsGqbpftHO5k/N35kjyju8yQoA6eN1Yp4u0UmI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shunyong Yang , Joey Zheng , Vinod Koul , Sasha Levin , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 232/262] dmaengine: qcom_hidma: initialize tx flags in hidma_prep_dma_* Date: Wed, 27 Mar 2019 14:01:27 -0400 Message-Id: <20190327180158.10245-232-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shunyong Yang [ Upstream commit 875aac8a46424e5b73a9ff7f40b83311b609e407 ] In async_tx_test_ack(), it uses flags in struct dma_async_tx_descriptor to check the ACK status. As hidma reuses the descriptor in a free list when hidma_prep_dma_*(memcpy/memset) is called, the flag will keep ACKed if the descriptor has been used before. This will cause a BUG_ON in async_tx_quiesce(). kernel BUG at crypto/async_tx/async_tx.c:282! Internal error: Oops - BUG: 0 1 SMP ... task: ffff8017dd3ec000 task.stack: ffff8017dd3e8000 PC is at async_tx_quiesce+0x54/0x78 [async_tx] LR is at async_trigger_callback+0x98/0x110 [async_tx] This patch initializes flags in dma_async_tx_descriptor by the flags passed from the caller when hidma_prep_dma_*(memcpy/memset) is called. Cc: Joey Zheng Reviewed-by: Sinan Kaya Signed-off-by: Shunyong Yang Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/qcom/hidma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c index ea219bca116d..411f91fde734 100644 --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c @@ -416,6 +416,7 @@ hidma_prep_dma_memcpy(struct dma_chan *dmach, dma_addr_t dest, dma_addr_t src, if (!mdesc) return NULL; + mdesc->desc.flags = flags; hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch, src, dest, len, flags, HIDMA_TRE_MEMCPY); @@ -448,6 +449,7 @@ hidma_prep_dma_memset(struct dma_chan *dmach, dma_addr_t dest, int value, if (!mdesc) return NULL; + mdesc->desc.flags = flags; hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch, value, dest, len, flags, HIDMA_TRE_MEMSET); -- 2.19.1