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=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 7CFD3C35E15 for ; Tue, 25 Feb 2020 20:57:51 +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 4D06D222C2 for ; Tue, 25 Feb 2020 20:57:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="gg6Rej+l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D06D222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 575386EBAC; Tue, 25 Feb 2020 20:57:49 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5B64A6EBAC for ; Tue, 25 Feb 2020 20:57:48 +0000 (UTC) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 146422467D for ; Tue, 25 Feb 2020 20:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582664268; bh=rEf2Wh9b2Cqc5tJSuDzSluIyGn5h8PEv+2AGQEQ1p7s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gg6Rej+lEjdE3MacAgPmABGfeEK4naM3qOPYaKvI6VDiP+dnMybL0IxoHGVGDs7yy E3V+I76+lUu0xY/bwpiOuR2QpnM95bq/0c4t6LVntRLm17lQNFftdzZSonrfhuEA9D oR7Ir/7pF1qi7QFUxPXnrZq2XPZK6VAIOSpFAbUg= Received: by mail-qk1-f177.google.com with SMTP id f3so574747qkh.3 for ; Tue, 25 Feb 2020 12:57:48 -0800 (PST) X-Gm-Message-State: APjAAAUgINMoboCKW4W+SV1F22XzL9eJBiJOJhnmpcE+GNsUyU8CEr9J iW119luSF/pTCMcCapV8e558i9NyC3hqjGBL/w== X-Google-Smtp-Source: APXvYqz2R5nikNFiKQzE3WzYAa4JRDhsDEPVyRy8hsiD3YIxfbq2k/r6k7Ue9axTsmsjn+eGEtYJoB+gv797DdDBI14= X-Received: by 2002:a37:a750:: with SMTP id q77mr933467qke.119.1582664267060; Tue, 25 Feb 2020 12:57:47 -0800 (PST) MIME-Version: 1.0 References: <20200221194731.13814-1-lukasz.luba@arm.com> <20200221194731.13814-5-lukasz.luba@arm.com> In-Reply-To: <20200221194731.13814-5-lukasz.luba@arm.com> From: Rob Herring Date: Tue, 25 Feb 2020 14:57:36 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 4/4] drm/panfrost: Register to the Energy Model with devfreq device To: Lukasz Luba 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: Nishanth Menon , juri.lelli@redhat.com, Peter Zijlstra , Viresh Kumar , Liviu Dudau , dri-devel , Bjorn Andersson , bsegall@google.com, Alyssa Rosenzweig , Morten Rasmussen , patrick.bellasi@matbug.net, Amit Kucheria , Lorenzo Pieralisi , Vincent Guittot , Kevin Hilman , Andy Gross , Daniel Lezcano , Steven Price , Chanwoo Choi , Ingo Molnar , NXP Linux Team , Zhang Rui , mgorman@suse.de, orjan.eide@arm.com, "open list:THERMAL" , linux-arm-msm , Sascha Hauer , Steven Rostedt , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , linux-omap , Dietmar.Eggemann@arm.com, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , David Airlie , javi.merino@arm.com, Tomeu Vizoso , qperret@google.com, Stephen Boyd , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , Bartlomiej Zolnierkiewicz , Sascha Hauer , Sudeep Holla , Shawn Guo Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Feb 21, 2020 at 1:48 PM Lukasz Luba wrote: > > Add device to the Energy Model framework. It will create a dedicated > and unified data structures used i.e. in the thermal framework. > The power model used in dev_pm_opp subsystem is simplified and created > based on DT 'dynamic-power-coefficient', volatage and frequency. It is typo. > similar to the CPU model used in Energy Aware Scheduler. > > Signed-off-by: Lukasz Luba > --- > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > index 413987038fbf..d527a5113950 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > @@ -105,6 +105,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) > } > pfdev->devfreq.devfreq = devfreq; > > + dev_pm_opp_of_register_em(dev, NULL); Can't fail? > + > cooling = of_devfreq_cooling_register(dev->of_node, devfreq); > if (IS_ERR(cooling)) > DRM_DEV_INFO(dev, "Failed to register cooling device\n"); > @@ -118,6 +120,7 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev) > { > if (pfdev->devfreq.cooling) > devfreq_cooling_unregister(pfdev->devfreq.cooling); > + dev_pm_opp_of_unregister_em(&pfdev->pdev->dev); > dev_pm_opp_of_remove_table(&pfdev->pdev->dev); Does it make sense to keep this (and the registration side) as separate calls? Perhaps there's some ordering requirement with everything between dev_pm_opp_of_add_table() and dev_pm_opp_of_register_em()? While you're just adding 2 lines, it seems there's a lot of complexity exposed to the driver just to initialize devfreq/opp. Rob _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel