From patchwork Wed Feb 21 09:20:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 128998 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp409281ljc; Wed, 21 Feb 2018 01:21:09 -0800 (PST) X-Google-Smtp-Source: AH8x226pwRURnAroKc79+5jFdNPPH8AJ9xqh3g5U4m7BTVUlnVTQTKD+kzew7LqBfnIZLfgBmGrI X-Received: by 2002:a17:902:9885:: with SMTP id s5-v6mr2592583plp.400.1519204869815; Wed, 21 Feb 2018 01:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519204869; cv=none; d=google.com; s=arc-20160816; b=zVH1CptF1fQaLLLcTLIluux0+ckZsf71GEJu8XvhJ4G4ZQQ6nJBcyG++EfpQFul/q4 UljIoX55rA82sSWc9ORIRH5kgo7mmuXlWvoIT1Tk1r5L02AligpLQ+Z6rWmEjOyjE1hl mqGcted4bB9XvN9UudWEBLRGGIp0nPqNlnnEE7iQl0MHdC+SxzkpaZ1GxwJSZ7/jW4Cc Gl2HobVZr6syXvKXeUlxzrSZAqnCT5Edx+ia5SS0RoRB9FQUCGR7qmMv/MhmQyLm3uwD BEIS+dyrWxpoYj9XfDLI6Pnj4cHCPdeUrUm2BfuRA70pUOZn/x76zxRX268iNxXNAZho N46A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=nzPSIMtq6b3kS2d67DoL8/TTKmgWFw7MjVhf/VJVM24=; b=fRmfypvZqaxtkjgmM2jU097tXwsdpYx5qptlmRSKBcESl3gqRoms5kbzFw2yNw8ySV 0w5wBwtRY8wgd3anrq/pjLfmKIk+D/IHifPc8CHZ7aUsW+x58CvNICY/TH/vsRtonxrx b8ZPXUkhd0L7s6fKuMuguVuZvqZx1wfQd8wo/vetE1ohNxtbHZk2U6IKOuksuO9ToQHJ QIgFYVcNxvi0/3Pv7xngSJt+aUzdwrFjCdLrzyq8Ta1HRcIKO5HuRs5ktGFSf2tTgbFs bTRZVobJlrl6uMpJyjW365eFQm3vBcDNYmoK+9w0IAkbTDz4yfDyIonY1oC/9M1+/YPx 4nFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id q24si1065916pfh.90.2018.02.21.01.21.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 01:21:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) 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 20DE46E59D; Wed, 21 Feb 2018 09:21:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id B6D146E59B for ; Wed, 21 Feb 2018 09:21:00 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 7A5AB207CC; Wed, 21 Feb 2018 10:20:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 46D2B207D7; Wed, 21 Feb 2018 10:20:40 +0100 (CET) From: Maxime Ripard To: Mark Brown , Thierry Reding , Chen-Yu Tsai , Maxime Ripard , Mark Rutland , Rob Herring Subject: [PATCH v2 03/10] drm/sun4i: Protect the TCON pixel clocks Date: Wed, 21 Feb 2018 10:20:27 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thomas Petazzoni , Daniel Vetter , Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Maxime Ripard Both TCON clocks are very sensitive to clock changes, since any change might lead to improper timings. Make sure our rate is never changed. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index b73acab74867..cbe87cee13d1 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -261,7 +261,7 @@ static void sun4i_tcon0_mode_set_common(struct sun4i_tcon *tcon, const struct drm_display_mode *mode) { /* Configure the dot clock */ - clk_set_rate(tcon->dclk, mode->crtc_clock * 1000); + clk_set_rate_exclusive(tcon->dclk, mode->crtc_clock * 1000); /* Set the resolution */ regmap_write(tcon->regs, SUN4I_TCON0_BASIC0_REG, @@ -419,7 +419,7 @@ static void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon, WARN_ON(!tcon->quirks->has_channel_1); /* Configure the dot clock */ - clk_set_rate(tcon->sclk1, mode->crtc_clock * 1000); + clk_set_rate_exclusive(tcon->sclk1, mode->crtc_clock * 1000); /* Adjust clock delay */ clk_delay = sun4i_tcon_get_clk_delay(mode, 1);