Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp112396ybj; Wed, 6 May 2020 12:50:30 -0700 (PDT) X-Google-Smtp-Source: APiQypIivLkYz6DYO5M81woTQAPw7oA+UA6c5+eFQ2mYIYHbWcDLQ0wSHWpqpy2P00src+UVxJ9l X-Received: by 2002:aa7:d783:: with SMTP id s3mr8899098edq.64.1588794630777; Wed, 06 May 2020 12:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588794630; cv=none; d=google.com; s=arc-20160816; b=edpUJxaz7s2DBduRPdxzk4oUjr+15HKyC3QkpwzzqK8UpRnm54zUFnuneB89EhAFyo QgFxma//ch7B1yDWzEzN5egKi9AJaeoNemgchHI80mRNYQ/rEQwcRT6NBDIntto+bkVI MUZVd/Y9p1QvRlMz0qQozzH09ehWwUtbu9xTy7e9QE8YEPW+KaaBTuM82IRFWIHGwD5P ceuzmNIWsgCmIjRRbfyyKCWI3x+/DmO5BrUndoxsMZpZtMFDuEHFeJcTvtlHXZJ/Ec5H zCv531A9bUoXSJXY0XVH4UtokmBQ2QwjT5KZWw1zyCX7x9k3JeilhxKjondA9tdLiiHK zPFg== 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=EaGNiVHRrlAZYXXBERxfZT7BGumy9fgH/Sfqh9FjJlc=; b=MtYOvpdsvaMyh99jzAH9Noh5YNGvHj6R9GO1rfZRNZMQNWFLZhRHGpNOu/nYTvNXS5 QGWQ/V4WfJwOHtXJIogNHsxRVbhSCqOeioyWooMYa+XzT3rMwHAVjTMfIi+fDLDNavBm uCvL5MwaCseDPLdUhMGCYn3TIURYcnNDbuLo8hj7P/Pr20iYU7G1Q7yovW2et2at/Efj V92gAFHmskE5Ww1pS9MeG1aHnJ/zSbzmticvcNKbXMpiezfI+wJUS6w9yTscA7BIN3au Zv26LaGbMxTgO+NInfPp4XF3LXpE4pCrOiBBPPc7FIm3jyh2vevZ35JvCucK7or7mSi0 WhqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EF5rBrg4; 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 w26si1790466ejs.63.2020.05.06.12.50.07; Wed, 06 May 2020 12:50:30 -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=EF5rBrg4; 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 S1728851AbgEFRfw (ORCPT + 99 others); Wed, 6 May 2020 13:35:52 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:59248 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728047AbgEFRfw (ORCPT ); Wed, 6 May 2020 13:35:52 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 046HZVkw103808; Wed, 6 May 2020 12:35:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1588786531; bh=EaGNiVHRrlAZYXXBERxfZT7BGumy9fgH/Sfqh9FjJlc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=EF5rBrg4HaRDOlGi6AEnqAdzew8tmyq3c6VEkbyVuQhCVWPq7GTRT3wdAFQhU0o/1 l4gbAAe7XGImtfHrJbviASZQITOZ+Q9R6V/BfcOeUgmpsfVobtkx5RLpbf2Dq7GDPG yIwsqKJOE0XeGpHrG4sTB4N4OCyHsCE1Tgq95ii4= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 046HZVFP049979 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 6 May 2020 12:35:31 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) 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; Wed, 6 May 2020 12:35:31 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) 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; Wed, 6 May 2020 12:35:31 -0500 Received: from [10.250.38.163] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 046HZUNM126702; Wed, 6 May 2020 12:35:30 -0500 Subject: Re: [RFC][PATCH 1/4] devicetree: bindings: Add linux,cma-heap tag for reserved memory To: John Stultz CC: Brian Starkey , lkml , Rob Herring , Sumit Semwal , Benjamin Gaignard , Liam Mark , Pratik Patel , Laura Abbott , Chenbo Feng , Alistair Strachan , Sandeep Patil , Hridya Valsaraju , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Andrew Morton , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , dri-devel , linux-mm , nd References: <20200501073949.120396-1-john.stultz@linaro.org> <20200501073949.120396-2-john.stultz@linaro.org> <20200501104216.4f226c2a7bzval5o@DESKTOP-E1NTVVP.localdomain> <20200504085007.5yrjhknkg6ugbqwk@DESKTOP-E1NTVVP.localdomain> <1bddb721-d4d9-f113-bacc-0a0ca2d57753@ti.com> From: "Andrew F. Davis" Message-ID: <1b82e66e-01b9-5c4d-9777-1aa34bf1b07e@ti.com> Date: Wed, 6 May 2020 13:35:30 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit 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 5/6/20 12:30 PM, John Stultz wrote: > On Wed, May 6, 2020 at 9:04 AM Andrew F. Davis wrote: >> On 5/4/20 4:50 AM, Brian Starkey wrote: >>> On Fri, May 01, 2020 at 11:40:16AM -0700, John Stultz wrote: >>>> So the name we expose is the CMA name itself. So with dt it will be >>>> the name of the reserved memory node that the flag property is added >>>> to. >>>> >>> >>> Yeah I'm just wondering if that's "stable" so we can say "the heap >>> will use the node name", or if saying that would cause us a headache >>> in the future. >> >> >> The issue is going to be this causes the node name in DT to become a >> kind of ABI. Right now until we have some userspace lib that enumerates >> the heaps in a stable way programs will hard-code the full heap name, >> which right now would look like: >> >> char *heap = "/dev/dma_heap/dma_heap_mem@89000000"; >> > > If that's what the device chose to export. > Well no "device" exported it, we did mostly automatically using only DT information. When making a DT I don't want to be thinking about how names will break userspace, for instance if node naming guidance is updated do apps suddenly stop working? That worries me a bit. >> Yuk.. we might want to look into exporting heap properties to make them >> searchable based on something other than name here soon. Or this will be >> a mess to cleanup in the future. > > Eh. I don't see this as such an issue. On different systems we have > different device nodes. Some boards have more or fewer NICs, or > various partitions, etc. There has to be some device specific userland > config that determines which partitions are mounted where (this is my > "gralloc is fstab" thesis :) > Oh I agree here, net interface names and /dev/ names have a history of changing, but those did both break a lot of apps. It could be argued they were abusing the API by making assumptions about the names, but we still have old scripts floating assuming "eth0" is going to just work.. So the sooner we get this fstab scheme in place and in practice, the fewer apps in the wild will hard-code names. > I think with the heaps, qualities other than name are going to be > poorly specified or unenumerable, so any generic query interface is > going to fall down there (and be awful to use). > Sure, so this "fstab" style config will have to be a mapping of names (which we will have to make static per heap in kernel) to properties that interest the current users of a system. For now I can only think of cached/uncached, contiguous/sg, and secure/mappable. Then maybe a list of devices that can consume buffers of that variety, should allow for simple constraint matching. I'll need to think on this a bit more as the use-cases show up.. Andrew > thanks > -john >