From patchwork Fri Nov 1 11:29:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 178295 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp344589ill; Fri, 1 Nov 2019 04:29:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMYW2PtFZMQEAYRMmuFTDwFfqqtyNdkJFaWW4suoChFQwbtc9sR3C/QBdRdUyGRFtGPzEI X-Received: by 2002:a17:906:80d1:: with SMTP id a17mr8808092ejx.77.1572607787214; Fri, 01 Nov 2019 04:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572607787; cv=none; d=google.com; s=arc-20160816; b=xcoQpVkcfLks+0FXgxrWLbM8vPKGdJrWlOG8kLHh7WDvlCpuWAXUPouPtJHXFWznE1 gQ3b+Je9XodXiCJICJyAKVaBkqgmCAes8BL5x2stmsoO6t7j7frHcHImPVqu8YPJNcbO //Nx4pVGpfuHyb6tz5YMaU5krXqilfY0qbRHoSSNBvZA+YVGxOzMCjMSqmKGaNx/CCC0 Mp91gAevJfqbdr+mO2MdTtxu3jRTMhpt/xFN0cXrNAqkgFCkKrpKEAV6qEbZz2/nQwOQ x8OU6Rb6iV6IhVS5MWVrb94ZybcbPk4marzWBLPNUKHDx/b/nShV36eTBuHyF8Hmf9HQ jxHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8wEKLy/QbmIjTepBa+G0u56b2IMWWIVu+NxyDN5fxcI=; b=x4LpesZoAzzTvnWWj1nxBlqq2nPwe5sLCLFaDzaniGiGZUduJL1XIR95XGqsVhK9SF DpBwoDyVb/4PbVBu8niyotuK7H0E1Wg51yLtev5knjC9vniDFQ6ME0ezJP8QnK7HKByC t+MYhoVG+4zaP82MsnSeRC8hoRb8HKbBOwP/C/sw/+JBxQsvhH137qjdv1vbee7A5P57 NwljZE3MTerzPZV8n1uM8i0ie4YmDk8wwxhMIgsUDPyGlYKsh2vRUE+9YspmHFqI0T4t uJX7Z+A2LOvCs3kGAV0BpGng327VPsuTQoQOwuHA5K8GvTMhaTk4915bikSnPvfsUU55 Mrwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ObaO68Gw; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j44si99889eda.345.2019.11.01.04.29.47; Fri, 01 Nov 2019 04:29:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ObaO68Gw; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728571AbfKAL3q (ORCPT + 8 others); Fri, 1 Nov 2019 07:29:46 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44573 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728293AbfKAL3q (ORCPT ); Fri, 1 Nov 2019 07:29:46 -0400 Received: by mail-pg1-f193.google.com with SMTP id e10so6289481pgd.11 for ; Fri, 01 Nov 2019 04:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8wEKLy/QbmIjTepBa+G0u56b2IMWWIVu+NxyDN5fxcI=; b=ObaO68GwYx/JIeZLc8UXrIbi4TERM6qSHLrZCLweBh6KlOozKXYgHCfXJyDYDTI0NB yf+B2S8MuFhcAlHxAmLNgsRoh6u+FwZwqeO9meHAJTJxQqyLkELLkK9gybKelOZgdI2B sNsPCIE7HYZguWCJAH5FA1+/Imq254FgIAd16I+4lp5waL/aQDlYz7edJRQeTNB3TURj HulQShN//6UflrZMHykGRKpvrXxOLY7+JSTYMdKoVA5lXwNoUG96LiWDApO2Vdu6QKmI 0n0RvNnGUvyOQtUgaAiD/C47GhiLZWZPKBqBzH0vVCiC4j9oef8k4F+1sHHqOr8Q3Rva 2qjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8wEKLy/QbmIjTepBa+G0u56b2IMWWIVu+NxyDN5fxcI=; b=HJwguElExzMY896zMOpQEH4R7YHjk6ZYunWgf0KUpqPPYn5AzTSrdqzVRBpG3W/nIs uQQJH1e7NxjCxuFByA+vg48KH6YkkQMlDturm3SW1mFy3jBRjhVWKCIvpfjYtC4EvO8j M90mnIYgy/c4+10CJusDGVfuGzlbwSKwC90CiXjBga8Sr4LArdBTxRjXheOBO72xkXdB CDDU0oU06PnQUSRlRmLbt0oitQPPAyJp1Bb5NuYfiD9ZKgoxQkJgxV1zWRUxcWxY6Hvq EcWoSdjL4DzLmg2U7c0A79WRnQxznQc/8av5boKHMB4kOZEBUbwJwnYw+28xq2dYHBWX OygQ== X-Gm-Message-State: APjAAAUFv3BYUaSlfNcfgjfbVCaLNQADW5U8Xc9sLPDHwouDRFDWa0wL 6walpCDQG34gKDtBl2GKAUI= X-Received: by 2002:a65:63cf:: with SMTP id n15mr13218245pgv.314.1572607785116; Fri, 01 Nov 2019 04:29:45 -0700 (PDT) Received: from voyager.lan ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id w12sm1369427pfn.105.2019.11.01.04.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 04:29:44 -0700 (PDT) From: Joel Stanley To: Rob Herring , Andrew Jeffery , Jeremy Kerr , Alistar Popple , Eddie James , Steven Rostedt , Ingo Molnar Cc: Benjamin Herrenschmidt , devicetree@vger.kernel.org, linux-fsi@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] fsi: aspeed: Add trace points Date: Fri, 1 Nov 2019 21:59:05 +1030 Message-Id: <20191101112905.7282-5-joel@jms.id.au> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191101112905.7282-1-joel@jms.id.au> References: <20191101112905.7282-1-joel@jms.id.au> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org These trace points help with debugging the FSI master. They show the low level reads, writes and error states of the master. Signed-off-by: Joel Stanley --- drivers/fsi/fsi-master-aspeed.c | 22 +++++++ include/trace/events/fsi_master_aspeed.h | 77 ++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 include/trace/events/fsi_master_aspeed.h -- 2.24.0.rc1 diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index 5bb7a778075e..be1f2449b77a 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -67,6 +67,9 @@ static const u32 fsi_base = 0xa0000000; #define XFER_HALFWORD (BIT(0)) #define XFER_BYTE (0) +#define CREATE_TRACE_POINTS +#include + #define FSI_LINK_ENABLE_SETUP_TIME 10 /* in mS */ #define DEFAULT_DIVISOR 14 @@ -92,6 +95,8 @@ static int __opb_write(struct fsi_master_aspeed *aspeed, u32 addr, status = readl(base + OPB0_STATUS); + trace_fsi_master_aspeed_opb_write(addr, val, transfer_size, status, reg); + /* Return error when poll timed out */ if (ret) return ret; @@ -139,6 +144,10 @@ static int __opb_read(struct fsi_master_aspeed *aspeed, uint32_t addr, result = readl(base + OPB0_FSI_DATA_R); + trace_fsi_master_aspeed_opb_read(addr, transfer_size, result, + readl(base + OPB0_STATUS), + reg); + /* Return error when poll timed out */ if (ret) return ret; @@ -186,6 +195,19 @@ static int check_errors(struct fsi_master_aspeed *aspeed, int err) { int ret; + if (trace_fsi_master_aspeed_opb_error_enabled()) { + __be32 mresp0, mstap0, mesrb0; + + opb_readl(aspeed, ctrl_base + FSI_MRESP0, &mresp0); + opb_readl(aspeed, ctrl_base + FSI_MSTAP0, &mstap0); + opb_readl(aspeed, ctrl_base + FSI_MESRB0, &mesrb0); + + trace_fsi_master_aspeed_opb_error( + be32_to_cpu(mresp0), + be32_to_cpu(mstap0), + be32_to_cpu(mesrb0)); + }; + if (err == -EIO) { /* Check MAEB (0x70) ? */ diff --git a/include/trace/events/fsi_master_aspeed.h b/include/trace/events/fsi_master_aspeed.h new file mode 100644 index 000000000000..a355ceacc33f --- /dev/null +++ b/include/trace/events/fsi_master_aspeed.h @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM fsi_master_aspeed + +#if !defined(_TRACE_FSI_MASTER_ASPEED_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_FSI_MASTER_ASPEED_H + +#include + +TRACE_EVENT(fsi_master_aspeed_opb_read, + TP_PROTO(uint32_t addr, size_t size, uint32_t result, uint32_t status, uint32_t irq_status), + TP_ARGS(addr, size, result, status, irq_status), + TP_STRUCT__entry( + __field(uint32_t, addr) + __field(size_t, size) + __field(uint32_t, result) + __field(uint32_t, status) + __field(uint32_t, irq_status) + ), + TP_fast_assign( + __entry->addr = addr; + __entry->size = size; + __entry->result = result; + __entry->status = status; + __entry->irq_status = irq_status; + ), + TP_printk("addr %08x size %zu: result %08x sts: %08x irq_sts: %08x", + __entry->addr, __entry->size, __entry->result, + __entry->status, __entry->irq_status + ) +); + +TRACE_EVENT(fsi_master_aspeed_opb_write, + TP_PROTO(uint32_t addr, uint32_t val, size_t size, uint32_t status, uint32_t irq_status), + TP_ARGS(addr, val, size, status, irq_status), + TP_STRUCT__entry( + __field(uint32_t, addr) + __field(uint32_t, val) + __field(size_t, size) + __field(uint32_t, status) + __field(uint32_t, irq_status) + ), + TP_fast_assign( + __entry->addr = addr; + __entry->val = val; + __entry->size = size; + __entry->status = status; + __entry->irq_status = irq_status; + ), + TP_printk("addr %08x val %08x size %zu status: %08x irq_sts: %08x", + __entry->addr, __entry->val, __entry->size, + __entry->status, __entry->irq_status + ) + ); + +TRACE_EVENT(fsi_master_aspeed_opb_error, + TP_PROTO(uint32_t mresp0, uint32_t mstap0, uint32_t mesrb0), + TP_ARGS(mresp0, mstap0, mesrb0), + TP_STRUCT__entry( + __field(uint32_t, mresp0) + __field(uint32_t, mstap0) + __field(uint32_t, mesrb0) + ), + TP_fast_assign( + __entry->mresp0 = mresp0; + __entry->mstap0 = mstap0; + __entry->mesrb0 = mesrb0; + ), + TP_printk("mresp0 %08x mstap0 %08x mesrb0 %08x", + __entry->mresp0, __entry->mstap0, __entry->mesrb0 + ) + ); + +#endif + +#include