soc: qcom: mem-offline: add module param for disabling the feature

Add module param named 'nopasr' for disabling memory offlining feature
via cmdline. In such case, driver probe is skipped from adding sysfs nodes
so that userspace services would disable as well, and also skips adding
remaining blocks if kernel memory was limited with 'mem=' param.

Change-Id: I2de5efad51bba6a1d734ee248c55a12f3870ad1c
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
This commit is contained in:
Sudarshan Rajagopalan 2021-08-18 00:43:02 -07:00 committed by Chris Goldsworthy
parent 2f5247b0ce
commit ba978111da

View File

@ -129,6 +129,9 @@ struct memory_refresh_request {
static struct section_stat *mem_info;
static int nopasr;
module_param_named(nopasr, nopasr, uint, 0644);
static void record_stat(unsigned long sec, ktime_t delay, int mode)
{
unsigned int total_sec = end_section_nr - start_section_nr + 1;
@ -1417,6 +1420,11 @@ static int mem_offline_driver_probe(struct platform_device *pdev)
int ret, i;
ktime_t now;
if (nopasr) {
pr_info("mem-offline: nopasr mode enabled. Skipping probe\n");
return 0;
}
ret = mem_parse_dt(pdev);
if (ret)
return ret;