Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-13 Thread Benjamin Herrenschmidt
On Wed, 2019-06-12 at 14:41 -0500, Larry Finger wrote: > On 6/12/19 1:55 AM, Christoph Hellwig wrote: > > > > Ooops, yes. But I think we could just enable ZONE_DMA on 32-bit > > powerpc. Crude enablement hack below: > > > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > > index

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-13 Thread Christoph Hellwig
On Thu, Jun 13, 2019 at 07:59:51AM +1000, Benjamin Herrenschmidt wrote: > > With the patch for Kconfig above, and the original patch setting > > ARCH_ZONE_DMA_BITS to 30, everything works. > > > > Do you have any ideas on what should trigger the change in ARCH_ZONE_BITS? > > Should it be

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-12 Thread Larry Finger
On 6/12/19 1:55 AM, Christoph Hellwig wrote: Ooops, yes. But I think we could just enable ZONE_DMA on 32-bit powerpc. Crude enablement hack below: diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 8c1c636308c8..1dd71a98b70c 100644 --- a/arch/powerpc/Kconfig +++

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-12 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 05:20:12PM -0500, Larry Finger wrote: > Your first patch did not work as the configuration does not have > CONFIG_ZONE_DMA. As a result, the initial value of min_mask always starts > at 32 bits and is taken down to 31 with the maximum pfn minimization. When > I forced

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 20:52 -0500, Larry Finger wrote: > On 6/11/19 5:46 PM, Benjamin Herrenschmidt wrote: > > On Tue, 2019-06-11 at 17:20 -0500, Larry Finger wrote: > > > b43-pci-bridge 0001:11:00.0: dma_direct_supported: failed (mask = > > > 0x3fff, > > > min_mask = 0x5000/0x5000,

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Larry Finger
On 6/11/19 5:46 PM, Aaro Koskinen wrote: Hi, On Tue, Jun 11, 2019 at 05:20:12PM -0500, Larry Finger wrote: It is obvious that the case of a mask smaller than min_mask should be handled by the IOMMU. In my system, CONFIG_IOMMU_SUPPORT is selected. All other CONFIG variables containing IOMMU are

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Larry Finger
On 6/11/19 5:46 PM, Benjamin Herrenschmidt wrote: On Tue, 2019-06-11 at 17:20 -0500, Larry Finger wrote: b43-pci-bridge 0001:11:00.0: dma_direct_supported: failed (mask = 0x3fff, min_mask = 0x5000/0x5000, dma bits = 0x1f Ugh ? A mask with holes in it ? That's very wrong... That

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 17:20 -0500, Larry Finger wrote: > b43-pci-bridge 0001:11:00.0: dma_direct_supported: failed (mask = > 0x3fff, > min_mask = 0x5000/0x5000, dma bits = 0x1f Ugh ? A mask with holes in it ? That's very wrong... That min_mask is bogus. Ben.

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Aaro Koskinen
Hi, On Tue, Jun 11, 2019 at 05:20:12PM -0500, Larry Finger wrote: > It is obvious that the case of a mask smaller than min_mask should be > handled by the IOMMU. In my system, CONFIG_IOMMU_SUPPORT is selected. All > other CONFIG variables containing IOMMU are not selected. When >

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Larry Finger
On 6/11/19 1:05 AM, Christoph Hellwig wrote: On Mon, Jun 10, 2019 at 11:09:47AM -0500, Larry Finger wrote: What might be confusing in your output is that dev->dma_mask is a pointer, and we are setting it in dma_set_mask. That is before we only check if the pointer is set, and later we override

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Andreas Schwab
On Jun 10 2019, Larry Finger wrote: > I do not understand why the if statement returns true as neither of the > values is zero. That's because the format string does not make any sense. You are printing garbage. > diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c > index

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 09:54 +0200, Christoph Hellwig wrote: > On Tue, Jun 11, 2019 at 04:59:54PM +1000, Benjamin Herrenschmidt > wrote: > > Ah stupid me ... it's dma_set_mask that failed, since it has no > > idea > > that the calling driver is limited to lowmem. > > > > That's also why the

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 04:59:54PM +1000, Benjamin Herrenschmidt wrote: > Ah stupid me ... it's dma_set_mask that failed, since it has no idea > that the calling driver is limited to lowmem. > > That's also why the "wrong" patch worked. > > So yes, a ZONE_DMA at 30-bits will work, though it's

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 04:58:12PM +1000, Benjamin Herrenschmidt wrote: > ... which b43legacy doesn't set to the best of my knowledge ... > > Which makes me wonder how come it didn't work even with your patches ? > AFAIK, we have less than 1GB of lowmem unless the config has been > tweaked

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 16:58 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2019-06-11 at 08:08 +0200, Christoph Hellwig wrote: > > On Tue, Jun 11, 2019 at 03:56:33PM +1000, Benjamin Herrenschmidt > > wrote: > > > The reason I think it sort-of-mostly-worked is that to get more > > > than > > > 1GB

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 08:08 +0200, Christoph Hellwig wrote: > On Tue, Jun 11, 2019 at 03:56:33PM +1000, Benjamin Herrenschmidt > wrote: > > 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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 03:56:33PM +1000, Benjamin Herrenschmidt wrote: > 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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Mon, Jun 10, 2019 at 11:09:47AM -0500, Larry Finger wrote: >>> return -EIO; >>> >>> For b43legacy, dev->dma_mask is 0xc2656848. >>> dma_supported(dev, mask) is 0xc08b, mask is 0x3fff, and >>> the routine returns -EIO. >>> >>> For b43,

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-10 Thread Benjamin Herrenschmidt
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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-10 Thread Larry Finger
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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-10 Thread Larry Finger
On 6/10/19 3:18 AM, Christoph Hellwig wrote: On Sat, Jun 08, 2019 at 04:52:24PM -0500, Larry Finger wrote: On 6/7/19 12:29 PM, Christoph Hellwig wrote: I don't think we should work around this in the driver, we need to fix it in the core. I'm curious why my previous patch didn't work. Can

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-10 Thread Christoph Hellwig
On Sat, Jun 08, 2019 at 04:52:24PM -0500, Larry Finger wrote: > On 6/7/19 12:29 PM, Christoph Hellwig wrote: >> I don't think we should work around this in the driver, we need to fix >> it in the core. I'm curious why my previous patch didn't work. Can >> you throw in a few printks what failed?

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-08 Thread Larry Finger
On 6/7/19 12:29 PM, Christoph Hellwig wrote: I don't think we should work around this in the driver, we need to fix it in the core. I'm curious why my previous patch didn't work. Can you throw in a few printks what failed? I.e. did dma_direct_supported return false? Did the actual allocation

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-08 Thread Christoph Hellwig
On Sat, Jun 08, 2019 at 02:21:23PM +1000, 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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-07 Thread Benjamin Herrenschmidt
> 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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-07 Thread Larry Finger
On 6/7/19 12:29 PM, Christoph Hellwig wrote: I don't think we should work around this in the driver, we need to fix it in the core. I'm curious why my previous patch didn't work. Can you throw in a few printks what failed? I.e. did dma_direct_supported return false? Did the actual allocation

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-07 Thread Christoph Hellwig
I don't think we should work around this in the driver, we need to fix it in the core. I'm curious why my previous patch didn't work. Can you throw in a few printks what failed? I.e. did dma_direct_supported return false? Did the actual allocation fail?

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-07 Thread Larry Finger
On 6/5/19 5:50 PM, Aaro Koskinen wrote: Hi, When upgrading from v5.0 -> v5.1 on G4 PowerBook, I noticed WLAN does not work anymore: [ 42.004303] b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18 02:36:27) [ 42.184837] b43legacy-phy0 debug: Chip initialized [

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-06 Thread Larry Finger
On 6/6/19 6:43 AM, Christoph Hellwig wrote: 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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-06 Thread Larry Finger
On 6/6/19 6:43 AM, Christoph Hellwig wrote: 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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-06 Thread Christoph Hellwig
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

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-06 Thread Benjamin Herrenschmidt
On Thu, 2019-06-06 at 20:56 +1000, Benjamin Herrenschmidt wrote: > On Thu, 2019-06-06 at 12:31 +0300, Aaro Koskinen wrote: > > Hi, > > > > On Thu, Jun 06, 2019 at 10:54:51AM +1000, Benjamin Herrenschmidt > > wrote: > > > On Thu, 2019-06-06 at 01:50 +0300, Aaro Koskinen wrote: > > > > Hi, > > > >

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-06 Thread Benjamin Herrenschmidt
On Thu, 2019-06-06 at 12:31 +0300, Aaro Koskinen wrote: > Hi, > > On Thu, Jun 06, 2019 at 10:54:51AM +1000, Benjamin Herrenschmidt > wrote: > > On Thu, 2019-06-06 at 01:50 +0300, Aaro Koskinen wrote: > > > Hi, > > > > > > When upgrading from v5.0 -> v5.1 on G4 PowerBook, I noticed WLAN > > >

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-06 Thread Aaro Koskinen
Hi, On Thu, Jun 06, 2019 at 10:54:51AM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2019-06-06 at 01:50 +0300, Aaro Koskinen wrote: > > Hi, > > > > When upgrading from v5.0 -> v5.1 on G4 PowerBook, I noticed WLAN does > > not work anymore: > > > > [ 42.004303] b43legacy-phy0: Loading

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-06 Thread Christoph Hellwig
On Wed, Jun 05, 2019 at 10:06:18PM -0500, Larry Finger wrote: > First of all, you have my sympathy for the laborious bisection on a > PowerBook G4. I have done several myself. Thank you. > > I confirm your results. > > The ppc code has a maximum DMA size of 31 bits, thus a 32-bit request will >

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-05 Thread Larry Finger
On 6/5/19 5:50 PM, Aaro Koskinen wrote: Hi, When upgrading from v5.0 -> v5.1 on G4 PowerBook, I noticed WLAN does not work anymore: [ 42.004303] b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18 02:36:27) [ 42.184837] b43legacy-phy0 debug: Chip initialized [

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-05 Thread Benjamin Herrenschmidt
On Thu, 2019-06-06 at 01:50 +0300, Aaro Koskinen wrote: > Hi, > > When upgrading from v5.0 -> v5.1 on G4 PowerBook, I noticed WLAN does > not work anymore: > > [ 42.004303] b43legacy-phy0: Loading firmware version 0x127, patch level 14 > (2005-04-18 02:36:27) > [ 42.184837] b43legacy-phy0

[BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-05 Thread Aaro Koskinen
Hi, When upgrading from v5.0 -> v5.1 on G4 PowerBook, I noticed WLAN does not work anymore: [ 42.004303] b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18 02:36:27) [ 42.184837] b43legacy-phy0 debug: Chip initialized [ 42.184873] b43legacy-phy0 ERROR: The