Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2820770imm; Wed, 16 May 2018 21:18:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrmZ3wAaDr1iF+AmglbRBmKQxUgU8oSGMCSKhmk+wWWjRmklXMTK7cijc0nxZWqzeiB5mAP X-Received: by 2002:a17:902:780a:: with SMTP id p10-v6mr3642075pll.281.1526530733285; Wed, 16 May 2018 21:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526530733; cv=none; d=google.com; s=arc-20160816; b=TB/anzwwIooA+0DTJrrwcJ3kARCfqnjSrSudlJfrfnpSga6gmTZCIAxDWNWguKwKfd oltuNCq5gjfo51dxXIUF+zPNfagmMdSWmJ6ZqbDOqPaael0Ct2n0cCTga47YijF9wmfe krF/2AonRX5raa4Fv1ESCn+Ce3O3vO85pnAS389suPGV8p76Ad0yKZ8WaDfWcBJFaCf0 gfw5K30wW7Te8MNlK+hO/zrLJOrzudVaohJSBwCOvTj9X3wSB8CAVpyEu26+DEoBru2x sRH4wXEHx7jMH4onDFvwQDio/sRwhgmN+f9Vk/kxMGTLCELIqmgq+oesBX/Bmsd/3Uuy BiNA== 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=1yhV98vxGa+YDSs/5M/whalZ5kuC6JKrzfBt6YQ5FLA=; b=bPn4pzeDbnqsOHiuLQGqj6s6Hp94HTGSv+Ar4GUlNxWFy4ekqDW0mw1zLjzUyyx9Bi aLIOREAAMjOu5o+fD8fHFtCni5sHexc36uukhJV9ps9yui7cC64pKMK2Ua3h6Z2hX+pF 23UyoFCtnPovml5oY0JF+3EsZA0ZUOqlYIaaivhAVAu2Hp1ktPcBvf9TuXNzENmbETtS ekDn7EkRQGVSlNxMVJkhuIP6JhuZi8juIUPNvYEG/YA9pPgS5QDMwjmieXovA7v7yme9 mOWP6UMoHzGqvrBP8CeS6EiPRkeOST12jog6ZivPDOk8v0oSmfMKzedeSd2RhHwo7zki AmzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=crlZX37n; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f131-v6si4145567pfc.316.2018.05.16.21.18.37; Wed, 16 May 2018 21:18:53 -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=@linaro.org header.s=google header.b=crlZX37n; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbeEQEOy (ORCPT + 99 others); Thu, 17 May 2018 00:14:54 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:38556 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbeEQEOx (ORCPT ); Thu, 17 May 2018 00:14:53 -0400 Received: by mail-pl0-f65.google.com with SMTP id c11-v6so1698093plr.5 for ; Wed, 16 May 2018 21:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1yhV98vxGa+YDSs/5M/whalZ5kuC6JKrzfBt6YQ5FLA=; b=crlZX37ncDKg/0BavL30CeYVIW9z35T61tiaYFmYVktKqehPmbLk7tDhbv699PwzQ4 63ddqemjqTB/oSBKqf9dh4jWRyK4q5n3qXNxkL3jDQNlX+1jilyeHAb40wKOp9qaW12o nnf8IFWPPXzQKjSobz4jaK6p46czuKZu8MTNI= 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=1yhV98vxGa+YDSs/5M/whalZ5kuC6JKrzfBt6YQ5FLA=; b=Y+nAXgFFnbtrKYVpyIgn34cTHu1hNy/bK8k+Zj3PDbvdcWkub4IcLvDtZmzcmPRLkf owHV7lY+UncMLClOjuZMw58vBHzz+X+02hZJbK7IyRPKC5wqo7sMnf6F4lm/+/POcXvW oGuaTF9qddqWA0b7xtkHARh6jDDQw5RNIdMxlVrrR/Y/AEu2baYLlWiQAzIOnaopuRLa 85IYDYCfD86j1F/pweL0s7rd5u9g5JgLGFq9G2lBAl9LtHnyaoWFTy0aUGi+YEShb+SD g+m5PHamrH7HVxUGn6T3x5Pf42DsIFktTa770yLBMumUo/7SLGdixYXS3jo4dOQKO57M a4og== X-Gm-Message-State: ALKqPwe2NJ6F4ATJXZqzU81sMUaAMdL+aEMcOv06QOuo+ZAM/QEzVdgT Zl7j0MHNqxH0Wrra347yuHiRVA== X-Received: by 2002:a17:902:aa94:: with SMTP id d20-v6mr3747089plr.323.1526530492839; Wed, 16 May 2018 21:14:52 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id l12-v6sm5313497pgr.82.2018.05.16.21.14.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 21:14:52 -0700 (PDT) Date: Thu, 17 May 2018 09:44:48 +0530 From: Viresh Kumar To: Florian Fainelli Cc: Markus Mayer , "Rafael J. Wysocki" , Brian Norris , Gregory Fong , Markus Mayer , Broadcom Kernel List , Power Management List , ARM Kernel List , Linux Kernel Mailing List Subject: Re: [PATCH] cpufreq: brcmstb-avs-cpufreq: sort frequencies in ascending order Message-ID: <20180517041448.ceh4g5fs2qfqqojm@vireshk-i7> References: <20180516034954.56475-1-code@mmayer.net> <20180516043218.7ktq5vjq2rhcszz5@vireshk-i7> <71309e94-90d4-2b58-729b-9ab488c6d554@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71309e94-90d4-2b58-729b-9ab488c6d554@gmail.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-05-18, 12:24, Florian Fainelli wrote: > On 05/15/2018 09:32 PM, Viresh Kumar wrote: > > On 15-05-18, 20:49, Markus Mayer wrote: > >> From: Markus Mayer > >> > >> Most CPUfreq drivers (at least on ARM) seem to be sorting the available > >> frequencies from lowest to highest. To match this behaviour, we reverse > >> the sorting order in brcmstb-avs-cpufreq, so it is now also lowest to > >> highest. > > > > The reasoning isn't correct. Just because everyone else is doing it > > doesn't make it right and so you shouldn't change just because of > > that. > > > > What you must written instead in the commit log is that the cpufreq > > core performs better if the table is sorted (in any order), and so we > > must sort it as well. > > Is there a reason why set_freq_table_sorted() tries an ascending or > descending sort, but does not enforce one versus another for all drivers? set_freq_table_sorted() doesn't sort the frequency table but checks if the table is already sorted in a particular order. And then cpufreq_frequency_table_target() is optimized based on this flag. We don't have to enforce any particular ordering here. > > But I feel the table is already sorted for your platform, isn't it? > > And I don't see a clear advantage of merging this patch. > > The patch changes the order to have the lowest to highest, whereas the > current implementation has them from highest to lowest. From what you > are saying, it sounds like this is unnecessary, since the sorting is > already making things efficient enough, so this is just a cosmetic thing? Right. It shouldn't make any performance improvements. -- viresh