Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2389929ybv; Mon, 24 Feb 2020 04:28:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwUKtZP3Xs8ijCS8c2VbAzSOXCQB1/ewt/8yfBZZ2v3x+cSqOU9Jl/E/4nfhllj+USjacPh X-Received: by 2002:aca:bb54:: with SMTP id l81mr11810702oif.175.1582547314697; Mon, 24 Feb 2020 04:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582547314; cv=none; d=google.com; s=arc-20160816; b=wPxWRfoeAk5XwRrA1oIMmtP34gIki0dVCVsC0e7cM/hYDWRJE1K80Jf7jt62P4EKUe TovO4qX/sE2GSn1JHHJQBZFAYY1Yp+8sIc18nb177YjxWr1TGFK50cGXoHYOIvmV2/oq SvySEbGMO3cW1oK5NtO3D7vLDefhDy35XxeBPqUq2qMxmBagdC7Qwl369Woy208kiwpq Vrx/sSIcAbFkPOGWYvxxtt4oSzcyipG6GldfTic5yhDSKyP/EFjoOu77H9VVY6Zu+Awq lG+08H3AGz95Kdzwv1qYC6p17ZXRr1NIq2POTfDbMJHrfMF0kr0w+38oz8GLKfEfKd/O WpTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0437Xbrk/gsKB0vnZW2noe1FhHjxhAnqlAuxijpckEM=; b=oEIgJVRQQUHpdZ9vABzZVeg60p55lFsFztf5WrILKSu/F1KQGIjqB1CP9mJGMGAOfc OuNY4GFQWDAvmqJcmKpuIVAtsFsu5m1w4gDoZ5JSgaI/D+x5LXPu9B5VY53FJrb5876d gd9ak3nR5V1oBQmq2a5/9ICqvY/SZaR/yoZ1A/sRnwZb6yWPxGlTaVTmzFCbujRTo3Up xrMeGIfqX+W7IU+bvb+9RgxoTJDW1s9pfHyEdbJPfOjMiNo554yZO/RH/kmm440h+r/v CV3pIr0AdTfZy/KJSA+devbxdHjH1+BL27FS3YPorwW0PdHl9HMsUZu+coYwBnMtj41a hLDQ== 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 i124si4987840oif.214.2020.02.24.04.28.21; Mon, 24 Feb 2020 04:28:34 -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 S1727438AbgBXM1L (ORCPT + 99 others); Mon, 24 Feb 2020 07:27:11 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:54844 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727357AbgBXM1L (ORCPT ); Mon, 24 Feb 2020 07:27:11 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 00068293775 Date: Mon, 24 Feb 2020 07:27:05 -0500 From: Alyssa Rosenzweig To: Rob Herring Cc: linux-kernel@vger.kernel.org, Tomeu Vizoso , David Airlie , dri-devel@lists.freedesktop.org, Steven Price , Robin Murphy Subject: Re: [PATCH v2] drm/panfrost: Don't try to map on error faults Message-ID: <20200224122705.GA3363@kevin> References: <20200212202236.13095-1-robh@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <20200212202236.13095-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Acked-by: Alyssa Rosenzweig On Wed, Feb 12, 2020 at 02:22:36PM -0600, Rob Herring wrote: > From: Tomeu Vizoso >=20 > If the exception type isn't a translation fault, don't try to map and > instead go straight to a terminal fault. >=20 > Otherwise, we can get flooded by kernel warnings and further faults. >=20 > Signed-off-by: Tomeu Vizoso > Signed-off-by: Rob Herring > --- > I rewrote this some simplifying the code and somewhat following Steven's= =20 > suggested. Still not using defines though. No defines here was good=20 > enough before IMO. >=20 > Only compile tested. >=20 > drivers/gpu/drm/panfrost/panfrost_mmu.c | 44 +++++++++++-------------- > 1 file changed, 19 insertions(+), 25 deletions(-) >=20 > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/pa= nfrost/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 =3D (fault_status >> 16); > =20 > /* Page fault only */ > - if ((status & mask) =3D=3D BIT(i)) { > - WARN_ON(exception_type < 0xC1 || exception_type > 0xC4); > - > + ret =3D -1; > + if ((status & mask) =3D=3D BIT(i) && (exception_type & 0xF8) =3D=3D 0x= C0) > ret =3D panfrost_mmu_map_fault_addr(pfdev, i, addr); > - if (!ret) { > - mmu_write(pfdev, MMU_INT_CLEAR, BIT(i)); > - status &=3D ~mask; > - continue; > - } > - } > =20 > - /* 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); > =20 > mmu_write(pfdev, MMU_INT_CLEAR, mask); > =20 > --=20 > 2.20.1 >=20 --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEQ17gm7CvANAdqvY4/v5QWgr1WA0FAl5TwRQACgkQ/v5QWgr1 WA1Hog//TrLApFg1MbWFYQX8Y/weTKYo4RLc+VHaQ///TZ4caRYQ9fJ1JCjuW7Jh ud8LA79XswB+sdgvVxhMsWWfQcQGT5jfeSl2QXQNRXtIyXyf3R8rPBht3OQ/FyCo fhrwdfQDEBDZA2/rsvAmZ/UUZVGA4Dp2ph6F/6gORK6Y5fCi81INGj3SGMZQCt/A HO9OksOe+uV03bXo5KFnULw7Q25oPp80sMCZUFxOq0eHMZObTzMZqA13HxEYnrnb uCfV58MAB8fIqd2M5M0fIpgmCNfOGm/2Gkg+Kof9RLOLjPUeQqRj5ss8QunDWw1L EATJFXeaWQiLaoPBJx/Q4i3uuVKQ0c/QkbqLN4otFHLTaLrdsAqhkVeASFUSOdJL CpmEISk5pCX27hHCwcWyj22SGuzE8zDhFvQNMYquKgVqhLEZdH1CHQf1jQazyxsz xLr/4e74IjkwpBB6gWZduLRHAqEhsooDLGoz94W5LDvOpOR0FT5pTgxgiU2MhFf7 aPu/nZQ7Fb/L0oqAGyyholv8KpLoTNI80LEqXdm1ntSceCQyvfTr8nMDJvC0uMiC xYlu9yMDwY6vvQXt4bVuFr3WoToFlvlmgD3piTKXUYShUdDN9gs7UDdCvhiB0aXo leDlW9VjcKbl76HNXbAOw7amcQqeTkcOSLw4kt859VeQnwVhtJE= =GEiC -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp--