From patchwork Tue Dec 8 09:04:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 339708 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp3617696ejs; Tue, 8 Dec 2020 01:05:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwB7myTU+qauj2wnK8A3X6ciW1HV9EOvFp/yRtz8PuzAMb/2mXvNTwW3C+XVj3vohMnkW67 X-Received: by 2002:a17:906:4c85:: with SMTP id q5mr22108048eju.375.1607418346120; Tue, 08 Dec 2020 01:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607418346; cv=none; d=google.com; s=arc-20160816; b=VdPoJ01z3w3r+EniQoQy/KNn3xaCv0F0a1a1hEiOP8eRb7xkkPsSoTYkhQKUcCyyqR jD1kJAuOhWtwrIh3Rh9YHxb/97DHxYe7/IsG5xigndjKCeDYv7cakZkyYyb7xMSMC7BK 0B2BHgsNhQoLr7y9YB1pQimTQxxm0mavApVzSbeqnQPFMvlEkYpV3D3uaprNwDZY44wm Y7QHC0AmmYPMLQ1yEYrgI+z5nnXq/5mxMUdwDlLWTxVzwm2j3A34rURtO59carP4MFkN uhsj5ENiL0D9Vbpxtfi7az022dscqkjvQdXH0AwSoojVKXvpAOHdub/FGHJfrOkb6cSr E07w== 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=V62egZO6vdHRRwU+a5fh5fDiV7+G8bJX28wmy6TSnzFlyCJT6P4sX0Gr7Nwr6VVdlU 1FviD3OCxlxAdnQSjDDTKUMRTyC4dfX5+QmScT6NO5enVaeKtXk1+jxCibugF1kE5p5n iVyQDl1Joqd2g+L7qOCPw4PFomWp8JyX2/Z02V0l9KiH6D2AwXvQQ6jV89wgOJvoOnWw /nGKSTmT1wJQBq21HMKMh1W3I79VxYWPUhLxjOI3cv5o2Im3fshEgjFH0/rEd/MjH5fQ 592toFR0EUHczL9VtMjXqlUGw2HUktl09WWnzxQVh2z2duBLpMNjEm3Hw9CE/22zVmfZ 3AFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="t/7smbS7"; 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 h18si5193516eds.65.2020.12.08.01.05.45; Tue, 08 Dec 2020 01:05:46 -0800 (PST) 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="t/7smbS7"; 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 S1728714AbgLHJFb (ORCPT + 6 others); Tue, 8 Dec 2020 04:05:31 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:51624 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728689AbgLHJFa (ORCPT ); Tue, 8 Dec 2020 04:05:30 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0B893nWa130151; Tue, 8 Dec 2020 03:03:49 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1607418229; bh=LQWkom4AlDyOMYyG9quYjUCZhb57RJ8vj/xUJWaN+D0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=t/7smbS7hKOpZSJ+/N9rlRW4XwqDyMKCYLHlnJeO+EajQrwcUgpj5ITAIFPYjCnp6 i5Ok12+xLpMrbpgoYz8xCvEUOU21JgR6CcZXcsh51dHzy3d9AfDJtmztsTXSFoFMFT CO/rrg/RCz1Ja7Jy4vLR2EF5GgeCUvX1RoDBNBpA= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0B893nPe043566 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 8 Dec 2020 03:03:49 -0600 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 8 Dec 2020 03:03:49 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE112.ent.ti.com (10.64.6.33) 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, 8 Dec 2020 03:03:49 -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 0B893dc7120112; Tue, 8 Dec 2020 03:03:46 -0600 From: Peter Ujfalusi To: , , , CC: , , , , , , , Subject: [PATCH v3 02/20] dmaengine: ti: k3-udma: Wait for peer teardown completion if supported Date: Tue, 8 Dec 2020 11:04:22 +0200 Message-ID: <20201208090440.31792-3-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201208090440.31792-1-peter.ujfalusi@ti.com> References: <20201208090440.31792-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 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), };