Skip to contentSkip to conversation

DMA mask issue on ReadyNAS 102 w/ 3.13.0-rc3

REGRESSION,BISECTED Arnaud Ebalard 3 participants 8 messages Dec 7, 2013 – Dec 12, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

Hi,

I just pulled 3.13.0-rc3 and was unable to make it boot on my ReadyNAS 102 (Armada 370 based): it kernel panics w/ a missing root fs, because my sata disk is no more seen. Looking at the log, I get the following:

[   71.855367] ahci 0000:01:00.0: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
[   71.863498] ahci 0000:01:00.0: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs 
[   71.871650] ahci 0000:01:00.0: Coherent DMA mask 0xffffffffffffffff is larger than dma_addr_t allows
[   71.880806] ahci 0000:01:00.0: Driver did not use or check the return value from dma_set_coherent_mask()?
[   71.890395] ahci 0000:01:00.0: failed to start port 0 (errno=-12)

...

[   72.134901] xhci_hcd 0000:02:00.0: xHCI Host Controller
[   72.140188] xhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 2
[   72.147631] xhci_hcd 0000:02:00.0: Coherent DMA mask 0xffffffffffffffff is larger than dma_addr_t allows
[   72.157136] xhci_hcd 0000:02:00.0: Driver did not use or check the return value from dma_set_coherent_mask()?
[   72.167072] xhci_hcd 0000:02:00.0: Couldn't initialize memory
[   72.172851] xhci_hcd 0000:02:00.0: can't setup: -12
[   72.177741] xhci_hcd 0000:02:00.0: USB bus 2 deregistered
[   72.183181] xhci_hcd 0000:02:00.0: init 0000:02:00.0 fail, -12
[   72.189031] xhci_hcd: probe of 0000:02:00.0 failed with error -12

3.13.0-rc2 worked just fine so I decided to git-bisect the issue and ended up on 11a5aa32562e (ARM: dma-mapping: check DMA mask against available memory).

If it has already been reported and fixed, sorry for the noise.

Cheers,

a+

#1 lore raw
Quoted 5 lines · Arnaud Ebalard

3.13.0-rc2 worked just fine so I decided to git-bisect the issue and ended up on 11a5aa32562e (ARM: dma-mapping: check DMA mask against available memory).

If it has already been reported and fixed, sorry for the noise.

Please try this patch, thanks:

arch/arm/mm/dma-mapping.c +2 -2
index f6b6bfa88ecf..c143a7bb681b 100644
@@ -185,7 +185,7 @@ static u64 get_coherent_dma_mask(struct device *dev)
 		 */
 		if (sizeof(mask) != sizeof(dma_addr_t) &&
 		    mask > (dma_addr_t)~0 &&
-		    dma_to_pfn(dev, ~0) > max_dma_pfn) {
+		    dma_to_pfn(dev, ~0) < max_dma_pfn) {
 			dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n",
 				 mask);
 			dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n");
@@ -1041,7 +1041,7 @@ int dma_supported(struct device *dev, u64 mask)
 	 */
 	if (sizeof(mask) != sizeof(dma_addr_t) &&
 	    mask > (dma_addr_t)~0 &&
-	    dma_to_pfn(dev, ~0) > arm_dma_pfn_limit)
+	    dma_to_pfn(dev, ~0) < min(max_pfn, arm_dma_pfn_limit))
 		return 0;
 
 	/*
#2 lore raw

Hi Russell,

Quoted 24 lines · Russell King - ARM Linux
Quoted 5 lines · Arnaud Ebalard

3.13.0-rc2 worked just fine so I decided to git-bisect the issue and ended up on 11a5aa32562e (ARM: dma-mapping: check DMA mask against available memory).

If it has already been reported and fixed, sorry for the noise.

Please try this patch, thanks:

arch/arm/mm/dma-mapping.c +1 -1
index f6b6bfa88ecf..c143a7bb681b 100644
@@ -185,7 +185,7 @@ static u64 get_coherent_dma_mask(struct device *dev)
 		 */
 		if (sizeof(mask) != sizeof(dma_addr_t) &&
 		    mask > (dma_addr_t)~0 &&
-		    dma_to_pfn(dev, ~0) > max_dma_pfn) {
+		    dma_to_pfn(dev, ~0) < max_dma_pfn) {
 			dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n",
 				 mask);
 			dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n");

arch/arm/mm/dma-mapping.c int dma_supported(struct device *dev, u64 mask) · line 1047

