From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754522AbbKWWRs (ORCPT ); Mon, 23 Nov 2015 17:17:48 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:41450 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753571AbbKWWRq (ORCPT ); Mon, 23 Nov 2015 17:17:46 -0500 From: "Rafael J. Wysocki" To: Srinivas Pandruvada , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, open list Subject: Re: [PATCH V2] cpufreq: Always remove sysfs cpuX/cpufreq link on ->remove_dev() Date: Mon, 23 Nov 2015 23:47:24 +0100 Message-ID: <2639074.3VUozvte35@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1448116929.3069.1.camel@linux.intel.com> References: <1448074212.3450.4.camel@linux.intel.com> <1448116929.3069.1.camel@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday, November 21, 2015 06:42:09 AM Srinivas Pandruvada wrote: > On Sat, 2015-11-21 at 09:06 +0530, Viresh Kumar wrote: > > Subsys interface's ->remove_dev() is called when the cpufreq driver > > is > > unregistering or the CPU is getting physically removed. We keep > > removing > > the cpuX/cpufreq link for all CPUs except the last one, which is a > > mistake as all CPUs contain a link now. > > > > Because of this, one CPU from each policy will still contain a link > > (to > > an already removed policyX directory), after the cpufreq driver is > > unregistered. > > > > Fix that by removing the link first and then only see if the policy > > is > > required to be freed. That will make sure that no links are left out. > > > > Fixes: 96bdda61f58b ("cpufreq: create cpu/cpufreq/policyX > > directories") > > Reported-by: Srinivas Pandruvada > Tested-by: Srinivas Pandruvada