Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d0b09d4 authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

Revert "mm: cma: make writeable CMA debugfs optional"



This reverts commit 099c0c9a.
CONFIG_CMA_DEBUGFS is only enabled in debug builds on 5.4+
and the purpose of this commit is to disallow CMA allocations
through debugfs on production builds. Since, this is no longer
possible, revert this change.

Change-Id: If1f322533660bfc7609fb09a5b13ff2ecbbe3135
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent f8eb824d
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -519,15 +519,6 @@ config CMA_DEBUGFS
	help
	  Turns on the DebugFS interface for CMA.

config  CMA_ALLOW_WRITE_DEBUGFS
	depends on CMA_DEBUGFS
	bool "Allow CMA debugfs write"
	help
	  Say 'y' here to allow the CMA debugfs write.
	  CMA debugfs write could be risky as it allows
	  cma allocation, so it is not recommended to
	  enable this option on any production device.

config CMA_AREAS
	int "Maximum count of the CMA areas"
	depends on CMA
+0 −10
Original line number Diff line number Diff line
@@ -74,7 +74,6 @@ static int cma_maxchunk_get(void *data, u64 *val)
}
DEFINE_SIMPLE_ATTRIBUTE(cma_maxchunk_fops, cma_maxchunk_get, NULL, "%llu\n");

#ifdef CONFIG_CMA_ALLOW_WRITE_DEBUGFS
static void cma_add_to_cma_mem_list(struct cma *cma, struct cma_mem *mem)
{
	spin_lock(&cma->mem_head_lock);
@@ -133,13 +132,8 @@ static int cma_free_write(void *data, u64 val)

	return cma_free_mem(cma, pages);
}
#else
#define cma_free_write NULL
#endif

DEFINE_SIMPLE_ATTRIBUTE(cma_free_fops, NULL, cma_free_write, "%llu\n");

#ifdef CONFIG_CMA_ALLOW_WRITE_DEBUGFS
static int cma_alloc_mem(struct cma *cma, int count)
{
	struct cma_mem *mem;
@@ -170,10 +164,6 @@ static int cma_alloc_write(void *data, u64 val)

	return cma_alloc_mem(cma, pages);
}
#else
#define cma_alloc_write NULL
#endif

DEFINE_SIMPLE_ATTRIBUTE(cma_alloc_fops, NULL, cma_alloc_write, "%llu\n");

static void cma_debugfs_add_one(struct cma *cma, struct dentry *root_dentry)