Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp315708pxj; Tue, 1 Jun 2021 23:16:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAftHjMGXRrRWcocBW2hWpcHdz/4FTohWMT6b5/yjsb9iWUHKn5c6SLBOamGcjq1tNEBAP X-Received: by 2002:a17:907:9874:: with SMTP id ko20mr2968502ejc.73.1622614587015; Tue, 01 Jun 2021 23:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622614587; cv=none; d=google.com; s=arc-20160816; b=fPucUmXCb6mgEi734KdelWBayBLBD0vdaBuYgSySLrtHVMQu42BpvRUFV5/YkZs2Ei VWUMFJWdwj8iwC9z5EySmwAjzZoYT9cKeS1lVcOiu1cITlnTIjlf1Lb8eJ438KysTxA7 kBgnEyMgPbeWQrrAZaYiBJLRZzTEw1ydZ6FrhLHcagWOWBahD/x/uBhtFxY/Wz7/CDHj rkkfcDL99DEN7EM3FUcfSCRH3Cq1XnwdGstEKAs7yOC/OZ6oALf83vmdM/sxKL2ae7Wb JAFXTjnPQRT+LcHJI793AxiyW3K09b2FLhEg3c6c76uchJGLYNSPf3aysPDAGmMy9YFT 76Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=7Xn3A6fVS46RBZmcAtbEyiPLKhOi7x8dz+VLSnh3H3w=; b=ED6CRGSHTQEMIX3/acGVqgqM11NEdBjUgHuYXruonzuhqQ8Zd6cAvy6tySecfE+WRP E8/gFcAeHk0MHQvkkJpBYHt4nXCixenjeGIttqLuzTETt1+DluxlCX8OlgxbQLbzstHY dys+IpEny+W7AYwazbU+4vrXBDiP46qRUGucb30i0sUN7/rrEBoRmtg3eq3wTDKsrf3E RBm23VL3MEcncwTGM26Y2RXl3GpEfillzbKQDsbVAWn8JEt/eRzB3ICHjSsnnKF6hHA8 QgZJ0IUzNUyvGB1tgiPpeJmSQhpVgEL2bjIWjTCdxJVGRNf1qpsoLiR/908zOikkHQLK 4JTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=Bn0FHRj4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b3si1280993edh.532.2021.06.01.23.16.00; Tue, 01 Jun 2021 23:16:27 -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=@mg.codeaurora.org header.s=smtp header.b=Bn0FHRj4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbhFBCfy (ORCPT + 99 others); Tue, 1 Jun 2021 22:35:54 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:43610 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbhFBCfx (ORCPT ); Tue, 1 Jun 2021 22:35:53 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1622601251; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=7Xn3A6fVS46RBZmcAtbEyiPLKhOi7x8dz+VLSnh3H3w=; b=Bn0FHRj4uhegFwYfmKZ6B8D3s69d9oD+fS+NF22/R7uqVRgTUlHf8EBWkBPaw7IHz0OUjkyt J5HEHN/ydsf5+8GHxSP++q30jHVX0VH5MK5qrVcG534PDLEv+6OdJVeGluUdoQufC3XZkJvR ZOH8twwaQHSDSUSTQcvdgwiPkcI= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 60b6ee1e2eaeb98b5e609d1e (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Jun 2021 02:34:06 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D9597C4360C; Wed, 2 Jun 2021 02:34:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2808BC433F1; Wed, 2 Jun 2021 02:34:05 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 02 Jun 2021 10:34:05 +0800 From: Can Guo To: Bean Huo Cc: 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, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/4] scsi: ufs: Let UPIU completion trace print RSP UPIU header In-Reply-To: <20210531104308.391842-3-huobean@gmail.com> References: <20210531104308.391842-1-huobean@gmail.com> <20210531104308.391842-3-huobean@gmail.com> Message-ID: <361f7611bc5193694487831bfd912ad1@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-05-31 18:43, Bean Huo wrote: > 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); > } Reviewed-by: Can Guo