Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8028984ybi; Thu, 6 Jun 2019 05:39:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhFwZILAq0jYNHpyPRgD0EoDr0UYxaQDyPDfqOJXuzgLqM5xnJmr7G7au3s6IvaL829HDz X-Received: by 2002:a63:c30e:: with SMTP id c14mr3213083pgd.41.1559824748386; Thu, 06 Jun 2019 05:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559824748; cv=none; d=google.com; s=arc-20160816; b=UK25KUEN5u+BHAR6pJHaRVM0L3ZUVu5SgRcP/A60EBTBU/wYMilD69CsUap1RN6U3n /adVbGlHhJsLZt0hVYOEnC8IQ5UrnWRlDxxX9W1G+o/ng09fH5xRfITikyRUlIVVabcu 0Q6AjM1OgXKTY/YVlwMHjim4u4aGe/ydsArxiPuTr0RP7hqYWOI2r6hh6P0SNEfu3I5b 8YQ9hnEpJggZDDfnceralqZ8MVwhEuzQjeuT3W/IK0llmPkesgPb7PCZhjH4uL5h5Fmo Oa7lHKwmKJ0ZFCt3XiULljPbwpGUL+AUrLjjtWS/a405rWUkWaO+nIHgbcJFciKJ+Q2a A3Mg== 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=kt7o1+XVy+lXH5WOMXil8IA2OM6q4I/uYbcFkZqbRc8=; b=ZcmKF0DT6WNuvA+iMhf6NxIYXnN76bmw3Rkz/V3h0IPXli8FvvXZTqkUjVXZYEuwBY iF4FC2Q/r5wM0p3r+tJgA7nGiZcrcQNYbM6wyk6MHh1YVm0Xq0/8iElalV1gQE0TTWuK mjkNfEANAJtR3zZ736qYseTr9KoX4d9HDHRvLEpuWzGEeyVEX7gt7b+pZmELpCZF/iaD 6UISB7oqqwFAs3IZSIqJvsGoDPoAsNdzW8ZCPbG2Pt3YUQcP49WFqNK5sQ2P88edjlS6 3rYrrmkTJcHCOP0QsBKq4MHHKt9WERM+cfrYDCH2Dypn63obDEWCWGLXSunytZzokHQH +HyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 x3si1952603pgr.22.2019.06.06.05.38.40; Thu, 06 Jun 2019 05:39:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727109AbfFFLn4 (ORCPT + 99 others); Thu, 6 Jun 2019 07:43:56 -0400 Received: from verein.lst.de ([213.95.11.211]:49104 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbfFFLn4 (ORCPT ); Thu, 6 Jun 2019 07:43:56 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id C2C8268B20; Thu, 6 Jun 2019 13:43:26 +0200 (CEST) Date: Thu, 6 Jun 2019 13:43:25 +0200 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: Aaro Koskinen , Christoph Hellwig , Christian Zigotzky , Michael Ellerman , Larry Finger , linuxppc-dev@lists.ozlabs.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook Message-ID: <20190606114325.GA7497@lst.de> References: <20190605225059.GA9953@darkstar.musicnaut.iki.fi> <20190606093149.GA11598@darkstar.musicnaut.iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Jun 06, 2019 at 08:57:49PM +1000, Benjamin Herrenschmidt wrote: > > Wow... that's an odd amount. One thing we could possibly do is add code > > to limit the amount of RAM when we detect that device.... > > Sent too quickly... I mean that *or* force swiotlb at 30-bits on those systems based > on detecting the presence of that device in the device-tree. swiotlb doesn't really help you, as these days swiotlb on matters for the dma_map* case. What would help is a ZONE_DMA that covers these devices. No need to do the 24-bit x86 does, but 30-bit would do it. WIP patch for testing below: diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index b8286a2013b4..7a367ce87c41 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -319,6 +319,10 @@ struct vm_area_struct; #endif /* __ASSEMBLY__ */ #include +#if 1 /* XXX: pmac? dynamic discovery? */ +#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