Received: by 10.223.185.116 with SMTP id b49csp740038wrg; Fri, 23 Feb 2018 06:07:41 -0800 (PST) X-Google-Smtp-Source: AH8x227mRf+eLKqDerGcspPEKeAwCSCXlveIBl6yN9ysCcarDU9SiONATFIojVWNJSvtjEkgIwcn X-Received: by 10.99.150.2 with SMTP id c2mr1584948pge.424.1519394861361; Fri, 23 Feb 2018 06:07:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519394861; cv=none; d=google.com; s=arc-20160816; b=ulHDClZCOd81jtSkt41u6vg81Zuo1r0zFPqh/YJr9DR/ozdU9diBq2ma+/0hPZFctc OoqOdiujwALzQl0AjRckBVn0u5CLuCVt4X+NSFDiRJnm8ECi2RI799CdC9qzjA5A2wr8 ZvQkfC7UNMpm9fJYfXaySI7YRnzT0g3rLnUKR/BVJMvlATlJu82XnXzKjNeFvTz6e52S OAM1RpYXvQvkcboITXdXf9YdBhsenk6cHVb+uDv9fQrDLI+CD6U4gvH32p4ctIIsA+6m NZtG0+l2HkHYKFhAcItK/SIJkEEVDr+FzJGRi4/sw/pK3nedOc1RDaewd5wU7tL29sk2 H13w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=mNqre41rlU2lslNEjXpdFOVWTOM/JjtAXcqgf09Owlo=; b=1BcTADGc3wk7ATFmSxD8+pnUh/bQz6OngjNhwxRd726jtsicxN9biHBW6WDjpQiDUs Q1/HInEIAf891UUvYPWK6W/by3tWyWcomKn5swDTP7Q1xm06FSp2Wv1nRxuXvHnxqMAw cBIZioju5473o/PXmy2aWwgJgbEOGzOz5Xqu/vyzL295UBIXyL/E13pXfYfClNtloe9w hI8uytAeaE2pDrF2pgvJwVhv4EBxdHzZE/l+Z4cg2whKgdzVvw5AdNAHVNbclfkUzW+e bKKtll0ON7Eu6UJpuHCEYupLbqHjIyJAv+TWjlOiSDlEZrWIwS1Zfy88xklFHq/KRlqp PXmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=WYpKIdUv; 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 b13si1857135pfi.53.2018.02.23.06.06.57; Fri, 23 Feb 2018 06:07:41 -0800 (PST) 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; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=WYpKIdUv; 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 S1751406AbeBWOFc (ORCPT + 99 others); Fri, 23 Feb 2018 09:05:32 -0500 Received: from mail.micronovasrl.com ([212.103.203.10]:57026 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751276AbeBWOFb (ORCPT ); Fri, 23 Feb 2018 09:05:31 -0500 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id BC929B019C8 for ; Fri, 23 Feb 2018 15:05:29 +0100 (CET) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:to:subject:subject; s=dkim; t= 1519394729; x=1520258730; bh=mQZmzneOa6ee+W4PHSVivRpNyM/iXUMnGgK rg//i8ig=; b=WYpKIdUvwduUqoF61U+8pFUjogUopeBm7CrxG18bw3ttqNweCZF U0YnWOmI0PNXeZbQEPVrwAGjEkKaOXK0vKHuu5fwcMKBeeH0dWCdUYCJ1S/uppPS JYwXPnOf+3RJ8AgRZrJfDN5NOIanxvkZ7GbWx7wErwkZpX/cvqp7W9PE= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Es1qWU7UPTsJ for ; Fri, 23 Feb 2018 15:05:29 +0100 (CET) Received: from [192.168.123.86] (unknown [192.168.123.86]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 70574B00288; Fri, 23 Feb 2018 15:05:27 +0100 (CET) Subject: Re: [v2,03/10] drm/sun4i: Protect the TCON pixel clocks To: Maxime Ripard , Mark Brown , Thierry Reding , Chen-Yu Tsai , Mark Rutland , Rob Herring 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 References: From: Giulio Benetti Message-ID: <287984f8-bcac-3789-d573-2f0c54fb537d@micronovasrl.com> Date: Fri, 23 Feb 2018 15:05:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: it Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Tested-by: Giulio Benetti 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);