Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1001636yba; Thu, 4 Apr 2019 02:09:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYo8ULXfgHLrYjKv2/V+uFSYz0PhfKCyDHOpvs7vVJVFM3kGX6DRQ4Gredq7NZhT7Z+XdL X-Received: by 2002:a62:cfc4:: with SMTP id b187mr4643777pfg.130.1554368942051; Thu, 04 Apr 2019 02:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368942; cv=none; d=google.com; s=arc-20160816; b=cWwWk61sYyX5nreM3lLRrkHysOUi8UO5QdotDZZN92WRwfHWAxxc8EhfH+DIaNH1AF 1OrX6nuf+yXNLrNauZRrxGIlrHSgXJf0GSLlr0PXiy+mGjHGdQIEcR+sOGDK6slJIZJ5 5CloBo+47emHXMBaWVbdug1Uh6HQ13kxAlDhM7CaY9itsttfIdoWlu7ykwSkUL4g2Y85 iA2Pej2DFlJbDWyhI4o6RO2+/jUXv1QpTPeOAWK1m0//WdCGp5OdU+sedNkqJmZT0/O5 0QFyxToijQDSBBcvRBEeFaFjOA+ynjHHLvdEPE1hcqgu/QfsRoH0nd+WbMsE22gc/Wnv uU6Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TEkb5M+b4xljgOV5Zpjo66PCz9cakjlL0iu+BXq08fo=; b=HUxhu4I8PDjXzmcqYbVdgaFrlKWdW9ePY/dBEZaYaBxo5xJk2JdmErYKSPnroaGdTt WRzy94IeTmke79z8DI6qSuma527aHGYzxncwcD2xOWbLVBUn8WOg3PDYywiv6XLv+/oG XZJl1in8BrbMNLysMmCQflSdsv9gq6/qLuP+EZW7R04V0vh/DpbrfMy4JWlHsUBX+oQw 0TEWn/M10ox8IOKzRSAYJDS21DX9+xrJbxGvJfBE1Vi7B5v88AwRjCN2AlFIEMtPjwWR 1awheVbyPK7qH3PER05F0UhZKkg4uhjocTpDsfvEASQEr/wKT9PZkxXi5g0so+wddDVs gCaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HKdZ3Jkb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14si7276495plo.287.2019.04.04.02.08.47; Thu, 04 Apr 2019 02:09:02 -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=HKdZ3Jkb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732430AbfDDJG7 (ORCPT + 99 others); Thu, 4 Apr 2019 05:06:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:45722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732423AbfDDJG7 (ORCPT ); Thu, 4 Apr 2019 05:06:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B0D2A2184B; Thu, 4 Apr 2019 09:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368818; bh=+wLpZvZHeueROCSTZd3BN8y75xg/eJrVs6/iUISw68Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HKdZ3JkbOcuGfQiCgwsa4EUBkdueK91pyYMJ09ubQ04QuVmA42Q9r5ph+kziVcnmO E61jWcn2AcrZJLy7Mh+7nVCabzaBLLHNUZAPAeXenWd8g/ukMO0vBCGxeiJCqe7kqE HEtm2Um1ldzHLWzNCW0w0+IrCP7VvZZXSDBfJtx4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joey Zheng , Sinan Kaya , Shunyong Yang , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 165/187] dmaengine: qcom_hidma: initialize tx flags in hidma_prep_dma_* Date: Thu, 4 Apr 2019 10:48:22 +0200 Message-Id: <20190404084610.866528419@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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