From patchwork Thu Jan 26 17:05:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 48810 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp384377wrn; Thu, 26 Jan 2023 09:10:44 -0800 (PST) X-Google-Smtp-Source: AK7set9N14wcEBE9ih3sAjHh4QX66h+3h5BWFKN/xBebgYXQlpAo65HoOpV9oPjVTzfyqMqpz51m X-Received: by 2002:a17:90b:17c2:b0:22b:fd64:c48e with SMTP id me2-20020a17090b17c200b0022bfd64c48emr8774721pjb.14.1674753043876; Thu, 26 Jan 2023 09:10:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674753043; cv=none; d=google.com; s=arc-20160816; b=D5GDgw3/0MZIJ4+R0UCXPYjPyKMvT+/duePDX6yOL0iLy0epBh/4Xf68cqK7CxQ1hb D9L7Yo9PfKDrv5p4aW2bZK2JRhXtu9B8Zgoe1zCLhhboKKqrGE8tHJieQzbIbjTJIV2O NWY2CcuTywih9r/s8hHzsHCIhe2T61onJ8tN2SIIzzttw++1Ly61HDAOP6k9MrhtOjsM a21JZWKgN1MBBjoalK9G7+FbBpA5JJW2PUgXqnzwxnzADBfLOs+BJQtNcQ9TEmmECGsM vdF3dI38tyzWgtTm8RmSgF99I6aKt8Xs90DTuz9cGQ31xg0E7ynMDqljrMEa090Ls6yu DokQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=8suY9sieWgtDXWyPn8u/nfHNi/hMsHiTv3FkopfWKNo=; b=lmo6z01rPa55YxUxWemSMPvarRHu5t7tQo2zo+CXPzEoctXu0wrEGL4ZpjzVtx33Jh B7yU1IoMtMiyJwyk1GYqngdqAM2lEvS/so+9a7f/QTsvmUCg2+t+jXqXr6yINeSzIkmv 49Mt3tFy1PxU6LFZFavytNl4IykDsKybtAI/fFnmHp/DjD+Xj63d0DlFjr9beOXXCIN2 fcjB6LVMvdyBjPxU759V5OOkLluyzCdfbrkG3375pIB5x1xorKRR7exMUd0yPcTqdJvh mumJMsdSflf4CC8DdQNuJ3rKznoYPOOUNPgRC6N2KIFUuau+8m1hECMKN+CCEa34My68 l1VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=dUKWNlAy; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=hwYEt41y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a17090a558c00b002294c989fafsi5615527pji.52.2023.01.26.09.10.31; Thu, 26 Jan 2023 09:10:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=dUKWNlAy; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=hwYEt41y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232160AbjAZRKC (ORCPT + 99 others); Thu, 26 Jan 2023 12:10:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbjAZRJw (ORCPT ); Thu, 26 Jan 2023 12:09:52 -0500 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CD2776BE for ; Thu, 26 Jan 2023 09:09:51 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AF9605C0446; Thu, 26 Jan 2023 12:09:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 26 Jan 2023 12:09:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1674752990; x= 1674839390; bh=8suY9sieWgtDXWyPn8u/nfHNi/hMsHiTv3FkopfWKNo=; b=d UKWNlAyDqdQbnSqiaN5A8uIwzd2zIm0QTtvJqrco8xWF6qB0tPZ0tQavtX9yH4WW KUmNdH74Xr7bvXrwD3wGvw8uSDPol3LFSgSTn6WitNVmPHzG19iL2RCuxgWxbzbD 5LswMBlYXLUY+WmzixIjtlSSlQTKq7+ddD7wLbYylIyQ3waqvT11OCExe0q91lA+ Hycm+haDk7yOTuUwEORP6QrZvVMnaAh+ZgrkCvggaLwQPW2l919B8DECmhMAYCi6 jLsf4Qh//mmTO8+5yvWpzfXy5i94Za7OvegOwnInwXRR/hYE9x01sI//lOu7Ci2M MpOqJ15+loA44Zhk/xucA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1674752990; x= 1674839390; bh=8suY9sieWgtDXWyPn8u/nfHNi/hMsHiTv3FkopfWKNo=; b=h wYEt41yvJORumJL5Kp2VMSQLZqz7KDzKE8V2y8GBr2YC5SLvrZdeP9lRAAy5QcyB 6yoj5Us121qX452KhmtuGxDLjIQsxhTKTou3gQpggl5wU0+M9ZL2cZmcQz2891Fq fWS+pZ0ueQ/b6p7mcD5gnfL1dbMTTSoBQi8T6bxSzMwghil5EkoyoDgg2a8O504g qLYwc983KuLum4YkS0BTFIhZHPnGbNKqR/fiHMU8F+41xr4SUTm9PcJVYTAKThnC f42/Ibe7vK1mRV9ZfYKQGUc/H8knRtLWLrxYJoHLfXYKGaBv46MhKjl6uANvPABd ScrnzOVRukjMFzPnahjQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvgedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepvedvleeijeegvdekffehkeehieelhfeggfffheetkeeuledvtdeuffeh teeltdffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Jan 2023 12:09:49 -0500 (EST) From: Maxime Ripard Date: Thu, 26 Jan 2023 18:05:46 +0100 Subject: [PATCH 1/4] drm/vc4: hdmi: Replace hardcoded value by define MIME-Version: 1.0 Message-Id: <20230126-rpi-display-fw-clk-cleanup-v1-1-d646ff6fb842@cerno.tech> References: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> In-Reply-To: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> To: Emma Anholt , Maxime Ripard , David Airlie , Daniel Vetter Cc: Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1066; i=maxime@cerno.tech; h=from:subject:message-id; bh=0qIZDkNiRrqLNfFTmO5XDGD2w7YMondxv9DscAkZRD4=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMmXNn3cKH4+7eYavcXG15VEY+d2NH65fc/t7paYNSocv3O0 I7VvdZSyMIhxMciKKbLECJsviTs163UnG988mDmsTCBDGLg4BWAiynYM/9Orfxn6M/0Ol0o5Xtuw6P CutK2b9PY6368riYuTjj+s+5PhnyWX/rPu97qF1rvEjJxyrxuKn35y8UGX54LwTVXZp3jFWAE= X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756105847484597770?= X-GMAIL-MSGID: =?utf-8?q?1756105847484597770?= The 120MHz value hardcoded in the call to max_t to compute the HSM rate is defined in the driver as HSM_MIN_CLOCK_FREQ, let's switch to it so that it's more readable. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 14628864487a..98fa306dbd24 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1482,7 +1482,9 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, * Additionally, the AXI clock needs to be at least 25% of * pixel clock, but HSM ends up being the limiting factor. */ - hsm_rate = max_t(unsigned long, 120000000, (tmds_char_rate / 100) * 101); + hsm_rate = max_t(unsigned long, + HSM_MIN_CLOCK_FREQ, + (tmds_char_rate / 100) * 101); ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); if (ret) { DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); From patchwork Thu Jan 26 17:05:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 48811 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp384938wrn; Thu, 26 Jan 2023 09:11:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvuso8d6mZccmR4atuOgLE0sRHbmsKd3bboE4F2P2H3z4HPVTOw9AdVhluFPU7ajiHcwIEG X-Received: by 2002:a05:6a20:e610:b0:9d:efbf:787d with SMTP id my16-20020a056a20e61000b0009defbf787dmr37716805pzb.50.1674753092641; Thu, 26 Jan 2023 09:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674753092; cv=none; d=google.com; s=arc-20160816; b=aFnUxADCxcX/5uWzoIOVVy4gnNpy9dKs22pl1/4LpwOM8Q/fKjrpKSblHVA0Q3hSp/ FIAdOvi9Vpz4ko2LX8Unj3g2rdTRSSo45HtVPoSKgHHEkmetDvMG3OhRtMvYJUlAHrRh EPPx6X5/P58V5fdmrpNKyh8Nbs4gzu1h9R8LJeoi8fIxEOrh600ZtHFL+zu3XLFLLQlr jMPvLkyybNO5ngP+j5RWTk7t7BvaWIzlpVs3fiLG4vrCHH8rKIxOulY12gnS4gZaZLw/ DAY8QPRDhCURxnaiXQb0/uajkNWE81V08sZdOfNq/s4nzvQd8bkF0jQAkUlNpaapE1Uh p1KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=r8PfVgfg1/1/LZjTHHsJomA3Uy4NDG54RVBnB5RCyr0=; b=L7iV8DCl25D9vA3V8C/XCtodOSf1NHEx4N0mcgvHWqom7adLirk9TV2hkrKRLqx9E+ i7qf0sFIS+9pcnRkeuuH+HVeesj2UHoFskwGzZZ7l5Ai1w9U/9F46OZjKIp47+y2+nFc GI/1NKforjoY1BNpNwBj+ddYdLRA885++BPYozehjPtPBoNjWpf0r8UsoFIv+Tyruhbr NnDg8Yrm6IQHhkgNgMUcy5sDRI6ZWiPCqSMj8jiaWMJug/uR57wd/GEbzY9MbjZg2oWq 1zGqwwVMWYVSnDFVhh/B9vfp6NzdC/lSigEiBxqCeFlwOgnqf+w/A0SW5SUVlPCDzX/h W+mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=iOMneerG; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=No8++D68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a639545000000b004deafa8f3b3si1529825pgn.739.2023.01.26.09.11.19; Thu, 26 Jan 2023 09:11:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=iOMneerG; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=No8++D68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbjAZRKQ (ORCPT + 99 others); Thu, 26 Jan 2023 12:10:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbjAZRKM (ORCPT ); Thu, 26 Jan 2023 12:10:12 -0500 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5B98C646 for ; Thu, 26 Jan 2023 09:10:08 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id D72865C0432; Thu, 26 Jan 2023 12:10:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 26 Jan 2023 12:10:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1674753007; x= 1674839407; bh=r8PfVgfg1/1/LZjTHHsJomA3Uy4NDG54RVBnB5RCyr0=; b=i OMneerGnFOg01mvXwYKOrilpgKgtN2YF2q43xZSo+mRI5twbkHDXaXIwgVSRouJ1 65p3JF8o+6q2GcOnyVyKOE9ebDL57uQv+Wx5hDz+78wX6b3JlwQSkOxuIArignc/ vQ+IUcQ63XwHhhr+fQW5sR9QLane19xyol7beemJQ/s+UGJqeHbwQe+f2gfb9qdq inswiE13VgzvaNEDKO9a9CFfz+uzqvi3DkYIPv732OwQtVkB/GKfc3dA5t7JEZ0n Ug/7qQ1atrz0+482puou0Z5zPYm9yFZ2TbVvGBGxT3tn37tO1S/GpJBUFPbbJ5oF oubgnACTLLlUM1FR1KIHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1674753007; x= 1674839407; bh=r8PfVgfg1/1/LZjTHHsJomA3Uy4NDG54RVBnB5RCyr0=; b=N o8++D68TaOHuEuvEILXJr6z7O+49rKKa6vOCJokzIte38Etazwc2Z0cKXXgUnVTc +0ePT76lzAOjkNe8CQwvZ+5MeDDlY3yOTqZb1MtJKDAOWzQ938dgFcYtrKAKUxH1 P66yPIHyvn1EpG2o7fETP3vwB/z0uS5wr68+7FM6Q4NxjGejFRscHPFNSehMoFl3 PYbXDH3pT2huERw7/TjRjdggm9lkluX7yNkw+yf4KN+h5D3gG169UBSGjTT1fjiN UteSy9cS63SHYZgedZOLC3PkUkQZTcAEAe2higU8EcPyhBrD1nBWwcBTbEqKUsiX O6piMwtZbMR07AP/DpEMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvgedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepvedvleeijeegvdekffehkeehieelhfeggfffheetkeeuledvtdeuffeh teeltdffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Jan 2023 12:10:06 -0500 (EST) From: Maxime Ripard Date: Thu, 26 Jan 2023 18:05:47 +0100 Subject: [PATCH 2/4] drm/vc4: hdmi: Enable power domain before setting minimum MIME-Version: 1.0 Message-Id: <20230126-rpi-display-fw-clk-cleanup-v1-2-d646ff6fb842@cerno.tech> References: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> In-Reply-To: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> To: Emma Anholt , Maxime Ripard , David Airlie , Daniel Vetter Cc: Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2394; i=maxime@cerno.tech; h=from:subject:message-id; bh=kZGgOHx1L8Al+hD8WBITB+QjtYhPj3I6fD0qrBD3FhE=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMmXNn1cUXxw3eOl1Z/WXv/I+yunIH534lFG8zne6xJjdvNM YFi5uqOUhUGMi0FWTJElRth8SdypWa872fjmwcxhZQIZwsDFKQATyXRkZFh2WyvtZvbNrpbMb+3t7g eimY5tOa33UHp5oq7i21yDzzMYGfZccHvts+12IG9UNOdxnZVp0pudnAMat6oaL+R9fOGmMA8A X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756105899305671760?= X-GMAIL-MSGID: =?utf-8?q?1756105899305671760?= On the RaspberryPi0-3, the HSM clock was provided by the clk-bcm2835 driver, but on the Pi4 it was provided by the firmware through the clk-raspberrypi driver. The clk-bcm2835 driver registers the HSM clock using the CLK_SET_RATE_GATE flag that prevents any modification to the rate while the clock is active. This meant that we needed to call clk_set_min_rate() before our call to pm_runtime_resume_and_get() since our runtime_resume implementation needs to enable the HSM clock for the HDMI controller registers to be functional. However, the HSM clock is part of the HDMI power domain which might not be powered prior to the pm_runtime_resume_and_get() call, so we could end up changing the rate of the HSM clock while its power domain was disabled. We recently changed the backing driver for the RaspberryPi0-3 to clk-raspberrypi though, which doesn't have such restrictions. We can thus move the clk_set_min_rate() after our call to runtime_resume and avoid the access while the power domain is disabled. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vc4/vc4_hdmi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 98fa306dbd24..9dd722b9ae3a 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1466,6 +1466,12 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, if (!drm_dev_enter(drm, &idx)) goto out; + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); + if (ret < 0) { + DRM_ERROR("Failed to retain power domain: %d\n", ret); + goto err_dev_exit; + } + /* * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must * be faster than pixel clock, infinitesimally faster, tested in @@ -1488,13 +1494,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); if (ret) { DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); - goto err_dev_exit; - } - - ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); - if (ret < 0) { - DRM_ERROR("Failed to retain power domain: %d\n", ret); - goto err_dev_exit; + goto err_put_runtime_pm; } ret = clk_set_rate(vc4_hdmi->pixel_clock, tmds_char_rate); From patchwork Thu Jan 26 17:05:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 48812 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp385042wrn; Thu, 26 Jan 2023 09:11:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXtCqrBAgMHcMqlUotL8W7XoVWY/rXSQIG2tT7RLD+TnIotOX/w/TkA4uIr4CUruJFLHRS0o X-Received: by 2002:a17:90b:4acb:b0:22b:b794:bb47 with SMTP id mh11-20020a17090b4acb00b0022bb794bb47mr24326524pjb.23.1674753102200; Thu, 26 Jan 2023 09:11:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674753102; cv=none; d=google.com; s=arc-20160816; b=s6r2daDRvLEwxGWwx5/wy/6kuOK1VYb7hfTjEMahyp+k4PlPFODr9JzyTUKm5dNzwC tKw3Ro2ADikpDAKkLmRKa2k5oMRlsqmb0mF9QWO3AjkjxxorWWUq3nGV8m2vZ8vl1UgH ySP8KilIVFyIz9CrM+7Kp683LbJmITBMLEjQXGb1+yHoxzw2rrpFUgcc+Suul+wV0R+v SSdCOPWyZYvfiHMGK+OCSQp4GJvIlSNet8OryVykzD6Lfqm33pmth+flHs5Bi7uweQu4 V6b1JPRIngSW5rIsF9HcBcXWDEpNEerCR3zTsveHvz161UiSp1CTkJoaJMGTuS5ksgd6 8vww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=TuONVed+Dr6TDLyZbTUpohIjZuE5nuNDcQ+ItZCvi3k=; b=Jfoy0xs+YXxUl+meSV33CbqwLtLKM8GX/gw7YDUJ25USpugt7QDBFL+VOz+GoUaQTX 5A5JZgfSq6zsWMUBe7x5+W4w+lw7qyQD2eH9Pf//iGjOgZXttH+hlKrOgFODXVLYC91O 9iXyUVeLKQJ7JkJ7P+FPkIhAqng73XdswDcdadFvPs0OqNrFFweGluF3kXer3LHhthAb WU4Ba+hFylOaJi04ON/WOAhRR0K18NkYxA8Mz3BrW0mr4a87+ELWi/ge+cbyMKY7YKOE Uf6rExEpr7KhDrVfkBV9bq4RYxfD45O3AE0fFWy/hhISgnT3LPRaBI2bXRiBk+7a6026 i08w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=Ra718uho; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=g713ha+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h62-20020a638341000000b004cfc40121e4si1626598pge.855.2023.01.26.09.11.29; Thu, 26 Jan 2023 09:11:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=Ra718uho; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=g713ha+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232330AbjAZRKV (ORCPT + 99 others); Thu, 26 Jan 2023 12:10:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232324AbjAZRKN (ORCPT ); Thu, 26 Jan 2023 12:10:13 -0500 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46EB365364 for ; Thu, 26 Jan 2023 09:10:11 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8E0945C0447; Thu, 26 Jan 2023 12:10:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 26 Jan 2023 12:10:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1674753010; x= 1674839410; bh=TuONVed+Dr6TDLyZbTUpohIjZuE5nuNDcQ+ItZCvi3k=; b=R a718uho7fMDkdpvip8rcL8lrHYt8zSw4/XDhNGY5faq4kEJiNX+QH/K2yxMkSxRi xkUlpjhQj4tUmN03sucPVzq197r9lMZWDRC/+vFh6kCyyCzXZyAfKf7Bnf0Tm2GL cbCDg/OPKUEScky1NRlpbKlZXdVkW0keZcL/9Iqnj4n77m/ZAcE0skbDtjrVrO3i Xo04SuwW5y6SzIdHlvAMbOWRSYWdbhe5JgKfsJEvTt+7zKhGldAPL123cY3quToi DrDBvn8wXBDbB+YbNLO5jJECI/MyWVhFjtrXqFQJCI4JN/F8GFchkW4Gy7HxhsNH euZVq6OSFfHqlyya3joKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1674753010; x= 1674839410; bh=TuONVed+Dr6TDLyZbTUpohIjZuE5nuNDcQ+ItZCvi3k=; b=g 713ha+uzpzWRxJgnidqiKvgLkv4dIMR6ban1Now8Cwp63DdKOuJscc+BJUIA9efL 4xp1l1BgbuVqSb/vdbFSCEKe/XjDRMe4tNBb82KVloOrshHJW2W64eROFf+TF67r hehQRqmALGE//2cWnZ1FnDPotxrTkiWA5qumYZDa1ClH8ECsTxEQn96cz7XrRW3p mETFFHuf+PGkTXQ+XmPH4aXqJhPhBH43AAhTU2McX0KJ/qkwRjMLRW251HrVcS5e p3WY6MDvHVaNf5u9aLFMQ7mZKEYyKrT68al5ynMd4i0q/Nb32XBDhfpKv9M8P0J6 TjXkyWAiHQriTgZsi/GSA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvgedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepvedvleeijeegvdekffehkeehieelhfeggfffheetkeeuledvtdeuffeh teeltdffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Jan 2023 12:10:09 -0500 (EST) From: Maxime Ripard Date: Thu, 26 Jan 2023 18:05:48 +0100 Subject: [PATCH 3/4] Revert "drm/vc4: hdmi: Fix HSM clock too low on Pi4" MIME-Version: 1.0 Message-Id: <20230126-rpi-display-fw-clk-cleanup-v1-3-d646ff6fb842@cerno.tech> References: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> In-Reply-To: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> To: Emma Anholt , Maxime Ripard , David Airlie , Daniel Vetter Cc: Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3246; i=maxime@cerno.tech; h=from:subject:message-id; bh=se4/zccLZCV03kCfGwykFTtzd+oBbkxTP8WaaiMrb2s=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMmXNn3sPi2bXfTs++38hseNXAIr1hTeYT3NZ3VvTffRqdz5 v0y3dZSyMIhxMciKKbLECJsviTs163UnG988mDmsTCBDGLg4BWAiHEcYGTallD9YNnnvh/VGPu1qd9 avZy2t/K8k8ZQ5Zg9vtdYEUV6G/6HHexSyTk5Qq/bgFdrXVHnhQ36ydK9F66TpFtufqk1L5wQA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756105908815870109?= X-GMAIL-MSGID: =?utf-8?q?1756105908815870109?= This reverts commit 3bc6a37f59f21a8bfaf74d0975b2eb0b2d52a065. Commit 3bc6a37f59f2 ("drm/vc4: hdmi: Fix HSM clock too low on Pi4") was introduced to work around an issue partly due to the clk-bcm2835 driver on the RaspberryPi0-3. Since we're not using that driver for our HDMI clocks, we can now revert that inelegant solution. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vc4/vc4_hdmi.c | 21 ++++----------------- drivers/gpu/drm/vc4/vc4_hdmi.h | 1 - 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 9dd722b9ae3a..e82fe17c9532 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -3189,16 +3189,9 @@ static int vc4_hdmi_init_resources(struct drm_device *drm, DRM_ERROR("Failed to get HDMI state machine clock\n"); return PTR_ERR(vc4_hdmi->hsm_clock); } - vc4_hdmi->audio_clock = vc4_hdmi->hsm_clock; vc4_hdmi->cec_clock = vc4_hdmi->hsm_clock; - vc4_hdmi->hsm_rpm_clock = devm_clk_get(dev, "hdmi"); - if (IS_ERR(vc4_hdmi->hsm_rpm_clock)) { - DRM_ERROR("Failed to get HDMI state machine clock\n"); - return PTR_ERR(vc4_hdmi->hsm_rpm_clock); - } - return 0; } @@ -3281,12 +3274,6 @@ static int vc5_hdmi_init_resources(struct drm_device *drm, return PTR_ERR(vc4_hdmi->hsm_clock); } - vc4_hdmi->hsm_rpm_clock = devm_clk_get(dev, "hdmi"); - if (IS_ERR(vc4_hdmi->hsm_rpm_clock)) { - DRM_ERROR("Failed to get HDMI state machine clock\n"); - return PTR_ERR(vc4_hdmi->hsm_rpm_clock); - } - vc4_hdmi->pixel_bvb_clock = devm_clk_get(dev, "bvb"); if (IS_ERR(vc4_hdmi->pixel_bvb_clock)) { DRM_ERROR("Failed to get pixel bvb clock\n"); @@ -3350,7 +3337,7 @@ static int vc4_hdmi_runtime_suspend(struct device *dev) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); - clk_disable_unprepare(vc4_hdmi->hsm_rpm_clock); + clk_disable_unprepare(vc4_hdmi->hsm_clock); return 0; } @@ -3368,11 +3355,11 @@ static int vc4_hdmi_runtime_resume(struct device *dev) * its frequency while the power domain is active so that it * keeps its rate. */ - ret = clk_set_min_rate(vc4_hdmi->hsm_rpm_clock, HSM_MIN_CLOCK_FREQ); + ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ); if (ret) return ret; - ret = clk_prepare_enable(vc4_hdmi->hsm_rpm_clock); + ret = clk_prepare_enable(vc4_hdmi->hsm_clock); if (ret) return ret; @@ -3385,7 +3372,7 @@ static int vc4_hdmi_runtime_resume(struct device *dev) * case, it will lead to a silent CPU stall. Let's make sure we * prevent such a case. */ - rate = clk_get_rate(vc4_hdmi->hsm_rpm_clock); + rate = clk_get_rate(vc4_hdmi->hsm_clock); if (!rate) { ret = -EINVAL; goto err_disable_clk; diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index dc3ccd8002a0..e3619836ca17 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -164,7 +164,6 @@ struct vc4_hdmi { struct clk *cec_clock; struct clk *pixel_clock; struct clk *hsm_clock; - struct clk *hsm_rpm_clock; struct clk *audio_clock; struct clk *pixel_bvb_clock; From patchwork Thu Jan 26 17:05:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 48813 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp385086wrn; Thu, 26 Jan 2023 09:11:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXsIJdFUz6bDS3yCY0F/mB8LjaanGx6TEUdaPV6xtKmDG4WE+KxqtzUgBhgPTk2POOK1b38M X-Received: by 2002:a05:6a20:1601:b0:b8:c659:9d51 with SMTP id l1-20020a056a20160100b000b8c6599d51mr46009844pzj.56.1674753105678; Thu, 26 Jan 2023 09:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674753105; cv=none; d=google.com; s=arc-20160816; b=gHrSk4EpR2+4qpWDqzImAKies3iT2dMQNRGMFYSSWzhlmvoJTL54D80TuW+8HzR4Rr kEyMqlrDpIRyi7G/BGOY0IkRrkscMkCbpT12JvyPO8k1Um+zgE/i48S39evOoAzoIVp0 +JPj9n9y4q06iKhaz8KgDMFvS10wfLklbM1o/mai0xtKQqqO708cpwBECirz2JpueE87 mTjvgutCDqRXVi7QNLyNDAHauUR1m9E52sIwJjDGkU8R9nmDfIsllpCcmhjbq5E7dcha zbZJESQHSHijlF0CxwjvYc1EY8zEIH6HZfYGnJsFG8L5Vu7ZBK5tTe+dWDtMP3glmpOg zkIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=KkZyTKB81d/nOJvQoWokQtvq54uqplhHOELZ15UddQs=; b=MZOiOaG9NvbNHpEI4yr+PdWhuCxqA1aWig1RZtvj9XCL+6Inl3FDXrFaNpJnJWXXfb jLFGTzgvuKN+RABFVZ3FXzleGRGmgjg8fc4RIQQirSD3KaSlhcGtUQs6zK1rzAiF6/Jb FKzmSYmx2YU34X2bOfEKPacaDVb7WYFpJ2T+e2Cg3ESb4gOGJCw5GpWVMvNmLwCHB6XV UNq8HVAseQZlpKtdm//En8qojCjkW498hcMH+lH1cgOwtNVgp0SxsGVAf2xSQ25yAzBh UBvS3KQ12EcNMsg4PUmhBMYpfc1iC/MHCUC6WytTWxeaaT4DOH66ccYcyu49gn/9XxvP 6J7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=XTzyCHmc; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=XJs8ZxA8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a63ab4d000000b004d3cdc38b67si1531485pgp.152.2023.01.26.09.11.33; Thu, 26 Jan 2023 09:11:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=XTzyCHmc; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=XJs8ZxA8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232339AbjAZRKa (ORCPT + 99 others); Thu, 26 Jan 2023 12:10:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232268AbjAZRKW (ORCPT ); Thu, 26 Jan 2023 12:10:22 -0500 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F97B39BA4 for ; Thu, 26 Jan 2023 09:10:14 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 792605C044E; Thu, 26 Jan 2023 12:10:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 26 Jan 2023 12:10:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1674753013; x= 1674839413; bh=KkZyTKB81d/nOJvQoWokQtvq54uqplhHOELZ15UddQs=; b=X TzyCHmcXizZsSZG7dr7cTeH74nAHI023nfE9pezBRlqVbSfvGc2/HMQt8FP6kMlr bOmFLs4XjxXa+Lk3QEd4qYOp+7R3R7WFkHVFkbWeBgWf2cFuyl2fF8i1kjlfu0IZ sfIrs1YE5gedZYPx3d/bRrGHpbcDtFHS4g7tUHN8s82WPhji6JiwS0sMiMZo34OB gnuIf9VXUefHBmLlJK4fOj2T2TMCTyYVfXUxmMW3Oy3i+TaYnhjfenZrRZeOlXgN zYFSbwecdXGsny8NEw7RD3h0dtwH8LCrb8uQ5z5esC9nXj7rYVQSEsge0+xohgO5 I8ahcSpel635PINldpYjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1674753013; x= 1674839413; bh=KkZyTKB81d/nOJvQoWokQtvq54uqplhHOELZ15UddQs=; b=X Js8ZxA8KkytZQ1JGokInNllJW5XDwIHCSrGnyCzMTcQ+0bIJXa4ktiuRcyLn864G XRJXxzIMUES18Au13rMSSMwa34/wbbraQLuT6V54hVkRrH2O72ZbvH8Yn9ITFt1b ESTr56hpQX9hwMZs/BttXTghZdbHpaAsNFKIpcbqsy8abHhZmkwsK4e9jBhw5enc EQw+7Za7LD6Nr6re6qPWBx4Gsep+PNmM3XCDMOk5yOlb5eKHVCggxixeMPMcFvYC hFec6cQIgZbgach7tblWN+A2lRPfoJEy5rRsDo1byrJLBwkQeacG8G2Ztdc5sxEp nSgQ0d6kB5X5UuldbbbRQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvgedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepvedvleeijeegvdekffehkeehieelhfeggfffheetkeeuledvtdeuffeh teeltdffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Jan 2023 12:10:11 -0500 (EST) From: Maxime Ripard Date: Thu, 26 Jan 2023 18:05:49 +0100 Subject: [PATCH 4/4] Revert "drm/vc4: hdmi: Enforce the minimum rate at runtime_resume" MIME-Version: 1.0 Message-Id: <20230126-rpi-display-fw-clk-cleanup-v1-4-d646ff6fb842@cerno.tech> References: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> In-Reply-To: <20230126-rpi-display-fw-clk-cleanup-v1-0-d646ff6fb842@cerno.tech> To: Emma Anholt , Maxime Ripard , David Airlie , Daniel Vetter Cc: Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1139; i=maxime@cerno.tech; h=from:subject:message-id; bh=9Ul4tbyTDXUKD/MhonRAgF3FnEZjFKzNzSrNVoRgm2E=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMmXNn0861dfqs2pGv4p36/t4IxX8z/1P8+blFBu05SYZfHw cSR3RykLgxgXg6yYIkuMsPmSuFOzXney8c2DmcPKBDKEgYtTACYy7yAjw+qlu0UYmyXdVyzbfu/uxs 3r+9fWXZ8S3c5z7MQu40P/l0xi+F8SGdOt4Tx5cc4ywQ/MTQ1f2us9vbs/J9dpKV/MeKblwQEA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756105912590608160?= X-GMAIL-MSGID: =?utf-8?q?1756105912590608160?= This reverts commit ae71ab585c819f83aec84f91eb01157a90552ef2. Commit ae71ab585c81 ("drm/vc4: hdmi: Enforce the minimum rate at runtime_resume") was introduced to work around an issue partly due to the clk-bcm2835 driver on the RaspberryPi0-3. Since we're not using that driver for our HDMI clocks, we can now revert it. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vc4/vc4_hdmi.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index e82fe17c9532..18d84aab54bb 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -3350,15 +3350,6 @@ static int vc4_hdmi_runtime_resume(struct device *dev) unsigned long rate; int ret; - /* - * The HSM clock is in the HDMI power domain, so we need to set - * its frequency while the power domain is active so that it - * keeps its rate. - */ - ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ); - if (ret) - return ret; - ret = clk_prepare_enable(vc4_hdmi->hsm_clock); if (ret) return ret;