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

Commit acf14241 authored by Sudarshan Rajagopalan's avatar Sudarshan Rajagopalan Committed by Swathi Sridhar
Browse files

soc: qcom: mem-offline: Ignore hotplug notification for other blocks



Other blocks that don't belong to mem-offline can still be offlined and
onlined if their 'removable' is set. This will call our notifier registered
to this driver. We don't want to do any AOP notification or record stats
for blocks that don't belong to mem-offline. Hence, just log the action on
those blocks and avoid performing any further actions.

Change-Id: I2adc128dfc099c908f67075fdd10e6520533dc5c
Signed-off-by: default avatarSudarshan Rajagopalan <sudaraja@codeaurora.org>
parent 00ea36d5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -118,6 +118,14 @@ static int mem_event_callback(struct notifier_block *self,
	start_addr = __pfn_to_phys(start);
	end_addr = __pfn_to_phys(end);
	sec_nr = pfn_to_section_nr(start);

	if (sec_nr > end_section_nr || sec_nr < start_section_nr) {
		if (action == MEM_ONLINE || action == MEM_OFFLINE)
			pr_info("mem-offline: %s mem%d, but not our block. Not performing any action\n",
				action == MEM_ONLINE ? "Onlined" : "Offlined",
				sec_nr);
		return NOTIFY_OK;
	}
	switch (action) {
	case MEM_GOING_ONLINE:
		pr_debug("mem-offline: MEM_GOING_ONLINE : start = 0x%lx end = 0x%lx\n",