From patchwork Sun May 23 21:14:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12275117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A9F5C47082 for ; Sun, 23 May 2021 21:14:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63ED661166 for ; Sun, 23 May 2021 21:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232026AbhEWVP5 (ORCPT ); Sun, 23 May 2021 17:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbhEWVPx (ORCPT ); Sun, 23 May 2021 17:15:53 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8D2DC061574; Sun, 23 May 2021 14:14:24 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id b17so29607953ede.0; Sun, 23 May 2021 14:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yfFmMK8z30MY8L2YVUkiaNovEksZpBQmtsz1iXNsSr8=; b=Z1Aj7aki7HrYhdiCfDVEMo0hUb2XHn/NWkeoJEuoFtM3cPT26bE++asZwN74K0rFGW pBMK41npyf3JvDMHiILmVdE0j+cRQo3ZDjEwhkyX2E+ReXMRIgbLiMoqj7wUbUpRD7td WcM0wk8AWkQodBVvJxjQl4kO+OUHNAjpYbSgf+cyYBIfEslA7F2spFf49BkZUscXReGy PNy6I4i0Sdi4hEHTwQ3YSJ3Ub/rCZ7TZuRKbbFuXq/Tx1wBbqoMjkYVwfpWYN2tQLEBK Aze1LySx1FfK4x6HgEU3JrdvYwqwS3+ynsditPbnbhcbTwYbQfTYjUlgQ2cKBPKw5GRY Bo9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yfFmMK8z30MY8L2YVUkiaNovEksZpBQmtsz1iXNsSr8=; b=DOicSc3tQ5dAkMpfs2CJg9ZixlJHCwqMCmyfZUGuZMA65ndU0xuEmgbrY2iKSw7yqy KUsZZTBxnp2lzlM4Xz89reUmBfwPQGqJ4QMH3GQz4rfXxO7e/8rRQJak3oay7HbRcQ7W /jJdgLWrD4QpSQiPYvGw/1WUAYCzp7WPt/RJH9of1Zs3/WFLVY9rZ+OAdzTwGMFKQTgv gtQVz+H0fAkxtYgbu0G+zklDFylPp1X1DJprTUVQ1M/r7/41c1KCtYi+wuiiqg5OjOg0 F1DYRJpZkJGoDtKZ0R0+of3Gwd7CPl2ZzxV6nzsY+XjuKMAh5Cl6qkPVeHsk9a5Kfe3h DZtw== X-Gm-Message-State: AOAM5339+ZA3aGV+lZZOFO1eRp0aHpqvp8xQc+wFA8xoCDvFWAh3uvei cnsk+vbnTUS6YjguRe0XYp8= X-Google-Smtp-Source: ABdhPJzUzzVffiCeZ2dr3HH6vLZH95w/lrZmsxGrikBttTkASk4Hi51GYrIouJ1NGv6aR04/CkHvKg== X-Received: by 2002:a05:6402:1548:: with SMTP id p8mr22127171edx.261.1621804463557; Sun, 23 May 2021 14:14:23 -0700 (PDT) Received: from localhost.localdomain (ip5f5bec5d.dynamic.kabel-deutschland.de. [95.91.236.93]) by smtp.gmail.com with ESMTPSA id t6sm2444ejd.123.2021.05.23.14.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 May 2021 14:14:23 -0700 (PDT) From: Bean Huo To: 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, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/3] scsi: ufs: Let UPIU completion trace print RSP UPIU Date: Sun, 23 May 2021 23:14:07 +0200 Message-Id: <20210523211409.210304-2-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210523211409.210304-1-huobean@gmail.com> References: <20210523211409.210304-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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:00 00 00 00 00 00 00 00 00 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:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index c382260e0cf7..dc5f13ccf176 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -300,13 +300,18 @@ static void ufshcd_scsi_block_requests(struct ufs_hba *hba) 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_req *rq_rsp; if (!trace_ufshcd_upiu_enabled()) return; - trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->sc.cdb, - UFS_TSF_CDB); + if (str_t == UFS_CMD_SEND) + rq_rsp = hba->lrb[tag].ucd_req_ptr; + else + rq_rsp = (struct utp_upiu_req *)hba->lrb[tag].ucd_rsp_ptr; + + trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq_rsp->header, + &rq_rsp->sc.cdb, UFS_TSF_CDB); } static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, From patchwork Sun May 23 21:14:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12275119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 698EEC47083 for ; Sun, 23 May 2021 21:14:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49A47611ED for ; Sun, 23 May 2021 21:14:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbhEWVP6 (ORCPT ); Sun, 23 May 2021 17:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232002AbhEWVP4 (ORCPT ); Sun, 23 May 2021 17:15:56 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC35DC061756; Sun, 23 May 2021 14:14:25 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id k14so35139483eji.2; Sun, 23 May 2021 14:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C/2CGtVUgkNHUKn8feRs8brY9+vXSWlUJgFt66SIrUY=; b=ShUfGkRA0BFzdEJyKzmFycpfCT2c/23QIVrNhbiTD0sNxCLy/W4yFI15ypJXOhsnhA S5l3y02L5IxSlqCChahKKkhcNHKszcmUzHvAr6xpqi68z+lT/BT1M//ZR9R5jHLu4lUy J7HrPOeYbi7U1YQsbHPK3C9ZrH9gVeOn/qm60kEHI1T5KPrlDs5laNNgV6TMqZVdF5Pp OMYCXkMT+tRfaX+AYX5sdnoUQiYB8W3QPOh/mQ7GB8Vr53YuVDC9P98oDgbB5HsM91wl 49/Wy9/MVJzCSx1LkSr7Cfb4gmYgaEE0Pyjq4tBmlj5h7A7ix8I1ncp2Uc2Y51nzz4qM YTEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C/2CGtVUgkNHUKn8feRs8brY9+vXSWlUJgFt66SIrUY=; b=MuvlUfOQdYvFbK6czgPdkNmy6t6bvy8O26qqp4uvm/gyx/D6WxDUJft+zz3TBhSdJR WrKaSvBZysVK8POVMuj7XNqLZOnZa4hUK6VKFecy0bOh7WxhUkWAe32vDj6HuMJCyzRI rvXWTWprF1Kupu7DZ4KPFV8K/HvVdzT1rtXD4+aCq3qORnXW0Ln5G3qhIufTiLMFOuk2 atOarUL18/R++Y1k3bxVGhHdcMHXtJwT/xV+DyDC67jcgWbp3C/5ne9+Lx8Vu3wMwhIy 6dhamxb/F1TTz2iSG6d/xUljjkKG+Wgs46PNo6nSnTlZn0yqeg13EHsiPEzqLLBYiBgv Fv9w== X-Gm-Message-State: AOAM531Xj8sR6lQ7Vf0uBv2Y9UW8xLC6Uxt7YRchZIA7yaRB3qgL8ydi D5Gg9T2BW0ctfIFsyZeJkuE= X-Google-Smtp-Source: ABdhPJwqv+o5JITd/AXk5aV9BiIW7ZPlabUlGzg1CDlYCqsWa7KKuZF43UobN4Fp4IJFY6G7S1uwlg== X-Received: by 2002:a17:907:768c:: with SMTP id jv12mr19368022ejc.215.1621804464327; Sun, 23 May 2021 14:14:24 -0700 (PDT) Received: from localhost.localdomain (ip5f5bec5d.dynamic.kabel-deutschland.de. [95.91.236.93]) by smtp.gmail.com with ESMTPSA id t6sm2444ejd.123.2021.05.23.14.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 May 2021 14:14:24 -0700 (PDT) From: Bean Huo To: 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, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/3] scsi: ufs: Let command trace only for the cmd != null case Date: Sun, 23 May 2021 23:14:08 +0200 Message-Id: <20210523211409.210304-3-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210523211409.210304-1-huobean@gmail.com> References: <20210523211409.210304-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 | 49 ++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index dc5f13ccf176..ed9059b3e63d 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -376,33 +376,31 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, struct scsi_cmnd *cmd = lrbp->cmd; int transfer_len = -1; - if (!trace_ufshcd_command_enabled()) { - /* trace UPIU W/O tracing command */ - if (cmd) - ufshcd_add_cmd_upiu_trace(hba, tag, str_t); + if (!cmd) return; - } - if (cmd) { /* data phase exists */ - /* trace UPIU also */ - ufshcd_add_cmd_upiu_trace(hba, tag, str_t); - 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; - transfer_len = be32_to_cpu( + /* trace UPIU W/O tracing command */ + ufshcd_add_cmd_upiu_trace(hba, tag, str_t); + + if (!trace_ufshcd_command_enabled()) + return; + + 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; + 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); - } + 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); } } @@ -9774,8 +9772,7 @@ static const struct dev_pm_ops ufs_rpmb_pm_ops = { }; /** - * Describes the ufs rpmb wlun. - * Used only to send uac. + * Describes the ufs rpmb wlun. Used only to send uac. */ static struct scsi_driver ufs_rpmb_wlun_template = { .gendrv = { From patchwork Sun May 23 21:14:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12275121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E80C47080 for ; Sun, 23 May 2021 21:14:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 470E161166 for ; Sun, 23 May 2021 21:14:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232045AbhEWVQA (ORCPT ); Sun, 23 May 2021 17:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbhEWVP4 (ORCPT ); Sun, 23 May 2021 17:15:56 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77A42C06138A; Sun, 23 May 2021 14:14:26 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id y7so12052940eda.2; Sun, 23 May 2021 14:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k3/TbwNFI9HmhMLl8iv6vlhOjkQhUhwgc45VnlZgXpQ=; b=W60V5nAxC/JJPeu1DW7gBrxEGdxhUWLNPrg2O2rkZl67RCJ+HvU0phYa7k5Sf8WOwW ilnq+zzKGrhTudnFETqltfNgqpXUcyrlbbjsqwhxbalkAr/EADGhzIo6Xe1os4/YoFzq xheCGLK5CWii2vcbJhX8nqOfpKQ6X+KjblXGJ6JoNAI9z5pK3cYo6qH8tA2Z3SfT8J19 7L95w0AU63Auzu5u2vS8XV1r/Sw7dYukc7LNgJLzrL5aQJ6XZ1NBaZa7Y8kO8ITpuIaQ IOwC6A4yopMIenaE0bbqM4LUdS5p7FqJoRvMqaHc53KC8tg+8B5oLjYEKElqQUHufUnQ LkEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k3/TbwNFI9HmhMLl8iv6vlhOjkQhUhwgc45VnlZgXpQ=; b=gUHN6LsOU5Lb16yJQl7gLNw6IRnJZ7j8Pbqbt6HPp361PWFfZGZN6OCqhLuIiEZmWl 2yybUbGV6zbhTKIRQ5vJi2P+x7cJD9VBX0Gq7XbYQtdtRGxPbcgkMlhDNvCe45svk31W fEg5HiEFF6IJUIlKLJyjdN2hFRaeLGSg3KDxiINhHaDygfHhB1b1qYBiS9jCJx/Fhy41 9T41474YejYxHBpz01PCVH9E3ZdATVH58a6kiOfdXEccGqfxjQSvWkjMZCsnBEzgMLWW ZWLzX2rKflSTIXFYqjfAqqw0HOSFUJTo/5TkVlu/oCaz68Sblba3Nvcc7FWhl7e/gAai VQHw== X-Gm-Message-State: AOAM533Vslh+mLUPlPGEB2sZafkoHnQRAwPDNU87OW3IMJsmhJCdocVt HshuoE4KvFL/NQ/Jatjoxys= X-Google-Smtp-Source: ABdhPJzA4DXJYm8b5VzpVVtlpASJZhCgZcVxGeOxmgM1eUCgnntKC/ExCbE6z0LbIqxWqSS+6eKpvg== X-Received: by 2002:a50:fd17:: with SMTP id i23mr22962801eds.54.1621804465083; Sun, 23 May 2021 14:14:25 -0700 (PDT) Received: from localhost.localdomain (ip5f5bec5d.dynamic.kabel-deutschland.de. [95.91.236.93]) by smtp.gmail.com with ESMTPSA id t6sm2444ejd.123.2021.05.23.14.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 May 2021 14:14:24 -0700 (PDT) From: Bean Huo To: 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, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 3/3] scsi: ufs: Use UPIU query trace in devman_upiu_cmd Date: Sun, 23 May 2021 23:14:09 +0200 Message-Id: <20210523211409.210304-4-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210523211409.210304-1-huobean@gmail.com> References: <20210523211409.210304-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bean Huo Since devman_upiu_cmd is not COMMAND UPIU, and doesn't have CDB, it is better to use UPIU query trace, which provides more helpful information for issue shooting. Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ed9059b3e63d..e8756a4fb972 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6697,6 +6697,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, hba->dev_cmd.complete = &wait; + ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr); /* Make sure descriptors are ready before ringing the doorbell */ wmb(); spin_lock_irqsave(hba->host->host_lock, flags); @@ -6729,6 +6730,9 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, } } + ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP, + (struct utp_upiu_req *)lrbp->ucd_rsp_ptr); + out: blk_put_request(req); out_unlock: