Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8451686ybl; Thu, 16 Jan 2020 17:08:16 -0800 (PST) X-Google-Smtp-Source: APXvYqy9U/rUBKA9i51or9iw8zx69K4xjCmtVl7aYTNtebW0ynrSHnA4eqpGoN2ebnZpX+iS4ta4 X-Received: by 2002:a05:6808:4c7:: with SMTP id a7mr1582009oie.83.1579223296200; Thu, 16 Jan 2020 17:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579223296; cv=none; d=google.com; s=arc-20160816; b=c4y/4642/4OD4LE04+zKtG3kCvFKE+l+5VVak7Xunjq6RHvD/BJMK9vimDjpbQzFm9 nUYnaOunGDTu5t5X7Ad2n7YGXNEBJVUZ+HGf6Oul0PZYjFQjheu0IQ2oOVncCj/Brwn+ jClawt1FtQQD+5Q8R12FtjbXG9bVbZSiut1dwcnjObnLb7F4p9I0CQQrk4Ph9rXuLn6T IPZA+yWYTJPetp24mkopgABkk1mVCpxVGFt/1wR2503MhyhX5g+23wJjkjKzWbLHzunh k6YVZ7jQFQ/241idgR3E4iGooROufmxrq9p9VcoGGWbdOL+HLGk2rL/lIIeK7HKC2E3y hOMw== 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=43rk8rpJZbKj5Wojzvgrc6nJGi1kZbI/yU+/tbvNoBo=; b=c2qYGgXSkWXUVGU3LSix+vXaDGh75ea+2X81kR4vfcv6Gujozjg77iP1HdrY22HVXC KpY+MiqU7qtA7IOWCzgrDkMN36Mz40S0TUHD0Rkwtnt72g7loEBwoBCNpY8PYghrAxmD PpSStVyQ3uy/iYZGt2vHVoFhTi2A8hy2j/UJsrJxQqyWbhrCNN85e0KIluP+C0aKxMHU L993I5OlkHlnToY5Edv2EzQe0ziXph3nJzCWP0H3ehbBVyuLCyDE9Hp2FYL0oBjO5TOF 6DNHL1gBCaxeWIsO1KHr/wJySlllQR/N2S6uyEiHQJcyjQ4GoIZKDgqbw/jSlqpEu2Ip Mo6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tLgBwiUL; 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 d3si12469824oia.236.2020.01.16.17.08.00; Thu, 16 Jan 2020 17:08:16 -0800 (PST) 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=tLgBwiUL; 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 S2390606AbgAPXVW (ORCPT + 99 others); Thu, 16 Jan 2020 18:21:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:48296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389488AbgAPXVP (ORCPT ); Thu, 16 Jan 2020 18:21:15 -0500 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 7F85F2072B; Thu, 16 Jan 2020 23:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579216875; bh=OJr/ByO9TRbCM9xgvCxyO58tS8jx1apSCf0bS3fx80w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tLgBwiULRTiBv0MYfwQiilXs79t29C1de+YxvK8xA1miMW1116+GGrZU493kjcA7C bnqwyzZjfm9ZGmvI5psbynaaEc4sOp5enXxh4QU7Echw08YlucTRpOrAEEWwrNBbVQ cHSX1duwovQegvgVHKB8c0s6W3dmFhSmJ4bqLpdg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thierry Reding , Dmitry Osipenko Subject: [PATCH 5.4 029/203] drm/tegra: Fix ordering of cleanup code Date: Fri, 17 Jan 2020 00:15:46 +0100 Message-Id: <20200116231746.894208763@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@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 From: Thierry Reding commit 051172e8c1ceef8749f19faacc1d3bef65d20d8d upstream. Commit Fixes: b9f8b09ce256 ("drm/tegra: Setup shared IOMMU domain after initialization") changed the initialization order of the IOMMU related bits but didn't update the cleanup path accordingly. This asymmetry can cause failures during error recovery. Fixes: b9f8b09ce256 ("drm/tegra: Setup shared IOMMU domain after initialization") Signed-off-by: Thierry Reding Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/tegra/drm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -201,19 +201,19 @@ hub: if (tegra->hub) tegra_display_hub_cleanup(tegra->hub); device: - host1x_device_exit(device); -fbdev: - drm_kms_helper_poll_fini(drm); - tegra_drm_fb_free(drm); -config: - drm_mode_config_cleanup(drm); - if (tegra->domain) { mutex_destroy(&tegra->mm_lock); drm_mm_takedown(&tegra->mm); put_iova_domain(&tegra->carveout.domain); iova_cache_put(); } + + host1x_device_exit(device); +fbdev: + drm_kms_helper_poll_fini(drm); + tegra_drm_fb_free(drm); +config: + drm_mode_config_cleanup(drm); domain: if (tegra->domain) iommu_domain_free(tegra->domain);