Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp276320ybv; Wed, 5 Feb 2020 05:27:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyGG4qmLlf71l83Pa5dZxxukklpKNfIrh3LmGGyLbSIHaRjlNlu7b0xtCrniEfh+Kwlhfbg X-Received: by 2002:aca:c383:: with SMTP id t125mr2617110oif.122.1580909252561; Wed, 05 Feb 2020 05:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580909252; cv=none; d=google.com; s=arc-20160816; b=QLlI2K6Q3+AhpFCgygFC+uHdUrs1Vb5e+e/IyFT9oviFkeSZdl1KpMzFIqIG4T7TF6 u52sma7KWFO8U3jRVK9nmyDoRYvGNb7DN2ijeddE0/rxvQGFvILj/Oi5a3LQ6RRCzoe6 bCVvTINGfuA3mR6h55leT5zps/9zyEB8squ3rxR5JNfFkAI4LTg1zHHVWz8MdBeGgQQk ep/h73ZvYfgtOgJeUpDr4L4A2CNS4gnpeMzKnyxaYgWM7x5kj2jFgfIc0Y/Tq/TMbNWf udsH1uLp1YyFBTn1yi5VleUMAQfhbu8gKn29UZASQwkVUVH0SAepYjgHGx08fp+F2DOK 4+5A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=rL7U4+wSyNd7eOutars1L33m3695PVxdpzHXYjcovLI=; b=MOO8DzK8dyM3eDVCOH88MTktudjFdMWsVf/oi0l85zu4ZdDLdeZ+y02ZMBsshoQsHE s56b5dcRVjj3OoIbONXAgIn8TCilsW/RqgT+trXnf25O4YO5h5I5ocONhX5mHmgJAk1z RVlToJxxbWNnM8v+pLxjPqDT0blRLgnYyAws7jtnIxiMgsslOxUFKJmoC5mgeqnxI05a o94TmrNPBYotWFpehn6cfXUninhc637KNvHB0bQrg/QGAEBgmyEBltmOYGcMeEARUxfD bfsQcsBxx4HXrRhLaV0wSPaVp2YgNilYRvKFsivCWth7LpmTZO8f6i1Auj/SErip9v/l Sfvw== ARC-Authentication-Results: i=1; mx.google.com; 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 e15si12515016otq.237.2020.02.05.05.27.20; Wed, 05 Feb 2020 05:27:32 -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; 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 S1727995AbgBENZv (ORCPT + 99 others); Wed, 5 Feb 2020 08:25:51 -0500 Received: from foss.arm.com ([217.140.110.172]:47252 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727162AbgBENZv (ORCPT ); Wed, 5 Feb 2020 08:25:51 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F16C231B; Wed, 5 Feb 2020 05:25:50 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2AC093F52E; Wed, 5 Feb 2020 05:25:50 -0800 (PST) Subject: Re: [PATCH] drm/panfrost: Don't try to map on error faults To: Tomeu Vizoso , linux-kernel@vger.kernel.org Cc: David Airlie , dri-devel@lists.freedesktop.org, Steven Price , Alyssa Rosenzweig References: <20200205100719.24999-1-tomeu.vizoso@collabora.com> From: Robin Murphy Message-ID: <3500c501-b166-6a1e-267b-31a4e5c62619@arm.com> Date: Wed, 5 Feb 2020 13:25:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200205100719.24999-1-tomeu.vizoso@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/2020 10:07 am, Tomeu Vizoso wrote: > If the exception type isn't one of the normal faults, don't try to map > and instead go straight to a terminal fault. "One of the the normal faults" seems a rather vague way of saying "a translation fault", which is what we're specifically handling here, and logically the only fault reflecting something not yet mapped rather than mapped inappropriately ;) (Who knows how the level ended up as 1-4 rather than 0-3 as it really should be - another Mali Mystery(TM)...) > Otherwise, we can get flooded by kernel warnings and further faults. Either way, Reviewed-by: Robin Murphy > Signed-off-by: Tomeu Vizoso > --- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c > index 763cfca886a7..80abddb4544c 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c > +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c > @@ -596,8 +596,9 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) > source_id = (fault_status >> 16); > > /* Page fault only */ > - if ((status & mask) == BIT(i)) { > - WARN_ON(exception_type < 0xC1 || exception_type > 0xC4); > + if ((status & mask) == BIT(i) && > + exception_type >= 0xC1 && > + exception_type <= 0xC4) { > > ret = panfrost_mmu_map_fault_addr(pfdev, i, addr); > if (!ret) { >