From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2D6EC433E0 for ; Tue, 22 Dec 2020 19:19:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CFE523133 for ; Tue, 22 Dec 2020 19:19:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbgLVTTH (ORCPT ); Tue, 22 Dec 2020 14:19:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbgLVTTG (ORCPT ); Tue, 22 Dec 2020 14:19:06 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E87E4C0613D3; Tue, 22 Dec 2020 11:18:25 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id a12so34541813lfl.6; Tue, 22 Dec 2020 11:18:25 -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=lcB/y6qU20WLnd5c6LTo3G6tp/OwhO3SBtrWVG5rCFc=; b=EejIC70QVALti28WPnuavpGynvc0S9z9Vat1lwcwhaT/aIgj9d4pqxEwv3zOyTaIDP wGnbYvDmOM6vimG54VEZjIQp4HBfaJWqDOmjLZ/8vaQ6pr2vm+hcXu+xBS1YQKE6uu/q kr+/N6OrkpQtpLJ8kOlg9V+0EWS9C9q8vkq77I+5GgvFDikfZsnl+6INCAImnw1+EMTk f0qcHVrmlK+RsBEVlZ6PyDiIHvFqVURHyeE0Q0HQ0L7Dw2nQxQ5thn19hiB9bz6Mr+nX WDGhtJrdSJtXUrKHzMntzzgWLTBClIU28dTWDdENyX/ey1+pWizesNNPD1LK+s6g9qni ZyIA== 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=lcB/y6qU20WLnd5c6LTo3G6tp/OwhO3SBtrWVG5rCFc=; b=fxg09ODRUXYucO5b86Myr2rddl5TOX53EivosLjFg587736DIUFP7ai49S55C5xnUZ 5uCGUuKHCWJhC2b4PsRKCNQaegA4tCwY26vYY9BHOByeOiBiQ03p+FhCji0CL/sAsCHF j1YE4bmYx1fh4yvPaXyVK9RolFJtHwX+OLpMjRiSEIPbU1Z28dJtIE7TIpHx/AaspD15 ttWKnV1TSg7EiASWkZEBRiGXMWLlb7WSVMFdEmAVEYK1Syai38BgHmfg0kVIw3z8pTWb Uw7KfVEcfx0CnVMfc6HQUpHMWWpf2UHXs3U1xotczugiYNkr4KPWjtZpeAYvCJ+cqgAx QdnA== X-Gm-Message-State: AOAM53084zj7QdRvJhEUP6wqUghMg4DP1FH3bL6oaewvchxUFz2xMiep zZyFiK+4Rl7f0OToRCNHvqcMbnFwy6U= X-Google-Smtp-Source: ABdhPJxW/f8t8lnOY/9IpSrJMD5QC3Uvhw+YOcc4pHXTNt7pE46dn90vPQ/S9qMKb9XmV6y5yqIGrQ== X-Received: by 2002:a19:950:: with SMTP id 77mr9116995lfj.133.1608664704345; Tue, 22 Dec 2020 11:18:24 -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 b5sm2782768lfg.13.2020.12.22.11.18.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Dec 2020 11:18:23 -0800 (PST) Subject: Re: [PATCH v2 15/48] opp: Support set_opp() customization without requiring to use regulators 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-16-digetx@gmail.com> <20201222090139.vopgc2ju72kr4ujy@vireshk-i7> From: Dmitry Osipenko Message-ID: <8fb90b3c-dcfe-e5e2-124e-bbb6d4bda0ad@gmail.com> Date: Tue, 22 Dec 2020 22:18:22 +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: <20201222090139.vopgc2ju72kr4ujy@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-tegra@vger.kernel.org 22.12.2020 12:01, Viresh Kumar пишет: > On 17-12-20, 21:06, Dmitry Osipenko wrote: >> Support set_opp() customization without requiring to use regulators. This >> is needed by drivers which want to use dev_pm_opp_set_rate() for changing >> rates of a multiple clocks and don't need to touch regulator. >> >> One example is NVIDIA Tegra30/114 SoCs which have two sibling 3D hardware >> units which should be use to the same clock rate, meanwhile voltage >> scaling is done using a power domain. In this case OPP table doesn't have >> a regulator, causing a NULL dereference in _set_opp_custom(). >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/opp/core.c | 16 ++++++++++++---- >> 1 file changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/opp/core.c b/drivers/opp/core.c >> index 3d02fe33630b..625dae7a5ecb 100644 >> --- a/drivers/opp/core.c >> +++ b/drivers/opp/core.c >> @@ -828,17 +828,25 @@ static int _set_opp_custom(const struct opp_table *opp_table, >> struct dev_pm_opp_supply *old_supply, >> struct dev_pm_opp_supply *new_supply) >> { >> - struct dev_pm_set_opp_data *data; >> + struct dev_pm_set_opp_data *data, tmp_data; >> + unsigned int regulator_count; >> int size; >> >> - data = opp_table->set_opp_data; >> + if (opp_table->set_opp_data) { >> + data = opp_table->set_opp_data; >> + regulator_count = opp_table->regulator_count; >> + } else { >> + data = &tmp_data; >> + regulator_count = 0; >> + } >> + >> data->regulators = opp_table->regulators; >> - data->regulator_count = opp_table->regulator_count; >> + data->regulator_count = regulator_count; >> data->clk = opp_table->clk; >> data->dev = dev; >> >> data->old_opp.rate = old_freq; >> - size = sizeof(*old_supply) * opp_table->regulator_count; >> + size = sizeof(*old_supply) * regulator_count; >> if (!old_supply) >> memset(data->old_opp.supplies, 0, size); >> else > > I don't see you making use of this in this patchset. How did you get this to > crash ? > Please see patch 38 where 3d driver makes use of devm_pm_opp_register_set_opp_helper(). The opp_table->set_opp_data=NULL and opp_table->regulator_count=-1 if OPP table doesn't use a regulator, hence the crash happens. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6D33C433E0 for ; Tue, 22 Dec 2020 19:18:30 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FC5223130 for ; Tue, 22 Dec 2020 19:18:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FC5223130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E11F12725F; Tue, 22 Dec 2020 19:18:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2y0OK64F85yM; Tue, 22 Dec 2020 19:18:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 18FB1233A6; Tue, 22 Dec 2020 19:18:28 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D46D51BF3D1 for ; Tue, 22 Dec 2020 19:18:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D10F685E60 for ; Tue, 22 Dec 2020 19:18:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZHhhwI_CDf3w for ; Tue, 22 Dec 2020 19:18:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 00CDF85E51 for ; Tue, 22 Dec 2020 19:18:25 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id o19so34608016lfo.1 for ; Tue, 22 Dec 2020 11:18:25 -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=lcB/y6qU20WLnd5c6LTo3G6tp/OwhO3SBtrWVG5rCFc=; b=EejIC70QVALti28WPnuavpGynvc0S9z9Vat1lwcwhaT/aIgj9d4pqxEwv3zOyTaIDP wGnbYvDmOM6vimG54VEZjIQp4HBfaJWqDOmjLZ/8vaQ6pr2vm+hcXu+xBS1YQKE6uu/q kr+/N6OrkpQtpLJ8kOlg9V+0EWS9C9q8vkq77I+5GgvFDikfZsnl+6INCAImnw1+EMTk f0qcHVrmlK+RsBEVlZ6PyDiIHvFqVURHyeE0Q0HQ0L7Dw2nQxQ5thn19hiB9bz6Mr+nX WDGhtJrdSJtXUrKHzMntzzgWLTBClIU28dTWDdENyX/ey1+pWizesNNPD1LK+s6g9qni ZyIA== 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=lcB/y6qU20WLnd5c6LTo3G6tp/OwhO3SBtrWVG5rCFc=; b=emTklDfwfwSUOMWqfK6+vJbq7N+nKEW6gnHNdRizCtTxCklG4HE+TA1+w9XZ0zUOb6 FFdYBqc+8iSTKnjC2p4vU2zPTdghWcc1Gze0eH2aoeGNoKYANNInZSY9M5sbuOJkg76x 4r4WJ/Msg03PsnWgsK0j46SfeCE33A2zMKd9gkgyoooTUE0i7I9prniKvR2494Ds+yiD +Q6YlkKeS+rmhkwDnuGG69d7SrZ5jrJEmVu21TlL+Huv04iK+AUL/3KqfdGV6YEiOkbZ 7qMrIv5yx04F73s8WAfce6T+nKvyGG8pgiK2zS74VGmIRcvh4B6OLyG/BpZBKh1kBQk4 0tFQ== X-Gm-Message-State: AOAM533sGTti4Ki1FjuSeESyJ2Yw18cyoLfT6pfTyrSTgFNAdLaDVtOm vRM/RgILf56AmIkLfVXzAPn/UFoaDuo= X-Google-Smtp-Source: ABdhPJxW/f8t8lnOY/9IpSrJMD5QC3Uvhw+YOcc4pHXTNt7pE46dn90vPQ/S9qMKb9XmV6y5yqIGrQ== X-Received: by 2002:a19:950:: with SMTP id 77mr9116995lfj.133.1608664704345; Tue, 22 Dec 2020 11:18:24 -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 b5sm2782768lfg.13.2020.12.22.11.18.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Dec 2020 11:18:23 -0800 (PST) Subject: Re: [PATCH v2 15/48] opp: Support set_opp() customization without requiring to use regulators To: Viresh Kumar References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-16-digetx@gmail.com> <20201222090139.vopgc2ju72kr4ujy@vireshk-i7> From: Dmitry Osipenko Message-ID: <8fb90b3c-dcfe-e5e2-124e-bbb6d4bda0ad@gmail.com> Date: Tue, 22 Dec 2020 22:18:22 +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: <20201222090139.vopgc2ju72kr4ujy@vireshk-i7> Content-Language: en-US X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Michael Turquette , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thierry Reding , linux-clk@vger.kernel.org, devel@driverdev.osuosl.org, Kevin Hilman , Nicolas Chauvet , Viresh Kumar , Krzysztof Kozlowski , Jonathan Hunter , linux-media@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , linux-tegra@vger.kernel.org, Mauro Carvalho Chehab , Stephen Boyd , Peter De Schrijver , "Rafael J. Wysocki" , Liam Girdwood , Mark Brown , Peter Geis Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" MjIuMTIuMjAyMCAxMjowMSwgVmlyZXNoIEt1bWFyINC/0LjRiNC10YI6Cj4gT24gMTctMTItMjAs IDIxOjA2LCBEbWl0cnkgT3NpcGVua28gd3JvdGU6Cj4+IFN1cHBvcnQgc2V0X29wcCgpIGN1c3Rv bWl6YXRpb24gd2l0aG91dCByZXF1aXJpbmcgdG8gdXNlIHJlZ3VsYXRvcnMuIFRoaXMKPj4gaXMg bmVlZGVkIGJ5IGRyaXZlcnMgd2hpY2ggd2FudCB0byB1c2UgZGV2X3BtX29wcF9zZXRfcmF0ZSgp IGZvciBjaGFuZ2luZwo+PiByYXRlcyBvZiBhIG11bHRpcGxlIGNsb2NrcyBhbmQgZG9uJ3QgbmVl ZCB0byB0b3VjaCByZWd1bGF0b3IuCj4+Cj4+IE9uZSBleGFtcGxlIGlzIE5WSURJQSBUZWdyYTMw LzExNCBTb0NzIHdoaWNoIGhhdmUgdHdvIHNpYmxpbmcgM0QgaGFyZHdhcmUKPj4gdW5pdHMgd2hp Y2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gcGF0Y2hzZXQuIEhvdyBkaWQg eW91IGdldCB0aGlzIHRvCj4gY3Jhc2ggPwo+IAoKUGxlYXNlIHNlZSBwYXRjaCAzOCB3aGVyZSAz ZCBkcml2ZXIgbWFrZXMgdXNlIG9mCmRldm1fcG1fb3BwX3JlZ2lzdGVyX3NldF9vcHBfaGVscGVy KCkuCgpUaGUgb3BwX3RhYmxlLT5zZXRfb3BwX2RhdGE9TlVMTCBhbmQgb3BwX3RhYmxlLT5yZWd1 bGF0b3JfY291bnQ9LTEgaWYKT1BQIHRhYmxlIGRvZXNuJ3QgdXNlIGEgcmVndWxhdG9yLCBoZW5j ZSB0aGUgY3Jhc2ggaGFwcGVucy4KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX18KZGV2ZWwgbWFpbGluZyBsaXN0CmRldmVsQGxpbnV4ZHJpdmVycHJvamVjdC5v cmcKaHR0cDovL2RyaXZlcmRldi5saW51eGRyaXZlcnByb2plY3Qub3JnL21haWxtYW4vbGlzdGlu Zm8vZHJpdmVyZGV2LWRldmVsCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A761C433E6 for ; Wed, 23 Dec 2020 10:52:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 35914224B0 for ; Wed, 23 Dec 2020 10:52:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35914224B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 376A46E925; Wed, 23 Dec 2020 10:51:39 +0000 (UTC) Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by gabe.freedesktop.org (Postfix) with ESMTPS id CA37E6E16D for ; Tue, 22 Dec 2020 19:18:25 +0000 (UTC) Received: by mail-lf1-x12f.google.com with SMTP id m12so34530724lfo.7 for ; Tue, 22 Dec 2020 11:18:25 -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=lcB/y6qU20WLnd5c6LTo3G6tp/OwhO3SBtrWVG5rCFc=; b=EejIC70QVALti28WPnuavpGynvc0S9z9Vat1lwcwhaT/aIgj9d4pqxEwv3zOyTaIDP wGnbYvDmOM6vimG54VEZjIQp4HBfaJWqDOmjLZ/8vaQ6pr2vm+hcXu+xBS1YQKE6uu/q kr+/N6OrkpQtpLJ8kOlg9V+0EWS9C9q8vkq77I+5GgvFDikfZsnl+6INCAImnw1+EMTk f0qcHVrmlK+RsBEVlZ6PyDiIHvFqVURHyeE0Q0HQ0L7Dw2nQxQ5thn19hiB9bz6Mr+nX WDGhtJrdSJtXUrKHzMntzzgWLTBClIU28dTWDdENyX/ey1+pWizesNNPD1LK+s6g9qni ZyIA== 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=lcB/y6qU20WLnd5c6LTo3G6tp/OwhO3SBtrWVG5rCFc=; b=koBmjZEzHd7Bb9CBOImEF5IMgRiAqd25LC4lKFVatZoY+T1yVjP5AAQLmsoRwCRRyh prO5kksz9hVjN2UU3/Z06BE67td+Yw/X0isihm86DfFqVDOhJkoRDdMnmkdLxoZuKtck u43R7YWC05e+16NgwI0njPI/9PbHA45buCHlIU9cRDh6sD98zo6XRDXkSbZ/Bt+L9hnM +ETZwt/bfGrhbvnu9wiBWZF5ocUYC3qRsyDFHhg41nVJ1HMupBUzmhfZpV/0NZPuEyUZ DzkeKzLkj2agO6qN/4SYZJa2LtTCIzO5OHUgq6QU4mdnMC2EORMhuAgc/KEPFZ0p2F5a K5CA== X-Gm-Message-State: AOAM532chbcPCL685ICMF4fN2a+d170HsXcLoRaiTs9diPgdh/XbAC6Z Tj6weeOvsaTwGvM1glsm2Zw= X-Google-Smtp-Source: ABdhPJxW/f8t8lnOY/9IpSrJMD5QC3Uvhw+YOcc4pHXTNt7pE46dn90vPQ/S9qMKb9XmV6y5yqIGrQ== X-Received: by 2002:a19:950:: with SMTP id 77mr9116995lfj.133.1608664704345; Tue, 22 Dec 2020 11:18:24 -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 b5sm2782768lfg.13.2020.12.22.11.18.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Dec 2020 11:18:23 -0800 (PST) Subject: Re: [PATCH v2 15/48] opp: Support set_opp() customization without requiring to use regulators To: Viresh Kumar References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-16-digetx@gmail.com> <20201222090139.vopgc2ju72kr4ujy@vireshk-i7> From: Dmitry Osipenko Message-ID: <8fb90b3c-dcfe-e5e2-124e-bbb6d4bda0ad@gmail.com> Date: Tue, 22 Dec 2020 22:18:22 +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: <20201222090139.vopgc2ju72kr4ujy@vireshk-i7> Content-Language: en-US X-Mailman-Approved-At: Wed, 23 Dec 2020 10:51:31 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Michael Turquette , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thierry Reding , linux-clk@vger.kernel.org, devel@driverdev.osuosl.org, Kevin Hilman , Nicolas Chauvet , Viresh Kumar , Krzysztof Kozlowski , Jonathan Hunter , linux-media@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , linux-tegra@vger.kernel.org, Mauro Carvalho Chehab , Stephen Boyd , Peter De Schrijver , "Rafael J. Wysocki" , Liam Girdwood , Mark Brown , Peter Geis Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" MjIuMTIuMjAyMCAxMjowMSwgVmlyZXNoIEt1bWFyINC/0LjRiNC10YI6Cj4gT24gMTctMTItMjAs IDIxOjA2LCBEbWl0cnkgT3NpcGVua28gd3JvdGU6Cj4+IFN1cHBvcnQgc2V0X29wcCgpIGN1c3Rv bWl6YXRpb24gd2l0aG91dCByZXF1aXJpbmcgdG8gdXNlIHJlZ3VsYXRvcnMuIFRoaXMKPj4gaXMg bmVlZGVkIGJ5IGRyaXZlcnMgd2hpY2ggd2FudCB0byB1c2UgZGV2X3BtX29wcF9zZXRfcmF0ZSgp IGZvciBjaGFuZ2luZwo+PiByYXRlcyBvZiBhIG11b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