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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E99B3C19759 for ; Thu, 1 Aug 2019 16:00:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB20F20B7C for ; Thu, 1 Aug 2019 16:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732510AbfHAQAa (ORCPT ); Thu, 1 Aug 2019 12:00:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:46452 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729117AbfHAQAa (ORCPT ); Thu, 1 Aug 2019 12:00:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7FF1DAC2E; Thu, 1 Aug 2019 16:00:27 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable From: Nicolas Saenz Julienne To: Christoph Hellwig Cc: catalin.marinas@arm.com, wahrenst@gmx.net, marc.zyngier@arm.com, Robin Murphy , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, Marek Szyprowski , phill@raspberryi.org, f.fainelli@gmail.com, will@kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, eric@anholt.net, mbrugger@suse.com, akpm@linux-foundation.org, frowand.list@gmail.com, linux-rpi-kernel@lists.infradead.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org Date: Thu, 01 Aug 2019 17:59:34 +0200 In-Reply-To: <20190801140452.GB23435@lst.de> References: <20190731154752.16557-1-nsaenzjulienne@suse.de> <20190731154752.16557-7-nsaenzjulienne@suse.de> <20190801140452.GB23435@lst.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-1xpVXG9aO5tI8LW1PkIr" User-Agent: Evolution 3.32.4 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-1xpVXG9aO5tI8LW1PkIr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, thanks for the review. On Thu, 2019-08-01 at 16:04 +0200, Christoph Hellwig wrote: > A few nitpicks, otherwise this looks great: >=20 > > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > > * everything else. GFP_DMA32 page allocations automatically fall back= to > > * ZONE_DMA. > > * > > - * By using 31-bit unconditionally, we can exploit ARCH_ZONE_DMA_BITS = to > > + * By using 31-bit unconditionally, we can exploit arch_zone_dma_bits = to > > * inform the generic DMA mapping code. 32-bit only devices (if not > > handled > > * by an IOMMU anyway) will take a first dip into ZONE_NORMAL and get > > * otherwise served by ZONE_DMA. > > @@ -237,9 +238,18 @@ void __init paging_init(void) > > printk(KERN_DEBUG "Memory hole size: %ldMB\n", > > (long int)((top_of_ram - total_ram) >> 20)); > > =20 > > + /* > > + * Allow 30-bit DMA for very limited Broadcom wifi chips on many > > + * powerbooks. > > + */ > > + if (IS_ENABLED(CONFIG_PPC32)) > > + arch_zone_dma_bits =3D 30; > > + else > > + arch_zone_dma_bits =3D 31; > > + >=20 > So the above unconditionally comment obviously isn't true any more, and > Ben also said for the recent ppc32 hack he'd prefer dynamic detection. >=20 > Maybe Ben and or other ppc folks can chime in an add a patch to the serie= s > to sort this out now that we have a dynamic ZONE_DMA threshold? Noted, for now I'll remove the comment. > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > > index 59bdceea3737..40dfc9b4ee4c 100644 > > --- a/kernel/dma/direct.c > > +++ b/kernel/dma/direct.c > > @@ -19,9 +19,7 @@ > > * Most architectures use ZONE_DMA for the first 16 Megabytes, but > > * some use it for entirely different regions: > > */ > > -#ifndef ARCH_ZONE_DMA_BITS > > -#define ARCH_ZONE_DMA_BITS 24 > > -#endif > > +unsigned int arch_zone_dma_bits __ro_after_init =3D 24; >=20 > I'd prefer to drop the arch_ prefix and just calls this zone_dma_bits. > In the long run we really need to find a way to just automatically set > this from the meminit code, but that is out of scope for this series. > For now can you please just update the comment above to say something > like: >=20 > /* > * Most architectures use ZONE_DMA for the first 16 Megabytes, but some u= se it > * it for entirely different regions. In that case the arch code needs t= o > * override the variable below for dma-direct to work properly. > */ Ok perfect. --=-1xpVXG9aO5tI8LW1PkIr 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/4FAl1DDGYACgkQlfZmHno8 x/7w9wgAsuuhgVK1nlC7WgrB2sfSYqL6HTJlDfkLJ2RMgzu/WSw4RJsje86on5R9 NmRSTVntXnCdpTNiKcSEKP7MnrVtMh2TtopfTOCvgho/uDJsc4DPAqZaLHO4quzo ZfimsWkcpC6n/E8ybEcew+6U7BIyqJPtqxgdkXz98gLQ1NK1wJU2x0Gt+KXT5a/0 hR3hA3whz8yIe4hwQTEiAzX/LnSP8+Yp+g1LLFjYveqt2RUbfC/udykYkLS7LdoO SJ6j5S/1jRpvusBjENkY3PQiRGrhfRnT4qxVSdpkK/rMG6pLMW4l9YjfbQCLOFhn 8qxZKNifDs1KxpZjExjd4Lisum4nhw== =nw8i -----END PGP SIGNATURE----- --=-1xpVXG9aO5tI8LW1PkIr-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Saenz Julienne Subject: Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable Date: Thu, 01 Aug 2019 17:59:34 +0200 Message-ID: References: <20190731154752.16557-1-nsaenzjulienne@suse.de> <20190731154752.16557-7-nsaenzjulienne@suse.de> <20190801140452.GB23435@lst.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-1xpVXG9aO5tI8LW1PkIr" Return-path: In-Reply-To: <20190801140452.GB23435@lst.de> Sender: linux-kernel-owner@vger.kernel.org To: Christoph Hellwig Cc: catalin.marinas@arm.com, wahrenst@gmx.net, marc.zyngier@arm.com, Robin Murphy , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, Marek Szyprowski , phill@raspberryi.org, f.fainelli@gmail.com, will@kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, eric@anholt.net, mbrugger@suse.com, akpm@linux-foundation.org, frowand.list@gmail.com, linux-rpi-kernel@lists.infradead.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linuxppc-dev@lists.oz List-Id: devicetree@vger.kernel.org --=-1xpVXG9aO5tI8LW1PkIr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, thanks for the review. On Thu, 2019-08-01 at 16:04 +0200, Christoph Hellwig wrote: > A few nitpicks, otherwise this looks great: >=20 > > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > > * everything else. GFP_DMA32 page allocations automatically fall back= to > > * ZONE_DMA. > > * > > - * By using 31-bit unconditionally, we can exploit ARCH_ZONE_DMA_BITS = to > > + * By using 31-bit unconditionally, we can exploit arch_zone_dma_bits = to > > * inform the generic DMA mapping code. 32-bit only devices (if not > > handled > > * by an IOMMU anyway) will take a first dip into ZONE_NORMAL and get > > * otherwise served by ZONE_DMA. > > @@ -237,9 +238,18 @@ void __init paging_init(void) > > printk(KERN_DEBUG "Memory hole size: %ldMB\n", > > (long int)((top_of_ram - total_ram) >> 20)); > > =20 > > + /* > > + * Allow 30-bit DMA for very limited Broadcom wifi chips on many > > + * powerbooks. > > + */ > > + if (IS_ENABLED(CONFIG_PPC32)) > > + arch_zone_dma_bits =3D 30; > > + else > > + arch_zone_dma_bits =3D 31; > > + >=20 > So the above unconditionally comment obviously isn't true any more, and > Ben also said for the recent ppc32 hack he'd prefer dynamic detection. >=20 > Maybe Ben and or other ppc folks can chime in an add a patch to the serie= s > to sort this out now that we have a dynamic ZONE_DMA threshold? Noted, for now I'll remove the comment. > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > > index 59bdceea3737..40dfc9b4ee4c 100644 > > --- a/kernel/dma/direct.c > > +++ b/kernel/dma/direct.c > > @@ -19,9 +19,7 @@ > > * Most architectures use ZONE_DMA for the first 16 Megabytes, but > > * some use it for entirely different regions: > > */ > > -#ifndef ARCH_ZONE_DMA_BITS > > -#define ARCH_ZONE_DMA_BITS 24 > > -#endif > > +unsigned int arch_zone_dma_bits __ro_after_init =3D 24; >=20 > I'd prefer to drop the arch_ prefix and just calls this zone_dma_bits. > In the long run we really need to find a way to just automatically set > this from the meminit code, but that is out of scope for this series. > For now can you please just update the comment above to say something > like: >=20 > /* > * Most architectures use ZONE_DMA for the first 16 Megabytes, but some u= se it > * it for entirely different regions. In that case the arch code needs t= o > * override the variable below for dma-direct to work properly. > */ Ok perfect. --=-1xpVXG9aO5tI8LW1PkIr 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/4FAl1DDGYACgkQlfZmHno8 x/7w9wgAsuuhgVK1nlC7WgrB2sfSYqL6HTJlDfkLJ2RMgzu/WSw4RJsje86on5R9 NmRSTVntXnCdpTNiKcSEKP7MnrVtMh2TtopfTOCvgho/uDJsc4DPAqZaLHO4quzo ZfimsWkcpC6n/E8ybEcew+6U7BIyqJPtqxgdkXz98gLQ1NK1wJU2x0Gt+KXT5a/0 hR3hA3whz8yIe4hwQTEiAzX/LnSP8+Yp+g1LLFjYveqt2RUbfC/udykYkLS7LdoO SJ6j5S/1jRpvusBjENkY3PQiRGrhfRnT4qxVSdpkK/rMG6pLMW4l9YjfbQCLOFhn 8qxZKNifDs1KxpZjExjd4Lisum4nhw== =nw8i -----END PGP SIGNATURE----- --=-1xpVXG9aO5tI8LW1PkIr-- 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E44ABC433FF for ; Thu, 1 Aug 2019 16:00:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B06F4206B8 for ; Thu, 1 Aug 2019 16:00:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B06F4206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4687B8E002F; Thu, 1 Aug 2019 12:00:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F5A88E0001; Thu, 1 Aug 2019 12:00:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BA2C8E002F; Thu, 1 Aug 2019 12:00:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id CF5EB8E0001 for ; Thu, 1 Aug 2019 12:00:29 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id w25so45148285edu.11 for ; Thu, 01 Aug 2019 09:00:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:message-id :subject:from:to:cc:date:in-reply-to:references:user-agent :mime-version; bh=1b/wt1U/lG3pg/LMYilipFpK6VhaOebkoQ+34IMQoiQ=; b=XhYgE+5R30CcHHOQTMtWgIIvZwfrrkLlU6GXISOkjIOIYOKR/u62duGgQ1GfRV+/SI Z5aXPwscHW5Mw9RCN4tNARUtwbzEBp4sol36nSMyV2yRlyVon5/QA2rGapUqKmgXw/7s R5RCnRN7vAikEzgvyIlYyn1MU8S4P7WDWYQzxm1s+1ms7JLFpqIM1GJ2vKbt4f1SWYHF hceHY5FNAvXfLdElbIvyQ5QQb1CE4krYt+eyhhwB4xnGGYJCNGPLUs8wmltVq8QcljSL HlOyGkfNfebMPzRunkdTCT5geBhn1hnjVDPhA/u1p3nVShf291KoqPoz9L/wC7Q7mSf7 8fFA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=nsaenzjulienne@suse.de X-Gm-Message-State: APjAAAXeWdF3rKOkDA5oMnWnZFSmF+HW8/qLScLqcZmoMULkz8L9mWR1 4lgY7n3yyB+Z3PcPFvxDrwS0pDQ0hlHqiE29t2QaiB4leqVdqgQzuFeTolsBT4KZFv9Uqe0j5In iEfK9byveBhnd45M+kwEXWRWH1VmvAXl8UJUkq65KsRQ7a11si0DMfS8TZHe+EefXJA== X-Received: by 2002:a17:906:8591:: with SMTP id v17mr100150332ejx.244.1564675229402; Thu, 01 Aug 2019 09:00:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyA/ACUlVczI36XSWHagapMU+nXJL8dD6MllVYOCMlJexV9ABCX6O+0aQlpQ+OiRBUAA4TQ X-Received: by 2002:a17:906:8591:: with SMTP id v17mr100150237ejx.244.1564675228541; Thu, 01 Aug 2019 09:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564675228; cv=none; d=google.com; s=arc-20160816; b=yF59kaEpcQhc+0TPExQMXuKpXIjlSkGvydk164er+PLlKnDgQRQ94/BaTalEj5ZolI TYTTXtAca5C2F8CikNGUPN3OYNHjcKbVd/ECGWT+Ody5FFqVxYNXDlMULTrrz5D5cgV0 qCxOdWKItB2e965gggKns1yAQ5p4qqxKOucJvqmAp1ZEiZVzHUoqPGt0lMUrlEauCRfp e55Wo47Wb9fgF1M//5l72YOuNwel7aWPOkKkyzlCXvwUSWCA7CO4QG4mJnfli+DL/gA/ vJiduEKC1a0oboYgJqfXrUC7kXD6Noimx1UTdUDki/13aS4O1Fhd3NbmjBmjEJsslW8f 5NZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id; bh=1b/wt1U/lG3pg/LMYilipFpK6VhaOebkoQ+34IMQoiQ=; b=l6CVOaHToVv1Xa5qTY3N0B55DytfFlarsVMiM0n94Fh1VjWtnJZPCHUCxmDrNmkgx9 dVP/LdfBYaWZQALFS9X0keO3IM3ZFs+JCR2eKioZZoL7Y2I1CqJfsYF2djEdHUgwh3ne LyqpssjIcAo0CQgUQC4LfVviMAjOSqr/9Ou7nK/K3rjl1yuecEDd5DDpIWqr9q1sxmbC PN47ELqIMnJv+gkM6WLNaPUw4F/DKBUbdi6Bgo3IQqGoaTcZXj2KgVIwBfBKykXxLGf9 +Tme1JHVW8SueBYWrEGHOep+v6M+794rSJMiiTIeLvZTeQ9XY93jVZ6HgAOzW+HZdhsZ Nclg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=nsaenzjulienne@suse.de Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id b21si22013916edw.264.2019.08.01.09.00.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 09:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) client-ip=195.135.220.15; Authentication-Results: mx.google.com; spf=pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=nsaenzjulienne@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7FF1DAC2E; Thu, 1 Aug 2019 16:00:27 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable From: Nicolas Saenz Julienne To: Christoph Hellwig Cc: catalin.marinas@arm.com, wahrenst@gmx.net, marc.zyngier@arm.com, Robin Murphy , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, Marek Szyprowski , phill@raspberryi.org, f.fainelli@gmail.com, will@kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, eric@anholt.net, mbrugger@suse.com, akpm@linux-foundation.org, frowand.list@gmail.com, linux-rpi-kernel@lists.infradead.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org Date: Thu, 01 Aug 2019 17:59:34 +0200 In-Reply-To: <20190801140452.GB23435@lst.de> References: <20190731154752.16557-1-nsaenzjulienne@suse.de> <20190731154752.16557-7-nsaenzjulienne@suse.de> <20190801140452.GB23435@lst.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-1xpVXG9aO5tI8LW1PkIr" User-Agent: Evolution 3.32.4 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --=-1xpVXG9aO5tI8LW1PkIr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, thanks for the review. On Thu, 2019-08-01 at 16:04 +0200, Christoph Hellwig wrote: > A few nitpicks, otherwise this looks great: >=20 > > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > > * everything else. GFP_DMA32 page allocations automatically fall back= to > > * ZONE_DMA. > > * > > - * By using 31-bit unconditionally, we can exploit ARCH_ZONE_DMA_BITS = to > > + * By using 31-bit unconditionally, we can exploit arch_zone_dma_bits = to > > * inform the generic DMA mapping code. 32-bit only devices (if not > > handled > > * by an IOMMU anyway) will take a first dip into ZONE_NORMAL and get > > * otherwise served by ZONE_DMA. > > @@ -237,9 +238,18 @@ void __init paging_init(void) > > printk(KERN_DEBUG "Memory hole size: %ldMB\n", > > (long int)((top_of_ram - total_ram) >> 20)); > > =20 > > + /* > > + * Allow 30-bit DMA for very limited Broadcom wifi chips on many > > + * powerbooks. > > + */ > > + if (IS_ENABLED(CONFIG_PPC32)) > > + arch_zone_dma_bits =3D 30; > > + else > > + arch_zone_dma_bits =3D 31; > > + >=20 > So the above unconditionally comment obviously isn't true any more, and > Ben also said for the recent ppc32 hack he'd prefer dynamic detection. >=20 > Maybe Ben and or other ppc folks can chime in an add a patch to the serie= s > to sort this out now that we have a dynamic ZONE_DMA threshold? Noted, for now I'll remove the comment. > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > > index 59bdceea3737..40dfc9b4ee4c 100644 > > --- a/kernel/dma/direct.c > > +++ b/kernel/dma/direct.c > > @@ -19,9 +19,7 @@ > > * Most architectures use ZONE_DMA for the first 16 Megabytes, but > > * some use it for entirely different regions: > > */ > > -#ifndef ARCH_ZONE_DMA_BITS > > -#define ARCH_ZONE_DMA_BITS 24 > > -#endif > > +unsigned int arch_zone_dma_bits __ro_after_init =3D 24; >=20 > I'd prefer to drop the arch_ prefix and just calls this zone_dma_bits. > In the long run we really need to find a way to just automatically set > this from the meminit code, but that is out of scope for this series. > For now can you please just update the comment above to say something > like: >=20 > /* > * Most architectures use ZONE_DMA for the first 16 Megabytes, but some u= se it > * it for entirely different regions. In that case the arch code needs t= o > * override the variable below for dma-direct to work properly. > */ Ok perfect. --=-1xpVXG9aO5tI8LW1PkIr 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/4FAl1DDGYACgkQlfZmHno8 x/7w9wgAsuuhgVK1nlC7WgrB2sfSYqL6HTJlDfkLJ2RMgzu/WSw4RJsje86on5R9 NmRSTVntXnCdpTNiKcSEKP7MnrVtMh2TtopfTOCvgho/uDJsc4DPAqZaLHO4quzo ZfimsWkcpC6n/E8ybEcew+6U7BIyqJPtqxgdkXz98gLQ1NK1wJU2x0Gt+KXT5a/0 hR3hA3whz8yIe4hwQTEiAzX/LnSP8+Yp+g1LLFjYveqt2RUbfC/udykYkLS7LdoO SJ6j5S/1jRpvusBjENkY3PQiRGrhfRnT4qxVSdpkK/rMG6pLMW4l9YjfbQCLOFhn 8qxZKNifDs1KxpZjExjd4Lisum4nhw== =nw8i -----END PGP SIGNATURE----- --=-1xpVXG9aO5tI8LW1PkIr-- 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 CE407C19759 for ; Thu, 1 Aug 2019 16:02:59 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DE8D206B8 for ; Thu, 1 Aug 2019 16:02:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DE8D206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45zw736XhVzDqhl for ; Fri, 2 Aug 2019 02:02:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=suse.de (client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=nsaenzjulienne@suse.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45zw4K0xzJzDqHb for ; Fri, 2 Aug 2019 02:00:31 +1000 (AEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7FF1DAC2E; Thu, 1 Aug 2019 16:00:27 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable From: Nicolas Saenz Julienne To: Christoph Hellwig Date: Thu, 01 Aug 2019 17:59:34 +0200 In-Reply-To: <20190801140452.GB23435@lst.de> References: <20190731154752.16557-1-nsaenzjulienne@suse.de> <20190731154752.16557-7-nsaenzjulienne@suse.de> <20190801140452.GB23435@lst.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-1xpVXG9aO5tI8LW1PkIr" User-Agent: Evolution 3.32.4 MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Carstens , eric@anholt.net, Paul Mackerras , will@kernel.org, Marek Szyprowski , phill@raspberryi.org, linux-s390@vger.kernel.org, f.fainelli@gmail.com, frowand.list@gmail.com, Christian Borntraeger , catalin.marinas@arm.com, devicetree@vger.kernel.org, Vasily Gorbik , marc.zyngier@arm.com, robh+dt@kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, mbrugger@suse.com, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, wahrenst@gmx.net, akpm@linux-foundation.org, Robin Murphy Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" --=-1xpVXG9aO5tI8LW1PkIr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, thanks for the review. On Thu, 2019-08-01 at 16:04 +0200, Christoph Hellwig wrote: > A few nitpicks, otherwise this looks great: >=20 > > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > > * everything else. GFP_DMA32 page allocations automatically fall back= to > > * ZONE_DMA. > > * > > - * By using 31-bit unconditionally, we can exploit ARCH_ZONE_DMA_BITS = to > > + * By using 31-bit unconditionally, we can exploit arch_zone_dma_bits = to > > * inform the generic DMA mapping code. 32-bit only devices (if not > > handled > > * by an IOMMU anyway) will take a first dip into ZONE_NORMAL and get > > * otherwise served by ZONE_DMA. > > @@ -237,9 +238,18 @@ void __init paging_init(void) > > printk(KERN_DEBUG "Memory hole size: %ldMB\n", > > (long int)((top_of_ram - total_ram) >> 20)); > > =20 > > + /* > > + * Allow 30-bit DMA for very limited Broadcom wifi chips on many > > + * powerbooks. > > + */ > > + if (IS_ENABLED(CONFIG_PPC32)) > > + arch_zone_dma_bits =3D 30; > > + else > > + arch_zone_dma_bits =3D 31; > > + >=20 > So the above unconditionally comment obviously isn't true any more, and > Ben also said for the recent ppc32 hack he'd prefer dynamic detection. >=20 > Maybe Ben and or other ppc folks can chime in an add a patch to the serie= s > to sort this out now that we have a dynamic ZONE_DMA threshold? Noted, for now I'll remove the comment. > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > > index 59bdceea3737..40dfc9b4ee4c 100644 > > --- a/kernel/dma/direct.c > > +++ b/kernel/dma/direct.c > > @@ -19,9 +19,7 @@ > > * Most architectures use ZONE_DMA for the first 16 Megabytes, but > > * some use it for entirely different regions: > > */ > > -#ifndef ARCH_ZONE_DMA_BITS > > -#define ARCH_ZONE_DMA_BITS 24 > > -#endif > > +unsigned int arch_zone_dma_bits __ro_after_init =3D 24; >=20 > I'd prefer to drop the arch_ prefix and just calls this zone_dma_bits. > In the long run we really need to find a way to just automatically set > this from the meminit code, but that is out of scope for this series. > For now can you please just update the comment above to say something > like: >=20 > /* > * Most architectures use ZONE_DMA for the first 16 Megabytes, but some u= se it > * it for entirely different regions. In that case the arch code needs t= o > * override the variable below for dma-direct to work properly. > */ Ok perfect. --=-1xpVXG9aO5tI8LW1PkIr 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/4FAl1DDGYACgkQlfZmHno8 x/7w9wgAsuuhgVK1nlC7WgrB2sfSYqL6HTJlDfkLJ2RMgzu/WSw4RJsje86on5R9 NmRSTVntXnCdpTNiKcSEKP7MnrVtMh2TtopfTOCvgho/uDJsc4DPAqZaLHO4quzo ZfimsWkcpC6n/E8ybEcew+6U7BIyqJPtqxgdkXz98gLQ1NK1wJU2x0Gt+KXT5a/0 hR3hA3whz8yIe4hwQTEiAzX/LnSP8+Yp+g1LLFjYveqt2RUbfC/udykYkLS7LdoO SJ6j5S/1jRpvusBjENkY3PQiRGrhfRnT4qxVSdpkK/rMG6pLMW4l9YjfbQCLOFhn 8qxZKNifDs1KxpZjExjd4Lisum4nhw== =nw8i -----END PGP SIGNATURE----- --=-1xpVXG9aO5tI8LW1PkIr-- 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 0CC09C433FF for ; Thu, 1 Aug 2019 16:01:02 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD0C62087E for ; Thu, 1 Aug 2019 16:01:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD0C62087E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C5A7C8987; Thu, 1 Aug 2019 16:01:01 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 835A26DA7 for ; Thu, 1 Aug 2019 16:00:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B4C7B8B3 for ; Thu, 1 Aug 2019 16:00:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7FF1DAC2E; Thu, 1 Aug 2019 16:00:27 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable From: Nicolas Saenz Julienne To: Christoph Hellwig Date: Thu, 01 Aug 2019 17:59:34 +0200 In-Reply-To: <20190801140452.GB23435@lst.de> References: <20190731154752.16557-1-nsaenzjulienne@suse.de> <20190731154752.16557-7-nsaenzjulienne@suse.de> <20190801140452.GB23435@lst.de> User-Agent: Evolution 3.32.4 MIME-Version: 1.0 Cc: Benjamin Herrenschmidt , Heiko Carstens , eric@anholt.net, Paul Mackerras , will@kernel.org, phill@raspberryi.org, linux-s390@vger.kernel.org, f.fainelli@gmail.com, frowand.list@gmail.com, Michael Ellerman , Christian Borntraeger , catalin.marinas@arm.com, devicetree@vger.kernel.org, Vasily Gorbik , marc.zyngier@arm.com, robh+dt@kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, mbrugger@suse.com, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, wahrenst@gmx.net, akpm@linux-foundation.org, Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3404404349131040559==" Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org --===============3404404349131040559== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-1xpVXG9aO5tI8LW1PkIr" --=-1xpVXG9aO5tI8LW1PkIr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, thanks for the review. On Thu, 2019-08-01 at 16:04 +0200, Christoph Hellwig wrote: > A few nitpicks, otherwise this looks great: >=20 > > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > > * everything else. GFP_DMA32 page allocations automatically fall back= to > > * ZONE_DMA. > > * > > - * By using 31-bit unconditionally, we can exploit ARCH_ZONE_DMA_BITS = to > > + * By using 31-bit unconditionally, we can exploit arch_zone_dma_bits = to > > * inform the generic DMA mapping code. 32-bit only devices (if not > > handled > > * by an IOMMU anyway) will take a first dip into ZONE_NORMAL and get > > * otherwise served by ZONE_DMA. > > @@ -237,9 +238,18 @@ void __init paging_init(void) > > printk(KERN_DEBUG "Memory hole size: %ldMB\n", > > (long int)((top_of_ram - total_ram) >> 20)); > > =20 > > + /* > > + * Allow 30-bit DMA for very limited Broadcom wifi chips on many > > + * powerbooks. > > + */ > > + if (IS_ENABLED(CONFIG_PPC32)) > > + arch_zone_dma_bits =3D 30; > > + else > > + arch_zone_dma_bits =3D 31; > > + >=20 > So the above unconditionally comment obviously isn't true any more, and > Ben also said for the recent ppc32 hack he'd prefer dynamic detection. >=20 > Maybe Ben and or other ppc folks can chime in an add a patch to the serie= s > to sort this out now that we have a dynamic ZONE_DMA threshold? Noted, for now I'll remove the comment. > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > > index 59bdceea3737..40dfc9b4ee4c 100644 > > --- a/kernel/dma/direct.c > > +++ b/kernel/dma/direct.c > > @@ -19,9 +19,7 @@ > > * Most architectures use ZONE_DMA for the first 16 Megabytes, but > > * some use it for entirely different regions: > > */ > > -#ifndef ARCH_ZONE_DMA_BITS > > -#define ARCH_ZONE_DMA_BITS 24 > > -#endif > > +unsigned int arch_zone_dma_bits __ro_after_init =3D 24; >=20 > I'd prefer to drop the arch_ prefix and just calls this zone_dma_bits. > In the long run we really need to find a way to just automatically set > this from the meminit code, but that is out of scope for this series. > For now can you please just update the comment above to say something > like: >=20 > /* > * Most architectures use ZONE_DMA for the first 16 Megabytes, but some u= se it > * it for entirely different regions. In that case the arch code needs t= o > * override the variable below for dma-direct to work properly. > */ Ok perfect. --=-1xpVXG9aO5tI8LW1PkIr 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/4FAl1DDGYACgkQlfZmHno8 x/7w9wgAsuuhgVK1nlC7WgrB2sfSYqL6HTJlDfkLJ2RMgzu/WSw4RJsje86on5R9 NmRSTVntXnCdpTNiKcSEKP7MnrVtMh2TtopfTOCvgho/uDJsc4DPAqZaLHO4quzo ZfimsWkcpC6n/E8ybEcew+6U7BIyqJPtqxgdkXz98gLQ1NK1wJU2x0Gt+KXT5a/0 hR3hA3whz8yIe4hwQTEiAzX/LnSP8+Yp+g1LLFjYveqt2RUbfC/udykYkLS7LdoO SJ6j5S/1jRpvusBjENkY3PQiRGrhfRnT4qxVSdpkK/rMG6pLMW4l9YjfbQCLOFhn 8qxZKNifDs1KxpZjExjd4Lisum4nhw== =nw8i -----END PGP SIGNATURE----- --=-1xpVXG9aO5tI8LW1PkIr-- --===============3404404349131040559== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu --===============3404404349131040559==-- 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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3082FC433FF for ; Thu, 1 Aug 2019 16:00:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03381206B8 for ; Thu, 1 Aug 2019 16:00:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fwKGU41G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03381206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Date:To:From:Subject:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=y0ikKvc/Rn2HrEXC5JxUDBGzUZFsFQOeQWONSCKcDng=; b=fwKGU41GT2DHnaM48psmfOpBw 5tfzgA4nvkION10o0bUEUS6jszajNoMOgJ1KyDYylDxHv78bdNGHf6QJCr8A33g2PprL89RKOWWvf lpACiH+/mhWPqNo91HgFiPe0ARski0hH8ol2+TIqebDv1UawBlFZmIjiD7vof69rWSCWajwAoXeki WP5qGSef6vvdnOUCGmj+QwguHC9CxpouVTHoQQbZp9MmUskhnwFsHshVWuJ8c/SEYnK+9XiE/z2V7 OXBW48PCdztTcNWgyHWctkFcG6nhGev2EfnbPPQB0Ur5quL+2EXGAWW9cKWJD6Lxi6rh/kxy8loQi /HXO4UgFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1htDVL-0002Rf-De; Thu, 01 Aug 2019 16:00:35 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1htDVH-0002KE-49; Thu, 01 Aug 2019 16:00:32 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7FF1DAC2E; Thu, 1 Aug 2019 16:00:27 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable From: Nicolas Saenz Julienne To: Christoph Hellwig Date: Thu, 01 Aug 2019 17:59:34 +0200 In-Reply-To: <20190801140452.GB23435@lst.de> References: <20190731154752.16557-1-nsaenzjulienne@suse.de> <20190731154752.16557-7-nsaenzjulienne@suse.de> <20190801140452.GB23435@lst.de> User-Agent: Evolution 3.32.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190801_090031_593934_39ADA54B X-CRM114-Status: GOOD ( 19.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Benjamin Herrenschmidt , Heiko Carstens , eric@anholt.net, Paul Mackerras , will@kernel.org, Marek Szyprowski , phill@raspberryi.org, linux-s390@vger.kernel.org, f.fainelli@gmail.com, frowand.list@gmail.com, Michael Ellerman , Christian Borntraeger , catalin.marinas@arm.com, devicetree@vger.kernel.org, Vasily Gorbik , marc.zyngier@arm.com, robh+dt@kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, mbrugger@suse.com, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, wahrenst@gmx.net, akpm@linux-foundation.org, Robin Murphy Content-Type: multipart/mixed; boundary="===============5492017327787931104==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5492017327787931104== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-1xpVXG9aO5tI8LW1PkIr" --=-1xpVXG9aO5tI8LW1PkIr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, thanks for the review. On Thu, 2019-08-01 at 16:04 +0200, Christoph Hellwig wrote: > A few nitpicks, otherwise this looks great: >=20 > > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > > * everything else. GFP_DMA32 page allocations automatically fall back= to > > * ZONE_DMA. > > * > > - * By using 31-bit unconditionally, we can exploit ARCH_ZONE_DMA_BITS = to > > + * By using 31-bit unconditionally, we can exploit arch_zone_dma_bits = to > > * inform the generic DMA mapping code. 32-bit only devices (if not > > handled > > * by an IOMMU anyway) will take a first dip into ZONE_NORMAL and get > > * otherwise served by ZONE_DMA. > > @@ -237,9 +238,18 @@ void __init paging_init(void) > > printk(KERN_DEBUG "Memory hole size: %ldMB\n", > > (long int)((top_of_ram - total_ram) >> 20)); > > =20 > > + /* > > + * Allow 30-bit DMA for very limited Broadcom wifi chips on many > > + * powerbooks. > > + */ > > + if (IS_ENABLED(CONFIG_PPC32)) > > + arch_zone_dma_bits =3D 30; > > + else > > + arch_zone_dma_bits =3D 31; > > + >=20 > So the above unconditionally comment obviously isn't true any more, and > Ben also said for the recent ppc32 hack he'd prefer dynamic detection. >=20 > Maybe Ben and or other ppc folks can chime in an add a patch to the serie= s > to sort this out now that we have a dynamic ZONE_DMA threshold? Noted, for now I'll remove the comment. > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > > index 59bdceea3737..40dfc9b4ee4c 100644 > > --- a/kernel/dma/direct.c > > +++ b/kernel/dma/direct.c > > @@ -19,9 +19,7 @@ > > * Most architectures use ZONE_DMA for the first 16 Megabytes, but > > * some use it for entirely different regions: > > */ > > -#ifndef ARCH_ZONE_DMA_BITS > > -#define ARCH_ZONE_DMA_BITS 24 > > -#endif > > +unsigned int arch_zone_dma_bits __ro_after_init =3D 24; >=20 > I'd prefer to drop the arch_ prefix and just calls this zone_dma_bits. > In the long run we really need to find a way to just automatically set > this from the meminit code, but that is out of scope for this series. > For now can you please just update the comment above to say something > like: >=20 > /* > * Most architectures use ZONE_DMA for the first 16 Megabytes, but some u= se it > * it for entirely different regions. In that case the arch code needs t= o > * override the variable below for dma-direct to work properly. > */ Ok perfect. --=-1xpVXG9aO5tI8LW1PkIr 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/4FAl1DDGYACgkQlfZmHno8 x/7w9wgAsuuhgVK1nlC7WgrB2sfSYqL6HTJlDfkLJ2RMgzu/WSw4RJsje86on5R9 NmRSTVntXnCdpTNiKcSEKP7MnrVtMh2TtopfTOCvgho/uDJsc4DPAqZaLHO4quzo ZfimsWkcpC6n/E8ybEcew+6U7BIyqJPtqxgdkXz98gLQ1NK1wJU2x0Gt+KXT5a/0 hR3hA3whz8yIe4hwQTEiAzX/LnSP8+Yp+g1LLFjYveqt2RUbfC/udykYkLS7LdoO SJ6j5S/1jRpvusBjENkY3PQiRGrhfRnT4qxVSdpkK/rMG6pLMW4l9YjfbQCLOFhn 8qxZKNifDs1KxpZjExjd4Lisum4nhw== =nw8i -----END PGP SIGNATURE----- --=-1xpVXG9aO5tI8LW1PkIr-- --===============5492017327787931104== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5492017327787931104==--