From patchwork Fri May 25 20:30:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10428489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA3FA6032C for ; Fri, 25 May 2018 20:34:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA9BD2971D for ; Fri, 25 May 2018 20:34:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF005297BA; Fri, 25 May 2018 20:34:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A7992971D for ; Fri, 25 May 2018 20:34:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968352AbeEYUd6 (ORCPT ); Fri, 25 May 2018 16:33:58 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46398 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968360AbeEYUbQ (ORCPT ); Fri, 25 May 2018 16:31:16 -0400 Received: by mail-pl0-f66.google.com with SMTP id 30-v6so3753690pld.13 for ; Fri, 25 May 2018 13:31:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LIF07CTd2VhGdXdKuUiWkN5SEshLQArY51KuMIwRS0M=; b=YNYXh8SDUrKJggPp2Nk8dy1vClLaQoYPuqTWID+V454bpCTZXuIkQlVxECJUO5BP5/ HfjVo57W11HYbOr4vh1A6VlMBO/zM+KuXZTrrv4rMRkFp9MZGt3NRuw++zxcsSxI+NQS Fqr7OIy+HzyZYl7L0DpTGZaW+OGcIqFD7nnh06YiBTYPKawmNHAFrtX4m1J777Ml/Pxz QKCQjD4Nm1TeL37PTeKOeEW25P9r3iBTBjqjI90VwOnF3oHmwOubg8HJ18/TGZtwHB8/ 7SPExmQ4DCqMrgaP/UM04xEw0OEOBVHAYCMZBu2JYaLnJdApVa1uykdx5+x425pqlach pasg== X-Gm-Message-State: ALKqPwdIcMkSajJ+tF3N8BEoDlRhiIBSYhsptoHOFhbhGH6uwXqxPX9m JuhwNR0Kn328fMj0UiAij8iLkw== X-Google-Smtp-Source: AB8JxZp9HL81qdWheihJXSuwjYc7t/Onjds61OpepFTavoUPHrbd0MPlWvwSFRCFQYum9LfDt3b1gA== X-Received: by 2002:a17:902:bd46:: with SMTP id b6-v6mr4070238plx.170.1527280276137; Fri, 25 May 2018 13:31:16 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id p1-v6sm42912360pfp.137.2018.05.25.13.31.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 13:31:15 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Matthias Kaehlcke Subject: [PATCH 01/11] PM / devfreq: Init user limits from OPP limits, not viceversa Date: Fri, 25 May 2018 13:30:33 -0700 Message-Id: <20180525203043.249193-2-mka@chromium.org> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-goog In-Reply-To: <20180525203043.249193-1-mka@chromium.org> References: <20180525203043.249193-1-mka@chromium.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit ab8f58ad72c4 ("PM / devfreq: Set min/max_freq when adding the devfreq device") introduced the initialization of the user limits min/max_freq from the lowest/highest available OPPs. Later commit f1d981eaecf8 ("PM / devfreq: Use the available min/max frequency") added scaling_min/max_freq, which actually represent the frequencies of the lowest/highest available OPP. scaling_min/ max_freq are initialized with the values from min/max_freq, which is totally correct in the context, but a bit awkward to read. Swap the initialization and assign scaling_min/max_freq with the OPP freqs and then the user limts min/max_freq with scaling_min/ max_freq. Needless to say that this change is a NOP, intended to improve readability. Signed-off-by: Matthias Kaehlcke Reviewed-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index fe2af6aa88fc..0057ef5b0a98 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -604,21 +604,21 @@ struct devfreq *devfreq_add_device(struct device *dev, mutex_lock(&devfreq->lock); } - devfreq->min_freq = find_available_min_freq(devfreq); - if (!devfreq->min_freq) { + devfreq->scaling_min_freq = find_available_min_freq(devfreq); + if (!devfreq->scaling_min_freq) { mutex_unlock(&devfreq->lock); err = -EINVAL; goto err_dev; } - devfreq->scaling_min_freq = devfreq->min_freq; + devfreq->min_freq = devfreq->scaling_min_freq; - devfreq->max_freq = find_available_max_freq(devfreq); - if (!devfreq->max_freq) { + devfreq->scaling_max_freq = find_available_max_freq(devfreq); + if (!devfreq->scaling_max_freq) { mutex_unlock(&devfreq->lock); err = -EINVAL; goto err_dev; } - devfreq->scaling_max_freq = devfreq->max_freq; + devfreq->max_freq = devfreq->scaling_max_freq; dev_set_name(&devfreq->dev, "devfreq%d", atomic_inc_return(&devfreq_no));