Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4578110pxj; Wed, 12 May 2021 08:33:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAFLAOB078ZLfaNIgZVfXS9+xCDpWu3vRR9nnW156Ba4cOwCy9BDmBlLeiooKcq0lzDKYG X-Received: by 2002:aa7:db90:: with SMTP id u16mr43967216edt.106.1620833608738; Wed, 12 May 2021 08:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620833608; cv=none; d=google.com; s=arc-20160816; b=ALhtJ/oqZOPgtU5A7WkOajUxeo4KRjainmrTiv9XimHit8TAQES4qrcQ+YrMWWXoIe SfKN9lyuL+aUSImIfRN+hFCnyl+Eulq7QK2cOe8cOitQQ5JTP504M/r1o3nI5tePeJAR 3mYfwel99vgkF2V+iXNEa/u7f4ccWlHd+dq4NSx4gqMbSmxzSIft4Zn3t78YkdO50kn5 2GltxUECrodVi54+Yf5r052G95xpSGf92d4m1a16BX+EJUTe7D2bieHmb84yyRspz8Ug GaKGfx9sTydYqdF8GH1cl7aXZbHd5SPCEjgK6r5nJHqTpMzYJU5fJS1QVfp7AzYa1Ebp TcxQ== 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=3XCxrb9BT1e0QqLBYZzsKae4s0B5GLY5nK+4Bxp3bc8=; b=tRa1jT8XvU/yAiOuNDM+4Gs2UMYyJWPsgOpMWifggnuf2VFkJDl+YFNp3gGeunL5MT w+pptjK2Ii+qZX1sdn7Q51b6Zmza1OWMyqnC//sc7oCxQVZrfsXnlHurHezY/vK0pQrV KAFXaUZJO8vrYZVg0biEdaQkpmzDLoygxrb8qEZxZFLwGW3VR3kdSFE9GGVdbJqrSXUB 0xUpUYBRR2xLL8Fg+Tflvf3u0c3HyhaDC3mpSWOwR5hMsjWTGg9bNZlbeI7bEOvLcRpH Xk3uZnnZKUN0adoU75bmaG84Bw2iY4/jRR32eF+3ij2wLVXD+oiuoTTcnRXu3WvxExW+ xZyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aE17wPHE; 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 gx23si309047ejb.149.2021.05.12.08.33.05; Wed, 12 May 2021 08:33:28 -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=aE17wPHE; 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 S234470AbhELPci (ORCPT + 99 others); Wed, 12 May 2021 11:32:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:50550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233929AbhELPPc (ORCPT ); Wed, 12 May 2021 11:15:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 862F961945; Wed, 12 May 2021 15:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831907; bh=JNzJkqclgj+qsZsTqLZTYNawv6r4r9lTzok9va8Pi1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aE17wPHEHWXnRnuS6SMaox7ImhYyIDGXe9uLM9wiv9Qw+nyQPcjfxC0j9NLq/MKNm EvoZMIw38pghbSmnndFqtSGT4+0eXMoe2QKrGgZmwEpYJz6+QrV8Y8fgI519sllHro c15EkxV88wadHlCR+LMHHygbeD8CFZi6cWbuBIUA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Boris Brezillon , Steven Price Subject: [PATCH 5.10 062/530] drm/panfrost: Clear MMU irqs before handling the fault Date: Wed, 12 May 2021 16:42:52 +0200 Message-Id: <20210512144821.789745915@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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: Boris Brezillon commit 3aa0a80fc692c9959c261f4c5bfe9c23ddd90562 upstream. When a fault is handled it will unblock the GPU which will continue executing its shader and might fault almost immediately on a different page. If we clear interrupts after handling the fault we might miss new faults, so clear them before. Cc: Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210205111757.585248-2-boris.brezillon@collabora.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -600,6 +600,8 @@ static irqreturn_t panfrost_mmu_irq_hand access_type = (fault_status >> 8) & 0x3; source_id = (fault_status >> 16); + mmu_write(pfdev, MMU_INT_CLEAR, mask); + /* Page fault only */ ret = -1; if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0) @@ -623,8 +625,6 @@ static irqreturn_t panfrost_mmu_irq_hand access_type, access_type_name(pfdev, fault_status), source_id); - mmu_write(pfdev, MMU_INT_CLEAR, mask); - status &= ~mask; }