Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3922269rwa; Tue, 23 Aug 2022 12:34:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR5jL7uwr5CXDecnmQaJATIi13XTWW+9utAyXD0f77upyZm115YRwnd15pgwQ4eSQdB0A9ke X-Received: by 2002:a17:907:6d8f:b0:73d:8416:908b with SMTP id sb15-20020a1709076d8f00b0073d8416908bmr660058ejc.651.1661283258352; Tue, 23 Aug 2022 12:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661283258; cv=none; d=google.com; s=arc-20160816; b=rOkHsmvN2ZQ+ykwZG02WkZ7myfnAhn2xK7zyR2+Jo58BUG/NMX1xUSG3WYJ1gEd3CR NbI4IXHW7jso5pUdXcuAkSmkNliBTlaVQq1mvsLaAg5ajHcj5ASwnG3Zbcrt/405IKb0 rXFbG1ZvrnLeR6+YQDgQcrqJf73LRTZQFRa3+16C7FiNVdpWUFCVyJpxUdfvv+07p7t8 cxZXIud3EYfKHSCjeA6mG5SewEYTjRF5CyE/JPPN8G21H3Xrch/xFYBD/a8TcxDQ7oXx CmH1VIeAOpa8dkaVk2BkKmMtYiD9jI6VsBGLxs4049LD/u+EScyvT2NqPK/1MFwc0B5J ej/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=tPcD7EUnD6n/pd4xrlexLo0BVKkP6oVxoQ1jP9+QRfY=; b=0z0HMcBlhPKCyieatLin+vr2Q88qQOifSgTsk+K1hRS4/VZ1JGuzAIgRuEkNphJSbA lWj3qwrUdc0z/rGlFqWj6OKfirBrtmTnyoOXlL2uWYFF4q4mbQBPGuqQ6RK/f9B39nR8 DJugVL7+lIo//JYO8NfDqchv+U57/loK31YbnSySnd+p8SjssdriyvSaFCyqr9Cb5gWL MhKX7X/N9tJn77OxlC9guokdJeTUekNzshBEu4bKBVXFte16+08AsJg5cXNHAfluRpEo YTr5LTPz2Nc0AaDegTOvk0MigPp1y3tv68kJTbTSO1y1DkBtYYq6azB8wl3SnUfwbL5d VNAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n14-20020a05640205ce00b00445b8b26174si3072396edx.396.2022.08.23.12.33.52; Tue, 23 Aug 2022 12:34:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232157AbiHWTWT (ORCPT + 99 others); Tue, 23 Aug 2022 15:22:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231739AbiHWTVw (ORCPT ); Tue, 23 Aug 2022 15:21:52 -0400 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAED2B4425; Tue, 23 Aug 2022 11:02:26 -0700 (PDT) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-335624d1e26so400762497b3.4; Tue, 23 Aug 2022 11:02:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=tPcD7EUnD6n/pd4xrlexLo0BVKkP6oVxoQ1jP9+QRfY=; b=dq9+DvYQEAGYeySAObrB8Sm77zs6J7I6OSPa27SGS/yS4RAYbRed2bRDS/7d+jegoq qe1H8p1ZNBguBnZvjfS+acDWhra3fZGYhwidlnImLGYfRoJZwk+f0De5rXoZGDY8Wx0i a393wIDbJYrM/zbh4V+G0KiFUptIpbl3rXDP4wqyQOLb9ExSfVqHB4/9r1wv4RImmWSo H/VshsFStlMxDMoZIQOIlbkb++zZ1aV8yB78GhKyKBCsAFqlYsYvHC6hDeVqZX4hw0Xp nJU6PfbMTHx7TRU0LsQccUXw1SO6pcPn+Uu2WGOhmxgXctem/yeeOVg5KmHJRhU82H81 8tEA== X-Gm-Message-State: ACgBeo2NMY4ZDm/8g1T+j6IGYMLzx3E6CL9XfHXZhW+leZwWQ0EYTS7k 2lUNxtVUiVqHOF2CLNtErm7oN2fT0MerfNILOuI= X-Received: by 2002:a25:ec0c:0:b0:690:d092:2d56 with SMTP id j12-20020a25ec0c000000b00690d0922d56mr23726786ybh.622.1661277745810; Tue, 23 Aug 2022 11:02:25 -0700 (PDT) MIME-Version: 1.0 References: <20220816120157.24455-1-lukasz.luba@arm.com> In-Reply-To: <20220816120157.24455-1-lukasz.luba@arm.com> From: "Rafael J. Wysocki" Date: Tue, 23 Aug 2022 20:02:14 +0200 Message-ID: Subject: Re: [PATCH v2] cpufreq: check only freq_table in __resolve_freq() To: Lukasz Luba Cc: Linux Kernel Mailing List , Linux PM , Viresh Kumar , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2022 at 2:02 PM Lukasz Luba wrote: > > There is no need to check if the cpufreq driver implements callback > cpufreq_driver::target_index. The logic in the __resolve_freq uses > the frequency table available in the policy. It doesn't matter if the > driver provides 'target_index' or 'target' callback. It just has to > populate the 'policy->freq_table'. > > Thus, check only frequency table during the frequency resolving call. > > Acked-by: Viresh Kumar > Signed-off-by: Lukasz Luba > --- > Changes: > v2: > - collected ACK from Viresh > - corrected patch description (Viresh) > > > drivers/cpufreq/cpufreq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 7820c4e74289..69b3d61852ac 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -532,7 +532,7 @@ static unsigned int __resolve_freq(struct cpufreq_policy *policy, > > target_freq = clamp_val(target_freq, policy->min, policy->max); > > - if (!cpufreq_driver->target_index) > + if (!policy->freq_table) > return target_freq; > > idx = cpufreq_frequency_table_target(policy, target_freq, relation); > -- Applied as 6.0-rc material, thanks!