Received: by 10.192.165.148 with SMTP id m20csp696189imm; Fri, 4 May 2018 05:06:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpag7IlmXWQVGq5kYHt9Nx0DS5KT0trytCo4niUohgU+PcAIL4GkEb3JJpeIvsX87ifZQni X-Received: by 2002:a17:902:2805:: with SMTP id e5-v6mr27959750plb.55.1525435603556; Fri, 04 May 2018 05:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525435603; cv=none; d=google.com; s=arc-20160816; b=VKzXgnUQ0o2TGLnJu6BRgYSDHMIe+uVLc8KSzT2p5dv5UZSK5ZfFH3/3vjOKHsceVI bT715bCNhc3khJt0k3hjLmYy+Tm1C0qsl7ibqp9D55Pfucj3JDBJnd7/1/LK9SBHanrh BCGMJkwxCzAuaRiVCLD1PhL7UhvB440BlFBp1/d5z+AQjYHTBaAYdVsTFLXFM3yGAirV i0DCij1JwRX3rAe0uGz9MMpWjmQ6fytyoJYYrJU/RGHUm7kUwcBOYamdx0jp37jli2ON mO8/GIb/Sw87bbpxIJBUzQrFP0vDjs//3iTwkPPb36lRE2EpPGdFBZ1QhEFutwoU1Kb/ Pw9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:references :in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=oXsAR7XT/hDjPvgbImbegHzsyGDXVDjQnxpPCXe3SzE=; b=yTDhb/rCHKk5iuUSNG9oPuZ8QsLM6y3lm5/QnaxCYh13sACdovn/vmOb+273Ny6x/Y e8++SIpaGjEfopBPBT8xnY4VdeYXYtt6EK4aJTEPynk4zX09QcSnPJIafHE27TVV2EzL uub1dpraA0GojohNDgxt1vqEK2WAvp/8brnygIQmkdYiHDtUpyhYlzBCCbcDstCmnNbf HEhLAdFe5arE3HLDmNHSQV4RrBCZJvb8G7m/2BnyWaNxHTn4lZrEGPDy8VIGAO2gMCzl QLBOAIisHzkqu0+78IZarignkJTltstQGvuRqLO05znMocGiBc6wqKOauxC2qa/sVjC5 Dl8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8-v6si2945948plk.539.2018.05.04.05.06.29; Fri, 04 May 2018 05:06:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751311AbeEDMGM (ORCPT + 99 others); Fri, 4 May 2018 08:06:12 -0400 Received: from mail.bootlin.com ([62.4.15.54]:57515 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751001AbeEDMGK (ORCPT ); Fri, 4 May 2018 08:06:10 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 4668D206A0; Fri, 4 May 2018 14:06:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from aptenodytes (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id C8C1D20376; Fri, 4 May 2018 14:05:57 +0200 (CEST) Message-ID: Subject: Re: [PATCH v2 09/10] ARM: dts: sun7i-a20: Add Video Engine and reserved memory nodes From: Paul Kocialkowski To: Maxime Ripard Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Chen-Yu Tsai , Pawel Osciak , Marek Szyprowski , Kyungmin Park , Hans Verkuil , Sakari Ailus , Philipp Zabel , Arnd Bergmann , Alexandre Courbot , Tomasz Figa Date: Fri, 04 May 2018 14:04:38 +0200 In-Reply-To: <20180504091555.idgtzey53lozj2uh@flea> References: <20180419154124.17512-1-paul.kocialkowski@bootlin.com> <20180419154536.17846-5-paul.kocialkowski@bootlin.com> <20180420073908.nkcbsdxibnzkqski@flea> <82057e2f734137a3902d9313c228b01ceb345ee7.camel@bootlin.com> <20180504084008.h6p4brari3xrbv6l@flea> <20180504091555.idgtzey53lozj2uh@flea> Organization: Bootlin Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-VN/vLUca0O9ClQU/OSCc" X-Mailer: Evolution 3.28.1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-VN/vLUca0O9ClQU/OSCc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Fri, 2018-05-04 at 11:15 +0200, Maxime Ripard wrote: > On Fri, May 04, 2018 at 10:47:44AM +0200, Paul Kocialkowski wrote: > > > > > > + reg =3D <0x01c0e000 0x1000>; > > > > > > + memory-region =3D <&ve_memory>; > > > > >=20 > > > > > Since you made the CMA region the default one, you don't need > > > > > to > > > > > tie > > > > > it to that device in particular (and you can drop it being > > > > > mandatory > > > > > from your binding as well). > > > >=20 > > > > What if another driver (or the system) claims memory from that > > > > zone > > > > and > > > > that the reserved memory ends up not being available for the VPU > > > > anymore? > > > >=20 > > > > Acccording to the reserved-memory documentation, the reusable > > > > property > > > > (that we need for dmabuf) puts a limitation that the device > > > > driver > > > > owning the region must be able to reclaim it back. > > > >=20 > > > > How does that work out if the CMA region is not tied to a driver > > > > in > > > > particular? > > >=20 > > > I'm not sure to get what you're saying. You have the property > > > linux,cma-default in your reserved region, so the behaviour you > > > described is what you explicitly asked for. > >=20 > > My point is that I don't see how the driver can claim back (part of) > > the > > reserved area if the area is not explicitly attached to it. > >=20 > > Or is that mechanism made in a way that all drivers wishing to use > > the > > reserved memory area can claim it back from the system, but there is > > no > > priority (other than first-come first-served) for which drivers > > claims > > it back in case two want to use the same reserved region (in a > > scenario > > where there isn't enough memory to allow both drivers)? >=20 > This is indeed what happens. Reusable is to let the system use the > reserved memory for things like caches that can easily be dropped when > a driver wants to use the memory in that reserved area. Once that > memory has been allocated, there's no claiming back, unless that > memory segment was freed of course. Thanks for the clarification. So in our case, perhaps the best fit would be to make that area the default CMA pool so that we can be ensured that the whole 96 MiB is available for the VPU and that no other consumer of CMA will use it? Cheers, --=20 Paul Kocialkowski, Bootlin (formerly Free Electrons) Embedded Linux and kernel engineering https://bootlin.com --=-VN/vLUca0O9ClQU/OSCc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAlrsTFYACgkQ3cLmz3+f v9FnMwgAmeAIyqwKlBcBjCF30yfm3n3JV88FTCP2y4bo//S2LercCFEdBY+IU5mF MfO7Sc++z5fPVVSSZ/eSYYvqscU6mjd7XIyVJI6GDFitk+EnsEwdM8nZ+sHjuqxb gB7cBjkblXlKX+xj2hFLtGiNQnipWv4AmKVPf6IBYWqKRJM8l6IMO1zlL/ckHHEE OqohpSYmTsPtzzAbYQLgETMpniN/OJyn1puZeHLC18kPTvQRHHs/h8d8qzprvcv1 x0RvKr2zD5imwmDY9hRWidwzirOLGU6LYbam/8vReVYb7UFW303xALLjMdtGHb0p pzSWsNkSk8a8yEwdc5FfY+Pw2eDKWQ== =S2C7 -----END PGP SIGNATURE----- --=-VN/vLUca0O9ClQU/OSCc--