Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2350393pxb; Mon, 20 Sep 2021 19:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYBiin7+y7fVwNT5RN2IgHxCueoIwbWIaIPOcrjKR8PBwgI55f44hSB/cDHD0Mcm7bAfio X-Received: by 2002:a50:fb8f:: with SMTP id e15mr32181278edq.162.1632192322618; Mon, 20 Sep 2021 19:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192322; cv=none; d=google.com; s=arc-20160816; b=IoMRniYrDt/hBYy40sZdA0SMuh0Is3po7NxYjtDRTUjgni29cFiNACRK4RLtvtq93J sjEzHYElIeqrjRcs0O2e6YwE6taAh41Dj3BaW8gW0LguhFrWpY9jmnnDeyAI8iUztsty qaOR0ke19EUrof8jydFwLfwbvaLAE1a0XXW5xFgHSptUJYucggzrzL072kbekdqYTaol fKh2xtyWBTV8McSLNZYXpnsePYgE5AqxcP0+e7K1ezkv9T1jSxLSR9jNrdy6IXBAef38 AP5FCKJPIAYQ0i6eKD46dkTqQnayjpt9fkjzb8FmmiJTuPGnrw6JvxFXLK+ig0GSB0X3 4avA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8mjbS+NGFHFr7Etw9BVVN789Bx5KPOKrdmxXmW6xiys=; b=zg2dqWawvGO1qH1K+4anTayT427wK9LIFv5nqUaZckHffnXrHycDrM/7Ffhjoyo4iu RW9zNOhsKLSKCuEcGPJq0tEFZH0LxIiLmYQD3EiLsCnt591qrNt6LZVfibRDtC0wp9rB zSxRQnf0CMxC056UOnHhq5vepg+SEHX4oLUgVFAvCuLRz0o5kticeR2A8qpQ6xJ3KOff qIzunv8WFUAqeCjSYBTMjMVnWsPU9NrFydTZddaGkAeRL1ZovB5Zxs9VePU09zLz/3cK Ntozpti4e8PWXHkS2HThFnQzoAiG0zqNCMNhKB70giKJzI9BNhiJWthNOnyfWlSakOg6 ih4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b3K78g5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si7218155eju.468.2021.09.20.19.44.58; Mon, 20 Sep 2021 19:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b3K78g5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352065AbhITSXw (ORCPT + 99 others); Mon, 20 Sep 2021 14:23:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:40568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359342AbhITSQX (ORCPT ); Mon, 20 Sep 2021 14:16:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEB9963296; Mon, 20 Sep 2021 17:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158536; bh=IAogcnxdLyI3hmQm+gsyK5ugXRi1rsEHfzSA4z6yE3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b3K78g5MZ55hgAULPt5nQQ4hcD7Muk1oATfnvpcK+k7mc8Wo2+nX9DFyLlT9U3KQp 7z/sRw5PYPcu7roaN2k3wHkZsdk8ZpFkPyanFgDVab0SmqE0nf2sAXSl+HtVTzWFks qrfWW3P73vC/4KJLWy4yQECo5DRiT8IJn/xNP3N8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Lucas Stach , Marek Vasut , Christian Gmeiner Subject: [PATCH 5.4 202/260] drm/etnaviv: keep MMU context across runtime suspend/resume Date: Mon, 20 Sep 2021 18:43:40 +0200 Message-Id: <20210920163937.975219348@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Stach commit 8f3eea9d01d7b0f95b0fe04187c0059019ada85b upstream. The MMU state may be kept across a runtime suspend/resume cycle, as we avoid a full hardware reset to keep the latency of the runtime PM small. Don't pretend that the MMU state is lost in driver state. The MMU context is pushed out when new HW jobs with a different context are coming in. The only exception to this is when the GPU is unbound, in which case we need to make sure to also free the last active context. Cc: stable@vger.kernel.org # 5.4 Reported-by: Michael Walle Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1547,9 +1547,6 @@ static int etnaviv_gpu_hw_suspend(struct */ etnaviv_gpu_wait_idle(gpu, 100); - etnaviv_iommu_context_put(gpu->mmu_context); - gpu->mmu_context = NULL; - gpu->fe_running = false; } @@ -1698,6 +1695,9 @@ static void etnaviv_gpu_unbind(struct de etnaviv_gpu_hw_suspend(gpu); #endif + if (gpu->mmu_context) + etnaviv_iommu_context_put(gpu->mmu_context); + if (gpu->initialized) { etnaviv_cmdbuf_free(&gpu->buffer); etnaviv_iommu_global_fini(gpu);