Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp316126pxj; Tue, 1 Jun 2021 23:17:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDAgGctCLGnjU/jNJSSr7Haepvd9kMNSCI3+rTOxeDyoYxE4vOlw8TNBw4QfEmD7FkdlTg X-Received: by 2002:a50:fc84:: with SMTP id f4mr17409103edq.252.1622614632957; Tue, 01 Jun 2021 23:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622614632; cv=none; d=google.com; s=arc-20160816; b=G77gEIt32nyzJhgVR8NSBtpZCBtXWWdyA8nTQwTmqolYmF5nTX7s8FQ/5Gg86IJefQ iwBBqoK4Iou0grZ3FY7BVtPMrBIw/q9XUugNiixxX9Zz9QWmvCTmqRrlrbZY/fvjRPAH n1pgF+WQAmdVLcFxALFza7zu/xcOv6P0EUYGnmBP3yCCsTWo9F7tEtVFOAvxhlqnIIcv ehUnHGoCS1raSTwQRElEd2L1c/otY5cyPnBmkNlz5oZIHTiGShZDwmZfJsjsrr33lIsM w0tJNfyit3c5XMZreeR+tZe/n6KlVgx3oOfDxNHEN3fYfZN5OIaVjk1LJVgpmuPZaTxv lcWA== 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=+uWNv/7Q+eLyPKvuqi7nUotZbu54u7L732mJwg+peRo=; b=YfBZxNgcjNybkyNbKKTW3tOeIZxFNO8Cz6s9faY5Bmm5pchW755f1FkJaKmtyRGFI7 ciBtqXi8FrHMamXuLGIRXDOlw+DPUuHMPPsbsLNSRGp3nYGV2YlgmPxPyhe3TY1Plo28 uTiAVtCXC1jAJcb2zq8q+U1Ulbc80MOhVXEwGIG6tObFRX/TK+iGhKvc5PFQkKUZLohp td1PnIaUlXEw/l8eE99CdZETCMihPYvunTp9ch6qPxxWmlSBSAAlJ4QhJFW7tnYZaG0I NVAmi02uaqAJbl3S7MfT4AEynUsduZeF/cYLOB4NjSD0rHcuRMJrHAtg2mQpd6XB7/jO g3Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=c7eoyVaq; 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 kj17si18063135ejc.587.2021.06.01.23.16.50; Tue, 01 Jun 2021 23:17:12 -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=c7eoyVaq; 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 S230514AbhFBChF (ORCPT + 99 others); Tue, 1 Jun 2021 22:37:05 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:22751 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbhFBCg7 (ORCPT ); Tue, 1 Jun 2021 22:36:59 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1622601317; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=+uWNv/7Q+eLyPKvuqi7nUotZbu54u7L732mJwg+peRo=; b=c7eoyVaqSpM1EojLF73tls0g+Z6n0lImeifVIH5RStk7rEskfF1NJxg/bcqhXBab28cLDqZw HKKq3AXKYuLdkK/uhROTHDD9+SeJJqTF6ubAuYSzF4rWcxJKKTATgnRCyhBo1xnQ6KYQrcRV 01zZJtGqucg1n1sTPM2tR67vmNU= X-Mailgun-Sending-Ip: 198.61.254.9 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-n05.prod.us-west-2.postgun.com with SMTP id 60b6ee60ed59bf69ccd04ae6 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Jun 2021 02:35:12 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 3F096C4360C; Wed, 2 Jun 2021 02:35:12 +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 66C22C433F1; Wed, 2 Jun 2021 02:35:06 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 02 Jun 2021 10:35:06 +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 1/4] scsi: ufs: Cleanup ufshcd_add_command_trace() In-Reply-To: <20210531104308.391842-2-huobean@gmail.com> References: <20210531104308.391842-1-huobean@gmail.com> <20210531104308.391842-2-huobean@gmail.com> Message-ID: <810c58442d4bdfb5e58009d87766dd7a@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 > > To consistent with trace event print, convert the value of the > variable 'lba' in the unit of LBA (logical block address). > > Suggested-by: Bart Van Assche > Signed-off-by: Bean Huo > --- > drivers/scsi/ufs/ufshcd.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index 02267b090729..85590d3a719e 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -25,6 +25,7 @@ > #include "ufs_bsg.h" > #include "ufshcd-crypto.h" > #include > +#include "../sd.h" > > #define CREATE_TRACE_POINTS > #include > @@ -364,7 +365,7 @@ static void ufshcd_add_uic_command_trace(struct > ufs_hba *hba, > static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int > tag, > enum ufs_trace_str_t str_t) > { > - sector_t lba = -1; > + u64 lba = -1; > u8 opcode = 0, group_id = 0; > u32 intr, doorbell; > struct ufshcd_lrb *lrbp = &hba->lrb[tag]; > @@ -382,22 +383,23 @@ static void ufshcd_add_command_trace(struct > ufs_hba *hba, unsigned int tag, > /* 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 > */ > - if (cmd->request && cmd->request->bio) > - lba = cmd->request->bio->bi_iter.bi_sector; > 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) { > - if (cmd->request) { > - lba = scsi_get_lba(cmd); > - transfer_len = blk_rq_bytes(cmd->request); > - } > + /* > + * The number of Bytes to be unmapped beginning with the > + * lba. > + */ > + transfer_len = blk_rq_bytes(cmd->request); > } > } Reviewed-by: Can Guo