Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp462000pxb; Thu, 5 Nov 2020 04:59:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSPukROap+ss+1Hnfq7SnLWGSCMNnDq6a6V3iiuXFWKFvXq720iXT8XmqZcQHBVEQGCsDa X-Received: by 2002:a17:906:cd0f:: with SMTP id oz15mr2200237ejb.228.1604581151593; Thu, 05 Nov 2020 04:59:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604581151; cv=none; d=google.com; s=arc-20160816; b=XW2/X2FLaOpl4n7G8q3wE+FMk4FTKNDiRRvdBuFtM8UyRiIlZ3KnwB7CgJBB+wUUcF 42I3xGCBgJJihKU1GxEywiy1zOB67e5hwhM6GS3CqYsaI46T2NnLljpqT778CL5rHBfP t86v7OhLOIjDorNGdv8cFCUSKXkbJJe91OLu4MiJjFLy96V/F0m+Pozb6bOlvrBaL+Vz ZJ63KgO6RgjlphnNigyF90h32stH9FsEWcnJp+3WovjbOQywOtlvrXMACtj4/nhxvhuH fHicUg+ibyN0dGj1wrXvIGuLiE1wz7aYRHBnugHd+6G7JfdfHNpZOdc4dK9p4ebhZUEj nhbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=6EEIEG9MuSZsTF391sAfPsOqCGFs6SFd2zZEb7UcQrA=; b=iz7Hgn0CQ4obXn27fVojMcx8SaCBPaEYJGoXLhUDARKQye6D0cp9hI9y44G3Oh8e96 zK3c5tiDzreh+WjN8IYAfHdP0OLR07l6uqwtPwznodPCrSsAXPeq3qqXTUa8YqIDOLVX 4p+co9ikxS5Mmf8gzn1siFCFkSasUNKdyqe6fYJfnSkpZBe6Nv8cS3nPqGD54/tReGkX LJ4td/s8LHL0nx1GiOt1wlRRzLkJYwOpaZGlsmimm+2x2gaQ+keLvhfz0HKzB4qeSX0F bRGqIHX7CFdwSsFsMwzGRVLbYa9TCIXUC+IY2/eEx8Qr85MNjNsiAdSJXlmcvgyfIaLb 29XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si1130122ejz.214.2020.11.05.04.58.48; Thu, 05 Nov 2020 04:59:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730871AbgKEM45 (ORCPT + 99 others); Thu, 5 Nov 2020 07:56:57 -0500 Received: from foss.arm.com ([217.140.110.172]:60042 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730808AbgKEM4v (ORCPT ); Thu, 5 Nov 2020 07:56:51 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7B56C14BF; Thu, 5 Nov 2020 04:56:50 -0800 (PST) Received: from e108754-lin.cambridge.arm.com (e108754-lin.cambridge.arm.com [10.1.198.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4709A3F719; Thu, 5 Nov 2020 04:56:49 -0800 (PST) From: Ionela Voinescu To: rjw@rjwysocki.net, viresh.kumar@linaro.org, lenb@kernel.org, sudeep.holla@arm.com Cc: morten.rasmussen@arm.com, jeremy.linton@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, ionela.voinescu@arm.com Subject: [PATCH 6/8] cppc_cpufreq: clarify support for coordination types Date: Thu, 5 Nov 2020 12:55:22 +0000 Message-Id: <20201105125524.4409-7-ionela.voinescu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201105125524.4409-1-ionela.voinescu@arm.com> References: <20201105125524.4409-1-ionela.voinescu@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The previous coordination type handling in the cppc_cpufreq init code created some confusion: the comment mentioned "Support only SW_ANY for now" while only the SW_ALL/ALL case resulted in a failure. The other coordination types (HW_ALL/HW, NONE) were silently supported. Clarify support for coordination types while describing in comments the intended behavior. Signed-off-by: Ionela Voinescu Cc: Rafael J. Wysocki Cc: Viresh Kumar --- drivers/cpufreq/cppc_cpufreq.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index fd2daeb59b49..60ac7f8049b5 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -363,11 +363,22 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu); policy->shared_type = domain->shared_type; - if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { + switch (policy->shared_type) { + case CPUFREQ_SHARED_TYPE_HW: + case CPUFREQ_SHARED_TYPE_NONE: + /* Nothing to be done - we'll have a policy for each CPU */ + break; + case CPUFREQ_SHARED_TYPE_ANY: + /* + * All CPUs in the domain will share a policy and all cpufreq + * operations will use a single cppc_cpudata structure stored + * in policy->driver_data. + */ cpumask_copy(policy->cpus, domain->shared_cpu_map); - } else if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL) { - /* Support only SW_ANY for now. */ - pr_debug("Unsupported CPU co-ord type\n"); + break; + default: + pr_info("Unsupported cpufreq CPU co-ord type: %d\n", + policy->shared_type); return -EFAULT; } -- 2.17.1