From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E328C388F7 for ; Mon, 9 Nov 2020 12:08:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5CDA207BC for ; Mon, 9 Nov 2020 12:08:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="pkP2c8rM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729243AbgKIMI1 (ORCPT ); Mon, 9 Nov 2020 07:08:27 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:34520 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728927AbgKIMI1 (ORCPT ); Mon, 9 Nov 2020 07:08:27 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0A9C8KGF016562; Mon, 9 Nov 2020 06:08:20 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1604923700; bh=VvLPSZfpwiHAjS3GjsrVd0qPrDT6hWWzu3IfDCtXXms=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=pkP2c8rMzFhKqVzAynG2FpOYK+a7qBCpdIe0YYlj5r10gRe/+yqZgrrTZeULg8dYV riIdbvJYa5DbekCDMRjZK8131epQtypXjzZnYM+EccDAGs8DHKzDqZHLO8CFVbXD77 cf1Ahi9kMjfjcb/LkjIrHClMD0JPeP45Iao//n40= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0A9C8Kjg031614 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Nov 2020 06:08:20 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 9 Nov 2020 06:08:19 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE115.ent.ti.com (157.170.170.26) 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; Mon, 9 Nov 2020 06:08:19 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0A9C8Hb6012848; Mon, 9 Nov 2020 06:08:17 -0600 Subject: Re: [PATCH 01/18] dmaengine: of-dma: Add support for optional router configuration callback To: Vinod Koul CC: , , , , , , , , , , References: <20200930091412.8020-1-peter.ujfalusi@ti.com> <20200930091412.8020-2-peter.ujfalusi@ti.com> <20201007054404.GR2968@vkoul-mobl> <20201007155533.GZ2968@vkoul-mobl> <45adb88b-1ef8-1fbf-08c1-9afc6ea4c6f0@ti.com> <20201028055531.GH3550@vkoul-mobl> <20201109114534.GH3171@vkoul-mobl> From: Peter Ujfalusi Message-ID: <7a7cb455-dd09-b71f-6ecc-fd6108d37051@ti.com> Date: Mon, 9 Nov 2020 14:09:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <20201109114534.GH3171@vkoul-mobl> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Hi Vinod, On 09/11/2020 13.45, Vinod Koul wrote: >> Without a channel number I can not do anything. >> It is close to a chicken and egg problem. > > We get 'channel' in xlate, so wont that help? I think I am still missing > something here :( Yes, we get channel in xlate, but we get the channel after ofdma->of_dma_route_allocate() of_dma_route_allocate() si the place where DMA routers create the dmaspec for the DMA controller to get a channel and they up until BCDMA did also the HW configuration to get the event routed. For a BCDMA channel we can have three triggers: Global trigger 0 for the channel Global trigger 1 for the channel Local trigger for the channel Every BCDMA channel have these triggers and for all of them they are the same (from the channel's pow). bchan0 can be triggered by global trigger 0 bchan1 can be triggered by global trigger 0 But these triggers are not the same ones, the real trigger depends on the router, which of it's input is converted to send out an event to trigger bchan0_trigger0 or to trigger bchan1_trigger0. When we got the channel with the dmaspec from the router driver then we need to tell the router driver that it needs to send a given event in order to trigger the channel that we got. We can not have traditional binding for BCDMA either where we would tell the bchan index to be used because depending on the resource allocation done within sysfw that exact channel might not be even available for us. - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki