Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351533pxb; Mon, 20 Sep 2021 19:47:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYyodecFTiyllzqKzxtkhAgKj9fUsr2/lKvftiwrv7WulLssvUppoQhRemkyf8eXT7CrH7 X-Received: by 2002:a17:906:a044:: with SMTP id bg4mr30941375ejb.312.1632192460245; Mon, 20 Sep 2021 19:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192460; cv=none; d=google.com; s=arc-20160816; b=glRnzPTVmcBBFnKf2THviG0v0x7QdsN3ms07TXTSM5BZe+U+WYZDgp2birJbdg6cu0 Ba5LLaXjIIqeJyogrXRA0/V5Qsh5x7U7kjnnZOcUPT1qwyzHLBiFX3PnSEZjgnLG4iQJ qddEzrPiV8//OJUDWkVSA0XyySD5PybH2M+KMWx/xzMUBUhVf7SWrQevBClQKLEqnZdJ fwhjbbckYwCBsfWSeH1RYK4N3ckjdh3ua/PYAf9f6vXcoWJ5GDY5PznbJ1Nb2tbGM670 SD+6ItMBpCjChqvztCHp5RIYlBE9vDwUWa8ch1P1gPm3gyb2KP9AWWsI0W1DEdWx6VC7 Kpog== 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=+YCeLJa5tqrxiWNbZZ7Sb6vBpKiUVAbONTUhz4mHhHc=; b=LE4ir5WAP59igItbkCR3UYugiXcO4gU0sIYng+PQJR5j++ad9DJdvBlTe2YxPZOZqc f5v9A1OnPQHfNn3XcLR6dlDF7J8BbCUscW19oa6iUPiyh8BEKsBHkYu41SEy3zmDjaR2 KISjCNCQqn6KZNTfXb5qI2KTOSNujs+QCPRCOGuLsFSmw9e8f2rF6etM82CP6TZv0fg/ BEFJhqHtxtggaXtq5z6sbFs/697puyXfwpRjeSY1gAHdDt2MNwUJyq3IQfb6ftT50azR 7pSSBTB+1OOT9pClLG7OvQRMcfoXXz73eTPdKrE7s1ZMHgJvCJCT6grsqHR+tht8tZJI rm/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WRaYViIB; 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 t10si5637899edj.386.2021.09.20.19.47.16; Mon, 20 Sep 2021 19:47:40 -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=WRaYViIB; 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 S1379697AbhITSaQ (ORCPT + 99 others); Mon, 20 Sep 2021 14:30:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:43182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378269AbhITSYV (ORCPT ); Mon, 20 Sep 2021 14:24:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 09DAC61A82; Mon, 20 Sep 2021 17:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158695; bh=DYVaVDAmiVP8486sNXO74FnWiOjCSJpncak/nMEFL/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WRaYViIB4kMyKg4j5r5VEXGZOjG3YwH8L8LNOTUTbzp4cazr1XYiVtEY5Z944ZePy kUwYzsnBcceOXkzbUALKEtqErIRskyh4ywsF0CUoR8A16hFnIa4t1TTlL40x1vaKbq Ni2LUBu7NBvJxZrqJ4WbJ6fpAYucs50mffZxipKg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lucas Stach , Michael Walle , Marek Vasut , Christian Gmeiner Subject: [PATCH 5.10 014/122] drm/etnaviv: exec and MMU state is lost when resetting the GPU Date: Mon, 20 Sep 2021 18:43:06 +0200 Message-Id: <20210920163916.238213155@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 725cbc7884c37f3b4f1777bc1aea6432cded8ca5 upstream. When the GPU is reset both the current exec state, as well as all MMU state is lost. Move the driver side state tracking into the reset function to keep hardware and software state from diverging. Cc: stable@vger.kernel.org # 5.4 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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -562,6 +562,8 @@ static int etnaviv_hw_reset(struct etnav etnaviv_gpu_update_clock(gpu); gpu->fe_running = false; + gpu->exec_state = -1; + gpu->mmu_context = NULL; return 0; } @@ -818,7 +820,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu /* Now program the hardware */ mutex_lock(&gpu->lock); etnaviv_gpu_hw_init(gpu); - gpu->exec_state = -1; mutex_unlock(&gpu->lock); pm_runtime_mark_last_busy(gpu->dev); @@ -1043,8 +1044,6 @@ void etnaviv_gpu_recover_hang(struct etn spin_unlock(&gpu->event_spinlock); etnaviv_gpu_hw_init(gpu); - gpu->exec_state = -1; - gpu->mmu_context = NULL; mutex_unlock(&gpu->lock); pm_runtime_mark_last_busy(gpu->dev);