Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3732677imm; Tue, 29 May 2018 12:33:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqjvQpnj0Go947EiEpaDrzmMvfXHTqeKKWK9/ON6Uam6znKHiyNrAGtd36BCuCGRtCph+02 X-Received: by 2002:a63:618f:: with SMTP id v137-v6mr15102054pgb.145.1527622422807; Tue, 29 May 2018 12:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527622422; cv=none; d=google.com; s=arc-20160816; b=vQmNU5uUtbAGZjIjPv9pjLG156ic61R1rC2yv2OSmseJY66Ncq/6Yd5XHDeAEoTwc2 Ng5KNNmUbOJdYNFcKUgIDnOz5/Vtx/cF/AF3bAPK8P8qA+TU3PBhDPCubn2z6HB3Ybz6 yraggCuOgyRcR9a9T9HR4o5cZnuKw7NTqGSw0aTLdPOTNd5EyOTDkshgCVlp7r+rEkkp 5sh+F3CU9Fh4VWj3tGCmY3VHO4o2EbeEZTzLWmKjt6+y/0Zm6G7cKXXdV+7YXCkJHkvH OlP5iOT1B8jkQFap6YqcI1IzVWpybO2bDwk6e9ICx8aBksGn4uDMdZT//rg9Hu3SaVGN dgWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=sQ5iMFnQSIrW/znZPrIADPYeTejamw5YcxJI9BxqUwo=; b=H2EjncFQpRGTfd+QUEp+F2OTotyMP97qHD3k/eTeweb3UKaxSrNDW/AH8aZmnZnsdr MMCeLi6aWebjSLtseES7ltYpzw1uTGe6R2tk0L8oQQ8UVaQhoviwV/uq0yW9qCTCC4CT xUllnMfXeSB8mwueqgimKCj4jRRwLFiXx05wSyweWWEVDbCKCXAr1qchzyUhd03G2FFW TUepV49Fu4QLoUZRH/n4hyZUufWKsn51YrVQd/JDbUsv8jF/1PPvGayP2PbiC5GiOo/9 SvdErY24WF//Z7biMBp6H8s9GvtUpD0JTAeSwns3nhxbCCQndWAJJJdm5cLx20imigcD Ft9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V5SeaooO; 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=pass (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 z8-v6si25843511pgc.693.2018.05.29.12.33.28; Tue, 29 May 2018 12:33:42 -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; dkim=pass header.i=@chromium.org header.s=google header.b=V5SeaooO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966397AbeE2Tcl (ORCPT + 99 others); Tue, 29 May 2018 15:32:41 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:45495 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966107AbeE2Tci (ORCPT ); Tue, 29 May 2018 15:32:38 -0400 Received: by mail-pl0-f66.google.com with SMTP id bi12-v6so9525899plb.12 for ; Tue, 29 May 2018 12:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sQ5iMFnQSIrW/znZPrIADPYeTejamw5YcxJI9BxqUwo=; b=V5SeaooOVjFO8nOIPah466eLr3aRuxs0SYn5Bax3do7SmQTMSb9+4aNpfYb1KzD+2u Rwm9aXz0lqteJgPRO2tVnQnKosbwuPdE9CrJm0kek2oPcgfloR0H+KGAbylEOg1RGJki 2wcY7IEfrPj7Krh738w8gJtiVOvIzCzGtwQK8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sQ5iMFnQSIrW/znZPrIADPYeTejamw5YcxJI9BxqUwo=; b=HMrQP5LFslggakN1REe1ogbkgX+wAJLDoQ/rRc7jb8qydIUSkrNC5GNCFPkUtJcgCR dhEeDIYAilDCNq4HiyNHdVtbY77xl0uVZkzjXWcrCIb84KSQGLWF+Otw92qoetO7NHA3 UHT/M4CcWy9gE1UEQf4eyLBmBufOOTUEzGNI9MczwBf4H5N0USakfvIjWxIiDH8eBG5F 5dlEisB+yRIS7F1+VqWl4VMlqi47JsaDzboovkQAn7HRmf+7oQ49RTuygQP7Mu+cRSOl C026BmjYVWBEkeRkCu2FjfVe0Guf0Zjm+o6cmKebBpnDBHMJQHuGWXpd8QHQnpeZGoNn 3mQw== X-Gm-Message-State: ALKqPwdpaAFDT8LvUK9kiKFLOTVHugJkyMk7SDS/oA9A4eJgY0NWmEAr FxKNxPW/M1A2DKXrHQDybQWRJg== X-Received: by 2002:a17:902:7c16:: with SMTP id x22-v6mr12786410pll.77.1527622358264; Tue, 29 May 2018 12:32:38 -0700 (PDT) Received: from localhost ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id u90-v6sm14518171pfa.101.2018.05.29.12.32.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 12:32:37 -0700 (PDT) Date: Tue, 29 May 2018 12:32:36 -0700 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 Subject: Re: [PATCH 05/11] PM / devfreq: governors: Return device frequency limits instead of user limits Message-ID: <20180529193236.GH168650@google.com> References: <20180525203043.249193-6-mka@chromium.org> <20180525203043.249193-1-mka@chromium.org> <20180528050444epcms1p8e6552d55231a099ec89304dfb1f819b9@epcms1p8> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180528050444epcms1p8e6552d55231a099ec89304dfb1f819b9@epcms1p8> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 28, 2018 at 02:04:44PM +0900, MyungJoo Ham wrote: > >The performance, powersave and simpleondemand governors can return > >df->min/max_freq, which are the user defined frequency limits. > >update_devfreq() already takes care of adjusting the target frequency > >with the user limits if necessary, therefore we can return > >df->scaling_min/max_freq instead, which is the min/max frequency > >supported by the device at a given time (depending on the > >enabled/disabled OPPs) > > > >Signed-off-by: Matthias Kaehlcke > >--- > > drivers/devfreq/governor_performance.c | 2 +- > > drivers/devfreq/governor_powersave.c | 2 +- > > drivers/devfreq/governor_simpleondemand.c | 6 +++--- > > 3 files changed, 5 insertions(+), 5 deletions(-) > > > > Actually, even scaling_max_freq and scaling_min_freq are > covered centerally at devfreq.c:update_devfreq(); > > Wouldn't it be sufficient to return UINT_MAX for performance > and return UINT_MIN (0) for powersave, if the purpose is to > remove redundancy? > > In the same sense, we may return UINT_MAX for freq-increasing > case for simpleondemand as well, because they are filtered > centrally anyway. > > (This commit might be better merged to 4/11 in that case as well.) I did this in the first variant of the patch (before sending it in a series), but Chanwoo Choi objected: https://patchwork.kernel.org/patch/10404893/ I also still think that returning a constant would be the cleanest solution if we can agree on this. What do you think about DEVFREQ_MIN/MAX_FREQ (0/UINT_MAX) to make things slightly clearer?