From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751574AbdBUFAh (ORCPT ); Tue, 21 Feb 2017 00:00:37 -0500 Received: from mail-pg0-f48.google.com ([74.125.83.48]:36322 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750896AbdBUFAO (ORCPT ); Tue, 21 Feb 2017 00:00:14 -0500 Date: Tue, 21 Feb 2017 10:30:10 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM , Srinivas Pandruvada , LKML , Jonathan Corbet , Linux Documentation Subject: Re: [RFC][PATCH] cpufreq: User/admin documentation update and consolidation Message-ID: <20170221050010.GW21911@vireshk-i7> References: <6949552.t0rZsBY3Lp@aspire.rjw.lan> <20170220095608.GS21911@vireshk-i7> <4488503.27M9KJWnWE@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4488503.27M9KJWnWE@aspire.rjw.lan> 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 20-02-17, 14:58, Rafael J. Wysocki wrote: > Yes, it is called for new and inactive policies. > > For new policies it has to populate policy->cpus (because otherwise the core > doesn't know what CPUs should be there), which quite arguably doesn't have > to (or even doesn't need to) be done for inactive policies (because they already > have policy->real_cpus and policy->related_cpus populated). > I would even argue that ->init() should not update policy->cpus for inactive > (but not new) policies. I agree, but I am not aware of any platforms that we have today which does any similar checks in ->init(). And I wouldn't encourage drivers to have such special handling at all. Why make it complex? The way you have written it earlier suggests that the drivers should check if the policy is active or not (by looking at related_cpus mask) and set the cpus mask only for new policies. I was just worried that new driver authors will actually try to write special code in init() for that and if we really want that to be the case. -- viresh