Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2495369pxj; Mon, 31 May 2021 03:45:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIiLns71bam2T0IF9rPCOm3sFE3QrL6H2zyABbjA/fxkAtcX0R0+Asu4+Fx9K22sxWXHUG X-Received: by 2002:a05:6402:3494:: with SMTP id v20mr24644035edc.169.1622457923470; Mon, 31 May 2021 03:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622457923; cv=none; d=google.com; s=arc-20160816; b=F6EicQekEcYec4Ls32/zYom+G/YuwYaCYCyaTTJiV11IqAi9RP1BkTGOAzYKVrTqQL N03E8yH5yO/TRy1s3OykhciguIUsv4xs0rxGDWXatTplpwK4sWl2b3xvuNPumRP3JpWg NXANoVDVhHqBw2bUAWgcUgzcDrm92gTmXUPc589J6XkBoliRGbNFqH+KsAb3CzabDt5t r5FfuWM3o2gAl9RLR/VSVVoMXmMjfo5NuHsswVAWk2MX+kG8pVn0WUU7d8K2RS0ECS+8 ij1mmpxm3SHQfmWkQp3wLvMIm8w9hVsTml3MqGFcTgORchEPyjPqBay+WW68RDO+RWHT 1c/Q== 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 :dkim-signature; bh=tA6A2ohh4L8vBzT6/8t9tpUkgl45rDZLB/Lv05qFeiw=; b=yOcujIN7AV1msWLVtv/5W5l3JT8OfR8k6QweA2Raj5KoRSczoDhuLmtBlz2szVvnyQ Lf0WjJw7U7EBuh5LSuBfOgFFzifiKdk/Zm3PsCkFtB25nkJQ99TZ2Nd88seB+afYu6J7 2rH6Stt/gT1WuTCWnEqRKV6ViTHxdJqrV9yQw5zmWcG61QjVYJHIICOOf6uP2x8lMSXd nWZXDSzKLR8RgpXMAeQugoX3f7GcJT8Fc5FMFwniu6JicYXHdgTqloakxv8/zJv18A1h lyfLWfoV14Eh6uLUiQ5DZ+dt7QYgEH7WFcVReCmMdXxS4fhMSw8zIueyCsUnG8VmiA2A vwQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="kAfcQ/GG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id b11si12432961ejd.10.2021.05.31.03.45.01; Mon, 31 May 2021 03:45:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="kAfcQ/GG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231515AbhEaKp2 (ORCPT + 99 others); Mon, 31 May 2021 06:45:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbhEaKpE (ORCPT ); Mon, 31 May 2021 06:45:04 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6718C06174A; Mon, 31 May 2021 03:43:23 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id k7so6458216ejv.12; Mon, 31 May 2021 03:43:23 -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 :mime-version:content-transfer-encoding; bh=tA6A2ohh4L8vBzT6/8t9tpUkgl45rDZLB/Lv05qFeiw=; b=kAfcQ/GGr5m+hwwczKIC6ejflav1uQUMGfO5AOqqv9OpJM9l5w44bw5NWNgDMp9zXL fDx7ar2wpcjlHbvEHxScCT6FJf6pFTGpMsx/RpIW3RDkRw91OMj2ItNl5Sp+FlBo2Z1f /KyndLMF+FFEfYgMwzpVKXvy94HsLbTCrLs297J7bsm7Cd9IWLh0hx5VV2NwqmuabVkK /qqzLCfr2vao3YvT30mWPRoWJvSTjq5h+rIyu2Af6uStJMoXOVgUy0jX6avYY4rhx+D+ 93vWMjM7sZCHu7ktRLUdx55RaxeSL0PIy5FiLi9sjOGHjhb87zII4QLRDB8eVu+ldKmr FIbQ== 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=tA6A2ohh4L8vBzT6/8t9tpUkgl45rDZLB/Lv05qFeiw=; b=drjt6IkTyMZNJqYdH4bm66ysMdckOrSwTxkeY5jzwBRuzgxfQZl4c8LgVT3dE2gD10 UiNnFHuW+7XLctHCFRsqvL9OW72d8n0JHUt2II78koBA32S+8Et2jO3znIr12kWod62t WmxLLb6f47gbQpl2QRrqrGEUnbtYQa25+1pM3i04+H2Ph0jankTzVYPIH7bCE/ROBVUm lQ//CT3+MZrcytjbaaaPOAUSDo2OH22Hfumdt2YXhlq/4FQ0Nh6iKfTcwO53X8L+5AhM JGZ3hazU0I9VFDMP9lgkhzgUPbORMSMgF0dHMS5/1xHscW+hDktO6NNWbwuusIu9GUa6 0Z0A== X-Gm-Message-State: AOAM530WMYw88fBPtQFUxR5jVuXKtGHc4hgSUB8RMvscsisZzsTr/exy GtABr0rjJj3PUvUwHdZqgiM= X-Received: by 2002:a17:906:f6d7:: with SMTP id jo23mr3164770ejb.302.1622457802464; Mon, 31 May 2021 03:43:22 -0700 (PDT) Received: from localhost.localdomain (ip5f5bec5d.dynamic.kabel-deutschland.de. [95.91.236.93]) by smtp.gmail.com with ESMTPSA id dk9sm5741035ejb.91.2021.05.31.03.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 03:43:22 -0700 (PDT) From: Bean Huo To: alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] scsi: ufs: Let UPIU completion trace print RSP UPIU header Date: Mon, 31 May 2021 12:43:06 +0200 Message-Id: <20210531104308.391842-3-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210531104308.391842-1-huobean@gmail.com> References: <20210531104308.391842-1-huobean@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo The current UPIU completion event trace still prints the COMMAND UPIU header, rather than the RSP UPIU header. This makes UPIU command trace useless in problem shooting in case we receive a trace log from the customer/field. There are two important fields in RSP UPIU: 1. The response field, which indicates the UFS defined overall success or failure of the series of Command, Data and RESPONSE UPIU’s that make up the execution of a task. 2. The Status field, which contains the command set specific status for a specific command issued by the initiator device. Before this patch, the UPIU paired trace events: ufshcd_upiu: send_req: fe3b0000.ufs: HDR:01 20 00 1c 00 00 00 00 00 00 00 00, CDB:3b e1 00 00 00 00 00 00 30 00 00 00 00 00 00 00 ufshcd_upiu: complete_rsp: fe3b0000.ufs: HDR:01 20 00 1c 00 00 00 00 00 00 00 00, CDB:3b e1 00 00 00 00 00 00 30 00 00 00 00 00 00 00 After the patch: ufshcd_upiu: send_req: fe3b0000.ufs: HDR:01 20 00 1c 00 00 00 00 00 00 00 00, CDB:3b e1 00 00 00 00 00 00 30 00 00 00 00 00 00 00 ufshcd_upiu: complete_rsp: fe3b0000.ufs: HDR:21 00 00 1c 00 00 00 00 00 00 00 00, CDB:3b e1 00 00 00 00 00 00 30 00 00 00 00 00 00 00 Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 85590d3a719e..c5754d5486c9 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -302,11 +302,17 @@ static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int tag, enum ufs_trace_str_t str_t) { struct utp_upiu_req *rq = hba->lrb[tag].ucd_req_ptr; + struct utp_upiu_header *header; if (!trace_ufshcd_upiu_enabled()) return; - trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->sc.cdb, + if (str_t == UFS_CMD_SEND) + header = &rq->header; + else + header = &hba->lrb[tag].ucd_rsp_ptr->header; + + trace_ufshcd_upiu(dev_name(hba->dev), str_t, header, &rq->sc.cdb, UFS_TSF_CDB); } -- 2.25.1