Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4081859ybi; Mon, 29 Jul 2019 18:51:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxptbflzTnijqWhkcuxdqA7XPlti1udBjGFieS6iDR7vQKift0h4rsTaqJtRRRQr72Kyu4x X-Received: by 2002:a63:c442:: with SMTP id m2mr108620477pgg.286.1564451515983; Mon, 29 Jul 2019 18:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564451515; cv=none; d=google.com; s=arc-20160816; b=Zq5jg+QMLCV6V70uLzkM2gl8t7dDH8fzOfbTaoA5en5CvjtpiUDepGqsn8tvP5AIBz +RzFUy/eQ6sNsQa6a+E/GCVPKLE6g6fpOJvYrXZuIlfnMD/oVfz3QrrZCiIts3N9AG9t 4ZlnZd5teCremKyrdUYiplarKN6IwlBSfiNlDeRBOLNHTqlAmimPfqPFaOPQKJ/5jjXI qPbrTGAEQTVw/oLgE0PBnlziFXrGVngiX/eGdK65Q0W0kQ1p5YWS2eDxHrYQf31Cf8hF dwK4THuimMvZ/3tIFdSfInTYyGZbFrm4Z+DGeXPLFp8rY+Wg2lUKZYhEYZHe0SrpdWkH fI+w== 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=fsvyrFiwoseOfSkVkr6ldEWnRRrSHNXrzmnuna/4ktw=; b=BK9sDGSV8az7EGKT2MkdcLSaENXfu6EId7EBmg8x2oXvGdcUjMma78r0EYoqEEqtDe F2Tm3QTExqnskjfq5bPKnU6tCdQl+2qJFucDJpxZ+z95q0sk2gjeCFpzh1Agz346G3yi ehB/Ek4JiiMoHlh3H8Joz0BO3aU82mPCS+Zoz4YTtvSAB1VprM877icYmk1vnrSFH/zB NpGaBaLlYcTQIvn6QBLPwuw8HXjo0d9iF9p3UUMBRkiGVt6Ff7Dx/A4VJZ/9WOMQ/wMu pGSz0iIOKK6fyCZoqP1uXEn/J4XPFeTep+imseK2hu58xKxqwc65CFp9XRETVrUZC6MF CMgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lQhev5I4; 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 w12si29059420pgs.364.2019.07.29.18.51.41; Mon, 29 Jul 2019 18:51:55 -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=lQhev5I4; 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 S2389500AbfG2Tmv (ORCPT + 99 others); Mon, 29 Jul 2019 15:42:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389557AbfG2Tms (ORCPT ); Mon, 29 Jul 2019 15:42:48 -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 D374721655; Mon, 29 Jul 2019 19:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429367; bh=zYpROnVsZzCeFQOKde21zbITF1meTJ/9cw4mH6Th/ng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lQhev5I49gD54aEhNO0iaa2kyq8OguweTL1UQXPsjo7BqXdYP67R9o4O/cZY89z4n 1ueS2/uS/zY1qa9EcXu8lFDuMSOn1o6R2Of5WdV6FjBCdXn9pO06sXhdFYoh0UA0MV h7cPl6SpVmluHwwpmESp1IYTmttaLBjHHbOkcSN0= 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 4.19 037/113] drm/msm: Depopulate platform on probe failure Date: Mon, 29 Jul 2019 21:22:04 +0200 Message-Id: <20190729190704.599374925@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@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 c1abad8a8612..ed9a3a1e50ef 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1321,16 +1321,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