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: 252957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 469AD2C00A3 for ; Fri, 21 Jun 2013 00:35:52 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965454Ab3FTOfv (ORCPT ); Thu, 20 Jun 2013 10:35:51 -0400 Received: from hqemgate04.nvidia.com ([216.228.121.35]:19879 "EHLO hqemgate04.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965258Ab3FTOfu convert rfc822-to-8bit (ORCPT ); Thu, 20 Jun 2013 10:35:50 -0400 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" CC: "sergei.shtylyov@cogentembedded.com" , Richard Zhao , "linux@arm.linux.org.uk" , "m.szyprowski@samsung.com" , Stephen Warren , "linux-arm-kernel@lists.infradead.org" , "linux-tegra@vger.kernel.org" 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 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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 the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in