Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3799896ybi; Mon, 29 Jul 2019 12:52:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/aKXvz0beDJaKLtxlZfTbuogac9hqQrMqNzBMj93G2tKGkWf/Ldb0ei1+p9/68k2xkTmb X-Received: by 2002:a17:902:b905:: with SMTP id bf5mr104312515plb.342.1564429954513; Mon, 29 Jul 2019 12:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429954; cv=none; d=google.com; s=arc-20160816; b=UMrLgh0VGW5RnCh+3u+OOUHaknLYebhwkDfGuGqLpwchNqMVHFxPDEnic0id16r1Gd OPXTNMdkB7fsXBV3XcNgmt8nyy3WG/yyDY0h1KDQe4fue7gyEvws8xdBq6I4fDLoHK2A l5NCmzQZ3ykf6OG4pJzSB0tsB11pd2mnQETWSWyfJRsggvcIEjkQ+TA3AF+tmu0IF79I ceWgTysj+sSzCXnxQSRvQdooY40F0agBB4fHnJCL3anJ/3U05KQGPlIB97b3I0b/kUQK wKe1zboFdJ6QiTbxaSqOSkkwJFOBgjqlxz9TNTKuZw9R4KcjhaWXFL6DD5kvmm1tK48r V5Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G/kyi2xK5OwtKJCCSBmn2UpBWMxhBczdGR7cbpafdoQ=; b=nunXD5aJpUyIXFBw43yr7lniUUUaac0sMSEBbOBUaYSvwS/WGvzE9xnfOAeJGCdIO5 bJV0EzSSJ7SmRvg14Pc7c4pdAmoufJgjnmSpzGE2nY3ySRTjihxxdk9rfGKCLFj3xJmJ eqQr/DBrENRQ1xEoBYVPXXnMAxnsG3Ixeq+d8IHaezmJR/rF0fG6Gx7WUGxYvlZn/h4S 28SnTuqu8MVb7ZMerlVzWIsAbNmLeYdOdrlfa2+cnDjMeJyXbTliuH1DL8lhElmqgwfl 24jqddSjsEQdkI++CQL1wQzFhI4ZZO3IvJZPRluZ0iJHEAgJs/Kk13K0sLogFqN1XzMJ e3LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WdReC12P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 131si21737549pgf.597.2019.07.29.12.52.19; Mon, 29 Jul 2019 12:52:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WdReC12P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403832AbfG2Tu7 (ORCPT + 99 others); Mon, 29 Jul 2019 15:50:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:42056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403813AbfG2Tu5 (ORCPT ); Mon, 29 Jul 2019 15:50:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14FE52054F; Mon, 29 Jul 2019 19:50:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429856; bh=LzfNP2/2fiV3yQotqscSonDsmaMObuAwMCULeBTHQHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WdReC12PJtSMpZA4axGc8MeRwLa7Y7QM5wMnBggOlMhE0r8pzgmN6hDNWuIxfCjI0 CPc55Lrjp629yUBct3g5SbxzUumhJnUVaQo2BIIJrHkKSmhwlahZFhkN0ji07thWts ssilu8gdXTL8dZgu63iJXiudVsqtjXxX3DCvTWzI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Sean Paul , Sasha Levin Subject: [PATCH 5.2 078/215] drm/msm: Depopulate platform on probe failure Date: Mon, 29 Jul 2019 21:21:14 +0200 Message-Id: <20190729190753.404914906@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 4368a1539c6b41ac3cddc06f5a5117952998804c ] add_display_components() calls of_platform_populate, and we depopluate on pdev remove, but not when probe fails. So if we get a probe deferral in one of the components, we won't depopulate the platform. This causes the core to keep references to devices which should be destroyed, which causes issues when those same devices try to re-initialize on the next probe attempt. I think this is the reason we had issues with the gmu's device-managed resources on deferral (worked around in commit 94e3a17f33a5). Reviewed-by: Rob Clark Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20190617201301.133275-3-sean@poorly.run Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/msm_drv.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index f38d7367bd3b..4a0fe8a25ad7 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1306,16 +1306,24 @@ static int msm_pdev_probe(struct platform_device *pdev) ret = add_gpu_components(&pdev->dev, &match); if (ret) - return ret; + goto fail; /* on all devices that I am aware of, iommu's which can map * any address the cpu can see are used: */ ret = dma_set_mask_and_coherent(&pdev->dev, ~0); if (ret) - return ret; + goto fail; + + ret = component_master_add_with_match(&pdev->dev, &msm_drm_ops, match); + if (ret) + goto fail; - return component_master_add_with_match(&pdev->dev, &msm_drm_ops, match); + return 0; + +fail: + of_platform_depopulate(&pdev->dev); + return ret; } static int msm_pdev_remove(struct platform_device *pdev) -- 2.20.1