Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5949116iog; Thu, 23 Jun 2022 08:22:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tDK9b6N/GcWqgef/Gvhtn9I7jVP1dCIa+7uls9fpMfhn2QrZpbPG+1C9HB7yTPWCrFycrI X-Received: by 2002:a17:907:3e20:b0:726:2c09:3fa4 with SMTP id hp32-20020a1709073e2000b007262c093fa4mr424942ejc.101.1655997721738; Thu, 23 Jun 2022 08:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655997721; cv=none; d=google.com; s=arc-20160816; b=IklBG+2CMu9gcOQWQLjfzWOA01D8GuRdQ9b8d/ntAFaMQuvZlP9GrCitx/fXDb9mz6 qkSoGm0kAQN1Y/LIoEF5P3QP28t8/Co/ykG5WEp0Hd+syCzxrFy7YuVwE+Jk2ubmp6p7 YGrId1rytsyjuhFILY8viJCFmdTsqlOf1soFT/hUaOVn/NE73JpieYB0bSkOBMZTifV8 HxKUOC7avkFPfUPFtyI7o/C5PNn5zTORAGGweP+IbgpUk9TZb3tiBasfTip62YqgYafk XppLgSL9CgnDYRGSM9R0altJ47Ftp4f89Aq4TpgzyPQIaHCNIWwQw/05Bv0MFWYAmlx0 iv5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=oU8TQHypXeIKcCVVdKL6N9GyZFyXu0m/uIz/qMK9fFI=; b=ZrU3ntxSnYL8qb+2uJmRi4IyuYvgyS86HKdJ5W6eMEN27HlUwpSRqYDbgnNZKMIgS9 8NGhVYQMzIZWhJLDKsH9+O1Xa3PCdsiT70T1ZBjS/HSn2cKHei1YFHhu7WI7cvXi86lx OTVldZFaeO6RZuB6xRRx/adEQCiWyHbz/36bx4Z7Yw7cyec8PHkgVsAE5bAv4Z8GMkRT h+24NlUqtoNIBWBMCgef7uiovG0gbD2RzNiSPJK/TPZvINJapgefWQQ6Q0rdsPM12sL9 zUo07E0bz+N8QEousX/xYInl0byMpvOMaB47I92okcMjFrNuzRB4pfeyLfKuzuKrSikW eCFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d23-20020a50fe97000000b0042bc9f106dcsi5739982edt.192.2022.06.23.08.21.36; Thu, 23 Jun 2022 08:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbiFWOzy (ORCPT + 99 others); Thu, 23 Jun 2022 10:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbiFWOzt (ORCPT ); Thu, 23 Jun 2022 10:55:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 672BEB3B for ; Thu, 23 Jun 2022 07:55:48 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4C5161474; Thu, 23 Jun 2022 07:55:48 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 01ABE3F66F; Thu, 23 Jun 2022 07:55:46 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, lukasz.luba@arm.com, james.quinlan@broadcom.com, Cristian Marussi Subject: [PATCH 2/2] firmware: arm_scmi: Use new SCMI full message tracing Date: Thu, 23 Jun 2022 15:55:33 +0100 Message-Id: <20220623145533.2882688-3-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220623145533.2882688-1-cristian.marussi@arm.com> References: <20220623145533.2882688-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add full message tracing for all transmitted and successfully received SCMI commands, replies and notifications. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/driver.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 8b7ac6663d57..276d3a4fd6b8 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -660,6 +660,11 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, smp_store_mb(xfer->priv, priv); info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size, xfer); + + trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "NOTI", + xfer->hdr.seq, xfer->hdr.status, + xfer->rx.buf, xfer->rx.len); + scmi_notify(cinfo->handle, xfer->hdr.protocol_id, xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts); @@ -694,6 +699,12 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo, smp_store_mb(xfer->priv, priv); info->desc->ops->fetch_response(cinfo, xfer); + trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, + xfer->hdr.type == MSG_TYPE_DELAYED_RESP ? + "DLYD" : "RESP", + xfer->hdr.seq, xfer->hdr.status, + xfer->rx.buf, xfer->rx.len); + trace_scmi_rx_done(xfer->transfer_id, xfer->hdr.id, xfer->hdr.protocol_id, xfer->hdr.seq, xfer->hdr.type); @@ -827,6 +838,12 @@ static int scmi_wait_for_message_response(struct scmi_chan_info *cinfo, xfer->state = SCMI_XFER_RESP_OK; } spin_unlock_irqrestore(&xfer->lock, flags); + + /* Trace polled replies. */ + trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, + "RESP", + xfer->hdr.seq, xfer->hdr.status, + xfer->rx.buf, xfer->rx.len); } } else { /* And we wait for the response. */ @@ -903,6 +920,10 @@ static int do_xfer(const struct scmi_protocol_handle *ph, return ret; } + trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "CMND", + xfer->hdr.seq, xfer->hdr.status, + xfer->tx.buf, xfer->tx.len); + ret = scmi_wait_for_message_response(cinfo, xfer); if (!ret && xfer->hdr.status) ret = scmi_to_linux_errno(xfer->hdr.status); -- 2.32.0