Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1736804ybi; Thu, 20 Jun 2019 02:56:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcQmLtPv225gaaVQQ7Jdy22jKNOzFteaC7JI7MWADf1NjZHlbUMTHiRyNP09FO1Ob7fH7t X-Received: by 2002:a62:640e:: with SMTP id y14mr125344315pfb.109.1561024618252; Thu, 20 Jun 2019 02:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561024618; cv=none; d=google.com; s=arc-20160816; b=vrvi4J9p9hs7IYjtZZI5olok+Hs4IWjQ4og8RnmS3qSYI1C9USz9XWuZEXPdY26CwT uQa1fAYYumgLxnyxPFynU4s0442YdFK/hviEKwbHd1Js5okDx6XTwyPGnJxHFgYSne7T zbStz5R0kcxrYfJFBXc//Wq4mqkNLXxbHTqV+rxkIlIdJ8xBvlBpIHWx22bq6cgb5jE6 FdeW1tD9uY8m1F5KgKFTrG9PYfX3fab10ws0LGicUeUrJ4KHjztVW+fDs+YFnUzUNmYa 0GdMMVB0pjVwMG4Wx8MVwn+gco8Km7Xhx2KtZhMrIndH+0h4HUQxVw1j59uFXfjiVzkC rqhQ== 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=gMzqG6E9O4i2YfBt81xekJ8pv03pPdWDJCxTqsWo7G0=; b=LKn2zcIsAkMsWXfqK+dfyuHKIW68STFMjSFyniwV+c8kvnhLjId08oKlp+/bOBtDME KOPgX5NYzforlbXFGZHNWiieahA3bpa4h4O8XNk4JZgqSG/6mhPE9xF9dInRlcRCbPvK SMp56eXLWD8Xgl/Bz2NY+VQ6O+3d3FrKGpj43CffDRQBiBXcXssePIvEOoaqkUhwCRwJ hi4g3DngItUbIU4JiudsGwTdC/OZe0tEh8KP8rleAQ/ne9hXiS6exChq/ghkSnCU2GyV AkiTOj2FqD7w2beXD0WlMZ5R4pDG+BPYxEO+8ECWhbRiIXdIl7JEx4ofH+htya2UaknZ 9+MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NQ1so63d; 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 31si5600667pgr.12.2019.06.20.02.56.41; Thu, 20 Jun 2019 02:56:58 -0700 (PDT) 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=NQ1so63d; 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 S1730759AbfFTJz5 (ORCPT + 99 others); Thu, 20 Jun 2019 05:55:57 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:42956 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbfFTJz5 (ORCPT ); Thu, 20 Jun 2019 05:55:57 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x5K9tfj3111742; Thu, 20 Jun 2019 04:55:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1561024541; bh=gMzqG6E9O4i2YfBt81xekJ8pv03pPdWDJCxTqsWo7G0=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=NQ1so63dygklF44KpEHQFiJ65zCl0/AG3QG3xL6D2Q80yRU4yN1Xr7yF7OXemcQ/g L/6fgj0DcUkGXq9jDqzNfvHqmJLecmfbVOYF2e0EhgDKIlQ/N3PvauhHr48h0H6+Um 6Erh7jeFw3aOiugZPDZqfCMIL+NMlwhgpUM63Nuk= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x5K9tfcN086307 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Jun 2019 04:55:41 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 20 Jun 2019 04:55:41 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 20 Jun 2019 04:55:41 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x5K9tciC018188; Thu, 20 Jun 2019 04:55:38 -0500 Subject: Re: [PATCH 09/16] dt-bindings: dma: ti: Add document for K3 UDMA To: Rob Herring CC: Vinod , Nishanth Menon , Santosh Shilimkar , Dan Williams , "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , , "linux-kernel@vger.kernel.org" , Grygorii Strashko , Lokesh Vutla , Tero Kristo , Tony Lindgren References: <20190506123456.6777-1-peter.ujfalusi@ti.com> <20190506123456.6777-10-peter.ujfalusi@ti.com> <20190613181626.GA7039@bogus> From: Peter Ujfalusi Message-ID: Date: Thu, 20 Jun 2019 12:56:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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 19/06/2019 17.04, Rob Herring wrote: > On Fri, Jun 14, 2019 at 7:42 AM Peter Ujfalusi wrote: >> >> >> On 14/06/2019 16.20, Rob Herring wrote: >>> On Thu, Jun 13, 2019 at 2:33 PM Peter Ujfalusi wrote: >>>> >>>> Rob, >>>> >>>> On 13/06/2019 21.16, Rob Herring wrote: >>>>>> +Remote PSI-L endpoint >>>>>> + >>>>>> +Required properties: >>>>>> +-------------------- >>>>>> +- ti,psil-base: PSI-L thread ID base of the endpoint >>>>>> + >>>>>> +Within the PSI-L endpoint node thread configuration subnodes must present with: >>>>>> +ti,psil-configX naming convention, where X is the thread ID offset. >>>>> >>>>> Don't use vendor prefixes on node names. >>>> >>>> OK. >>>> >>>>>> + >>>>>> +Configuration node Required properties: >>>>>> +-------------------- >>>>>> +- linux,udma-mode: Channel mode, can be: >>>>>> + - UDMA_PKT_MODE: for Packet mode channels (peripherals) >>>>>> + - UDMA_TR_MODE: for Third-Party mode >>>>> >>>>> This is hardly a common linux thing. What determines the value here. >>>> >>>> Unfortunately it is. >>> >>> No, it's a feature of your h/w and in no way is something linux >>> defined which is the point of 'linux' prefix. >> >> The channel can be either Packet or TR mode. The HW is really flexible >> on this (and on other things as well). >> It just happens that Linux need to use specific channels in a specific mode. >> >> Would it help if we assume that all channels are used in Packet mode, >> but we have linux,tr-mode bool to indicate that the given channel in >> Linux need to be used in TR mode. > > Your use of 'linux' prefix is wrong. Stop using it. OK, I can not argue with that. I'll have 'tr-mode' bool to indicate that the channel should be configured in TR mode for the given thread. >>>> Each channel can be configured to Packet or TR mode. For some >>>> peripherals it is true that they only support packet mode, these are the >>>> newer PSI-L native peripherals. >>>> For these channels a udma-mode property would be correct. >>>> >>>> But we have legacy peripherals as well and they are serviced by PDMA >>>> (which is a native peripheral designed to talk to the given legacy IP). >>>> We can use either packet or TR mode in UDMAP to talk to PDMAs, it is in >>>> most cases clear what to use, but for example for audio (McASP) channels >>>> Linux is using TR channel because we need cyclic DMA while for example >>>> RTOS is using Packet mode as it fits their needs better. >>>> >>>> Here I need to prefix the udma-mode with linux as the mode is used by >>>> Linux, but other OS might opt to use different channel mode. >>> >>> So you'd need ,udma-mode? That doesn't work... If the setting is >>> per OS, then it belongs in the OS because the same dtb should work >>> across OS's. >> >> So I should have a table for the thread IDs in the DMA driver and mark >> channels as TR or Packet in there for Linux use? > > Perhaps. I haven't heard any reasons why you need this in DT. If Linux > is dictating the modes, then sounds like it should be in Linux. > > But really, I don't fully understand what you are doing here to tell > you what to do beyond using 'linux' prefix is wrong. We have certain peripherals (McASP/UART/McSPI/etc) which is serviced by PDMAs to be compatible with the data movement architecture implemented within NAVSS. Unlike native peripherals, like networking we can configure the UDMAP channel to either Packet or TR mode. There are differences between the two modes, but the job can be done in both modes. In Linux we use TR mode for audio channels as it provides the needed functionality we need (efficient cyclic mode, can disable interrupts). There is no information from the HW on how a given thread is best used and other OSs can opt for not optimal use. But the majority of threads are better served in Packet mode, so adding a bool flag to the thread configuration to indicate that TR mode is the advised mode for it is perfectly fine. - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki