Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4015513ybi; Mon, 10 Jun 2019 22:57:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx72xb/wAwbpv8mlslAZ8BuHo84OJqqpv6BXau576EomXz97bCsrNAGSw0PwrYLBfKhgRT3 X-Received: by 2002:a62:15c3:: with SMTP id 186mr14306229pfv.141.1560232638879; Mon, 10 Jun 2019 22:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560232638; cv=none; d=google.com; s=arc-20160816; b=kno6XJGZD2IGQ7rsFHwL/N2VTqkN3ke7PbGEaDnGk4ApUSnfyVpMZr1pEL95me7D/A I+xMNqs5boBogL+VAfyP9eQI1spQFC6TXV1SLFYAp9tvZvhEzfrUVh0QW7sftGnjUq+y r2lKe5gcSCj8DbTtmY+EhqKwv+E280vlwiHPDSPA8gGC+lbzPkgHBKCzEWQZHxA2eK7w ivwZemJFd8y+xyVdfEyFkUvEqAl7dxTd0fdvv9Q2dYdk3WiNVNXziI46K5c9AvAlJoI5 z8dqaFE1aQYOUD5hOgg65J9CW/gCB03G8deDarKrBnki3IF5x12QWR8fL5UQjxeZIhP3 PgAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=UMCXnhAsLfrfrKvZqkuAIFLEjfxZUC4X0+cg8h79tug=; b=sIYSMWBF5org26YK+x7xNkrQ+rgqAgRucoTR/BksHJ85u4uUkX58uibm86xiA8AHIQ QkN9O2NQlnhO+dRNGI+k4vG5tzprXERUfumhTEMcgVQTGTgKgD4ThkQgynoLM4bWnFj9 rP5tUbK620T6BIeKrWQETEOruZauVPyP6JXIzodjbLW/QXQD3K2SFO0w0xcHdplmR7AL SPg0YM2AUqySn4oYm6sY2XDhflIsZapZoVTU64OrnWKChfL55Zdl2CuLKQ2J+2X++QQf 3BCvLOCD0eC9QgaEcLN7+koYsHjtMyvYGKK6vrxIiapzYho4Ph+gdcfhx7NGnjSiwEWK KMrA== 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 k1si11612977pfa.25.2019.06.10.22.57.04; Mon, 10 Jun 2019 22:57:18 -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 S2403827AbfFKF45 (ORCPT + 99 others); Tue, 11 Jun 2019 01:56:57 -0400 Received: from gate.crashing.org ([63.228.1.57]:41517 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390485AbfFKF45 (ORCPT ); Tue, 11 Jun 2019 01:56:57 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x5B5uXlu029265; Tue, 11 Jun 2019 00:56:34 -0500 Message-ID: Subject: Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook From: Benjamin Herrenschmidt To: Larry Finger , Aaro Koskinen , Christoph Hellwig , Christian Zigotzky , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 11 Jun 2019 15:56:33 +1000 In-Reply-To: <3ed1ccfe-d7ca-11b9-17b3-303d1ae1bb0f@lwfinger.net> References: <20190605225059.GA9953@darkstar.musicnaut.iki.fi> <73da300c-871c-77ac-8a3a-deac226743ef@lwfinger.net> <7697a9d10777b28ae79fdffdde6d0985555f6310.camel@kernel.crashing.org> <3ed1ccfe-d7ca-11b9-17b3-303d1ae1bb0f@lwfinger.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-06-10 at 13:44 -0500, Larry Finger wrote: > On 6/7/19 11:21 PM, Benjamin Herrenschmidt wrote: > > > > > Please try the attached patch. I'm not really pleased with it and I will > > > continue to determine why the fallback to a 30-bit mask fails, but at least this > > > one works for me. > > > > Your patch only makes sense if the device is indeed capable of > > addressing 31-bits. > > > > So either the driver is buggy and asks for a too small mask in which > > case your patch is ok, or it's not and you're just going to cause all > > sort of interesting random problems including possible memory > > corruption. > > Of course the driver may be buggy, but it asks for the correct mask. > > This particular device is not capable of handling 32-bit DMA. The driver detects > the 32-bit failure and falls back to 30 bits. It works on x86, and did on PPC32 > until 5.1. As Christoph said, it should always be possible to use fewer bits > than the maximum. No, I don't think it *worked* on ppc32 before Christoph patch. I think it "mostly sort-of worked" :-) The reason I'm saying that is if your system has more than 1GB of RAM, then you'll have chunks of memory that the device simply cannot address. Before Christoph patches, we had no ZONE_DMA or ZONE_DMA32 covering the 30-bit limited space, so any memory allocation could in theory land above 30-bits, causing all sort of horrible things to happen with that driver. The reason I think it sort-of-mostly-worked is that to get more than 1GB of RAM, those machines use CONFIG_HIGHMEM. And *most* network buffers aren't allocated in Highmem.... so you got lucky. That said, there is such as thing as no-copy send on network, so I wouldn't be surprised if some things would still have failed, just not frequent enough for you to notice. > Similar devices that are new enough to use b43 rather than b43legacy work with > new kernels; however, they have and use 32-bit DMA. Cheres, Ben.