Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756269AbbGVHMq (ORCPT ); Wed, 22 Jul 2015 03:12:46 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:36242 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755822AbbGVHMp (ORCPT ); Wed, 22 Jul 2015 03:12:45 -0400 Date: Wed, 22 Jul 2015 12:42:40 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Rafael Wysocki , Russell King - ARM Linux , Lists linaro-kernel , "linux-pm@vger.kernel.org" , open list Subject: Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links Message-ID: <20150722071240.GD30970@linux> References: <20150718163149.GP7557@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 34 On 22-07-15, 01:15, Rafael J. Wysocki wrote: > So the problem is that the cpu_is_offline(cpu) check in > cpufreq_add_dev() matches two distinct cases: (1) the CPU was not > present before and it is just being hot-added and (2) the CPU is > initially offline, but present, and this is the first time its device > is registered. In the first case we can expect that the CPU will > become online shortly (although that is not guaranteed too), but in > the second case that very well may not happen. Yeah. > We need to be able to distinguish between those two cases and your > patch does that, but I'm not sure if this really is the most > straightforward way to do it. Maybe yeah. I will take another look into that after considering Russell's input. > I'm also unsure why you're changing the removal code paths. Is there > any particular failure scenario you're concerned about? The same issue is present here too. The problem was that cpu_offline() check was getting hit for a CPU that is present in related_cpus mask. While allocating/freeing the policy, we create links for all related_cpus and the cpu_offline() check was adding/removing the link again. -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/