Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2129583ybv; Sun, 23 Feb 2020 23:24:04 -0800 (PST) X-Google-Smtp-Source: APXvYqyro9mKUirD44q3tt83fHokMn0Y6OQnCv1d8wnLJfpsr3m1O6OOjGGtd4Q4uQuJZRa9tM29 X-Received: by 2002:a9d:6653:: with SMTP id q19mr39939638otm.94.1582529044824; Sun, 23 Feb 2020 23:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582529044; cv=none; d=google.com; s=arc-20160816; b=riU90T59N8dFRP5573YquEh/VoWflillMojOEiJWvBfkKNZbv0Kbw54V+qRH2kwh+I t0zTHrsD7DU8XsbsmSx1ZmrLpBVgN6bMPjQybwEDwBSMjZ3mxjW9GkHqcijk1TjjtRUU /grEoNxK8BHkqpxUYa9aL2uMoHb51O4mpl3V8UiSVs79c2V0YR/qtR268zVefsCab0s0 S5x4pCTcbe3++MiehROmtzSURcIqQf29OH6ceV4lXkvB3M/h44nL+oquPSi0yLavHR9B 5sDbUmJbA1QtghXUxYVjpeaAP3/lbS1B98hMRi5phyoqH2xsgWb+/3+Mmt7aYo0SXwFT xlaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=3uWqpH0FizNQxnodtS0BMO7C44y4V2HGUhMB2HUYwPs=; b=hlRVBgQzXG6xMfyM7agItvLRVgkM/nw/352V8SMEHUQQLeR1PWQ2s8QlnnDonRw3sd Pqmj+wObtFbsNvugr0RkpMHjUB0T90jNADvWbcojKTf0kKLi3k6OEtnl5zqYuerFptEq BOEV/AM8yjUCi6cDRJN1SgNA7ybJEzUo+sjNe96qQMF5eQOy9roIqycRWypXAXw+1T4v cuwRJ8oZmrZgwoowGiDM8LNqrmh9Aa2qLzYX+XxcOZoTqiH4iUbrb9RHhzgPQ1dHCBls gz+4eqEecMXlDXKQBTgjwPu1O5PJ9Y2ah3U8jWGlnTb/00vGXO0ptvw8zTjYOAlquwXH fZDg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62si4440368oiz.271.2020.02.23.23.23.52; Sun, 23 Feb 2020 23:24:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727275AbgBXHWw (ORCPT + 99 others); Mon, 24 Feb 2020 02:22:52 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36628 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbgBXHWw (ORCPT ); Mon, 24 Feb 2020 02:22:52 -0500 Received: by mail-wr1-f67.google.com with SMTP id z3so9047051wru.3 for ; Sun, 23 Feb 2020 23:22:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3uWqpH0FizNQxnodtS0BMO7C44y4V2HGUhMB2HUYwPs=; b=l36brtc6N6grQqiI/XIhTNCTkjvrohQdVQZ4U4Nt/Sc3i/qX9xbXbkkm5epeSq4szh a6ZDIParg6uHmSwMEZGeNvO2Zb6Q1ev9L8cP5lrvaVRf6ff7BaUuYH9Ksr5spVCzeF4M FdUXrNoTyzZvAGXAfryBQ2o+dlBwnZk47EJCboMyFyRkKTSgfYQEi9E8XIHiDSQ18Jlc gSgJy9TNhkyNpiFInUhX33shINgCLNYHaydJu5fLKJs0WAXA8DbVX0fuOaskYMM9Kqoz zaUwKXAIMSQl7sC8PNIx8++HwxgnETYopSxzoh2TMt4c+tV6UN842wlNYiQbtPX++OWG Qzug== X-Gm-Message-State: APjAAAXkimYavSUNCy5ALndlwFrNIQvR/7TvjtoN7GSvoeOrifIr0qqD I3HCLgFUs6tMS4FccDxcdO9F4rx9uf0hcrQFLrY= X-Received: by 2002:adf:eec3:: with SMTP id a3mr61552115wrp.337.1582528970137; Sun, 23 Feb 2020 23:22:50 -0800 (PST) MIME-Version: 1.0 References: <20200212202236.13095-1-robh@kernel.org> In-Reply-To: <20200212202236.13095-1-robh@kernel.org> From: Tomeu Vizoso Date: Mon, 24 Feb 2020 08:22:38 +0100 Message-ID: Subject: Re: [PATCH v2] drm/panfrost: Don't try to map on error faults To: Rob Herring Cc: open list , David Airlie , dri-devel , Steven Price , Alyssa Rosenzweig , Robin Murphy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Feb 2020 at 21:22, Rob Herring wrote: > > From: Tomeu Vizoso > > If the exception type isn't a translation fault, don't try to map and > instead go straight to a terminal fault. > > Otherwise, we can get flooded by kernel warnings and further faults. > > Signed-off-by: Tomeu Vizoso > Signed-off-by: Rob Herring > --- > I rewrote this some simplifying the code and somewhat following Steven's > suggested. Still not using defines though. No defines here was good > enough before IMO. > > Only compile tested. Looks good, I also tested it on RK3399. Reviewed-by: Tomeu Vizoso Thanks, Tomeu > drivers/gpu/drm/panfrost/panfrost_mmu.c | 44 +++++++++++-------------- > 1 file changed, 19 insertions(+), 25 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c > index 763cfca886a7..4f2836bd9215 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c > +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c > @@ -596,33 +596,27 @@ 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); > - > + ret = -1; > + if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0) > ret = panfrost_mmu_map_fault_addr(pfdev, i, addr); > - if (!ret) { > - mmu_write(pfdev, MMU_INT_CLEAR, BIT(i)); > - status &= ~mask; > - continue; > - } > - } > > - /* terminal fault, print info about the fault */ > - dev_err(pfdev->dev, > - "Unhandled Page fault in AS%d at VA 0x%016llX\n" > - "Reason: %s\n" > - "raw fault status: 0x%X\n" > - "decoded fault status: %s\n" > - "exception type 0x%X: %s\n" > - "access type 0x%X: %s\n" > - "source id 0x%X\n", > - i, addr, > - "TODO", > - fault_status, > - (fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"), > - exception_type, panfrost_exception_name(pfdev, exception_type), > - access_type, access_type_name(pfdev, fault_status), > - source_id); > + if (ret) > + /* terminal fault, print info about the fault */ > + dev_err(pfdev->dev, > + "Unhandled Page fault in AS%d at VA 0x%016llX\n" > + "Reason: %s\n" > + "raw fault status: 0x%X\n" > + "decoded fault status: %s\n" > + "exception type 0x%X: %s\n" > + "access type 0x%X: %s\n" > + "source id 0x%X\n", > + i, addr, > + "TODO", > + fault_status, > + (fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"), > + exception_type, panfrost_exception_name(pfdev, exception_type), > + access_type, access_type_name(pfdev, fault_status), > + source_id); > > mmu_write(pfdev, MMU_INT_CLEAR, mask); > > -- > 2.20.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel