Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1091899pxk; Thu, 3 Sep 2020 23:31:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoCNb7kjH0WfKE8pchetcrm85iBLGKnyVrzTexP/157Bx+qG+HkzZk5cYEaLZjhPkwvLPS X-Received: by 2002:aa7:cc92:: with SMTP id p18mr6901556edt.253.1599201088601; Thu, 03 Sep 2020 23:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599201088; cv=none; d=google.com; s=arc-20160816; b=z92ivzNQiYyuULOA0pdSzmvxPbZQJHCB+o+Pwo5y6NXyM47efRSKhmco/huqZxZyjm kZMj0CSjfOBBjbz+7utZKn7/0U0CbL25Nr17clxBv6QQB/facXztItFMb6nNtPJDgXiq YnhZnLCQyls8iX6KwIb0KNEtaI4cKmI1EfbVymrSVRWt21+ty4TIX3tcz8y76wif8MpD SzrBQVMm3QR2zUqwBdkCftO7GWevgZVA4dje5JuBSN4R14WIWpB1YIWIlnjFZWt1QIvz Ak0ryJp4vfLrPBlRePNIoO7kN1CrXGpy+h0GOoJxCS9e4a2UI7scBN/LmZaZ3eWZSnYb uagg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uUM2Oj4qkFE3oYXIgBVnfIb36eIz3gZ7/uHRmD/RPxo=; b=EE/wJOi1JG+/TdCGyxMr9MEMGdp3mFdvys+f5aXwlho4Gj2fwkB08qfkqTVSOyXQHF o9M4XwKnxuTIYlXJTQByKSnCpTE/LB39gLfuwmbIq9RJCHrTNetKKhUteHf++0W4aIEg lerDEBg8oLd+9psA6KmjI4ObKvmT+7EBo2YplR8icMUH+ayKhapF7g2/L9DwWx3D+/fg m82eS3wStr4bPaWpshf+Xyazq/oQRbdlztMwfQJvDEF2MfIbfV4mVS0DXVSsV10oabde gDABJ7UPlgUwpfJ0pDskMTnINIFrBs0FUQkflmO04uwJnsyOrptva/TrjcaUa5B04kGT PZcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cOcSzMdY; 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 g2si3482120eji.132.2020.09.03.23.31.06; Thu, 03 Sep 2020 23:31:28 -0700 (PDT) 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=cOcSzMdY; 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 S1729856AbgIDG37 (ORCPT + 99 others); Fri, 4 Sep 2020 02:29:59 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:42278 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbgIDG36 (ORCPT ); Fri, 4 Sep 2020 02:29:58 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0846TrQ6125651; Fri, 4 Sep 2020 01:29:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1599200993; bh=uUM2Oj4qkFE3oYXIgBVnfIb36eIz3gZ7/uHRmD/RPxo=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=cOcSzMdYt/WiWfLI5cIvdXi9Oswm8+h4tMhNJFNtpiRqLhO8Gt0MIwuP4YMx52Bi2 qyzSPZJfBaQIxp8S+UavpSpSMzaH1KFemRoEmds9s3nCsQeJF4XLcRxEglL3Pur/lm AmmYVTDYJOt+jEFD3VyWyC2mjLUCeAtAtgk19fsU= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0846TrXA008913 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 4 Sep 2020 01:29:53 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) 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; Fri, 4 Sep 2020 01:29:53 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) 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; Fri, 4 Sep 2020 01:29:53 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0846ToFE045013; Fri, 4 Sep 2020 01:29:51 -0500 Subject: Re: [PATCH v5 2/2] Add Intel LGM soc DMA support. To: "Reddy, MallikarjunaX" , , , , CC: , , , , , References: <3aea19e6-de96-12ba-495c-94b3b313074d@ti.com> <51ed096a-d211-9bab-bf1e-44f912b2a20e@linux.intel.com> <831fadff-8127-7634-32be-0000e69e0d94@ti.com> <6a2e572e-c169-21d5-d36f-23972a24cc54@linux.intel.com> From: Peter Ujfalusi X-Pep-Version: 2.0 Message-ID: <331db01b-ceea-64bd-0eff-5c75134a603b@ti.com> Date: Fri, 4 Sep 2020 09:31:37 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <6a2e572e-c169-21d5-d36f-23972a24cc54@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 On 31/08/2020 11.07, Reddy, MallikarjunaX wrote: >=20 > On 8/28/2020 7:17 PM, Peter Ujfalusi wrote: >> Hi, >> >> On 27/08/2020 17.41, Reddy, MallikarjunaX wrote: >>>>>>> + >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_alloc_chan_resources =3D >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 d->inst->ops->device_= alloc_chan_resources; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_free_chan_resources =3D >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 d->inst->ops->device_= free_chan_resources; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_terminate_all =3D >>>>>>> d->inst->ops->device_terminate_all; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_issue_pending =3D >>>>>>> d->inst->ops->device_issue_pending; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_tx_status =3D d->inst->ops->d= evice_tx_status; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_resume =3D d->inst->ops->devi= ce_resume; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_pause =3D d->inst->ops->devic= e_pause; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_config =3D d->inst->ops->devi= ce_config; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_prep_slave_sg =3D >>>>>>> d->inst->ops->device_prep_slave_sg; >>>>>>> +=C2=A0=C2=A0=C2=A0 dma_dev->device_synchronize =3D d->inst->ops-= >device_synchronize; >>>>>>> + >>>>>>> +=C2=A0=C2=A0=C2=A0 if (d->ver =3D=3D DMA_VER22) { >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dma_dev->src_addr_wid= ths =3D BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dma_dev->dst_addr_wid= ths =3D BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dma_dev->directions =3D= BIT(DMA_MEM_TO_DEV) | >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BIT(DMA_DEV_= TO_MEM); >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dma_dev->residue_gran= ularity =3D >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DMA_RESIDUE_GRANULARITY_= DESCRIPTOR; >>>>>>> +=C2=A0=C2=A0=C2=A0 } >>>>>> So, if version is !=3D DMA_VER22, then you don't support any direc= tion? >>>>>> Why register the DMA device if it can not do any transfer? >>>>> Only dma0 instance (intel,lgm-cdma) is used as a general purpose sl= ave >>>>> DMA. we set both control and datapath here. >>>>> Other instances we set only control path. data path is taken care >>>>> by dma >>>>> client(GSWIP). >>>> How the client (GSWIP) can request a channel from intel,lgm-* ? Don'= t >>>> you need some capabilities for the DMA device so core can sort out t= he >>>> request? >>> client request channel by name, dma_request_slave_channel(dev, name);= >> clients should use dma_request_chan(dev, name); >> >> If the channel can be requested via DT or ACPI then we don't check the= >> capabilities at all, so yes, that could work. >> >>>>> Only thing needs to do is get the channel, set the descriptor and j= ust >>>>> on the channel. >>>> How do you 'on' the channel? >>> we on the channel in issue_pending. >> Right. >> Basically you only prep_slave_sg/single for the DMA_VER22? Or do you >> that for the others w/o direction support? > > Yes. prep_slave_sg/single only for the DMA_VER22. So, you place the transfers to DMA_VER22's channel >> >> For the intel,lgm-* DMAs you only call issue_pending() and probably >> terminate_all? > Yes, correct. and issue_pending on a channel which does not have anything pending? How client knows which of the 'only need to be ON' channel to enable when it placed a transfer to another channel? How would the client driver (and the IP) would be integrated with different system DMA which have standard channel management? If DMA_VER22 knows which intel,lgm-* it should place the transfer then with virt-dma you can handle that just fine? Do you have public documentation for the DMA? It sounds a bit like TI's EDMA which is in essence is a two part setup: CC: Channel Controller - to submit transfers (like your DMA_VER22) TC: Transfer Controller - it executes the transfers submitted by the CC One CC can be backed by multiple TCs. I don't have direct control over the TC (can not start/stop), it is controlled by the CC. Documentation/devicetree/bindings/dma/ti-edma.txt Or is it a different setup? - P=C3=A9ter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki