diff mbox

[REGRESSION,BISECTED] DMA mask issue on ReadyNAS 102 w/ 3.13.0-rc3

Message ID 20131207231958.GS4360@n2100.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King - ARM Linux Dec. 7, 2013, 11:19 p.m. UTC
On Sun, Dec 08, 2013 at 12:02:45AM +0100, Arnaud Ebalard wrote:
> 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:

Comments

Arnaud Ebalard Dec. 7, 2013, 11:42 p.m. UTC | #1
Hi Russell,

Russell King - ARM Linux <linux@arm.linux.org.uk> writes:

> On Sun, Dec 08, 2013 at 12:02:45AM +0100, Arnaud Ebalard wrote:
>> 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:
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index f6b6bfa88ecf..c143a7bb681b 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -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;
>  
>  	/*
>

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

Cheers,

a+
Jason Cooper Dec. 11, 2013, 6:54 p.m. UTC | #2
Russell,

On Sun, Dec 08, 2013 at 12:42:47AM +0100, Arnaud Ebalard wrote:
> Hi Russell,
> 
> Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> 
> > On Sun, Dec 08, 2013 at 12:02:45AM +0100, Arnaud Ebalard wrote:
> >> 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:
> >
> > diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> > index f6b6bfa88ecf..c143a7bb681b 100644
> > --- a/arch/arm/mm/dma-mapping.c
> > +++ b/arch/arm/mm/dma-mapping.c
> > @@ -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;
> >  
> >  	/*
> >
> 
> 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.
Russell King - ARM Linux Dec. 11, 2013, 8:57 p.m. UTC | #3
On Wed, Dec 11, 2013 at 01:54:45PM -0500, Jason Cooper wrote:
> 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?
Jason Cooper Dec. 12, 2013, 12:34 p.m. UTC | #4
On Wed, Dec 11, 2013 at 08:57:24PM +0000, Russell King - ARM Linux wrote:
> On Wed, Dec 11, 2013 at 01:54:45PM -0500, Jason Cooper wrote:
> > 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.
Russell King - ARM Linux Dec. 12, 2013, 12:41 p.m. UTC | #5
On Thu, Dec 12, 2013 at 07:34:22AM -0500, Jason Cooper wrote:
> On Wed, Dec 11, 2013 at 08:57:24PM +0000, Russell King - ARM Linux wrote:
> > On Wed, Dec 11, 2013 at 01:54:45PM -0500, Jason Cooper wrote:
> > > 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?

Yes.  9f28cde0bc643186d32744ce69d12222e8588fe7, which is definitely in
the fixes branch.
Jason Cooper Dec. 12, 2013, 1:32 p.m. UTC | #6
On Thu, Dec 12, 2013 at 12:41:54PM +0000, Russell King - ARM Linux wrote:
> On Thu, Dec 12, 2013 at 07:34:22AM -0500, Jason Cooper wrote:
> > On Wed, Dec 11, 2013 at 08:57:24PM +0000, Russell King - ARM Linux wrote:
> > > On Wed, Dec 11, 2013 at 01:54:45PM -0500, Jason Cooper wrote:
> > > > 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?
> 
> 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.
diff mbox

Patch

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index f6b6bfa88ecf..c143a7bb681b 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -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;
 
 	/*