Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2007941imm; Sat, 18 Aug 2018 08:59:16 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxZgkz5A0+Xz659XFlgez5LFVoAcV7zXwzJUUqBamTBrbjgkGkmeWnEBRqlkPycbHsnEjBr X-Received: by 2002:a63:f043:: with SMTP id s3-v6mr35522534pgj.94.1534607956468; Sat, 18 Aug 2018 08:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534607956; cv=none; d=google.com; s=arc-20160816; b=sbFNxtvTPLZwPbhJ4CXpeG/bpucFPQs5Cxn9IZkavdOw/YA/TgHKZ144ZT/18uCNJX KIEKVFbJD5tWDkntfJa1Ehn0DI/8I1Wq4yJYlkzIZt56XuuDIMMETMRwxrXu3idr2z/M QO3GIZcprhhOzB8l12EFam6OedOdUPLlzOcldObTq/nSDjxhGoRd3A8FzxkcosXxUj8K 4Uk9GKfLtn1GUvWwMZVPVdQqK31XM8lP3OYTO35OmKD5S9aDCnLGr7b+boBjx7DV2Ngc 503dWCz9pKTjww+2ph8IpsS/q0SEyplaS2bZlr1o6jUx/a/+clX0+vuk2NTbf5+O/Xh+ 9V8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=yc39MaJWlWuFsUruW/W28tlu/IXsoT4wAtYkbXGwtVU=; b=mrijLFLgg1W9bn0bhGABw8A+BcVzSx0yWT5XL4eK9t7kpymyGTN+XwWqDypsbTE7Qw bj1ieq2Hk0jwcNtMei5SsiJqaeWSCpxDUupkK5/h3nn3oW0k3txV/J3ZJDQKMwjX4oyW dXvanFtpXmSkyBydutJMSUuH8ctqWHmDi2/BUexMHQMc5csbltKfInYRmwB+q+7uqq4g PV71TJl/dGlre2hYO8n6PHHNXcPAVeK1PffMHtQpE3GAbjh8+M+mMXZ/p6ZEeaqha04+ Cw4kWJohliz0dVY3Dp7ILaBTr/OixxB1fMvwKUK8pCxovh0EEY+svZCQv0Dd2t2UQX39 hXTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yqe5FYTQ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i35-v6si5155292plg.460.2018.08.18.08.59.01; Sat, 18 Aug 2018 08:59:16 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yqe5FYTQ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbeHRTEB (ORCPT + 99 others); Sat, 18 Aug 2018 15:04:01 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39169 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbeHRTD7 (ORCPT ); Sat, 18 Aug 2018 15:03:59 -0400 Received: by mail-ed1-f65.google.com with SMTP id h4-v6so6115672edi.6; Sat, 18 Aug 2018 08:55:49 -0700 (PDT) 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; bh=yc39MaJWlWuFsUruW/W28tlu/IXsoT4wAtYkbXGwtVU=; b=Yqe5FYTQPapMof27ShaTmUr5oFcqJ65+arwZvWOUPyDizGxTEKGiZhL3zS0qEryrVt qQhyBcgQRqu6IDeEir6zoeEvRrXZEe/BWLerx3snzNU8vLnIAakd5JqW0NpOHHTTZ1va 79bLwxkgcFWxrba9w/a3ZoEpNIYkb9GoqH+2sDLF8P/O/hf4TgpZwgPeG0vqBHn42KO6 dfQOjQoMmi41gj7i/TsXhfzJwNYRf4Qm+alx3mNwRsCRCL/quslaUjEtQ4nOBhOvdh1E i5matDsYPYlUoWKC5MMq/JAxV9ceIRptEJbxxXEmW79qjip4hAH9paRh3kYL8EjI9TrN 7AeA== 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; bh=yc39MaJWlWuFsUruW/W28tlu/IXsoT4wAtYkbXGwtVU=; b=VBvcAdVgKeoJ2l84EkdtPuznwdFv57yN+rQ9H6Hc9Z7zPt+kpdSue9a/RZjRpnuXUP jtZY2KvKtCPPHsMaVxNlaiCbZ1QOrDZiGsUq4Kne7TuI7L6Ecm/9lvq0xRLrFlrqaKKi Zjord4mkVO/LRWVy7eto2MNy0V8RtZ8PQwx2QYL/Dir+R3joxFZC6qNsQOkoZQXS3XBX TGjZYq9Z3IwSymj20/TrQLmV+X59ELwfBGAGvKUwpPrmJ3xavd+ShfPHMHiWxdAEllL7 fTnfdb+QE/yHy/SKCRYEsL3xLcKdkTpqIJMIylnst2Dn8v61+++V0dAuWVEssRbfhjMq /bMw== X-Gm-Message-State: AOUpUlFx0Mes6s41w4DQiTEvoYWkQ5eJrwIMl0JRARHzkYPoyF7GvzNn 4zQbPUnM7KfCfaHJwZ7MHVOEFfoT X-Received: by 2002:a50:d54a:: with SMTP id f10-v6mr28836944edj.151.1534607749115; Sat, 18 Aug 2018 08:55:49 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id v8-v6sm2784014edr.48.2018.08.18.08.55.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Aug 2018 08:55:48 -0700 (PDT) From: Dmitry Osipenko To: Joerg Roedel , Robin Murphy , Thierry Reding , Jonathan Hunter , Rob Herring Cc: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 10/19] memory: tegra: Read client ID on GART page fault Date: Sat, 18 Aug 2018 18:54:21 +0300 Message-Id: <20180818155430.5586-11-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180818155430.5586-1-digetx@gmail.com> References: <20180818155430.5586-1-digetx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the device tree binding changes, now Memory Controller has access to GART registers. Hence it is now possible to read client ID on GART page fault to get information about what memory client causes the fault. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/mc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c index 3bf3138769f4..ab383d7a7842 100644 --- a/drivers/memory/tegra/mc.c +++ b/drivers/memory/tegra/mc.c @@ -38,6 +38,7 @@ #define MC_ERR_ADR 0x0c +#define MC_GART_ERROR_REQ 0x30 #define MC_DECERR_EMEM_OTHERS_STATUS 0x58 #define MC_SECURITY_VIOLATION_STATUS 0x74 @@ -575,8 +576,15 @@ static __maybe_unused irqreturn_t tegra20_mc_irq(int irq, void *data) break; case MC_INT_INVALID_GART_PAGE: - dev_err_ratelimited(mc->dev, "%s\n", error); - continue; + reg = MC_GART_ERROR_REQ; + value = mc_readl(mc, reg); + + id = (value >> 1) & mc->soc->client_id_mask; + desc = error_names[2]; + + if (value & BIT(0)) + direction = "write"; + break; case MC_INT_SECURITY_VIOLATION: reg = MC_SECURITY_VIOLATION_STATUS; -- 2.18.0