Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp30771imm; Fri, 25 May 2018 13:36:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZruLUfiGAqywbfINqm6Nfb3J07ouw1fx6qlThEyp8kAlMlPGyWHmjdkFFittchxMeOZ4jhA X-Received: by 2002:a63:79ce:: with SMTP id u197-v6mr3132771pgc.284.1527280598776; Fri, 25 May 2018 13:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527280598; cv=none; d=google.com; s=arc-20160816; b=MOkG539pfTawnLE2sbF1hLwD4VcORpy/Kjbn5FMyEsWBj4/VU9Prl/BzJfD8+HrJsX eGgtEw9uCh+bvfIYfH/nLe5TJP69PboeZaXN8HaIHJLO6TTqWxtGto9I3dGdckME9n28 fepvWLM4SRrz4mXeCZUIj0UxOgkyG7b1dOM5tufmdMa3U78q3Sa4ZYIRYawsfgDP8drd bwIs3ZprhC12sPQpKGQaIohJV+2Lj885m0qBf6XF2lJp2zIrt43nMpRs+AYI+cinmsLB FHq79Y5ZpyoZNaFmmh0G9wz5f7IHzEE1F6SXNJF4si4E/oqYj/shaU+qFs4CeW4uPsQO WYaA== 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=LIF07CTd2VhGdXdKuUiWkN5SEshLQArY51KuMIwRS0M=; b=wgHB/RPjpsmLPNItiBJ7JK1jRwrbqp9IP2WI55Fha0PgOq1NH3ofVt5jawv6tAJEIc +6jQk/Dk4saej63u4E7ARV6Jq37jh1L6WovJTJMM6X5z93s0WLLoNBn4nNdxObD/7AVn YAZ9sBllIOG+6QcF65EdjMKI5DZ++eS3Iou6UC4Yk7Jl3sGZnZV5/sumlC+tvCM5V5eB bqVS7tv3folevNRr9L+Kn5qgF1GsH5eeaeDlAVcub4jIvToiUFtmZ1y/YyMWlLxqrtWf /LnZAev2vyMbOJVYMBAiw5wkn/xou2JaeSEut788hz9qNpWS9IgA0JPgzT1Vk62S0H8B QnUw== 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 o1-v6si24028839pld.424.2018.05.25.13.36.23; Fri, 25 May 2018 13:36:38 -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 S968403AbeEYUd6 (ORCPT + 99 others); Fri, 25 May 2018 16:33:58 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:45934 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968359AbeEYUbQ (ORCPT ); Fri, 25 May 2018 16:31:16 -0400 Received: by mail-pl0-f66.google.com with SMTP id bi12-v6so3746728plb.12 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=swxRWexr3fLcVxUW2C1xFfT7mfeX8eg1TV3CWJl6po/crJhDokjjJs5YxfAzH2L1Lq kH1i/9eRHeQKZqT3pbYSgfTTUHU2AyvFwqR+1wuK4yEf8EdLoysF1BwQrHg0VEsQaGuK TD8FcDdXd0ccnTynFGJWF3UjPl1fjEdgxhylrqyHicmsZjg6NqQplH7m8psWgg46YU19 GS0ez8Mg0yvs6wqsPFNmu/RXUmHM1lM4KZaxTH0teTiKRxT0jAISx2IdL2/wDHEEPhBm af1jFjlQA4VEpJMzKZCsFrtbh6qKRSBe9IpK1Mw9B3msGY7fZ+SWauIlLcvwd+f0iUfE xndA== X-Gm-Message-State: ALKqPweeQDUK/qmx1qFImWHUXoiaya0rrIYkuLlc/Xq/eZozDUj6u5ao sByxx2eudBSDLA9ZIe/OZoT9EQ== 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-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 --- 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.17.0.921.gf22659ad46-goog