From patchwork Mon Dec 9 09:43:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181014 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4117928ile; Mon, 9 Dec 2019 01:44:33 -0800 (PST) X-Google-Smtp-Source: APXvYqziELhDOccWyOJHuFAa6RtgJ/q3qb20Z5QOP6OwS0eboN+ZFv4rtiL6NlbrEYoguM6GrqvM X-Received: by 2002:a05:6830:12c1:: with SMTP id a1mr19060685otq.357.1575884673729; Mon, 09 Dec 2019 01:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575884673; cv=none; d=google.com; s=arc-20160816; b=o1pGL8FcQl+NiFY3fyzq9SYo4Gjxz2y9szsT41qFt1NKpt+26S1NhZhKTca94V8qMf vZ9Lm+wIHtcGJqMMF5VhOn0JEt5B7eft5C+nQiIHX2SRyntry0aMAtAvhE7sDPJLhdwQ gUSQvU+m783NPXwkCqYfh0v+idS+Xz25Qo4jS7gmGTgMYlb5QBv+C0BzgDpWH66B3Cit 2IpD/p1UVxLMhCivi6pW7JW5WuZ81IFu/sWwH7aJmrwHtQGh3UET9Y3d04IRa3nRSO18 qezy5WRxdKowt4UzvurdozYn14LChhoVTYMXV+y7kFy8lhQW44QAhg7V7Rnsyey190EW D/bA== 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=WLIFq7NRcnOQ5VrrQVld4qrMZ5LO0r2DacFF2Nqd75g=; b=G+bxr44qM3IzmVcWBiu6YawLBbCmsjOza013zPHFexcmN0z2pxIKvqqGMX/f80gJuS RZgMaaj2ttpWimS4hRNkJFlDPkNKOa9AnVGAbiFU7Ze2vCYcJnDVBEPEDxMCDnPal4a/ DgsZthpE2mTA+zh/6uYHx2q5Zhhi4XAfJ1ZwrPegNnOMhI/K2KgWiCNZPtU2A/hXrWtx FARoFbVVBeDhd7fZo6gxpXIUEIy4hUL9HImtaF6Guj4A/MQvCWx1YrKile7cvRaQFSzS GtOKsGQfxdyDyH5D0OeI1r3eXpUGHntEcvpA0HgMTziLWxUV4m1ifs1UHoYD0OM4HMnT Pqbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lPZPSKzt; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16si7075688oto.287.2019.12.09.01.44.33; Mon, 09 Dec 2019 01:44:33 -0800 (PST) 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=@ti.com header.s=ti-com-17Q1 header.b=lPZPSKzt; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbfLIJob (ORCPT + 27 others); Mon, 9 Dec 2019 04:44:31 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:57628 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbfLIJo0 (ORCPT ); Mon, 9 Dec 2019 04:44:26 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xB99iJ6N108696; Mon, 9 Dec 2019 03:44:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1575884659; bh=WLIFq7NRcnOQ5VrrQVld4qrMZ5LO0r2DacFF2Nqd75g=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=lPZPSKztLyHDhZKS4X3DYLyPRgStoxw7ECMb/BEvkkXKbB+O5KSFm/rI0kyDit7vN tMx02pMFm1PTixuWfoVUYFEi+yNR6ey7B7F3vwSa78WOCtzSWMfFXnTIDXCLb+KhCc MG3Kw/n6UQnbij5DEswm/2H0kyJV+WjkyKTyhypk= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xB99iJ0q100211 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Dec 2019 03:44:19 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 9 Dec 2019 03:44:18 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 9 Dec 2019 03:44:18 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id xB99hOWt080263; Mon, 9 Dec 2019 03:44:14 -0600 From: Peter Ujfalusi To: , , , CC: , , , , , , , , , , Subject: [PATCH v7 12/12] dmaengine: ti: k3-udma: Wait for peer teardown completion if supported Date: Mon, 9 Dec 2019 11:43:32 +0200 Message-ID: <20191209094332.4047-13-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191209094332.4047-1-peter.ujfalusi@ti.com> References: <20191209094332.4047-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org 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 --- drivers/dma/ti/k3-udma.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 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 48933689f790..58239b53ba35 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -85,6 +85,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; @@ -1586,7 +1587,8 @@ static int udma_tisci_tx_channel_config(struct udma_chan *uc) req_tx.tx_supr_tdpkt = uc->notdpkt; req_tx.tx_fetch_size = fetch_size >> 2; req_tx.txcq_qnum = tc_ring; - if (uc->ep_type == PSIL_EP_PDMA_XY) { + if (uc->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; @@ -3032,7 +3034,7 @@ 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), .rchan_oes_offset = 0x400, .tpl_levels = 3, @@ -3046,7 +3048,7 @@ static struct udma_match_data j721e_main_data = { 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), .rchan_oes_offset = 0x400, .tpl_levels = 2,