From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932986AbdKAOmj (ORCPT ); Wed, 1 Nov 2017 10:42:39 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:47908 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853AbdKAOmi (ORCPT ); Wed, 1 Nov 2017 10:42:38 -0400 Date: Wed, 1 Nov 2017 14:42:31 +0000 From: Brian Starkey To: Liviu Dudau Cc: Mali DP Maintainers , David Airlie , DRI-devel , LKML Subject: Re: [PATCH] drm: hdlcd: Skip checking the clock provider when CRTC is disabled. Message-ID: <20171101144231.GA17750@e107564-lin.cambridge.arm.com> References: <20171101141625.3297-1-Liviu.Dudau@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20171101141625.3297-1-Liviu.Dudau@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 01, 2017 at 02:16:25PM +0000, Liviu Dudau wrote: >Some clock providers (clk-vexpress-osc) trigger a WARN() when the >requested rate falls outside its capabilities, as is the case when >a CRTC gets disabled. Check if the CRTC's new state is enabled and >skip the clk_round_rate() call if it is not. In itself, this seems like a fine patch. However, the motivation maybe isn't. IMO the WARN() in clk-vexpress-osc is bogus and should be removed - the clk_round_rate() API is intended to convert from a desired rate to something the clock actually supports - so it's basically expected that the input rate might not be achievable. Spewing a WARN when the API is used as-intended seems a little off :-) Cheers, -Brian > >Reported-by: Vladimir Murzin >Signed-off-by: Liviu Dudau >Tested-by: Vladimir Murzin >--- > drivers/gpu/drm/arm/hdlcd_crtc.c | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c >index 72b22b805412b..a1387a8bf78c4 100644 >--- a/drivers/gpu/drm/arm/hdlcd_crtc.c >+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c >@@ -193,6 +193,10 @@ static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc, > struct drm_display_mode *mode = &state->adjusted_mode; > long rate, clk_rate = mode->clock * 1000; > >+ /* if the crtc is disabled, skip the clock check */ >+ if (!state->enable) >+ return 0; >+ > rate = clk_round_rate(hdlcd->clk, clk_rate); > if (rate != clk_rate) { > /* clock required by mode not supported by hardware */ >-- >2.14.1 >