Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754312AbbGHEvk (ORCPT ); Wed, 8 Jul 2015 00:51:40 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:36722 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753305AbbGHEvV (ORCPT ); Wed, 8 Jul 2015 00:51:21 -0400 Date: Wed, 8 Jul 2015 10:21:03 +0530 From: Viresh Kumar To: Dmitry Torokhov Cc: Pan Xinhui , "linux-kernel@vger.kernel.org" , linux-pm@vger.kernel.org, rjw@rjwysocki.net, "mnipxh@163.com" , "yanmin_zhang@linux.intel.com" Subject: Re: [PATCH V2] acpi-cpufreq: replace per_cpu with driver_data of policy Message-ID: <20150708045103.GA19130@linux> References: <559BC96E.8020804@intel.com> <20150707171126.GB12491@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150707171126.GB12491@dtor-ws> 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: 811 Lines: 23 Hi Dmitry, On 07-07-15, 10:11, Dmitry Torokhov wrote: > > + data = policy->driver_data; > > + cpufreq_cpu_put(policy); > > If we put policy here can we guarantee that memory pointed to by data > stays valid? Shoudln't we issue cpufreq_cpu_put(policy) after we done > assessing the pointer? Ideally yes, you are right. But this was a special case as a callback of the cpufreq-driver is being called and any such issues must be handled at the core level, it at all they are relevant. So probably we can do cpufreq_cpu_put() as soon as we have used it. -- 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/