From patchwork Wed Feb 15 19:04:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 653900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 722E8C636D4 for ; Wed, 15 Feb 2023 19:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbjBOTE5 (ORCPT ); Wed, 15 Feb 2023 14:04:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbjBOTEy (ORCPT ); Wed, 15 Feb 2023 14:04:54 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F6E39BB5; Wed, 15 Feb 2023 11:04:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 298B0B8236D; Wed, 15 Feb 2023 19:04:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5A5EC433EF; Wed, 15 Feb 2023 19:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676487890; bh=FaRNhtG1pjZ8L7eZVmPD5vLGCZlfxjcuMkgF3wWZ6e4=; h=From:To:Cc:Subject:Date:From; b=pXCYJZ+b4a3P4bmJdT1ZZzw0DLBFCMTsfnN0V1uJMhdBT8zBZ/eMJfihC6nXXgNqa RrhVaRueDseaJcz7khXZYClYpq30BXgNXAuuJ9VMIOyQCoXTe0ao2d00PxMAzenUv1 yLhSufoiL59X2Peh7kMzyf5Mf3rPgR79FlJU7Tnci/vCetZaRNYDRX+xnO2JMWzJoY zpoOncr7PYnS3bHA6yUe45K3UoN2CjW3kMgc1oAEeQQ8ZfjPJwxaH1E67RrTh9t+nV cNdWHAyyKHInOdXvnWVQCebmcOS7sbZJga6fUywLfQ9V+SdEX5wM6eGhNi99TyA/Xc NSt/HfeQRAraw== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, "Martin K . Petersen" , Bart Van Assche , Adrian Hunter , Avri Altman , Bean Huo , Stanley Chu , Can Guo Cc: Jaegeuk Kim , Jaegeuk Kim Subject: [PATCH] scsi: ufs: support IO traces for zoned block device Date: Wed, 15 Feb 2023 11:04:48 -0800 Message-Id: <20230215190448.1687786-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.39.1.581.gbfd45094c4-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Jaegeuk Kim Let's support WRITE_16, READ_16, ZBC_IN, ZBC_OUT. Signed-off-by: Jaegeuk Kim Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 8 ++++---- include/trace/events/ufs.h | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index e18c9f4463ec..235d2e2d828a 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -402,15 +402,15 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, opcode = cmd->cmnd[0]; - if (opcode == READ_10 || opcode == WRITE_10) { - /* - * Currently we only fully trace read(10) and write(10) commands - */ + if (opcode == READ_10 || opcode == WRITE_10 || + opcode == READ_16 || opcode == WRITE_16) { transfer_len = be32_to_cpu(lrbp->ucd_req_ptr->sc.exp_data_transfer_len); lba = scsi_get_lba(cmd); if (opcode == WRITE_10) group_id = lrbp->cmd->cmnd[6]; + if (opcode == WRITE_16) + group_id = lrbp->cmd->cmnd[14]; } else if (opcode == UNMAP) { /* * The number of Bytes to be unmapped beginning with the lba. diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h index 599739ee7b20..f82a9e15fd78 100644 --- a/include/trace/events/ufs.h +++ b/include/trace/events/ufs.h @@ -18,7 +18,9 @@ { READ_16, "READ_16" }, \ { READ_10, "READ_10" }, \ { SYNCHRONIZE_CACHE, "SYNC" }, \ - { UNMAP, "UNMAP" }) + { UNMAP, "UNMAP" }, \ + { ZBC_IN, "ZBC_IN" }, \ + { ZBC_OUT, "ZBC_OUT" }) #define UFS_LINK_STATES \ EM(UIC_LINK_OFF_STATE, "UIC_LINK_OFF_STATE") \