Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351590pxb; Mon, 20 Sep 2021 19:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+ee3DTsV5RXkJy/qRdROSIrC2m0P9ZDUZ7zxkxw1pIwvnqbe7qCEuQtzCnUnqrG2qLdZg X-Received: by 2002:a17:906:3882:: with SMTP id q2mr32755607ejd.396.1632192465711; Mon, 20 Sep 2021 19:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192465; cv=none; d=google.com; s=arc-20160816; b=YAzlFckenw8CJZWYgDAwuwxCMbu32cPLLQHg0ZGqtAQ4YLiBrNGSq0YNkCjijN1M3t v2PKhWk6MQf8EJLPZYzNdtiq4kMI0+0FH95t2aC4k2Bkqs+ESjGpp38czSATovL8X+mb ooI1GDzfEi19lxqBESl6cW2VfidFljK2nKZ1QJ8/lSdOaJXzlhNRlXMxn/X1qH0Fcb44 VgEwjGOCl6nNDO09u1GQhcfvBnzyA1I9F4qVSwxTEWOdHLDEWxflgP4Gx428x+JW1E/J C+/ffjzylhOYWrcpq6Zi+e1S4Q3m9pVfSapZEL0ZlGQy77LY6iG7u08GOiWJZKxSi05K ihoQ== 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=R5IV38bqv6lx+CpXO4jyHW74iSj0ufNK+K6C4n7KL2M=; b=FewFaxEG5sC67aV4QQ3iWB1k5GELUgvZJlk9+29k+ljfRzYMbRFKJE0UpFRbaLKV8R D5PlOEc3fYD+D0px+sJQ3En7Rnz1Mn3qI5RtKIvfwPKcRqGgGE+OW+JZIeNUksWGvoPZ IKJViLje4lrA6t9A3xJxKQRA5iy8rXA/Vd1pp4hd6REKJZyQQujQGbkwk/ujvTT9Qvlm VnKDGwePpaQ6DvAL69FjaQq99gWMRnvHPo+vF0ddzQK3v0lEqUxH0/oT/3cbBlEsIgW2 AdkGbJVv0X2jOR0Fl/DxEVWtAbwf+Rs0fp5IVg+Mh3EAZT1kJ9DqFz4seCAfOIzYQsGb Bx+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HrZCL0Ky; 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 i25si19517239ejd.625.2021.09.20.19.47.22; Mon, 20 Sep 2021 19:47:45 -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=HrZCL0Ky; 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 S1346663AbhITSbD (ORCPT + 99 others); Mon, 20 Sep 2021 14:31:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:44436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378272AbhITSYV (ORCPT ); Mon, 20 Sep 2021 14:24:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9AA8632C4; Mon, 20 Sep 2021 17:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158693; bh=yHJCbk60b7eF5ao3CvNkwObzZqQs9cpObsBVChBaiR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HrZCL0KyuzybdHdJ0ZTAr1v+ungXPAwO53cLsyy4KQPMtqzcI1dA0XeTJCbFtiGdZ LEVEdlfYVYFnhYFF7IwdNHhQAQ1ZGuA69FWVy4i3w8GfJBDydjVV/lLwbuNMdpY07a 5/iW0ZBcb6nl/UCrWkVE5r3MKXQMDB9dj1CaLFJo= 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.10 013/122] drm/etnaviv: keep MMU context across runtime suspend/resume Date: Mon, 20 Sep 2021 18:43:05 +0200 Message-Id: <20210920163916.205709812@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@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 @@ -1578,9 +1578,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; } @@ -1729,6 +1726,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);