From patchwork Fri Jan 17 08:46:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 3502761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 598C4C02DC for ; Fri, 17 Jan 2014 08:47:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CFAD20131 for ; Fri, 17 Jan 2014 08:47:45 +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 B03822014A for ; Fri, 17 Jan 2014 08:47:44 +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 1W4555-0006BM-2S; Fri, 17 Jan 2014 08:47:11 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W454w-0002fa-C0; Fri, 17 Jan 2014 08:47:02 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W454p-0002dz-7D for linux-arm-kernel@lists.infradead.org; Fri, 17 Jan 2014 08:46:58 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MZJ00IWAF1IO050@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 17 Jan 2014 17:46:30 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-fe-52d8ede63e3d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 6D.F5.29263.6EDE8D25; Fri, 17 Jan 2014 17:46:30 +0900 (KST) Received: from amdc1339.mshome.net ([106.116.147.30]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MZJ001LCF1BFDJ0@mmp1.samsung.com>; Fri, 17 Jan 2014 17:46:30 +0900 (KST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: dma-mapping: fix GFP_ATOMIC macro usage Date: Fri, 17 Jan 2014 09:46:16 +0100 Message-id: <1389948376-26298-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jAd1nb28EGezdYGrx8fJsZotNj6+x WlzeNYfNYu2Ru+wWCzY+YnRg9di8pN6jt/kdm0ffllWMHp83yQWwRHHZpKTmZJalFunbJXBl 9Oy+wFbQxF6xa0ULYwPjE9YuRk4OCQETibfHpjNB2GISF+6tZ+ti5OIQEljEKDHzz0N2kISQ QCuTRFNXJojNJmAo0fW2iw3EFhFwk/i37hCYzSyQJfF49ntGEFtYwFbi+tnbQHEODhYBVYm1 J5JBTF4BD4nzrxRATAkBBYk5k2wmMHIvYGRYxSiaWpBcUJyUnmuoV5yYW1yal66XnJ+7iRHs /2dSOxhXNlgcYhTgYFTi4ZUQvxEkxJpYVlyZe4hRgoNZSYR3602gEG9KYmVValF+fFFpTmrx IUZpDhYlcd4DrdaBQgLpiSWp2ampBalFMFkmDk6pBsalfwVfr5/vHHdZvzmc0VO+MMSpy6LT 7e9J9jW8N7LffvQyY7jhXfDDt0iWfdWn5xZ1tnf3Kealry5++vx15TzRVXqXbH5sNTY+JJ52 5mxi/g17swOMxpek+EXvS2g/n/bb/8yWzJ+yTeaWPOnNRmJhOvxW/b8atgce8GQ63MmmKSI4 ec3qg0osxRmJhlrMRcWJALeh4Un7AQAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140117_034655_510530_D4C1B339 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -7.2 (-------) Cc: Hiroshi Doyu , stable@vger.kernel.org, Marek Szyprowski 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: , MIME-Version: 1.0 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 GFP_ATOMIC is not a single gfp flag, but a macro which expands to the other flags and LACK of __GFP_WAIT flag. To check if caller wanted to perform an atomic allocation, the code must test __GFP_WAIT flag presence. This patch fixes the issue introduced in v3.6-rc5 Signed-off-by: Marek Szyprowski CC: stable@vger.kernel.org --- arch/arm/mm/dma-mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index f61a570..5fe4d72 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1358,7 +1358,7 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, *handle = DMA_ERROR_CODE; size = PAGE_ALIGN(size); - if (gfp & GFP_ATOMIC) + if (!(gfp & __GFP_WAIT)) return __iommu_alloc_atomic(dev, size, handle); /*