Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3764192pxb; Tue, 17 Nov 2020 03:00:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZ7lychrP0Pbo2KxiMgPQROlbjg5pm4zBhU+868AfnEItuEvCGs+2tg3rV4caPf183WWVI X-Received: by 2002:a17:906:8c7:: with SMTP id o7mr11492077eje.413.1605610811817; Tue, 17 Nov 2020 03:00:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605610811; cv=none; d=google.com; s=arc-20160816; b=xra2LY5wxO283C2jEyzTrsDoRSVt4t8bjuxB8ECjqpzLXUQu2KxdSgl4961BXJipHY /RQk+2zFYNcOW6SXvBJft++I1eCjsd5LleBzOosQwYVeS18kiohXENrkRovISRT3G5UV 3VE+SmskGHA51viU8rsQ3jWjn8kyxf3puJwxo0PGsyWvj527hOTb1JgA/riNzdQWXHHi eBVjzzyfYIeDvplttVfDFIwbtAsp4Q9+aTEYCEmyMFgcgRJ3HfzCxWXVa2GfUHNFuMIF hsprTNhEmGwb69Smij+cpxDYsUscG760L0a/RGbHJVTKZC7+gay25fIuyDGzxbnBtgRx /Efw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LQWkom4AlDyOMYyG9quYjUCZhb57RJ8vj/xUJWaN+D0=; b=k2hrfpLoziXodqiOnx7fNrYHjl7teavbYbPECXpUWAxop4ugLUkec8DLAUw3Z9wHlw SwuDnNFVByhEVK80Zf+zp5pn9M01iqu6/NII5O2iqDGQztgIHVuAOd0MpL7belzr3HgN 9tsCZfub6WLwmkbzOVCgfv1MH2CSZS16sjvem59OwDmZUKQQWQ5jk4HHsER1Sv+rbCrf G3AdwcJbyoXA3T0fEYqHFQwz1EXfWhwmMvbzWTsyr3hnlxnyTaAg56RaIP9r87W9C7t1 BmHLlo6sgO5LIUzHsU58mKjRI9tVFumd7JaB5F4bHqhtauQjj9U+QCmslkvx8dTfL+mc 2waQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fb3LVBkR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si178552ejc.387.2020.11.17.02.59.49; Tue, 17 Nov 2020 03:00:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fb3LVBkR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727996AbgKQK4Y (ORCPT + 99 others); Tue, 17 Nov 2020 05:56:24 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:59610 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbgKQK4V (ORCPT ); Tue, 17 Nov 2020 05:56:21 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0AHAuGPc019508; Tue, 17 Nov 2020 04:56:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1605610576; bh=LQWkom4AlDyOMYyG9quYjUCZhb57RJ8vj/xUJWaN+D0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fb3LVBkRu5Z6JEvUr+0Q2d8iNO8h7CAFdxJTUbeZfTJf3JFhTtFT0K7eidyv7hFup FKCGFulewIC9lsTz7cUQPLLMG6QiH6/wk+Vrk5d391w5xbIZLQRRsHKyx1GharbfNv dpZAFLG8dfttRwnD05Nnx9CpywhYkAJe5Qe8lnSI= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AHAuGKP005098 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Nov 2020 04:56:16 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 17 Nov 2020 04:56:15 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 17 Nov 2020 04:56:15 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0AHAu6tm087311; Tue, 17 Nov 2020 04:56:13 -0600 From: Peter Ujfalusi To: , , , CC: , , , , , , , Subject: [PATCH v2 02/19] dmaengine: ti: k3-udma: Wait for peer teardown completion if supported Date: Tue, 17 Nov 2020 12:56:39 +0200 Message-ID: <20201117105656.5236-3-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117105656.5236-1-peter.ujfalusi@ti.com> References: <20201117105656.5236-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set the TDTYPE if it is supported on the platform (j721e) which will cause UDMAP to wait for the remote peer to finish the teardown before returning the teardown completed message. Signed-off-by: Peter Ujfalusi Tested-by: Keerthy Reviewed-by: Grygorii Strashko --- drivers/dma/ti/k3-udma.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index 0e8426dd18a7..eee43757e774 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -86,6 +86,7 @@ struct udma_rchan { #define UDMA_FLAG_PDMA_ACC32 BIT(0) #define UDMA_FLAG_PDMA_BURST BIT(1) +#define UDMA_FLAG_TDTYPE BIT(2) struct udma_match_data { u32 psil_base; @@ -1589,6 +1590,13 @@ static int udma_tisci_tx_channel_config(struct udma_chan *uc) req_tx.tx_fetch_size = fetch_size >> 2; req_tx.txcq_qnum = tc_ring; req_tx.tx_atype = uc->config.atype; + if (uc->config.ep_type == PSIL_EP_PDMA_XY && + ud->match_data->flags & UDMA_FLAG_TDTYPE) { + /* wait for peer to complete the teardown for PDMAs */ + req_tx.valid_params |= + TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_TDTYPE_VALID; + req_tx.tx_tdtype = 1; + } ret = tisci_ops->tx_ch_cfg(tisci_rm->tisci, &req_tx); if (ret) @@ -3105,14 +3113,14 @@ static struct udma_match_data am654_mcu_data = { static struct udma_match_data j721e_main_data = { .psil_base = 0x1000, .enable_memcpy_support = true, - .flags = UDMA_FLAG_PDMA_ACC32 | UDMA_FLAG_PDMA_BURST, + .flags = UDMA_FLAG_PDMA_ACC32 | UDMA_FLAG_PDMA_BURST | UDMA_FLAG_TDTYPE, .statictr_z_mask = GENMASK(23, 0), }; static struct udma_match_data j721e_mcu_data = { .psil_base = 0x6000, .enable_memcpy_support = false, /* MEM_TO_MEM is slow via MCU UDMA */ - .flags = UDMA_FLAG_PDMA_ACC32 | UDMA_FLAG_PDMA_BURST, + .flags = UDMA_FLAG_PDMA_ACC32 | UDMA_FLAG_PDMA_BURST | UDMA_FLAG_TDTYPE, .statictr_z_mask = GENMASK(23, 0), }; -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki