Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3788975ybi; Mon, 29 Jul 2019 12:38:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNMFoauzZPVw6nkcOpPIAPmUF2St5Gjgu4GG9ey7Z1j1b5eOt32kzTdE3RrghXswlGqzkK X-Received: by 2002:a17:902:5c3:: with SMTP id f61mr103653486plf.98.1564429136902; Mon, 29 Jul 2019 12:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429136; cv=none; d=google.com; s=arc-20160816; b=I68ybkSDu3UnBHDwaRuLsvj+lUxpLw0teSrNZATnn0/+qXR+18Tm+XYsuFdJoaKvBn oo+7BqXKOosvhh4ngxvjKt/mtQo10f8RGDRHeaU8Xqj6+Bhv7kJjE9ZXnl9AlpYfK2dL mkY9qbfA9eewi5PWi1T7FHocfkJ9qAzpNl+I+HQ9cLovWFJB6uLM/MAD1K+6tnXuzs/T T5NH/QuQS8Cn/S1QdLteNQ1D8PWu2mUVYpZeplt0CK2Ckk7iMOj56OXj5y1qL4xIQXxF CCgDj4pgut4n+XOaB7UXVw3gzLtezbV/FJyAChfjeEkCHN1BJwNmGKktGo9ReEpYfVeo sj2w== 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=Cznnk3rVsBYpu1jPop5ciLXWhhb4mYEqyok4TSJhwaI=; b=MYxnYdWgoAVJTYNkC/An8QkgIxEhje5sfEd3RcuISMhhABMYnN+LEVpqlW2Hh6vdPm /acpG0pxKsJpG8U/lblfOoESuFzMrqvLW/NPtggqS9hEXhBS4ckX5xgIGVuVivht1NQR y8JfO51jIiNTnXsqoE7tLc6HNq2x5/1IUCdvxGv4B1HA50yGWQv+NecDDst8cK8PIk5y FoxxkJQvGntP2rlJZcr0G0El9X5h/E38rv4kHybmX0D3nh+iNlnUbWoaEKsCuATBrdwH /juKl7KZf5Gkazxrhpb7xBJS0de1xKp3x/vDiy4x50z1meov7w576Brm3ltqfsBayvxt iGpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d+PnF3P5; 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 co4si7625881plb.363.2019.07.29.12.38.42; Mon, 29 Jul 2019 12:38:56 -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=d+PnF3P5; 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 S2387595AbfG2TgM (ORCPT + 99 others); Mon, 29 Jul 2019 15:36:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:50426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729795AbfG2TgG (ORCPT ); Mon, 29 Jul 2019 15:36:06 -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 F40FA217D9; Mon, 29 Jul 2019 19:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428965; bh=8fw/Yr+dTESAq9f0syfX1PISVmZ2laUtxOc8GUM9vaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d+PnF3P5LW0yESWzxSDCNvG13W1S5oKQbFyoxDV8xQBb7jTbtGwZFC2RBtUH5UYvX bqv78QvZ1NZY8V9h3Q3w+N1ulJsLc7Vhj6VwxTzD/R4xRTUeiwdScos8YNcH3TvNsC 0MVobBgC8ZL4gYInWKRwaMuJ71jJ9C8sVVluUANs= 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.14 243/293] drm/msm: Depopulate platform on probe failure Date: Mon, 29 Jul 2019 21:22:14 +0200 Message-Id: <20190729190843.086680487@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 606df7bea97b..b970427e53a7 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1097,16 +1097,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 0; - return component_master_add_with_match(&pdev->dev, &msm_drm_ops, match); +fail: + of_platform_depopulate(&pdev->dev); + return ret; } static int msm_pdev_remove(struct platform_device *pdev) -- 2.20.1