From patchwork Mon Dec 13 09:25:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12695850 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42D78C433F5 for ; Mon, 13 Dec 2021 09:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BJnaeRWtHL8eoLq+2XDNIQGYveYlg0blsVOsFwteZnc=; b=uyFt9/qlnmX61U LQ3qO9rHVNcRX/7wtyVdumuc4WH+l6IkV9pGnQakQa1wG/i2kMrn7fOL5rOmQJQuUhyT9+DVpZG8E wgO2ITKnL4JIczgr/i7JMXVIbxDegvxXWsazqN1m/V7aovYivZ2kUgU1diSFO5e5gOb8vlmue1oJF iOBYd/N6iwYTXio4gJduXyvPqVLGUAIi9/55C1tdOZTwZLX/BvaStCoj8jnys6XXJ3scB9/ifCouv Sp3aHK/UDkWQ8XKgauTJGSIrNdF4VerZ0y7kbVutkf7KaiWkm2robHK3Syi88ph1hi/wacSKCP5/A HSSdPxUE1YwSvVO9gp/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwhbQ-008ciZ-1o; Mon, 13 Dec 2021 09:26:37 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwhaC-008cNA-4T; Mon, 13 Dec 2021 09:25:21 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 970522B0014C; Mon, 13 Dec 2021 04:25:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 13 Dec 2021 04:25:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=yQw9DXa8mMxZk wpFz13lFKHWrNaJJt0CezYCd2GiA6o=; b=d2GPi9d0aM+UzxZ7JlmT/9l7uvNSx 1e5gI6Jfma7IYxImjXP7Ssaf1DVsC2ZMWWYk6GtWEz8kY/wRAwy0sDycong/7EQr kJp/pifgZTHfqH9h3zSQzWIki749RgP2SlzVhbo31l8XLRSYmIQsI1UrBhxcQ/XZ J4s0Ra5D5DyKonnMs+L4Ks5VTbe3D3U48KMqVf13Ovhv2oR7u6Mj3fcuDMlkZnU4 PY3ZIUMwmgACnQHELaVnUT/dfAg8/CWlWmHJcIR6Lyilg1qv+WwASyDFA8Leo56z NaoSfsaXg5IpJUzbxjXpODG9MEKVYxtkWzCpzd6rsZdrGObzRdwN01JTA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=yQw9DXa8mMxZkwpFz13lFKHWrNaJJt0CezYCd2GiA6o=; b=MtB+R0Jb PVc1ViZSf5qy5sTcgy071EkcAD6O8c8qed8sQFDscCV/6bVKKBri6bMLWX+hviF6 nhWaLQK84MkdMzGsUKO1KJnAEdkQVzmSsFIM4LrLS5enP24GLNhzOvBCrXg7P73K JUZFMmqxw1HE164C5slJCxajITMlLkltJV9sL1USoiBvLL0h8/OYxJ6nSTklP0h2 N8Ht3TZUe/1KLDKlP9mcLQBipLNDXF7ToZVCelR8luldK4EQ973Guz11Woexk3Fi OWOJ4PRGT+t8TNA9jTbwqdJ+R4QjwKWc334xPKRI25JM+/rnZ66Alo1GynfuX2Im 3pzUWXRFEzU4VA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 04:25:15 -0500 (EST) From: Maxime Ripard To: Ray Jui , Florian Fainelli , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Scott Branden , Rob Herring , Frank Rowand , Daniel Vetter , David Airlie , Nicolas Saenz Julienne Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v3 2/3] drm/vc4: Remove conflicting framebuffers before callind bind_all Date: Mon, 13 Dec 2021 10:25:02 +0100 Message-Id: <20211213092503.57379-3-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213092503.57379-1-maxime@cerno.tech> References: <20211213092503.57379-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_012520_278326_A7313BA7 X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The bind hooks will modify their controller registers, so simplefb is going to be unusable anyway. Let's avoid any transient state where it could still be in the system but no longer functionnal. Acked-by: Nicolas Saenz Julienne Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 16abc3a3d601..8ab89f805826 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -251,6 +251,10 @@ static int vc4_drm_bind(struct device *dev) if (ret) return ret; + ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); + if (ret) + return ret; + ret = component_bind_all(dev, drm); if (ret) return ret; @@ -259,10 +263,6 @@ static int vc4_drm_bind(struct device *dev) if (ret) goto unbind_all; - ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); - if (ret) - goto unbind_all; - ret = vc4_kms_load(drm); if (ret < 0) goto unbind_all;