From patchwork Wed Sep 30 09:13:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 313858 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:1081:0:0:0:0 with SMTP id r1csp21233ilj; Wed, 30 Sep 2020 02:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4H2DMGsnYZ/sAN4ao7YKWIYhd2G+1OVkKppQpcwvhPLXumyW2hTR9+vN4H7sVRVDcKhqU X-Received: by 2002:a50:da84:: with SMTP id q4mr1619461edj.238.1601457267848; Wed, 30 Sep 2020 02:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601457267; cv=none; d=google.com; s=arc-20160816; b=hXFKEBWp6Dho7bRcqHVZCKfDAqE3CrbiPl2fmEoBxZhW8Z9D2y/tHAGMjpo4ag7lm5 PNOBrCBNktjxW0nq2uXNBc0AbZVPEmAZBzAZoDeLsGFThZxTO1WjitgibR+r4/wZNLpB /XSk+c9qnJrtc/HPBZRaLCRjByQwXWSI5MsU+0B54SUT22T+PzpyB2QSfT+eoFqkO4Rl DaMhE5FrClusDXY0krozkwWAexLf46YrSvGqU8FQyLct01lUtt2EU2Ld/UUgDJBS0Vqv gFeeG8Eqw4+r1iatU8vLCWU7G5oem9o2CIKcc6r4XSRH5+ouyzy6ItSvGKhWZWrEE56+ tG9g== 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=uajOkBw+qG5SkQgCuPiRovW8kdqx1dHM4++EH9YD2UM=; b=tqirl3gW5wtSz96zpBNkeyUn3qgaDMpgZ4/2WH96VCt/nZaVPMIqDRzTgcRa+iuVse iNipZdm0RAqWic6Meb/s9JvUo1vyq7OMukyPX/WTQ+JJm8Fg99FfcMbVi7MMwygxdOdT rU7dqk1jT05wBeEV/3I5gNOruBLaGyWvogLuamLrtHDegSScgEafMxMMg0lqhA4cQfcp jDFPohBGK0/LVHOmuUlPk2Ij/cWxU4gwFO8OrtdFs899pTkKqixVT1ET/FtdOgtuYqXV 2Yy2jTsxdPQM081vXjEEV8my5apa4NSRL3KumYTZhSg5MoTNcDBnu9VU67PsjN1vHkf1 /AAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aw+HeqcU; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 dd23si388541edb.534.2020.09.30.02.14.27; Wed, 30 Sep 2020 02:14:27 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=aw+HeqcU; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S1728973AbgI3JOY (ORCPT + 6 others); Wed, 30 Sep 2020 05:14:24 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:53024 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728938AbgI3JOT (ORCPT ); Wed, 30 Sep 2020 05:14:19 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 08U9EEFK067322; Wed, 30 Sep 2020 04:14:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1601457254; bh=uajOkBw+qG5SkQgCuPiRovW8kdqx1dHM4++EH9YD2UM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aw+HeqcU8C9VIFIa+Y6W+4tXwp9mCLuhk9PaHXtlNaZcGWDOSEcC+C6hTsKQH73Ga im1zbCGc6y5oDzOOi4Ic/KxxmKad4wP/hGACsIWFjRsGYYZ/QhYU1bXtpEAI9hF9xo EOre/23/yc9HgeLwBX12aCAC7kCEGTs24geDn4K8= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 08U9EEHi049314 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Sep 2020 04:14:14 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 30 Sep 2020 04:14:14 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Wed, 30 Sep 2020 04:14:14 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 08U9DuJc116385; Wed, 30 Sep 2020 04:14:11 -0500 From: Peter Ujfalusi To: , , , , CC: , , , , , , Subject: [PATCH 05/18] dmaengine: ti: k3-udma: Wait for peer teardown completion if supported Date: Wed, 30 Sep 2020 12:13:59 +0300 Message-ID: <20200930091412.8020-6-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200930091412.8020-1-peter.ujfalusi@ti.com> References: <20200930091412.8020-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: devicetree@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(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index de7bfc02a2de..3f798993a8b1 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; @@ -1591,6 +1592,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) @@ -3107,14 +3115,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), };