Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp230624ybv; Wed, 5 Feb 2020 04:38:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxEqPXyqjiwc5/ZBsktoVPPbekskvfXFAPptGsQ7yD7OkQ/xT9bfgcG/fULFDe96cnlaTFc X-Received: by 2002:a05:6830:3153:: with SMTP id c19mr7171215ots.39.1580906308664; Wed, 05 Feb 2020 04:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580906308; cv=none; d=google.com; s=arc-20160816; b=SUpO09f8WkV6SuGmRIvprFENm9U+hEFb5dncvlOaO9VfNEKyJQv6CcSAuiC/VD+eAx bigH0hI5CypQpNAeBGBbZ95+XNb6o62xV3CRapa4SkKBfYDsKg/WD7j4x33M6kw60eN/ 9ob4uNEy6H/5rpbAOAPCpiujPi0G1IWdNnwQjlBqIEMyMgFCi8KOyyOmthMvFn3zyIYM PnYm3CNDPzUeLpsuTXBE30tAXFuDw06Guy9A9p3as81aHXkr5vpQvoCruU0h3jMVPXJy QOYSskOh3ulFwSnDTFrNyqI1TfxZL+6jlosVe11KUhOlmzJ0S2pz3fUmqt7lk5oLb7J1 Vd9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=t8HmIr5+q2hWW4If3UqbNkWPzhki7FNQhXV4+wWlg4M=; b=nXlFzChzs2mQfJhEpx9927gUcb12R+emWJvLwgvTQMjWPO2GJrEHhHyAOcqvdlpG9i A/T8H2/rodpqycyJb2ZO7M8GozGjHwfRNVNK+kd0EgqPc+/hO9snUjh+WzFJtqwrMvCR I6+1FCT7r6Bpi1YL7qIydGYlU8I4LvJ5aNHmBd7gXOARpB+TWO4z9Rtm7xaTSlsCHK51 fCaghX66DxKEOzAt3h+IsLevOSrp5Zk5+GINUJ2NLlJGqgStbRxRopEb6V2Dj1mwLFix 5RIAcg5Bym4mS6ANTCvXJHj53G7OPucduerM6D+EcMHLyuPXDb3VTaCOOaB2hfkGUqiz X/9A== 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 w2si13158574otq.31.2020.02.05.04.38.05; Wed, 05 Feb 2020 04:38:28 -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 S1727561AbgBEMY3 (ORCPT + 99 others); Wed, 5 Feb 2020 07:24:29 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:53182 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbgBEMY3 (ORCPT ); Wed, 5 Feb 2020 07:24:29 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 4104628DAA6 Date: Wed, 5 Feb 2020 07:24:23 -0500 From: Alyssa Rosenzweig To: Tomeu Vizoso Cc: linux-kernel@vger.kernel.org, Rob Herring , Steven Price , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/panfrost: Don't try to map on error faults Message-ID: <20200205122423.GA2903@kevin> References: <20200205100719.24999-1-tomeu.vizoso@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline In-Reply-To: <20200205100719.24999-1-tomeu.vizoso@collabora.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Reviewed-by: Alyssa Rosenzweig =20 Although it might be nice to #define TRANSLATION_FAULT_LEVEL1 0xC1 ... #define TRANSLATION_FAULT_LEVEL4 0xC4 and then use semantic names instead of magic values. Minimally maybe add a comment explaining that. On Wed, Feb 05, 2020 at 11:07:16AM +0100, 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. >=20 > Otherwise, we can get flooded by kernel warnings and further faults. >=20 > Signed-off-by: Tomeu Vizoso > --- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/pa= nfrost/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(in= t 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); > + if ((status & mask) =3D=3D BIT(i) && > + exception_type >=3D 0xC1 && > + exception_type <=3D 0xC4) { > =20 > ret =3D panfrost_mmu_map_fault_addr(pfdev, i, addr); > if (!ret) { > --=20 > 2.21.0 >=20 --sdtB3X0nJg68CQEu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEQ17gm7CvANAdqvY4/v5QWgr1WA0FAl46s+0ACgkQ/v5QWgr1 WA3Xtw//WjS7YeR6jL+CSEjw3qqi00m2hORBCxE2+yrEUv3RgF9pYj8ugBAZIV20 TdvPTpZulaMFU8v3eV8T9e5RyrUrlUCjPBodW9Sc1VUXLSSUXAeE+gnMpUAB12pR f14Tmqc7q6e0eJsuFmA+cICJqkzmWQcnhBMhaXxaW0uF2ziew4/GaHo8F5tFyzue mu/t6u/RYB/GRIMtrAElsVGKGzgjw6TpCB4TiAjK20OTNkJfeZLHfpFop/nEwPcO VrY+J43BJikSleYbyUhxbpfhTDfmxaeg8TJPsRvXayeJ17oIh1Cz1gV/TrR6AGLF jrxfL+bkQ3QiOPJevtFy3w7G7uyC5LdpFdSYdYCiadctmhdJC8R/yFAMyxhV+HIv 0MGEWvUnNobNBP88nnVT7JoBcbYIc4ncfJB9+L4X4wWpGCy6JOFc5Gz36re0pI4t 7L5E7/CkI+zapX14ffqYlCNvuXM3kXcWavBcsiwGmW9gNUB5iu8dJPCwsShCICSl 1zdePzXDjj8VVFy6aE8agY03hhTDG9qPT/Btxbt/Jj5W3UtMKGrl+u65V8HtZ9Jt PW/2Dsh7rwGHcqCya/zyNEZmlBQk1VZKQkcc3V22bH1pyb1VTdklQZ1PCwQPIafp aCzVPpgtKocCZTf30LVncWNnMxAFspoSppBE3jPBtk8VTLWdSqo= =AhWm -----END PGP SIGNATURE----- --sdtB3X0nJg68CQEu--