From patchwork Tue Nov 17 10:56:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 324561 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp4066546ils; Tue, 17 Nov 2020 02:57:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaGGkr9WV6Ol/hsbzkp73epoibGO6WAUSnPuaUbUd/DBa6T/gnP9eMclrp05iGq+jpU1gG X-Received: by 2002:a17:906:c08f:: with SMTP id f15mr18379159ejz.97.1605610628893; Tue, 17 Nov 2020 02:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605610628; cv=none; d=google.com; s=arc-20160816; b=cmnmsvhdKKgAvQC3nWjaFN1Bstg2xQP0x4uOSy8in69KFzSuqWQSmjkA+eJ6V+qIkD 98JoI/znyu9b40wlCi83Bj26nHZSI30ygQJK6M3Y65Pu/ouAa7kBrkRFbpfI6MMdY1+9 fnKrkER3FTeXL+oZioYNRsadPRRKY1DP8pdZsx+o/4KMGtwfsQQGaljI4gY0x57ms2Z9 /+WDylcUq8Dorf1Fdx+KWMjAjFreykVFsZK09txN5uQNV/5smPlQRNQPSe9yfXvTtRFq Tu5vjbx2h0yZvyexSavhfoTQk+yMQWAUNUKOFS7z1Zu9MVkO6wzT7hkq9++UoTvHCe5R l8nw== 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=GPNClNRp61iGNgJX9hjyyFfrcPdoVMSd0kEOHS+xKLc=; b=SC66af/B8xTm6A8mdhSW7WCg+5ck2ndG9OlHdoJPaEr3zsrkKp1OLELZZYUsrxIE06 3Rj21H0SPbvVvhkiwM+4iVa4Qro1JxGdzxcsIgW8l2YwD+yGr7S5vebcqaHOs0qy8Hl5 gDIknwmiYRj6XYQPt1oqX6IfKyjdxptJKPaN7Ws6hcSpTUl+wJgfLpMOrdRKrruXP83w qP0ILyTR5wypa4O5eT5ZXUM98muoaQOM+D78iD/VRWUCjqVxHMIVPpzdKhipmqyJbvYw 1Etho6nPFTNTIJx9MT+j71rE4oV/nGED5syNTxfMSc6pC8erDsNpHvECJS9C7MR97APm bMqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uVdP+flR; 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 dm25si12962825edb.238.2020.11.17.02.57.08; Tue, 17 Nov 2020 02:57:08 -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=uVdP+flR; 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 S1728039AbgKQK4b (ORCPT + 6 others); Tue, 17 Nov 2020 05:56:31 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:34070 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbgKQK4a (ORCPT ); Tue, 17 Nov 2020 05:56: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 0AHAuP2k117215; Tue, 17 Nov 2020 04:56:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1605610585; bh=GPNClNRp61iGNgJX9hjyyFfrcPdoVMSd0kEOHS+xKLc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uVdP+flRTAxnCrsn0rXQ/oBgbbZFdX+SKtKMBOx88G9hWGtnZSAQNuWWJKdT72Qef ruE8j7JL3CwrjXEKYa2pHbcMCbWLkxpgoqmzkydS9SeQUl0nfHJVEhQqwz+bJg0yma PFOpk3mlR3bw2QJ0Dh5oYwViIOPPI+TA63yW2btM= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AHAuPJj010058 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Nov 2020 04:56:25 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE102.ent.ti.com (10.64.6.23) 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:24 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE102.ent.ti.com (10.64.6.23) 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:24 -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 0AHAu6tp087311; Tue, 17 Nov 2020 04:56:22 -0600 From: Peter Ujfalusi To: , , , CC: , , , , , , , Subject: [PATCH v2 05/19] dmaengine: ti: k3-udma-glue: Configure the dma_dev for rings Date: Tue, 17 Nov 2020 12:56:42 +0200 Message-ID: <20201117105656.5236-6-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 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Rings in RING mode should be using the DMA device for DMA API as in this mode the ringacc will not access the ring memory in any ways, but the DMA is. Fix up the ring configuration and set the dma_dev unconditionally and let the ringacc driver to select the correct device to use for DMA API. Signed-off-by: Peter Ujfalusi --- drivers/dma/ti/k3-udma-glue.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 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-glue.c b/drivers/dma/ti/k3-udma-glue.c index 29d1524d1916..ddf0730aa2bc 100644 --- a/drivers/dma/ti/k3-udma-glue.c +++ b/drivers/dma/ti/k3-udma-glue.c @@ -280,6 +280,10 @@ struct k3_udma_glue_tx_channel *k3_udma_glue_request_tx_chn(struct device *dev, goto err; } + /* Set the dma_dev for the rings to be configured */ + cfg->tx_cfg.dma_dev = k3_udma_glue_tx_get_dma_device(tx_chn); + cfg->txcq_cfg.dma_dev = cfg->tx_cfg.dma_dev; + ret = k3_ringacc_ring_cfg(tx_chn->ringtx, &cfg->tx_cfg); if (ret) { dev_err(dev, "Failed to cfg ringtx %d\n", ret); @@ -595,6 +599,10 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn, goto err_rflow_put; } + /* Set the dma_dev for the rings to be configured */ + flow_cfg->rx_cfg.dma_dev = k3_udma_glue_rx_get_dma_device(rx_chn); + flow_cfg->rxfdq_cfg.dma_dev = flow_cfg->rx_cfg.dma_dev; + ret = k3_ringacc_ring_cfg(flow->ringrx, &flow_cfg->rx_cfg); if (ret) { dev_err(dev, "Failed to cfg ringrx %d\n", ret);