From patchwork Fri Sep 13 05:50:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 11143959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2AA4C76 for ; Fri, 13 Sep 2019 05:51:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 132A120830 for ; Fri, 13 Sep 2019 05:51:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 132A120830 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 206A06EE7E; Fri, 13 Sep 2019 05:51:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21D716E96F; Fri, 13 Sep 2019 05:51:21 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id g207so1281851wmg.5; Thu, 12 Sep 2019 22:51:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jXC2JSeYDwfRzTDWTmvulHeraPlQ3lge32wRaYjTBZI=; b=VR7WnU3FT3B9Imkdj/cYpCiEbQ/Qh4anjpuxhDtA7NwZK+tUb8czvLWNzr92LBwR9p P6J/cJVElg61QYTROrITvz22Q8YwR9PtOU2x+useZv9LPJa003xfhNFBhc8RhnURDEQ/ K8ocSwWRQnM6zU70WDsEbeB9+YigswPKgqeSLfYktJcw4TZVTfsYAnouDoLmX47uLCAL jr44hCYIZQok0szs/rVxEGqCZZ+rHJmikfp/W6TTlZgGrB76KVwjEshS35oIREsTwGWN pPQhAN6xrwmWZ1O1dtb5zwiLl1hNkiXZgUaQ8t1kh60JLXNuPHVCwx1pUMgfHZwfLf0/ 1aYw== X-Gm-Message-State: APjAAAUtihKRUNnNUI3qanryMjmzumIpTaCItpU9yw6UhbkUpKWX9f51 VCS7Xz3RM7us/usYP9hVRLU= X-Google-Smtp-Source: APXvYqyPuytCs7qgPT8aDxXS0ADHQ+Ao/igSxMfV2CjGE2qnx7wAaeoyMX0W1A8Z/HLqtS4yG8snFA== X-Received: by 2002:a1c:f913:: with SMTP id x19mr1751035wmh.2.1568353879564; Thu, 12 Sep 2019 22:51:19 -0700 (PDT) Received: from localhost.localdomain ([62.178.82.229]) by smtp.gmail.com with ESMTPSA id h125sm2429279wmf.31.2019.09.12.22.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 22:51:18 -0700 (PDT) From: Christian Gmeiner To: linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm/etnaviv: print MMU exception cause Date: Fri, 13 Sep 2019 07:50:37 +0200 Message-Id: <20190913055052.25599-2-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190913055052.25599-1-christian.gmeiner@gmail.com> References: <20190913055052.25599-1-christian.gmeiner@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jXC2JSeYDwfRzTDWTmvulHeraPlQ3lge32wRaYjTBZI=; b=pAMsPgBcYtBzJAqYVIgj1LP8nysURYvTGbxAXtyPU4cqugH9uJT1fgMdCaKcf6wrcv JkT2w42BprXACBM/JShBo/c0CgiThyWdqM35FSKY5pUoEpxFqsTjEqqxLsggPrx4fkgV 0cx+8EMqqUL40BkxCgOKSDPAu0ErLvO/CR5IzsqotQVUSYMyVN27g+o/gHIhWvEvOozz YOfc3g8exQWaOLRnCrRgy8fVnQs/CesWfvBN+whWJzIzwlYvhrhyZn+hm2/DpMpo4A6/ axvvWeXlF8at7OsBUlDh11dX3igTLwuWDv64I5FlNg6Zdr4QdlymDHmuS5gVnueKq6zy gxFA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Russell King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Might be useful when debugging MMU exceptions. Changes in V2: - Use a static array of string for error message as suggested by Lucas Stach. Signed-off-by: Christian Gmeiner --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index d47d1a8e0219..b8cd85153fe0 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1351,6 +1351,15 @@ static void sync_point_worker(struct work_struct *work) static void dump_mmu_fault(struct etnaviv_gpu *gpu) { + static const char *errors[] = { + "slave not present", + "page not present", + "write violation", + "out of bound", + "read security violation", + "write security violation", + }; + u32 status_reg, status; int i; @@ -1364,10 +1373,16 @@ static void dump_mmu_fault(struct etnaviv_gpu *gpu) for (i = 0; i < 4; i++) { u32 address_reg; + const char *error = "unknown state"; if (!(status & (VIVS_MMUv2_STATUS_EXCEPTION0__MASK << (i * 4)))) continue; + if (status < ARRAY_SIZE(errors)) + error = errors[status]; + + dev_err_ratelimited(gpu->dev, "MMU %d %s\n", i, error); + if (gpu->sec_mode == ETNA_SEC_NONE) address_reg = VIVS_MMUv2_EXCEPTION_ADDR(i); else