Quoted 8 lines
arch/arm/mm/dma-mapping.c +1 -1
@@ -1041,7 +1041,7 @@ int dma_supported(struct device *dev, u64 mask)
 	 */
 	if (sizeof(mask) != sizeof(dma_addr_t) &&
 	    mask > (dma_addr_t)~0 &&
-	    dma_to_pfn(dev, ~0) > arm_dma_pfn_limit)
+	    dma_to_pfn(dev, ~0) < min(max_pfn, arm_dma_pfn_limit))
 		return 0;
 
 	/*

With that applied, 3.13.0-rc3 boots again on my RN102 w/o any error.

Cheers,

a+

#3 lore raw

Russell,

Quoted 34 lines · Arnaud Ebalard

Hi Russell,

Quoted 30 lines · Russell King - ARM Linux
Quoted 5 lines · Arnaud Ebalard

3.13.0-rc2 worked just fine so I decided to git-bisect the issue and ended up on 11a5aa32562e (ARM: dma-mapping: check DMA mask against available memory).

If it has already been reported and fixed, sorry for the noise.

Please try this patch, thanks:

arch/arm/mm/dma-mapping.c +2 -2
index f6b6bfa88ecf..c143a7bb681b 100644
@@ -185,7 +185,7 @@ static u64 get_coherent_dma_mask(struct device *dev)
 		 */
 		if (sizeof(mask) != sizeof(dma_addr_t) &&
 		    mask > (dma_addr_t)~0 &&
-		    dma_to_pfn(dev, ~0) > max_dma_pfn) {
+		    dma_to_pfn(dev, ~0) < max_dma_pfn) {
 			dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n",
 				 mask);
 			dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n");
@@ -1041,7 +1041,7 @@ int dma_supported(struct device *dev, u64 mask)
 	 */
 	if (sizeof(mask) != sizeof(dma_addr_t) &&
 	    mask > (dma_addr_t)~0 &&
-	    dma_to_pfn(dev, ~0) > arm_dma_pfn_limit)
+	    dma_to_pfn(dev, ~0) < min(max_pfn, arm_dma_pfn_limit))
 		return 0;
 
Quoted 4 lines

arch/arm/mm/dma-mapping.c int dma_supported(struct device *dev, u64 mask) · line 1047

Quoted 2 lines
arch/arm/mm/dma-mapping.c +0 -0
 	/*

With that applied, 3.13.0-rc3 boots again on my RN102 w/o any error.

I don't see this in any of your branches. Is there anything else you need from us to get this merged?

thx,

Jason.

#4 lore raw
Quoted 2 lines · Jason Cooper

I don't see this in any of your branches. Is there anything else you need from us to get this merged?

Where are you looking?

#5 lore raw
Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Jason Cooper

I don't see this in any of your branches. Is there anything else you need from us to get this merged?

Where are you looking?

I looked in for-linus-dma-masks, unstable/dma-masks, and fixes branches at:

http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm.git

That was yesterday, and I just did another quick check this morning. Nothing jumps out at me. Did I miss something obvious?

thx,

Jason.

#6 lore raw
Quoted 7 lines · Jason Cooper
Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Jason Cooper

I don't see this in any of your branches. Is there anything else you need from us to get this merged?

Where are you looking?

Quoted 7 lines

I looked in for-linus-dma-masks, unstable/dma-masks, and fixes branches at:

http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm.git

That was yesterday, and I just did another quick check this morning. Nothing jumps out at me. Did I miss something obvious?

Yes. 9f28cde0bc643186d32744ce69d12222e8588fe7, which is definitely in the fixes branch.

#7 lore raw
Quoted 11 lines · Russell King - ARM Linux
Quoted 10 lines · Jason Cooper
Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Jason Cooper

I don't see this in any of your branches. Is there anything else you need from us to get this merged?

Where are you looking?

I looked in for-linus-dma-masks, unstable/dma-masks, and fixes branches at:

Quoted 7 lines
Quoted 4 lines

http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm.git

That was yesterday, and I just did another quick check this morning. Nothing jumps out at me. Did I miss something obvious?

Yes. 9f28cde0bc643186d32744ce69d12222e8588fe7, which is definitely in the fixes branch.

Ahhh, yes, I saw that one. I dismissed it as a candidate be cause the diffstats weren't even close. Thanks for clearing that up and sorry for the noise.

thx,

Jason.