From patchwork Mon Mar 6 10:35:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 64600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1772280wrd; Mon, 6 Mar 2023 03:01:53 -0800 (PST) X-Google-Smtp-Source: AK7set/6idvitb2hBXi+EVE3jkDNH9kuJfAGwoj3wngZe1pdVGXRxZbacM3IO9SMCW4i9UWz2NQS X-Received: by 2002:a05:6a21:78a1:b0:cd:3069:28cd with SMTP id bf33-20020a056a2178a100b000cd306928cdmr12164177pzc.39.1678100513540; Mon, 06 Mar 2023 03:01:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678100513; cv=none; d=google.com; s=arc-20160816; b=pA4kbXPleUYWaONrZXeA+qVq/sIs+W6Gx+E9tvOG6nMo/8VMU5On45xonx/uxnwEpM ysZz7zB2X6syWMQN0HrU2HJCTXdpFktEYdc20lYs81cvd3elwDjdl4K48kNCjK1jHnXq YXFvwlMUji0IOf1MRnTnY/tvSYoKfYS/GVxJYc888FFQVn1I/cEvs3c6bBkUyY4XCzmF 6KjyWNMuX3OI8jKwGGMJ1TeGpjmsySZPwsishEbIMBpz/vyDkCc8G6vYiWgBiWsBHcgF UwaV+LzJWIjHIjLZFu8ngAZDXLZSBxt76pcT6miO0ehXVG3MFiyFIgk2VC+QakCrRAWg gfgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZOKICHAhHT61487Pk5benl24IlZVNRo4OLC94rEOx8w=; b=XkGr6f12gaSQGi+3sKn32xs/5OtS80tabEqCQKLPUneI1401DoKPaJdckfuLT6+yl9 zj7jgz2ahs5X2gqXAJOMKEoKeg0EKMqdBCcRRmHGghJo9qrPy/tz9xCG95gWmBgV9xCt 9gcBPxIVRe2MHSGq5+GPF/CXEz9WrD68HQxqcysytsIJxgQ6kQ/GmIauxtVhN4Bp3Zp8 exGZ1pBuus5fk3gSKLhdThTfQX/Zs8ZM/N9MYoRjlwDboDWQRbq5eluu9+gs0GUgYbOB itnWQSH6Bgdli20901scQWGb/niYCrhm17J1TSkHytKrdf34f9DD9/cuyhr1SYLi08Cj 0gvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cFKax5qc; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 129-20020a630087000000b004fbd3213f0fsi9204426pga.357.2023.03.06.03.01.26; Mon, 06 Mar 2023 03:01:53 -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=@kernel.org header.s=k20201202 header.b=cFKax5qc; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230388AbjCFKfw (ORCPT + 99 others); Mon, 6 Mar 2023 05:35:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbjCFKfk (ORCPT ); Mon, 6 Mar 2023 05:35:40 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 265F059E6; Mon, 6 Mar 2023 02:35:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B4E0A60DD8; Mon, 6 Mar 2023 10:35:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E768C433EF; Mon, 6 Mar 2023 10:35:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678098921; bh=SRUfSdNrezRb0O3IdTK2gQ4I8eUwRNj/lM/SpHhJyzk=; h=From:To:Cc:Subject:Date:From; b=cFKax5qc9bZgyqF07BqIBQn1IixKmGK6qqgwzTH2dgSKFoMBja6hBio5dlINqRBsc BzKJukhpkk2eKTOaYCa+b4YrEPhGrWl9RRGjUQIb9ehBC6gnleZrd+9S07FwBz8j4T c/nqt3e2MElvmEHSm+tyrh+ztgc+pAzpVK6W3r6g/SK0Hh5cpFSZCh4X5UovUbSQpk pziKnOrP//m34QXp9pJNcPZ81LGA2b6hbOeVxMGqIK3tD7vJzeF75sNzkaVKrwfVel Ps93IE6prRpA2EhMtPg3oXtfK51lg1NAgXKJqhCML1IbLuU4W+/zzyFT+5G1anR4va N6p+c6niGaz+g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pZ8CH-0001Hm-Ce; Mon, 06 Mar 2023 11:36:01 +0100 From: Johan Hovold To: Neil Armstrong Cc: David Airlie , Daniel Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH] drm/meson: fix missing component unbind on bind errors Date: Mon, 6 Mar 2023 11:35:33 +0100 Message-Id: <20230306103533.4915-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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?1759615924127971566?= X-GMAIL-MSGID: =?utf-8?q?1759615924127971566?= Make sure to unbind all subcomponents when binding the aggregate device fails. Fixes: a41e82e6c457 ("drm/meson: Add support for components") Cc: stable@vger.kernel.org # 4.12 Cc: Neil Armstrong Signed-off-by: Johan Hovold Acked-by: Neil Armstrong --- Note that this one has only been compile tested. Johan drivers/gpu/drm/meson/meson_drv.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 79bfe3938d3c..7caf937c3c90 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -325,23 +325,23 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) ret = meson_encoder_hdmi_init(priv); if (ret) - goto exit_afbcd; + goto unbind_all; ret = meson_plane_create(priv); if (ret) - goto exit_afbcd; + goto unbind_all; ret = meson_overlay_create(priv); if (ret) - goto exit_afbcd; + goto unbind_all; ret = meson_crtc_create(priv); if (ret) - goto exit_afbcd; + goto unbind_all; ret = request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm); if (ret) - goto exit_afbcd; + goto unbind_all; drm_mode_config_reset(drm); @@ -359,6 +359,9 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) uninstall_irq: free_irq(priv->vsync_irq, drm); +unbind_all: + if (has_components) + component_unbind_all(drm->dev, drm); exit_afbcd: if (priv->afbcd.ops) priv->afbcd.ops->exit(priv);