Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4839364pxv; Tue, 29 Jun 2021 17:37:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGKKhyZkAj7OYLLROfi+tuRII3xqTcWUgfJMelAwqcR8PFW1OmvlZAo4NLY8p+7GdEAtXD X-Received: by 2002:a05:6e02:1b8f:: with SMTP id h15mr24781010ili.151.1625013462079; Tue, 29 Jun 2021 17:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625013462; cv=none; d=google.com; s=arc-20160816; b=D4zc2fpEF/5GZc0dAJ/Cqu8DVxHrGeZBkCNd3CqlSk+khQy2fOf9CA7qY30XpgN0At hLmoNFLQn0jj6X1hLZhpgMDJFgT1ypGX4FCzspWfMAOhD9u8b0trRO2kXApdfXM1p83n yGBasdLna9pRTLaMnfjgOYymbvcMFdn5g19uDVMaV4lnbs3r82QiCs+YsoiNQMvgROrN wou6ID97YbaBScjfL1wyx0xR0/DNnLYkqDvqqcUodNRqscS54G5+ol4Uk0KXFIsr5JNe 0N5YpepeDs+o7QPNa+09zvfnp2dasqtc6GzbIEpJioz47qU3OOL8fkWSKOz/wvOn+AaY hH8Q== 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=7d+hvafjNqkuLN4l9EGDgvyWp865HKjDqji5vD6RecM=; b=ZvDpNDquMWLsWTOX5Rf+zT6e1ZPckn+NFuL0hY0GF/BtYIEgM+EhR++i+WU/NpiVDS HJdKen8rSunzOxBjuYDhPRV+5GN03QeHqYHrw8oj9XxQb/p3xBLUt+/tg5I3KUTA1Vpw VkEf2NgHKDm2e21WH5dvuBfAlPj1eXjfn+wExat1iC52FVtXxewv4sIqTT8wzOdsS/zS Vh77qSa66dmIE0UJiGX3xBAqEmbOd5itP0I01nng0peQndzgtPSkymv17xnmKczq/6Xc r6J3gaBOOyMcf3iZ7nKYT9yHJ886BVNuTfuH3oXVrUIvuPbzFo7EG6534L8FB5mnIpHC NQKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=XaaIg08G; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si22616233ilm.29.2021.06.29.17.37.29; Tue, 29 Jun 2021 17:37:42 -0700 (PDT) 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=@denx.de header.s=phobos-20191101 header.b=XaaIg08G; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235659AbhF3Ahg (ORCPT + 99 others); Tue, 29 Jun 2021 20:37:36 -0400 Received: from phobos.denx.de ([85.214.62.61]:38454 "EHLO phobos.denx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235641AbhF3Ahg (ORCPT ); Tue, 29 Jun 2021 20:37:36 -0400 Received: from [IPv6:::1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id DB8E08318C; Wed, 30 Jun 2021 02:35:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625013307; bh=7d+hvafjNqkuLN4l9EGDgvyWp865HKjDqji5vD6RecM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=XaaIg08GyrpafgYTDYiZY3MYc4mI7Bgolmdb0ksmBVgQwLMkUIvHqf1+cUDFumHiM zL2FhNG/tvaZZsgGcnTrPq/77X8kNUGN4r/n5NP53N7fqFMkzQT1GhbBXqBBaV6k24 KC/cQ6AyQ4kS9WQaCIP2jlmrtQXvrgwaz5qpN3WBsUPeuLbJRp1Wov1NoEWjke3tzK L8DrbtszwVK+km/EA1nAhW3Q8ByETdVM02oC62H5HxYpf3bb8mk26SYp9m8pz7zSIs 1E7xVvdvTeXDQCrgeGgvLja05Aia6HvPpO8B+ac4wO/4l6KMIHbHec5z61x6AZnATD lLsW1y3k3NdOw== Subject: Re: [PATCH] drm/stm: ltdc: improve pm_runtime to stop clocks To: Raphael GALLAIS-POU - foss Cc: Yannick FERTRE , Philippe CORNU , Raphael GALLAIS-POU , Yannick FERTRE - foss , Philippe CORNU - foss , Benjamin Gaignard , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre TORGUE - foss , "dri-devel@lists.freedesktop.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Stephen Boyd References: <20210629115709.16145-1-raphael.gallais-pou@foss.st.com> From: Marek Vasut Message-ID: <420e243d-7541-a07e-177b-d2db11c26aef@denx.de> Date: Wed, 30 Jun 2021 02:35:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210629115709.16145-1-raphael.gallais-pou@foss.st.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/29/21 1:58 PM, Raphael GALLAIS-POU - foss wrote: [...] > +++ b/drivers/gpu/drm/stm/ltdc.c > @@ -425,10 +425,17 @@ static void ltdc_crtc_atomic_enable(struct drm_crtc *crtc, > { > struct ltdc_device *ldev = crtc_to_ltdc(crtc); > struct drm_device *ddev = crtc->dev; > + int ret; > > DRM_DEBUG_DRIVER("\n"); > > - pm_runtime_get_sync(ddev->dev); > + if (!pm_runtime_active(ddev->dev)) { > + ret = pm_runtime_get_sync(ddev->dev); All these if (!pm_runtime_active()) then pm_runtime_get_sync() calls look like workaround for some larger issue. Shouldn't the pm_runtime do some refcounting on its own , so this shouldn't be needed ?