From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A50324B0482; Fri, 7 Aug 2026 14:53:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786114400; cv=none; b=A/Fuoe68J+s/jatlObzqThAN6pHXxIpWokc5EiBQPxVbC58BSDwjMd0mti9akrWeiRCGMqEmhhC9H2PzfUFSEaaCvYiZXYjZWAj1sevxsrm442oSC/NKeDn5YMRJbsbHNorPemaGlX2yVhPKaGEvMPI2sjc9V6fuyt81zHalquQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786114400; c=relaxed/simple; bh=CfFlCfidmU57CjAKZcwN64x/tJyNNX0Haazsl58Fq6o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iRYPbAIzQ9q3phUnOKF7nMMKlVSphnhhaiqAPqasYzpiDQxy7D+775fMyVl8UkHXM8naiP6m7sIRzW1GfZMAA4xjYgTZVSADtg0Cs4W0ntaeFq4kjSBrfDS/3faFi6Soj9X7dxx+W/Pl95rWcWKsOvvn8mVwhays2pVkFjynlt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yrQ796Mm; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yrQ796Mm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C28E1F000E9; Fri, 7 Aug 2026 14:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786114399; bh=TNxi7DTjo/oTw8sifDhe8S1F0o85mepoBuwwPBrUIps=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yrQ796MmnSh2bAjBxIVwHQO8HfhCPlT7rFhnXi34DcTUy62G9G1+N71Gt5GB/kB6V Y1h2DCXPLLxFUBBvDMXch4MkS3ilZfAlx+DzCsheHIdLvf7zbW2YS/+Y0loAFxfHsS rP6tfJ18iepGozZ3FJUlr+/nVNvP8i9pF5iY/o7A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ijae Kim , Myeonghun Pak , CK Hu , Chun-Kuang Hu Subject: [PATCH 6.12 249/337] drm/mediatek: ovl_adaptor: balance component registrations Date: Fri, 7 Aug 2026 16:37:32 +0200 Message-ID: <20260807143423.944773967@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260807143418.516897842@linuxfoundation.org> References: <20260807143418.516897842@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak commit 533e3469a57996905cdb95f178e7efe38c21aeb2 upstream. The OVL adaptor registers both an aggregate driver for its child devices and a component for the main DRM aggregate. Probe currently ignores an error from registering the child aggregate and leaves that aggregate registered if registering the DRM component fails. The remove callback also leaves the DRM component registered. These imbalances can leave component framework entries referring to a device whose probe failed or whose driver has been detached. The aggregate unbind callback also fails to undo component_bind_all(), leaving its child components marked as bound when the aggregate is removed. Check the aggregate registration result, unwind it when the component registration fails, and unregister the component before the aggregate on remove. Keep runtime PM enabled until both framework registrations have been removed, and unbind all child components from the aggregate unbind callback. Fixes: 453c3364632a ("drm/mediatek: Add ovl_adaptor support for MT8195") Cc: stable@vger.kernel.org # 6.4+ Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20260721152242.47138-1-mhun512@gmail.com/ Signed-off-by: Chun-Kuang Hu Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c @@ -585,6 +585,7 @@ static void mtk_disp_ovl_adaptor_master_ struct mtk_disp_ovl_adaptor *priv = dev_get_drvdata(dev); priv->children_bound = false; + component_unbind_all(dev, priv->mmsys_dev); } static const struct component_master_ops mtk_disp_ovl_adaptor_master_ops = { @@ -611,12 +612,15 @@ static int mtk_disp_ovl_adaptor_probe(st priv->mmsys_dev = pdev->dev.platform_data; - component_master_add_with_match(dev, &mtk_disp_ovl_adaptor_master_ops, match); + ret = component_master_add_with_match(dev, &mtk_disp_ovl_adaptor_master_ops, match); + if (ret) + return dev_err_probe(dev, ret, "Failed to add component master\n"); pm_runtime_enable(dev); ret = component_add(dev, &mtk_disp_ovl_adaptor_comp_ops); if (ret != 0) { + component_master_del(dev, &mtk_disp_ovl_adaptor_master_ops); pm_runtime_disable(dev); return dev_err_probe(dev, ret, "Failed to add component\n"); } @@ -626,6 +630,7 @@ static int mtk_disp_ovl_adaptor_probe(st static void mtk_disp_ovl_adaptor_remove(struct platform_device *pdev) { + component_del(&pdev->dev, &mtk_disp_ovl_adaptor_comp_ops); component_master_del(&pdev->dev, &mtk_disp_ovl_adaptor_master_ops); pm_runtime_disable(&pdev->dev); }