Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6071674pxu; Wed, 23 Dec 2020 12:38:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTpncegM7iPKZ08IT0+zcMERqLCTApApi70Ei6eHvJG2KPX/uDg11WO9wrXLzie4d5CjAo X-Received: by 2002:a05:6402:2066:: with SMTP id bd6mr26117111edb.211.1608755930414; Wed, 23 Dec 2020 12:38:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608755930; cv=none; d=google.com; s=arc-20160816; b=xlt2AP0P1swHMSjonDTjYgAS71uWYHgwsZD58Dv7r9QAdm2RYCEPK90VQE66PYESui HFVSjKLMHFuA8dC3fQ1xpcrDfse/vcvePTX7tApxOUe8Q3oR4jS3WK4K1ofdYQx83+Y0 cO/R49MKE2W98WpXCi4e8NYaM/KiLHswRzjv0zIqFwJsei3VICvB3vPMnzdFynNrzn4K 8h9mNBx4OxB1YX5+Z8d8DyNGFg71lvYePPs4C91m3K4uWRytZh/80pF5ZQiDlUHFN+vc 27UufsZqZK2DHgO0ce+PmS48heiECuoPQJnr68YZYRPXgCK9dicSyHq62BJ7aJomjam+ 2Slg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=z8D0v9w6eLHS5d5x0vZY+QzqYtTC2mP/fYl8494giiU=; b=vRSmXzDF5nhyjnNh07BvofYZkyrb1u0rQJwhwljHYCloa5l1qwwy4z8Elyr5qiKFjr 42qwzcam8QfslNPvYRuWq5XUU+Hs9OReYXQDz8LhCyvb79rVQJ4NvpJROwOEYhM9NwM7 dq87X0WO4iewjQkw1OJS+rIPebk8dunwcEdh9CagM3IM7H8qIekf2Y+Hf15EJ39X7oeu McYiPs1XMHCSsocrvxaKAq/lrtrqh2aADeBT1f64wAg9EuU8kAzndRFvOjceTRZHk2o2 o/e20eChELUs3IjbctKpeTIoE127CDRuP5LSTrV+w092FxOYPQULbCAF0QmEvXT3sbNr l5Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HadHxSML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si12425415eju.94.2020.12.23.12.38.27; Wed, 23 Dec 2020 12:38:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HadHxSML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729087AbgLWUhN (ORCPT + 99 others); Wed, 23 Dec 2020 15:37:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbgLWUhN (ORCPT ); Wed, 23 Dec 2020 15:37:13 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B002C061794; Wed, 23 Dec 2020 12:36:32 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id y19so200975lfa.13; Wed, 23 Dec 2020 12:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=z8D0v9w6eLHS5d5x0vZY+QzqYtTC2mP/fYl8494giiU=; b=HadHxSMLhDZhkJqBkxDVtRCRHgzsranQMuvvPkCW8ZvWERI0I/IV3jmYhrnnUiBMI+ 7bhhS0TCu++x3528jZkIg0GBh93HvAHa4m5GFYkt4lut2M+43qdrkbdbQymCHGAvtZwS gPa9zaEGRLx854V8GzVDPvoNJd/vl09zAQV4+eIvWEF9DfOM/DN+IVabjMlyg7bFptR3 peW/KIS0flnlEUh9OP1v+48hjIhLMv1IqpfCsHwsT5faZmJPdepA2s80mn0eUyUHOa0I zE3A8fT2QV1G2b1n/M8N0awGXrQEuf+3I6INY8xv14mX3oKWJIO6Mv1Ys47bGKcm+cBi Mqag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=z8D0v9w6eLHS5d5x0vZY+QzqYtTC2mP/fYl8494giiU=; b=NuFCPNAWMAGI2tvpGe3rm55rQCqnA719GLlwIbLfehNtvyZu96my/rVq9V81m5YYrs lNXl47ht+bNJG2IWLj5jIROh89w4ZI4s3+mtrgTzlFd2VxCzlC29Nnoc4hj5DpgBGP1G JEYEHjhOHtj/PtdvDDI2wGzktFSJ7oBc0Wthf/c6JH6xTlFwUp4koY0HFqNjJmZmaY4L bs0lwY7GrROJB3zfgPDZQNvK066t5kIUULkqGt+6NuxjvVro7JVXTpIsoX6nGg20d3bc iQMnMR8rvXS/nArfrz2aMsnMWYdFfQmQWW/+pFOR4Zfi3WdTe4SFF+sU1J3yNYg1qV2j 2LMg== X-Gm-Message-State: AOAM532IP10rLSQwk+rem++JU87ftuhB6mXWK8p43GI5mOlIbfJ913xL oQGPToTiEGA6rIOITtiRGotdLErq6sM= X-Received: by 2002:a2e:980f:: with SMTP id a15mr12009304ljj.301.1608755790793; Wed, 23 Dec 2020 12:36:30 -0800 (PST) Received: from [192.168.2.145] (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.googlemail.com with ESMTPSA id y20sm3658851lji.86.2020.12.23.12.36.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Dec 2020 12:36:30 -0800 (PST) Subject: Re: [PATCH v2 19/48] opp: Fix adding OPP entries in a wrong order if rate is unavailable To: Viresh Kumar Cc: Thierry Reding , Jonathan Hunter , Mark Brown , Liam Girdwood , Ulf Hansson , Mauro Carvalho Chehab , Rob Herring , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Michael Turquette , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-20-digetx@gmail.com> <20201222091255.wentz5hyt726qezg@vireshk-i7> <20201223043443.rklw5er6hck3gl4y@vireshk-i7> From: Dmitry Osipenko Message-ID: <7688d6b9-52a2-d30f-123f-43c01e03b968@gmail.com> Date: Wed, 23 Dec 2020 23:36:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.2 MIME-Version: 1.0 In-Reply-To: <20201223043443.rklw5er6hck3gl4y@vireshk-i7> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 23.12.2020 07:34, Viresh Kumar пишет: > On 22-12-20, 22:19, Dmitry Osipenko wrote: >> 22.12.2020 12:12, Viresh Kumar пишет: >>> On 17-12-20, 21:06, Dmitry Osipenko wrote: >>>> Fix adding OPP entries in a wrong (opposite) order if OPP rate is >>>> unavailable. The OPP comparison is erroneously skipped if OPP rate is >>>> missing, thus OPPs are left unsorted. >>>> >>>> Signed-off-by: Dmitry Osipenko >>>> --- >>>> drivers/opp/core.c | 23 ++++++++++++----------- >>>> drivers/opp/opp.h | 2 +- >>>> 2 files changed, 13 insertions(+), 12 deletions(-) >>>> >>>> diff --git a/drivers/opp/core.c b/drivers/opp/core.c >>>> index 34f7e530d941..5c7f130a8de2 100644 >>>> --- a/drivers/opp/core.c >>>> +++ b/drivers/opp/core.c >>>> @@ -1531,9 +1531,10 @@ static bool _opp_supported_by_regulators(struct dev_pm_opp *opp, >>>> return true; >>>> } >>>> >>>> -int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2) >>>> +int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2, >>>> + bool rate_not_available) >>>> { >>>> - if (opp1->rate != opp2->rate) >>>> + if (!rate_not_available && opp1->rate != opp2->rate) >>> >>> rate will be 0 for both the OPPs here if rate_not_available is true and so this >>> change shouldn't be required. >> >> The rate_not_available is negated in the condition. This change is >> required because both rates are 0 and then we should proceed to the >> levels comparison. > > Won't that happen without this patch ? No