From patchwork Fri Feb 23 14:05:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 10237837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C38C602A0 for ; Fri, 23 Feb 2018 14:06:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AE7629608 for ; Fri, 23 Feb 2018 14:06:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F63E2960D; Fri, 23 Feb 2018 14:06:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17B0829608 for ; Fri, 23 Feb 2018 14:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EsoLsP8tARBKTYHOx9JLyObe5hoDjIs/RtIvx6bhWYg=; b=WdGbKvhbCZl1qmIHWV9YMRyFR qGT4lTdP5dpvXmoiZP4gFkcMYTpkqHNPP9SEWobJkNo265LAn0VGfGrbu08qitOx3Rc6352auf9Py K9WGVxYaJTHVeCJ9PdWmOICAtsUr1J00+2Hc9Zwlg/Qhz+rTMwRi5/kMFdtCTa3Ij5mb9106wrmkf zIs2xvtTnbAfvWIK9K/acGYRRg+2q86puMDCLZ4Dx+yivNMsTi/bGZaqIkG7CCvnlR1gikTa3t9GJ GDnG4VtjKSwlpsZXFCe6TAMmYw/+31I6T9vt7J5pEyNmQJErzcmq7KsHTDnwjUl6QK0Dggm/tKKPR OECFg+5gQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1epDyv-0003na-4F; Fri, 23 Feb 2018 14:05:49 +0000 Received: from mail.micronovasrl.com ([212.103.203.10]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1epDyr-0003mF-Gv for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2018 14:05:47 +0000 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id B3A1EB019D4 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 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 r5crcRkrjYwD 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 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-Language: it X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180223_060545_776902_8B5608CF X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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); 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 */