Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp473741imu; Fri, 9 Nov 2018 00:25:47 -0800 (PST) X-Google-Smtp-Source: AJdET5eF3u85jhdPu1AmoHRVx06dxv4OPAnijOqpGMs3MET9bTYJWbufCCw7rUWNOaX4zfUh2RND X-Received: by 2002:a17:902:b286:: with SMTP id u6-v6mr8071517plr.89.1541751947912; Fri, 09 Nov 2018 00:25:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541751947; cv=none; d=google.com; s=arc-20160816; b=lznBLAmp+ZlDCyz+Egck+clbXeq64jCLnccuBchetSGjfl0B5sovtkqctc6YAJtHd/ FzWxvcEUI28q7dPE69P6E9+lUyQ2Nchc4qlTrk8Z/Tu9s4aB3785LDsqkjkIRedHb/SD olNfu8ucY9G2XZOCkl1nK2T3utrfNd4TU7tRJKXGpwDxrRtSyaXeWUTYTTkDo/2JImhJ L8LDpiBUBEos/gyjWFkmnNTwCNPbM6jKttW0OHBuJNZA7xiH/w9iPOSDIe0qEgCkkJQs FqAmSU1vk3/LvC5u/ZE8Ifcc05eZuGO3gKXJ16RUF2foz4ZXvd9mGdCu0hQG2lkth9IK REag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LemySw+6VGiamWvqm4d+lqoRj+4VmarF9XYWRMSCiY0=; b=NCjMZljoJHjbkvtgmBd06A8cdqWeR1/08uGhXFZnOIPjoTgfldR5KgSt0KRItjN9IV QVqbhRNYouj3jJO6gdJuPs7S+uacWVQb6R8fUKPcKE8wqXB++sSUB+nZy2BPnED3R6/y 3LNXrF+lIv4Vf8SV0atfP+KAYMrbQ25kMvQpweIzppxF4MyVaydCqNwtau5ewgGjzFMU zHEXHrW15snmQgPn/QDuOMkTgJKsNUgincO5YMICQn7W7SiQIPGxxKc9UqV7O71qpzIr t8w/kx6RAnZ/0Iztgz/2msbsHDNh+K61s1pRMse/U7MoR4BfV5t0QYh4gZBysUhYMTFF xULw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kXRqBVeN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si6942365plp.132.2018.11.09.00.25.32; Fri, 09 Nov 2018 00:25:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kXRqBVeN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbeKISEh (ORCPT + 99 others); Fri, 9 Nov 2018 13:04:37 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44807 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbeKISEg (ORCPT ); Fri, 9 Nov 2018 13:04:36 -0500 Received: by mail-pg1-f195.google.com with SMTP id w3-v6so541993pgs.11 for ; Fri, 09 Nov 2018 00:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LemySw+6VGiamWvqm4d+lqoRj+4VmarF9XYWRMSCiY0=; b=kXRqBVeNEZdfgT3ytQbgbNo0uRTe3Xsc6d3oPkkEZhjcWlI18sIckVu6vbliNO90tc olUj5T/CnTthMuYB9ChqlAk12gsPARZ7DmsTtDZXCLYlzQAffFO20/PQnFgJJl2kYV6j 5FpNkBRpuQUMncbBrRoIectbjBfuwZzMPWSr8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LemySw+6VGiamWvqm4d+lqoRj+4VmarF9XYWRMSCiY0=; b=oUxcsI+KmWEq7xTeq8p/XjvIOpU85WqFkdqFlwzBQ0IoMwNJ9E7NuU0Ab2RIAsP1nA nGNqqP8L9dl2wxXBSL+9AvDUQgIoxA1qIKamEyATwDsqyL1Mpj+BOVNTz0k0lPG1ScWr 6Way69CCYSQzPHfrDXbETRa7MpI8wVn6J/fKa9AqDxwAWqLJEqN3PqBvG1rfz/S8pZsm xCsKLjAPAeDJxma82SoC5K1bDCuh3NvCauUl0oKRtTOLHEy2AHI0aFSVx/u1n4J1x4Gs cJzoDbzssCAeQcp8ldmSWTcGSRJFFutUzh3qSpW1ZcgvKHvLYonlJNOAP0Igy4CASqNW oXrQ== X-Gm-Message-State: AGRZ1gJGlK8C9UuEjtmWgxSKonRc1LMc8zbFHoSXyTf5wKcY6ml+U2gT MFzLCT5weJzZLUdc10EROSEnvQ== X-Received: by 2002:a62:7514:: with SMTP id q20-v6mr8165586pfc.8.1541751906702; Fri, 09 Nov 2018 00:25:06 -0800 (PST) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:f659:7f17:ea11:4e8e]) by smtp.gmail.com with ESMTPSA id u2-v6sm6415667pfn.50.2018.11.09.00.25.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 00:25:06 -0800 (PST) From: Nicolas Boichat To: Robin Murphy Cc: Will Deacon , Joerg Roedel , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Michal Hocko , Mel Gorman , Levin Alexander , Huaisheng Ye , Mike Rapoport , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yong Wu , Matthias Brugger , Tomasz Figa , yingjoe.chen@mediatek.com Subject: [PATCH RFC 2/3] include/linux/gfp.h: Add __get_dma32_pages macro Date: Fri, 9 Nov 2018 16:24:47 +0800 Message-Id: <20181109082448.150302-3-drinkcat@chromium.org> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog In-Reply-To: <20181109082448.150302-1-drinkcat@chromium.org> References: <20181109082448.150302-1-drinkcat@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some callers (e.g. iommu/io-pgtable-arm-v7s) require DMA32 memory when calling __get_dma_pages. Add a new macro for that purpose. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- include/linux/gfp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 76f8db0b0e715c..50e04896b78017 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -535,6 +535,8 @@ void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask); #define __get_dma_pages(gfp_mask, order) \ __get_free_pages((gfp_mask) | GFP_DMA, (order)) +#define __get_dma32_pages(gfp_mask, order) \ + __get_free_pages((gfp_mask) | GFP_DMA32, (order)) extern void __free_pages(struct page *page, unsigned int order); extern void free_pages(unsigned long addr, unsigned int order); -- 2.19.1.930.g4563a0d9d0-goog