linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [REGRESSION,BISECTED] DMA mask issue on ReadyNAS 102 w/ 3.13.0-rc3
Date: Sat, 7 Dec 2013 23:19:58 +0000	[thread overview]
Message-ID: <20131207231958.GS4360@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <87haakfene.fsf@natisbad.org>

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;
 
 	/*

  reply	other threads:[~2013-12-07 23:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07 23:02 [REGRESSION,BISECTED] DMA mask issue on ReadyNAS 102 w/ 3.13.0-rc3 Arnaud Ebalard
2013-12-07 23:19 ` Russell King - ARM Linux [this message]
2013-12-07 23:42   ` [REGRESSION, BISECTED] " Arnaud Ebalard
2013-12-11 18:54     ` [REGRESSION,BISECTED] " Jason Cooper
2013-12-11 20:57       ` Russell King - ARM Linux
2013-12-12 12:34         ` Jason Cooper
2013-12-12 12:41           ` Russell King - ARM Linux
2013-12-12 13:32             ` Jason Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131207231958.GS4360@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).