Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp188447imm; Tue, 3 Jul 2018 16:51:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKw+EfQNNyfjlijlqiqiyx0bl20ejJi+fbkrebjiGcMn8rxQud1JlUrR0p/pl/NCZZnCfr4 X-Received: by 2002:a17:902:d716:: with SMTP id w22-v6mr31783075ply.98.1530661872928; Tue, 03 Jul 2018 16:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530661872; cv=none; d=google.com; s=arc-20160816; b=jm11/5nwIpHERfi3T8fM13F82vblt+esCIIA9UWYE3vc7ZE0LGD252VFTMes7vEdr7 tpHc5CbUVpnbnipwY4aLy1f7bxVPM5Ms+DGITQ30WwlvRMnUtMs2onOlyugdvcj/FXRL BB+x3xXjGf+zfHBge0A3V4MQVTLbonc3UbR2EkZIiVL7ha/J57CAFBoqFN7HsM2CpecX Zac5K/OyROdSCA/TIlcDksiU6A2Ly3zog12gpqFTNVw3BWsC2d/WqdYQ9eZPpOZDYsNG 2/W/lhbGz7OqbmxQrijOBQZpJBvInT/2oIBHNBm2ex0NjG3RL21R8cpTV6lvIPNazhfo SVEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=t//gmzpIVvV+WQDfrai/menR07GoTdBew0ehvnbR71Y=; b=ilthqGNGmp8CddeSitE4dmCY241d2NljXzajDW0y/ZgNqvmKtNMxYYzUozqScEv90H 0oXPUmbVAF12Z61UMDSoodNicTAmZUXQflr3JgaK2Fh5c4YVX6HH9KdLtjEZeJTqVA2/ kJH7Wv04N06hHSiCH4geMPt59pFS6zONY4tNDGlsA8BF6gFskucGQofZ6WLGRxebRYiv zuRQ+2piRRcvgRl7Vqb+1pjI13NuhZo2Y5G3mLKbnvpjALtQeCH4NLP0VnBXDc+GPl3u ue3zJsUwNR7KQSn45yqn67dSzfTDRvrEriEYkpH0tJE90LIPJpa43QE90de9vssiVKYq wpFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11-v6si2082001pla.184.2018.07.03.16.50.58; Tue, 03 Jul 2018 16:51:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753366AbeGCXr1 (ORCPT + 99 others); Tue, 3 Jul 2018 19:47:27 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:45909 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271AbeGCXrY (ORCPT ); Tue, 3 Jul 2018 19:47:24 -0400 Received: by mail-pf0-f194.google.com with SMTP id y24-v6so1720073pfe.12 for ; Tue, 03 Jul 2018 16:47:24 -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=t//gmzpIVvV+WQDfrai/menR07GoTdBew0ehvnbR71Y=; b=l6TE2qIPzVPLq8FLbhd9UvHgUNQq/I5w7+czRNkYehxBB0rtwuQOKkBFYwX6P188TD 5gwVq3dxtZxH1HXmna4i+nvlRwMo1qocjOj7N0NlF7VHiB91a6l+InDHru5sKJ153vMM QaU7idvdWxDV34hXKqSq6bGoKsylPZsh6keWhKNBRBkPhg42mAN9H+cQFH2HDUDzad3+ ggKIwo2XnYu1F2McqRsuAVc/6mYe7Ne/esOkSkRVH4zeOCUoFAmrM6lW0X/z1EqDADmU XyvYcxANIL8qrBupxvJKXXQ2yr1bbZlUOph2e+dQC3kJHwpvOsNkJp4WXYKrDEL1W6cL Ctzg== X-Gm-Message-State: APt69E3rieMnPPmb4gmXJ0vsIrkNsthkw7CA5PioPBGNKQm5wjgGpEgw yIvEJoNYI2Q1FH8B2opFri9eOQ== X-Received: by 2002:a62:4a51:: with SMTP id x78-v6mr31824908pfa.45.1530661643730; Tue, 03 Jul 2018 16:47:23 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id l85-v6sm6608562pfk.79.2018.07.03.16.47.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 16:47:22 -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 , Enric Balletbo i Serra , "Rafael J . Wysocki" , Viresh Kumar , Lee Jones , Benson Leung , Olof Johansson , Matthias Kaehlcke Subject: [PATCH v5 01/12] PM / devfreq: Init user limits from OPP limits, not viceversa Date: Tue, 3 Jul 2018 16:46:54 -0700 Message-Id: <20180703234705.227473-2-mka@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180703234705.227473-1-mka@chromium.org> References: <20180703234705.227473-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Brian Norris --- Changes in v5: - none Changes in v4: - added 'Reviewed-by: Brian Norris ' tag Changes in v3: - none Changes in v2: - added 'Reviewed-by: Chanwoo Choi ' tag --- 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)); -- 2.18.0.203.gfac676dfb9-goog