Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp536355ybi; Wed, 19 Jun 2019 03:51:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVI7ZmPGqgOxsQvg4j91ws39zo8Ir6LXhJYNfypToCmlw2BXULoamCehT0feUpNzJxEEfM X-Received: by 2002:a17:902:b115:: with SMTP id q21mr58238597plr.36.1560941489635; Wed, 19 Jun 2019 03:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560941489; cv=none; d=google.com; s=arc-20160816; b=bje2Fp3ntO0B9oVIFydOl1Y6KeP67W1/4XrMdNF4zY75gbhdrq24rXiutjUH6Sd84r rKEbs+s+8glTM7Fw6y/fVFSHJbmk/XNsS2ooVcXLlvN6BI/bN/hegOK50bUBGuzqDfXp nltdhbCnHEpu+f8oSp2VP3FCco/BZYaAu9b1qjq7qb0kGw+aO/xcVxFVUW6qi63FQjTi fXJbTnPe5ojziKEO32UQKt4w5XZvlzKI8r2A78BHDdZGWgTflAW7TqJK5nkKQujlFnYn 426UD9feIfG0aSwwyUAgrskyXJs6J/2CTgdGgGpehfUkPwTicwLS5n4Jqgj4xzptbTex GSgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nVcflRGsArF+G/OgfVbAq6mAYldsbEM9KTN/Kj0plgM=; b=YMIehHO0yA9zopW6mjOp8IHfhJECUSwFMiTiOUDNY3RXzu17/SE0qH4TNFRwx1WB36 ar+2Na+wAigMldeyHJzE5pIP3xsMzp2S5DP6udFYwu5MWXrkNF7Xk5I9GrZeRsP1OqkS eKkH4vdOMQiQSTsmbeZkkHTpD1msWRa1LwTrpp9jJgxPAZX74MJ58bt19/LovJptxCCQ ZJROXXmyCLf8D1dMQnCpRqOzIxzzX4V6d6HgQJuhtHgWjS4CwvpRghhDsDwqiDYYzEDM 9UvIffw6EFhtUS2Inou9qL3v066LEFPNZzXvVeW5XKjZptc0srmOjqXUrfHVYk8MNVBD SjUg== 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 j66si15245436plb.375.2019.06.19.03.51.14; Wed, 19 Jun 2019 03:51:29 -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 S1727129AbfFSKvK (ORCPT + 99 others); Wed, 19 Jun 2019 06:51:10 -0400 Received: from verein.lst.de ([213.95.11.211]:52653 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbfFSKvJ (ORCPT ); Wed, 19 Jun 2019 06:51:09 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id BE4D768AA6; Wed, 19 Jun 2019 12:50:39 +0200 (CEST) Date: Wed, 19 Jun 2019 12:50:39 +0200 From: Christoph Hellwig To: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Cc: Larry.Finger@lwfinger.net, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, aaro.koskinen@iki.fi Subject: Re: [PATCH] powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac Message-ID: <20190619105039.GA10118@lst.de> References: <20190613082446.18685-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190613082446.18685-1-hch@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Any chance this could get picked up to fix the regression? On Thu, Jun 13, 2019 at 10:24:46AM +0200, Christoph Hellwig wrote: > With the strict dma mask checking introduced with the switch to > the generic DMA direct code common wifi chips on 32-bit powerbooks > stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds > to allow them to reliably allocate dma coherent memory. > > Fixes: 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported") > Reported-by: Aaro Koskinen > Signed-off-by: Christoph Hellwig > --- > arch/powerpc/include/asm/page.h | 7 +++++++ > arch/powerpc/mm/mem.c | 3 ++- > arch/powerpc/platforms/powermac/Kconfig | 1 + > 3 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h > index b8286a2013b4..0d52f57fca04 100644 > --- a/arch/powerpc/include/asm/page.h > +++ b/arch/powerpc/include/asm/page.h > @@ -319,6 +319,13 @@ struct vm_area_struct; > #endif /* __ASSEMBLY__ */ > #include > > +/* > + * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks. > + */ > +#ifdef CONFIG_PPC32 > +#define ARCH_ZONE_DMA_BITS 30 > +#else > #define ARCH_ZONE_DMA_BITS 31 > +#endif > > #endif /* _ASM_POWERPC_PAGE_H */ > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > index cba29131bccc..2540d3b2588c 100644 > --- a/arch/powerpc/mm/mem.c > +++ b/arch/powerpc/mm/mem.c > @@ -248,7 +248,8 @@ void __init paging_init(void) > (long int)((top_of_ram - total_ram) >> 20)); > > #ifdef CONFIG_ZONE_DMA > - max_zone_pfns[ZONE_DMA] = min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT); > + max_zone_pfns[ZONE_DMA] = min(max_low_pfn, > + ((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT); > #endif > max_zone_pfns[ZONE_NORMAL] = max_low_pfn; > #ifdef CONFIG_HIGHMEM > diff --git a/arch/powerpc/platforms/powermac/Kconfig b/arch/powerpc/platforms/powermac/Kconfig > index f834a19ed772..c02d8c503b29 100644 > --- a/arch/powerpc/platforms/powermac/Kconfig > +++ b/arch/powerpc/platforms/powermac/Kconfig > @@ -7,6 +7,7 @@ config PPC_PMAC > select PPC_INDIRECT_PCI if PPC32 > select PPC_MPC106 if PPC32 > select PPC_NATIVE > + select ZONE_DMA if PPC32 > default y > > config PPC_PMAC64 > -- > 2.20.1 ---end quoted text---