Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3004768pxj; Sun, 23 May 2021 18:33:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnAGsoou3/ylnyBsmmKwghvccHnfVmzXQ/ei6qviJoylQ0Tpzn8t5IRrsv+fXH1I/dN3AU X-Received: by 2002:a92:cecb:: with SMTP id z11mr11629562ilq.186.1621819984115; Sun, 23 May 2021 18:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621819984; cv=none; d=google.com; s=arc-20160816; b=Rz4ya7APWxbvqCPXoyisGiDDHilhucHv/79+cOKNOx04O1YBBjNs56YzkJXKb4iEnD L6zVugIo7tYqS/UHJvgYusASgSAE8pqVef8Juci3e+GElpV4e8EjECBwtY/VPnGqJ2yF eBBFEy0EfPhsvl/gg4dxzrOrc1EIDCCXazLemNF1S0XfHQpXoXwLrVyJ0bI4uoLu/+LO /pCNHZf9OSucrPzm78ph/M2QqkJYrkyNrGZvH0WaglPptwK/R+SZsPM91bXUI/JkFWHH KnisOQamNZNnMaSJ8PFDhDILJZ7gON8S3BeaWoZorJTLG8NjDGEDgH7CIciEizrJFG2c oOIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=/iD3hUpPGd4ZOnzXl6gABzu1r0gr7/yG9XxFyjXRrGE=; b=YaQv7eVgZR8AngHS8fYR3POjU8sOAyzjkdrZQ2+pAg+fCNJTTqlAg8uyueKNgZrF0M 0r3EvLGbT6H/Ozat8fl+3g+b8044FSGanwA6oQgfid9VBiwg/Erv6i6AR3mk3FUZyjaB ApEQdM1NsROj70uBQFZf6kVUxq62WtEANdb3IlCoFgIvEIW8+ON1AmvLPSlorVhxq3Cj FKdyXJYykDDu/PMVedv+gj8sF+5i1Y8TYAKixEhlKAHpq6iRcptRBCAQTwP4l3vUScxB XaWXDGnPa4iQIUkDqOMZgOqClma5DozDoi+MYAy8D817QaswJd1wvWyNp8sCmtK6QlU5 X/MQ== ARC-Authentication-Results: i=1; mx.google.com; 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 m30si13670931jav.6.2021.05.23.18.32.49; Sun, 23 May 2021 18:33:04 -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; 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 S232124AbhEXBdk (ORCPT + 99 others); Sun, 23 May 2021 21:33:40 -0400 Received: from mail-pl1-f178.google.com ([209.85.214.178]:40599 "EHLO mail-pl1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232067AbhEXBdj (ORCPT ); Sun, 23 May 2021 21:33:39 -0400 Received: by mail-pl1-f178.google.com with SMTP id n8so8585730plf.7; Sun, 23 May 2021 18:32:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/iD3hUpPGd4ZOnzXl6gABzu1r0gr7/yG9XxFyjXRrGE=; b=A5oHjlCGtcdQoeBlrD7L9ZjrWrIfQtOvmI0/G2q6TczZNTBKG3Tc7aQac174lyILTn Ua/KyotJUFTjJ7ux/HO1apUzBq8LLT0MTsmBYLFuzisXjKraKaQtGplYuY3Q5IaJPuGp qK74xcJakaOewXaTKwObumzT5H6vMXKRWayhNhyxRjK79STujPDwD3exvlF2X62KNewV NrarE63c/l549ILzBYNpYXohRv+c+dsJnxJkvd19pvsLsltrmZ7BWoZJJyUBgUh4WzHK eNYD35T1bdhLBHjFVfgQvGejwSh+GA0lYvq52OVaL0jio0MaFFQd0FGWrTWSUKP0meuL ub6g== X-Gm-Message-State: AOAM530iMpRbygkeVZHYmpFDLdD7AVbYYEsvsty+jIUp7uFLabcQlldd HaoCF57H9LmCZzDbabjGLVVBIBrIFE8= X-Received: by 2002:a17:90a:e09:: with SMTP id v9mr21766970pje.202.1621819931489; Sun, 23 May 2021 18:32:11 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id 24sm9701733pgz.77.2021.05.23.18.32.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 May 2021 18:32:10 -0700 (PDT) Subject: Re: [PATCH v1 2/3] scsi: ufs: Let command trace only for the cmd != null case To: Bean Huo , 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, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210523211409.210304-1-huobean@gmail.com> <20210523211409.210304-3-huobean@gmail.com> From: Bart Van Assche Message-ID: <1d06cc01-a642-e8e0-a251-1b392e4935c7@acm.org> Date: Sun, 23 May 2021 18:32:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210523211409.210304-3-huobean@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/23/21 2:14 PM, Bean Huo wrote: > + opcode = cmd->cmnd[0]; > + 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; Why does the lba assignment occur inside the if-statement for the READ_10 and WRITE_10 cases? Has it been considered to move that assignment before this if-statement? Does 'lba' represent an offset in units of 512 bytes (sector_t) or an LBA (logical block address)? In the former case, please rename the variable 'lba' into 'sector' or 'start_sector'. In the latter case, please use sectors_to_logical(). Why are READ_16 and WRITE_16 ignored? Please remove the 'if (cmd->request)' checks since these are not necessary. > + } else if (opcode == UNMAP) { > + if (cmd->request) { > + lba = scsi_get_lba(cmd); > + transfer_len = blk_rq_bytes(cmd->request); > } > } The name of the variable 'transfer_len' is wrong since blk_rq_bytes() returns the number of bytes affected on the storage medium instead of the number of bytes transferred from the host to the storage controller. > /** > - * Describes the ufs rpmb wlun. > - * Used only to send uac. > + * Describes the ufs rpmb wlun. Used only to send uac. > */ Is this change related to the rest of this patch? Thanks, Bart.