Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp210953pxj; Tue, 1 Jun 2021 19:37:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrwDBeIma9xtxL5F/a22WTaC9WD90GvIdMsqQwvYOymTCRkqfGO92CzasW74qvJJ9me6ds X-Received: by 2002:a50:9e2e:: with SMTP id z43mr35349387ede.70.1622601449247; Tue, 01 Jun 2021 19:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622601449; cv=none; d=google.com; s=arc-20160816; b=SJpBMN6xueGgQBKdjSHz5N+0xbay8Pthc2YH0qH72mz6aOFlYh5eou06AUF2yflFc8 LyVjjm7kdgBl9qkpAR1F3e6OZFHSWEwhWQsAbHpAaX/ShB5cAkz1Dnzrn615tmC4XU/0 WTGFc8/ryd07GXC96TbTubF2hH+WTgw+Q3qb1NgE9IrNvC8d2gM8U8BhDkoeq/VJhxhd /4FYNbS5uxZeCqqqIqYcWP+dvjUh2G+ePvzOh8noGOnzNG7Jf24RfIwv99in57kYroat iZesGZnj03z+RbdId7wjf0RLEivuMM/THEyuPkPnnAcAkYwMCI2dfUIAT5jVwGZRFwu3 e1RA== 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=N2aWNaK6HbPpRc2PN5lxaYs+zFYsZrJUqGdXKGBg3Nw=; b=hZolM3wEMD1uCFljLo9Za8mclzn5nIh/pXSppJT9T80jXcbrlTop8SfQnXT7y6bmej gDu9HiDUmM6V2BqLErtf9iDYMrwZGGxrpN6eiD+xDsPh3z60BQxhJ12ppS7qz5tAvY6e 1TUYMwwhMD6iwc2AGr8yIir2W4UpG3zf6EJA4oPZgXLQghlrpGMKp3VQWSAQ8CM17GQV S8kkIfODtKBlT65ogYlMMKzgd11/GXHpjzoYXQ7BY6ZYB8xkVLvn7H0QmsqONMYKgZy2 nCMC9UWzk6uBonoIXHULwdvcLnBgHXnfmBJ/xMcbOBiOFtD/Vtvtr+dQ0782ac0zrhXK eyKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=IHo3m9FP; 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 s14si2148300ejm.98.2021.06.01.19.37.05; Tue, 01 Jun 2021 19:37:29 -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=IHo3m9FP; 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 S230021AbhFBCeY (ORCPT + 99 others); Tue, 1 Jun 2021 22:34:24 -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 S229970AbhFBCeW (ORCPT ); Tue, 1 Jun 2021 22:34:22 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1622601160; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=N2aWNaK6HbPpRc2PN5lxaYs+zFYsZrJUqGdXKGBg3Nw=; b=IHo3m9FP6jdI53s/7HokI9Cibpcd35yFcE3IcgBki5jJzXlZXXEACHo5DkLPWi1SUoVZjSwC /OXqhCEgQJ/fMsM5tQmnzzs9fd65Gf6W3oY+lznq/Zq1PYCf6fLPV3Zlv1Kq5GJlOLiVxl00 MnK33fSHDsKqvzc+U8xYhyKhcwA= 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-n06.prod.us-east-1.postgun.com with SMTP id 60b6edbcabfd22a3dcf05628 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Jun 2021 02:32:28 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 60100C43144; Wed, 2 Jun 2021 02:32:27 +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 4F10AC43460; Wed, 2 Jun 2021 02:32:26 +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:32:26 +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 3/4] scsi: ufs: Let command trace only for the cmd != null case In-Reply-To: <20210531104308.391842-4-huobean@gmail.com> References: <20210531104308.391842-1-huobean@gmail.com> <20210531104308.391842-4-huobean@gmail.com> Message-ID: <309e9bacdc0a6ab78913036f4c95f142@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 > > For the query request, we already have query_trace, but in > ufshcd_send_command (), there will add two more redundant > traces. Since lrbp->cmd is null in the query request, the > below these two trace events provide nothing except the tag > and DB. Instead of letting them take up the limited trace > ring buffer, it’s better not to print these traces in case > of cmd == null. > > ufshcd_command: send_req: ff3b0000.ufs: tag: 28, DB: 0x0, size: -1, > IS: 0, LBA: 18446744073709551615, opcode: 0x0 (0x0), group_id: 0x0 > ufshcd_command: dev_complete: ff3b0000.ufs: tag: 28, DB: 0x0, size: > -1, IS: 0, LBA: 18446744073709551615, opcode: 0x0 (0x0), group_id: 0x0 > > Signed-off-by: Bean Huo > --- > drivers/scsi/ufs/ufshcd.c | 44 +++++++++++++++++++-------------------- > 1 file changed, 21 insertions(+), 23 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index c5754d5486c9..c84bd8e045f6 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -378,35 +378,33 @@ static void ufshcd_add_command_trace(struct > ufs_hba *hba, unsigned int tag, > struct scsi_cmnd *cmd = lrbp->cmd; > int transfer_len = -1; > > + if (!cmd) > + return; > + > if (!trace_ufshcd_command_enabled()) { > /* trace UPIU W/O tracing command */ > - if (cmd) > - ufshcd_add_cmd_upiu_trace(hba, tag, str_t); > + ufshcd_add_cmd_upiu_trace(hba, tag, str_t); > return; > } > > - if (cmd) { /* data phase exists */ > - /* trace UPIU also */ > - ufshcd_add_cmd_upiu_trace(hba, tag, str_t); > - opcode = cmd->cmnd[0]; > - lba = sectors_to_logical(cmd->device, blk_rq_pos(cmd->request)); > + /* trace UPIU also */ > + ufshcd_add_cmd_upiu_trace(hba, tag, str_t); > + opcode = cmd->cmnd[0]; > + lba = sectors_to_logical(cmd->device, blk_rq_pos(cmd->request)); > > - if ((opcode == READ_10) || (opcode == WRITE_10)) { > - /* > - * Currently we only fully trace read(10) and write(10) > - * commands > - */ > - transfer_len = be32_to_cpu( > - lrbp->ucd_req_ptr->sc.exp_data_transfer_len); > - if (opcode == WRITE_10) > - group_id = lrbp->cmd->cmnd[6]; > - } else if (opcode == UNMAP) { > - /* > - * The number of Bytes to be unmapped beginning with the > - * lba. > - */ > - transfer_len = blk_rq_bytes(cmd->request); > - } > + if (opcode == READ_10 || opcode == WRITE_10) { > + /* > + * Currently we only fully trace read(10) and write(10) commands > + */ > + transfer_len = > + be32_to_cpu(lrbp->ucd_req_ptr->sc.exp_data_transfer_len); > + if (opcode == WRITE_10) > + group_id = lrbp->cmd->cmnd[6]; > + } else if (opcode == UNMAP) { > + /* > + * The number of Bytes to be unmapped beginning with the lba. > + */ > + transfer_len = blk_rq_bytes(cmd->request); > } > > intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS); Reviewed-by: Can Guo