From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752496AbcC3LVK (ORCPT ); Wed, 30 Mar 2016 07:21:10 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:33153 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbcC3LVI (ORCPT ); Wed, 30 Mar 2016 07:21:08 -0400 Date: Wed, 30 Mar 2016 16:51:04 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Rafael Wysocki , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List Subject: Re: [PATCH] cpufreq: acpi: policy->driver_data can't be NULL in ->exit() Message-ID: <20160330112104.GF24343@vireshk-i7> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-03-16, 13:15, Rafael J. Wysocki wrote: > On Wed, Mar 30, 2016 at 6:24 AM, Viresh Kumar wrote: > > Its always set by ->init() and so it will always be there in ->exit(). > > There is no need to have a special check for just that. > > I'm not sure what happens if there are two (or more) CPUs in the policy, though. > > That case is almost certainly handled incorrectly here (or rather not > handled at all), but it may just happen to sort of work, because the > first exiting CPU will clear driver_data and the second one will > notice that it is NULL now. Of course, that still is racy with > respect to governors etc, but I'd rather fix the driver properly. Sorry, I probably didn't understood your comments properly. But, the core will call ->exit() only for the last exiting CPU. So, driver_data will never be NULL. -- viresh