From patchwork Wed Nov 1 14:16:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 117721 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp941259qgn; Wed, 1 Nov 2017 07:16:38 -0700 (PDT) X-Google-Smtp-Source: ABhQp+ToCv744UkYYHfwwXyXr0OqpvXC2vsta0Ae+RsnnSgsy929ZVTTA/hDpwMedORkYZN4wcva X-Received: by 10.99.97.67 with SMTP id v64mr6335396pgb.89.1509545798727; Wed, 01 Nov 2017 07:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509545798; cv=none; d=google.com; s=arc-20160816; b=grRNYQHbtIUymdugBLVK42ta0veJ/Z9ky5tBfO2Dnmjw1cWGx+Z28oDvT/Ej7zrOOF wkTwd5IPaScrDAkVYtNx1BzGpk764i4oRfWT2by+UbVcXwVGDjFLRORqZDGsKBq7C/Fk FSrkE6OkeSDn1uWESAqY0RpbhGf8ifRVfs0D9FeEShp9VgBh673eCgcFpX85ELiclTIM fITKWdqOkP82to5mldW77digNZRupNTakJPSnTcXTBD4StTdcdLGNJ3nc6coWKcydxOa dKSQrynsTsTb9/AV/FZKoh19NYcs374AfSOIoDfqHD5EQ+JxBeWTOuVSE0zKgoxWCO/X 86Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Y8yt+cHdFRSR3cunavoQvYqrA6VIaXlKtwdHZIz0/vY=; b=Q0P5GBA9WEHCH+FxTCsBb/exO4hL3AsJZbdYCix455B/PUFlJtamjBXmKAF/FllUwZ 6FNjpXlVgSpLN90o4Ma9l+yjFOzeDHUabFV7PqbvRtLo79wzabhVQ+emtCIEzryXwfsz KnyNj5F06Txiz0mI6tseasD3dEGKd1frpXs1SFtGoFY7z2e2VyIkAWUnuvoiBo4UlKYv KH6aX0tx6b+USd52chNncQ3v1gwPDmbWc8fIeDz1dR0/W9MXN05wPwMYyNCd/RTR6anR oDY9DMWORpVZJavvhA/4JA1RvlaJEDnqKGXs2DHHdop+tUvnPrFUBpiJP9IpDT6x0Bv+ kviA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x70si1109795pfe.582.2017.11.01.07.16.38; Wed, 01 Nov 2017 07:16:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754266AbdKAOQg (ORCPT + 26 others); Wed, 1 Nov 2017 10:16:36 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:52315 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750848AbdKAOQf (ORCPT ); Wed, 1 Nov 2017 10:16:35 -0400 Received: from e110455-lin.cambridge.arm.com (e110455-lin.cambridge.arm.com [10.2.131.60]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id vA1EGPij007522; Wed, 1 Nov 2017 14:16:25 GMT From: Liviu Dudau To: Brian Starkey Cc: Mali DP Maintainers , David Airlie , DRI-devel , LKML Subject: [PATCH] drm: hdlcd: Skip checking the clock provider when CRTC is disabled. Date: Wed, 1 Nov 2017 14:16:25 +0000 Message-Id: <20171101141625.3297-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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(+) -- 2.14.1 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 */