From patchwork Mon Feb 26 16:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 1904503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=BBYFP0uq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linux-fsi-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tk6C60rqZz23cb for ; Tue, 27 Feb 2024 03:53:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=BBYFP0uq; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Tk6C56l8tz3vdW for ; Tue, 27 Feb 2024 03:53:53 +1100 (AEDT) X-Original-To: linux-fsi@lists.ozlabs.org Delivered-To: linux-fsi@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=BBYFP0uq; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=eajames@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Tk6Bz62LXz3vds for ; Tue, 27 Feb 2024 03:53:47 +1100 (AEDT) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41QGgVR9002939; Mon, 26 Feb 2024 16:53:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=zvpqrz1IR95x4v/nVIcA1R/mLkFs7xansTMd+3MOVyo=; b=BBYFP0uqNUf5uQepQkGiI+FNz5PpzJHDoDMDJSj2E14GjuG07Rhx2XincBcxVLqlKR6Z 9rJOe2mLc9FZp+ym1Btm9wGnMMkZ7mTdVjs/0cX+pBHOhJ2oQ5GWNWpYuO3Tmz9luFe4 uXg8ZpCaTIdNMltMydhvZofn90lvJvEYcwfIEs30qJpOFQGSZ4fzc4Fq6FFvRLSTwfWT qI9J3tahP/2Z+NNYPDviGT+SujbEi9mM5xJN1IzHEX5XQupRFADpu7SwbIkN7Ti/j4hX Yarf3tV4HvEblNf+4TrrNEAAaX0WWgzKWOmMvSRoPQXHh4UsNwOClfoFPMZJ1kTiUsyX 1w== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wgxd4g9xv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 16:53:40 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41QFLKEe008164; Mon, 26 Feb 2024 16:53:38 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wfv9m2a0r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 16:53:38 +0000 Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41QGrZO249676706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Feb 2024 16:53:38 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9AC558059; Mon, 26 Feb 2024 16:53:35 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0DC858053; Mon, 26 Feb 2024 16:53:34 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.57.130]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 26 Feb 2024 16:53:34 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Subject: [PATCH v2 16/31] fsi: aspeed: Refactor trace functions Date: Mon, 26 Feb 2024 10:53:06 -0600 Message-Id: <20240226165321.91976-17-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240226165321.91976-1-eajames@linux.ibm.com> References: <20240226165321.91976-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: JXCh92xZ_8bmT7NItvxgaCBoSUewsLWc X-Proofpoint-ORIG-GUID: JXCh92xZ_8bmT7NItvxgaCBoSUewsLWc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-26_11,2024-02-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 mlxlogscore=943 spamscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402260128 X-BeenThere: linux-fsi@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, andi.shyti@kernel.org, alistair@popple.id.au, linux-kernel@vger.kernel.org, lakshmiy@us.ibmcom, linux-i2c@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org Errors-To: linux-fsi-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "linux-fsi" Remove the opb error trace, add a timeout trace, and combine the read/write traces. Signed-off-by: Eddie James --- drivers/fsi/fsi-master-aspeed.c | 29 +++------ include/trace/events/fsi_master_aspeed.h | 80 ++++++++---------------- 2 files changed, 34 insertions(+), 75 deletions(-) diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index c36e7e49e965..1a91f3acdfcc 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -116,16 +116,17 @@ 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) + if (ret) { + trace_fsi_master_aspeed_timeout(reg, status, false); return ret; + } /* Command failed, master will reset */ if (status & STATUS_ERR_ACK) return -EIO; + trace_fsi_master_aspeed_opb_xfer(addr, transfer_size + 1, val, false); return 0; } @@ -169,13 +170,11 @@ 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) + if (ret) { + trace_fsi_master_aspeed_timeout(reg, status, true); return ret; + } /* Command failed, master will reset */ if (status & STATUS_ERR_ACK) @@ -198,6 +197,7 @@ static int __opb_read(struct fsi_master_aspeed *aspeed, uint32_t addr, } + trace_fsi_master_aspeed_opb_xfer(addr, transfer_size + 1, result, true); return 0; } @@ -220,19 +220,6 @@ 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 index 0fff873775f1..7eeecbfec7f0 100644 --- a/include/trace/events/fsi_master_aspeed.h +++ b/include/trace/events/fsi_master_aspeed.h @@ -8,69 +8,41 @@ #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), +TRACE_EVENT(fsi_master_aspeed_opb_xfer, + TP_PROTO(uint32_t addr, uint32_t size, uint32_t data, bool read), + TP_ARGS(addr, size, data, read), TP_STRUCT__entry( - __field(uint32_t, addr) - __field(size_t, size) - __field(uint32_t, result) - __field(uint32_t, status) - __field(uint32_t, irq_status) - ), + __field(uint32_t, addr) + __field(uint32_t, size) + __field(uint32_t, data) + __field(bool, read) + ), 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 - ) + __entry->data = data; + __entry->read = read; + ), + TP_printk("%s addr %08x size %u data %08x", __entry->read ? "read" : "write", + __entry->addr, __entry->size, __entry->data) ); -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), +TRACE_EVENT(fsi_master_aspeed_timeout, + TP_PROTO(uint32_t irq, uint32_t status, bool read), + TP_ARGS(irq, status, read), TP_STRUCT__entry( - __field(uint32_t, addr) - __field(uint32_t, val) - __field(size_t, size) - __field(uint32_t, status) - __field(uint32_t, irq_status) - ), + __field(uint32_t, irq) + __field(uint32_t, status) + __field(bool, read) + ), TP_fast_assign( - __entry->addr = addr; - __entry->val = val; - __entry->size = size; + __entry->irq = irq; __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 - ) - ); + __entry->read = read; + ), + TP_printk("%s irq %08x status %08x", __entry->read ? "read" : "write", __entry->irq, + __entry->status) +); TRACE_EVENT(fsi_master_aspeed_cfam_reset, TP_PROTO(bool start),