Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2594932imj; Mon, 11 Feb 2019 05:37:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IaoJd8cdOeBYSYc10GdhKHdNbufEoUKjchVl7ebSne8lNAgV7dO4cRgnAM31KZ5m3oMUYkY X-Received: by 2002:a17:902:7892:: with SMTP id q18mr37515891pll.217.1549892230718; Mon, 11 Feb 2019 05:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549892230; cv=none; d=google.com; s=arc-20160816; b=TmBMAkZoH5ArNEDzjyAiIknFK2PMi6ZwHvxffFVODWolSNXLVjdD6zfycQ8DJgvX7k LRt0YAgorfQK6kqZNF1hEh04UO830B0p6Jn4LBp91JWy4GzzBxyZr+RGF3itIWENtYY4 soMsu8c3MVCm+mLnzR6DDT/v8/Kc+EbGrTZi31jgiyHQXorVrz1jBH3R3ts0iPMQ5omG DnONUkMEy0EydL85iagu5J6pL/h33R+xIwN4EMR/Qx6myg3hkB4CNYLAAVh8csOEOhBt KgkJrWz7ZymE5lwR4lw5J5rM98AJpOwGSResFNlDHYT85Frzui1IgFJUl/V8Nce55X3C 8A7Q== 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=kS81US42l2eBH55sNfQ2cxqJLL8J5zIp6tiw36gy2lk=; b=edap5uYQuEIEDkV75+GHkuAeQmrWBeoFPAu3yxcRmPjghfI/6pQX8XmEPopUxdATev UNygosbr6VHuIqTxnA5Fk3ZOX2sGd7EzT03aa2ixY2+QD+xmLecQZhgCaF2XIadMYd3G Ls5U4GaAO9TZ+mNf7fVQfbfPX5IApnMTmelPbRCm3bkBR/TVgjoh9z7xFjsYzl34ZZ+R Je74exvpDsqpbe8gREaZElJndebsMHq6y8HwvKmN2+AuUyhMSE27fxW5vt+Jvwib4E0Q LjEg8PjzBRygr2Q4Ojq6ZXUkU4kZwJPVit/YHDgcD9Sl/NjvKRxk3oPrCKnOd781OmTd 9khg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=EyLuCDHD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si10009251pgf.54.2019.02.11.05.36.54; Mon, 11 Feb 2019 05:37:10 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=EyLuCDHD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728123AbfBKNg1 (ORCPT + 99 others); Mon, 11 Feb 2019 08:36:27 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47034 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728116AbfBKNgW (ORCPT ); Mon, 11 Feb 2019 08:36:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kS81US42l2eBH55sNfQ2cxqJLL8J5zIp6tiw36gy2lk=; b=EyLuCDHDWfjzDGunyxTVNtkg+H ipxJCXmkBSFVn/Fu+J/jiy+YkGgfNuyRX7jJYG9D3n5Vp6ohMN4cdeuCGoCwAzGBuSacj3iqouGte v2LfEpqXVqggN1nCbIOrNPwUXxzSMYXbjfPCH0RCFRz9vl9ueIv29G3a5UxkbKD91lVfyx7orUsP7 FKS7NnREErcImnr0xoHGOhXdb+vFWAvLKpyTstAHjfb3HXWvh6gaenK+JhzTjsjodL6xKNnH116O4 OfpJmrW2ET+ND8yAhI0mzyVC/5cplIkipVQZqv38BOn7i5Sw9A7mCekh4ICVPk7jp/iTJ2WO2sQKb 0Hu9FRTQ==; Received: from 089144210182.atnat0019.highway.a1.net ([89.144.210.182] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtBkw-0000D4-Ff; Mon, 11 Feb 2019 13:36:19 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org Cc: Greg Kroah-Hartman , Lee Jones , x86@kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/12] dma-mapping: move CONFIG_DMA_CMA to kernel/dma/Kconfig Date: Mon, 11 Feb 2019 14:35:49 +0100 Message-Id: <20190211133554.30055-8-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211133554.30055-1-hch@lst.de> References: <20190211133554.30055-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is where all the related code already lives. Signed-off-by: Christoph Hellwig --- drivers/base/Kconfig | 77 -------------------------------------------- kernel/dma/Kconfig | 77 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 3e63a900b330..059700ea3521 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -191,83 +191,6 @@ config DMA_FENCE_TRACE lockup related problems for dma-buffers shared across multiple devices. -config DMA_CMA - bool "DMA Contiguous Memory Allocator" - depends on HAVE_DMA_CONTIGUOUS && CMA - help - This enables the Contiguous Memory Allocator which allows drivers - to allocate big physically-contiguous blocks of memory for use with - hardware components that do not support I/O map nor scatter-gather. - - You can disable CMA by specifying "cma=0" on the kernel's command - line. - - For more information see . - If unsure, say "n". - -if DMA_CMA -comment "Default contiguous memory area size:" - -config CMA_SIZE_MBYTES - int "Size in Mega Bytes" - depends on !CMA_SIZE_SEL_PERCENTAGE - default 0 if X86 - default 16 - help - Defines the size (in MiB) of the default memory area for Contiguous - Memory Allocator. If the size of 0 is selected, CMA is disabled by - default, but it can be enabled by passing cma=size[MG] to the kernel. - - -config CMA_SIZE_PERCENTAGE - int "Percentage of total memory" - depends on !CMA_SIZE_SEL_MBYTES - default 0 if X86 - default 10 - help - Defines the size of the default memory area for Contiguous Memory - Allocator as a percentage of the total memory in the system. - If 0 percent is selected, CMA is disabled by default, but it can be - enabled by passing cma=size[MG] to the kernel. - -choice - prompt "Selected region size" - default CMA_SIZE_SEL_MBYTES - -config CMA_SIZE_SEL_MBYTES - bool "Use mega bytes value only" - -config CMA_SIZE_SEL_PERCENTAGE - bool "Use percentage value only" - -config CMA_SIZE_SEL_MIN - bool "Use lower value (minimum)" - -config CMA_SIZE_SEL_MAX - bool "Use higher value (maximum)" - -endchoice - -config CMA_ALIGNMENT - int "Maximum PAGE_SIZE order of alignment for contiguous buffers" - range 4 12 - default 8 - help - DMA mapping framework by default aligns all buffers to the smallest - PAGE_SIZE order which is greater than or equal to the requested buffer - size. This works well for buffers up to a few hundreds kilobytes, but - for larger buffers it just a memory waste. With this parameter you can - specify the maximum PAGE_SIZE order for contiguous buffers. Larger - buffers will be aligned only to this specified order. The order is - expressed as a power of two multiplied by the PAGE_SIZE. - - For example, if your system defaults to 4KiB pages, the order value - of 8 means that the buffers will be aligned up to 1MiB only. - - If unsure, leave the default value "8". - -endif - config GENERIC_ARCH_TOPOLOGY bool help diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig index b122ab100d66..d785286ad868 100644 --- a/kernel/dma/Kconfig +++ b/kernel/dma/Kconfig @@ -53,3 +53,80 @@ config DMA_REMAP config DMA_DIRECT_REMAP bool select DMA_REMAP + +config DMA_CMA + bool "DMA Contiguous Memory Allocator" + depends on HAVE_DMA_CONTIGUOUS && CMA + help + This enables the Contiguous Memory Allocator which allows drivers + to allocate big physically-contiguous blocks of memory for use with + hardware components that do not support I/O map nor scatter-gather. + + You can disable CMA by specifying "cma=0" on the kernel's command + line. + + For more information see . + If unsure, say "n". + +if DMA_CMA +comment "Default contiguous memory area size:" + +config CMA_SIZE_MBYTES + int "Size in Mega Bytes" + depends on !CMA_SIZE_SEL_PERCENTAGE + default 0 if X86 + default 16 + help + Defines the size (in MiB) of the default memory area for Contiguous + Memory Allocator. If the size of 0 is selected, CMA is disabled by + default, but it can be enabled by passing cma=size[MG] to the kernel. + + +config CMA_SIZE_PERCENTAGE + int "Percentage of total memory" + depends on !CMA_SIZE_SEL_MBYTES + default 0 if X86 + default 10 + help + Defines the size of the default memory area for Contiguous Memory + Allocator as a percentage of the total memory in the system. + If 0 percent is selected, CMA is disabled by default, but it can be + enabled by passing cma=size[MG] to the kernel. + +choice + prompt "Selected region size" + default CMA_SIZE_SEL_MBYTES + +config CMA_SIZE_SEL_MBYTES + bool "Use mega bytes value only" + +config CMA_SIZE_SEL_PERCENTAGE + bool "Use percentage value only" + +config CMA_SIZE_SEL_MIN + bool "Use lower value (minimum)" + +config CMA_SIZE_SEL_MAX + bool "Use higher value (maximum)" + +endchoice + +config CMA_ALIGNMENT + int "Maximum PAGE_SIZE order of alignment for contiguous buffers" + range 4 12 + default 8 + help + DMA mapping framework by default aligns all buffers to the smallest + PAGE_SIZE order which is greater than or equal to the requested buffer + size. This works well for buffers up to a few hundreds kilobytes, but + for larger buffers it just a memory waste. With this parameter you can + specify the maximum PAGE_SIZE order for contiguous buffers. Larger + buffers will be aligned only to this specified order. The order is + expressed as a power of two multiplied by the PAGE_SIZE. + + For example, if your system defaults to 4KiB pages, the order value + of 8 means that the buffers will be aligned up to 1MiB only. + + If unsure, leave the default value "8". + +endif -- 2.20.1