From 2cf6f07bf0892661b2f042e1f9514ad4e3792bda Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Wed, 24 Mar 2021 16:24:08 -0700 Subject: [PATCH] ANDROID: make cma_sysfs experimental Since it's not stable until it could be merged into Linus's tree lets make it as experimental. If a vendor want to use it, they should carry on cma_sysfs.experimental=Y on kernel parameter. Otherwise, it will be disabled. If some vendor enables it, it means they know this is experimental faeture so Android never guarantee it in the future. Bug: 179256052 Signed-off-by: Minchan Kim Change-Id: Ic6566197a7865dfcab6964d008103d3686c9d14b --- mm/cma_sysfs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/cma_sysfs.c b/mm/cma_sysfs.c index eb2f39caff59..d552b2a1506b 100644 --- a/mm/cma_sysfs.c +++ b/mm/cma_sysfs.c @@ -8,9 +8,12 @@ #include #include #include +#include #include "cma.h" +static bool experimental; + #define CMA_ATTR_RO(_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name) @@ -77,6 +80,9 @@ static int __init cma_sysfs_init(void) struct cma *cma; int i, err; + if (!experimental) + return 0; + cma_kobj_root = kobject_create_and_add("cma", mm_kobj); if (!cma_kobj_root) return -ENOMEM; @@ -110,3 +116,5 @@ out: return err; } subsys_initcall(cma_sysfs_init); + +module_param(experimental, bool, 0400);