Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2367697ybb; Fri, 27 Mar 2020 04:18:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtE8uk6PUGApdfeO4VK5LwugHnwvukM5UShuW1+ICluUFetcDje1jqxKSTuOI4+Tt7jvkb+ X-Received: by 2002:a9d:ac5:: with SMTP id 63mr10189341otq.239.1585307935084; Fri, 27 Mar 2020 04:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585307935; cv=none; d=google.com; s=arc-20160816; b=YVLS2MxNTepZ/sMINyrTj6omd0dPmhANwMVrFiZ8JDYpJ7cloGuLClFsm5KamKXEeS OjP62C1wqNZq2a5rHWuBiB9e3XE/oepS/ocf0KAIF2A+yyoP3xuY72Rc2f/Q3uqnr9Bk 8UKh1pc24h6gq+snCsXWRuy0wcw5SkBPKpC37s3K6qe1Oqh/g9S5i639Cq8kQJ2dUQfQ qtX6RdrSgOvuytHkXU9SwKsT7FAqNN6D5x27YeuAdbfOXFcwt6p82RN57ftfWXpmEKz5 pGtZtEzfwhc1DFOqyt+QWzV33li2/OVle7tba5vuZtxz0B91UpZIHajAY5PpDJVyJeMt fPnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=Id+T0zptNw0CWyreFm7I8BxOe77VbVzyrNQytJGX3lQ=; b=nekL4Ut9UKDYxtzFXm9Q2ilMo87vEUrhiwWNCFwnjqVBXX78hVglMS1Gpu1zhv0Uri iocEhExpbO6jgTNRmGyfA9oNnTY1lQ1p4dBn88N5o/tP02SVEIEd9KOpmFdvI86hoS2B 7acfzl4Lh9EuNnOxOo8+oDpdYeX2hcE7M//ItT7fnKyVM4C4xIdf9ayo2ej/lHDylxm0 Y1wqn8a0eRYVPfRV0orew6afi2IVYusgiH9ll2w+wNI2T9MPJHkoP14GaRZIyfdP6+PD PmD7dHI3BlPyUNOmyA3Nbi3w7WAfyxMIE5sOASMi69xw0iWVK0alFJm6BSy8jckH0Ee7 2+dQ== 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 q4si1144166ooo.92.2020.03.27.04.18.41; Fri, 27 Mar 2020 04:18:55 -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 S1726515AbgC0LSE (ORCPT + 99 others); Fri, 27 Mar 2020 07:18:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:36088 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbgC0LSD (ORCPT ); Fri, 27 Mar 2020 07:18:03 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3DA58AED2; Fri, 27 Mar 2020 11:18:01 +0000 (UTC) Message-ID: <41607c9fc20afc6554d697daa7782de1e3281db7.camel@suse.de> Subject: Re: [PATCH] arm64: mm: make CONFIG_ZONE_DMA configurable without EXPERT From: Nicolas Saenz Julienne To: Peng Fan , Catalin Marinas Cc: "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , Robin Murphy Date: Fri, 27 Mar 2020 12:17:59 +0100 In-Reply-To: References: <1583844526-24229-1-git-send-email-peng.fan@nxp.com> <20200324174134.GH3901@mbp> <20200325101652.GJ3901@mbp> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-gybhYNbk/O36qUlXjYkF" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-gybhYNbk/O36qUlXjYkF Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Peng, On Wed, 2020-03-25 at 12:30 +0000, Peng Fan wrote: > > > > I see a few potential options: > > > >=20 > > > > a) Ensure the CMA is contained within a single zone. > > >=20 > > > This will break legacy dts with new version kernel. > > >=20 > > > > How large is it in your case? > > >=20 > > > It is 1GB > > >=20 > > > > Is it allocated by the kernel dynamically or a fixed start set by > > > > the boot loader? > > >=20 > > > We use alloc-ranges and size in kernel dts. > > >=20 > > > But there is only 2GB DRAM in the board. > >=20 > > So I guess without changing the dts, option (a) doesn't really work. > >=20 > > > > b) Change the CMA allocator to allow spanning multiple zones (last = time > > > > I looked it wasn't trivial since it relied on some per-zone lock= ). I like this as a solution, ultimately why should CMA be linked to a specifi= c zone. Also, crossing the ZONE_DMA/ZONE_DMA32 boundary shouldn't be an issue since we already default to ZONE_DMA32 as the default area for CMA. That said, easier said than done. > > > > c) Make ZONE_DMA dynamic on arm64 and only enable it if RPi4. > > >=20 > > > Option c seems a bit easier to me :) > > >=20 > > > I will try to explore both, but if you have time to help, that would > > > be appreciated. > >=20 > > I don't have time but option (c) was already discussed and there are pa= tches > > from Nicolas on the list: > >=20 > > https://eur01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Flor= e.ke > > rnel.org%2Flinux-arm-kernel%2F20190820145821.27214-5-nsaenzjulienne% > > 40suse.de%2F&data=3D02%7C01%7Cpeng.fan%40nxp.com%7C6403ddf37 > > 89b452ae5ee08d7d0a5a659%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0 > > %7C0%7C637207282191026738&sdata=3Dt2cZ9HTCcRuaL9RO4kD%2BzN > > 2n4VqM%2F66zYNZIOComCVs%3D&reserved=3D0 > >=20 > > The above series was checking whether the platform is RPi4 and limiting= the > > ZONE_DMA size to 1GB (otherwise 4GB with ZONE_DMA32 empty). We > > ended up with a static 1GB for ZONE_DMA but we missed the fact that it = may > > break existing platforms. >=20 > Thanks for the information. I'll check the patchset and work out somethin= g > proper to fix the issue I met. Just an FYI, I'm follwing the conversation, and will try to look into as so= on as I get some free time. In the meantime if you want me to test/review anyt= hing on the Raspberry Pi, I'll be happy to. Regards, Nicolas --=-gybhYNbk/O36qUlXjYkF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl594OcACgkQlfZmHno8 x/7e1gf/UtbHfYf9EO36liu7HDv+5r0zCa19nQ64rn/FN46GJbl++HyRBerEwig7 L8pNRHFamul6BolfWHLJE1e4gSBAOlt5oJph7vK0/cGXoownZHGfjy4ygBgbj2Zc Tf8YTBV1bTWWSPEjsdBbjNUMrxqtVkr+13NXs5yb4hxnKX7OAFf9YLyNOiTSk3yU XgMIgwWuMQZ8FR290WAghA/wmBUfTEVJJ/rbi34xlQnBGaUZpwqR87SE/hGoNpoW qv4kci3ttdJ3yX7IvTqnsYEJ7ThMbYmhwH8Tk7tuKi2C/zqTpzgajvfDtA6MDMCN 87b41meteMRHPKf+eqhUU2s+meQCYA== =hASN -----END PGP SIGNATURE----- --=-gybhYNbk/O36qUlXjYkF--