From patchwork Sat Dec 7 23:19:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 3305251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3E5849F384 for ; Sat, 7 Dec 2013 23:21:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7328D202E9 for ; Sat, 7 Dec 2013 23:21:52 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B2F1202E6 for ; Sat, 7 Dec 2013 23:21:50 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpRBY-00021l-9a; Sat, 07 Dec 2013 23:21:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpRBR-0005Ml-Is; Sat, 07 Dec 2013 23:21:13 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpRBN-0005Lb-H5 for linux-arm-kernel@lists.infradead.org; Sat, 07 Dec 2013 23:21:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=AzESX3unu5+a/ezYZvib73MW9O+NAKsd2xn55+10D30=; b=OcGUBIwpqApfo+FYa+OCBldTuynNSlmHbS23ifl10o6NIBj2AXtqQU5rn2CZj7qM+foqKIlvtDHhUGqKrJyZgAw2xWX3PbuVxE2t9pJKo09Wfssrm/R/yBiyWxyXTgsMJPwg/NMJn5AV5vze69R8pOzj68/0cmFjgunz6QKnMCg=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:46552) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1VpRAH-0005RP-NN; Sat, 07 Dec 2013 23:20:02 +0000 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1VpRAF-00048u-AB; Sat, 07 Dec 2013 23:19:59 +0000 Date: Sat, 7 Dec 2013 23:19:58 +0000 From: Russell King - ARM Linux To: Arnaud Ebalard Subject: Re: [REGRESSION, BISECTED] DMA mask issue on ReadyNAS 102 w/ 3.13.0-rc3 Message-ID: <20131207231958.GS4360@n2100.arm.linux.org.uk> References: <87haakfene.fsf@natisbad.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87haakfene.fsf@natisbad.org> User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131207_182110_672400_9C9D65E3 X-CRM114-Status: GOOD ( 11.64 ) X-Spam-Score: -1.2 (-) Cc: Nicolas Pitre , Andrew Lunn , Jason Cooper , Will Deacon , Sebastian Hesselbarth , Gregory Clement , Marek Szyprowski , linux-arm-kernel@lists.infradead.org, Hiroshi Doyu X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; /*