From patchwork Thu Jun 20 14:35:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi DOYU X-Patchwork-Id: 2756511 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 1ECB9C0AB1 for ; Thu, 20 Jun 2013 14:37:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72FE5201C2 for ; Thu, 20 Jun 2013 14:36:55 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 149BC201BA for ; Thu, 20 Jun 2013 14:36:54 +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 1Upfxz-0000gb-Gt; Thu, 20 Jun 2013 14:36:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upfxo-0000ik-US; Thu, 20 Jun 2013 14:35:52 +0000 Received: from hqemgate04.nvidia.com ([216.228.121.35]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upfxl-0000fr-9P for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2013 14:35:49 +0000 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Thu, 20 Jun 2013 07:35:33 -0700 Received: from hqemhub02.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Thu, 20 Jun 2013 07:35:18 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 20 Jun 2013 07:35:18 -0700 Received: from deemhub01.nvidia.com (10.21.69.137) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.298.1; Thu, 20 Jun 2013 07:35:18 -0700 Received: from DEMAIL01.nvidia.com ([10.21.69.139]) by deemhub01.nvidia.com ([10.21.69.137]) with mapi; Thu, 20 Jun 2013 16:35:14 +0200 From: Hiroshi Doyu To: "linuxzsc@gmail.com" Date: Thu, 20 Jun 2013 16:35:11 +0200 Subject: Re: [PATCH] ARM: dma: Drop __GFP_COMP for iommu dma memory allocations Thread-Topic: [PATCH] ARM: dma: Drop __GFP_COMP for iommu dma memory allocations Thread-Index: Ac5tw2BboT9rbQ5fSkigrpjLR+pg9A== Message-ID: <20130620.173511.831032817734076793.hdoyu@nvidia.com> References: <1371731460-15316-1-git-send-email-rizhao@nvidia.com><51C2FDE0.4060206@cogentembedded.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-nvconfidentiality: public acceptlanguage: en-US MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_103549_455113_8B53603E X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: -8.2 (--------) Cc: Stephen Warren , "sergei.shtylyov@cogentembedded.com" , Richard Zhao , "linux-tegra@vger.kernel.org" , "linux@arm.linux.org.uk" , "linux-arm-kernel@lists.infradead.org" , "m.szyprowski@samsung.com" 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=-5.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 Richard Zhao wrote @ Thu, 20 Jun 2013 15:40:50 +0200: > >> + /* > >> + * Following is a work-around (a.k.a. hack) to prevent pages > >> + * with __GFP_COMP being passed to split_page() which cannot > >> + * handle them. The real problem is that this flag probably > >> + * should be 0 on ARM as it is not supported on this > >> + * platform; see CONFIG_HUGETLBFS. > >> + */ > >> + gfp &= ~(__GFP_COMP); > > > > > > Hm, what exactly is the sense you meant in using ()? > > It's copy/paste from elsewhere in this file. At least it's consistent? :) I almost sent the exact same one, actually it was under internal reivew;) This patch is similar but is the iommu version of: commit ea2e7057c0234cfb8b09467d8f137760d371fc72 Author: Sumit Bhattacharya Date: Thu Nov 24 00:47:12 2011 +0100 ARM: 7172/1: dma: Drop GFP_COMP for DMA memory allocations dma_alloc_coherent wants to split pages after allocation in order to reduce the memory footprint. This does not work well with GFP_COMP pages, so drop this flag before allocation. This patch is ported from arch/avr32 (commit 3611553ef985ef7c5863c8a94641738addd04cff). [swarren: s/HUGETLB_PAGE/HUGETLBFS/ in comment, minor comment cleanup] Signed-off-by: Sumit Bhattacharya Tested-by: Varun Colbert Signed-off-by: Stephen Warren Signed-off-by: Russell King diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index ab58456..1aa664a 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -332,6 +332,15 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, struct page *page; void *addr; + /* + * Following is a work-around (a.k.a. hack) to prevent pages + * with __GFP_COMP being passed to split_page() which cannot + * handle them. The real problem is that this flag probably + * should be 0 on ARM as it is not supported on this + * platform; see CONFIG_HUGETLBFS. + */ + gfp &= ~(__GFP_COMP); + *handle = ~0; size = PAGE_ALIGN(size);