From ea2ba6f23cc4b96136c41b19a270af2d1400f165 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 18 Nov 2016 13:04:57 +0530 Subject: [PATCH] sparc64: release thirds level cache reference for cpu hotplug feature This crash as see on T7-4 which was related to the introduction of 3rd level caching patch. issue: sysfs: cannot create duplicate filename '/devices/system/cpu/cpu0/cache' Orabug: 24841354 Reviewed-by: Chris Hyser Signed-off-by: Allen Pais (cherry picked from commit c33aebff52457ee7d0bacc922dc23b07cee4139a) --- arch/sparc/kernel/sysfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c index 3708a783d369..f5043d3b0468 100644 --- a/arch/sparc/kernel/sysfs.c +++ b/arch/sparc/kernel/sysfs.c @@ -480,6 +480,10 @@ static void unregister_cpu_online(unsigned int cpu) unregister_mmu_stats(s); for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) device_remove_file(s, &cpu_core_attrs[i]); + + for (i = 0; i < MAX_CACHE_LEVEL; i++) + kobject_put(&(INDEX_KOBJECT_PTR(cpu, i)->kobj)); + kobject_put(cache_kobjs[cpu]); } #endif -- 2.50.1