Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2500455imm; Sun, 5 Aug 2018 05:48:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezOcgIXxXtDExbwOiWCotzxIpVFYhFR2/gLJscTwYMLZMdhfSfN7zGQ4pqghgONm9v9A/m X-Received: by 2002:a63:a619:: with SMTP id t25-v6mr10728787pge.288.1533473283986; Sun, 05 Aug 2018 05:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533473283; cv=none; d=google.com; s=arc-20160816; b=CSMubiEcqtproImni99E8BiMGHli8PqjT5w3VIR+DC7sIMQexT2nJECk59jpKxQqDQ 3ugV2CVvwF6wLYrUye1BFji+mj9WzR7KIbqWAQN4CVaWZZpfe8xH2UT9PINDhbzZWrtV /lRgCsLVr1aZgWkxH7HNNRPdmCGsuYwyjA8Dpy34Rk2HvoBRNDlHN2ANNIKmWYdCL+XK Lf3dsNK9yIJ+u196BIq0UcCZ+Pfw25GhyQxJsJDtv4+RjwTrWIf+PbWB7B+Z++NYohSn 2ujbb4Zj2Er/59D7oBKOR8TVTpZilQ6UdK2EaHz9+caS4aCvricFeYl8ik6HKd/IaMBX 6uPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ijzKiK0h9B5eOi0PZ9FMBJh6MCo8jZn3r3W0E78xVzc=; b=UN+L9Z0IOY5//Ytb7ud0aeyfBLPB+v+YcIdbxuVbpnOlYB2XlhYue/n4XjaKlwMC8N qlm7Wj0C6qTyavLkI5TH/AhdFGiIoiQCo8OLZHUYh0UdvkgsJeMiwhB4QmGY9t+pXSHc yDcpVv0s8eNhGDkVgAc2Icz06FULFo/x/9Tf+RDL3jcX3aVEptaj6jPWAaNpFrwm8buF aMmCHh7+DWxRkRpynM0cjDBt78PWaYpJBnrPnYL9S38TpBXxm/jMWv0jIEnO2mcnlIzK 6BQzCUxX3cbK9zjXrSYHwxZn3vOG/0F7UOV+7ecYnIWzNjj1DGXAFpRhQIXFGNPN9Q6n R5yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sandisk.com header.s=dkim.sandisk.com header.b="rSI/QBLP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4-v6si10499095pgm.454.2018.08.05.05.47.49; Sun, 05 Aug 2018 05:48:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sandisk.com header.s=dkim.sandisk.com header.b="rSI/QBLP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbeHEOv2 (ORCPT + 99 others); Sun, 5 Aug 2018 10:51:28 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:4917 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbeHEOv2 (ORCPT ); Sun, 5 Aug 2018 10:51:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sandisk.com; i=@sandisk.com; q=dns/txt; s=dkim.sandisk.com; t=1533473220; x=1565009220; h=from:to:cc:subject:date:message-id; bh=m8CuS8sEAiiAz8+zkPS3GBoGjKbB2ygoFxNboyYS7OU=; b=rSI/QBLPYfm6u1Jef93/GCmG+zKPvWuczXSSKia1Z1CDQ3enphqmkhS0 16TevMBCWEKkK3B4CGQNeffBFxSH2vETFNVYv+PW2gNFlEY5upi4OzSQ5 B9HGQ1qV5KeM+doM1cNBjeqjd0MOwTxtqHjFuBETsQAk6s/OKPiQJsn/r 4clRARLIESSXOPCY7uOX+gozFYbKjXSeWoo8zPdiOSEjdg7+/3oavXA2M w6+ZycArChVFyQ+37cW3MWntSxfCTxPT83qZ/I+9PxsFpFH2AlL6g6zY1 lKDo41IUlYQhGZCfM2xf4PQ4Z85uxDOn6+lEgbtRwChE5jhouZ0LiDmJF A==; X-IronPort-AV: E=Sophos;i="5.51,447,1526313600"; d="scan'208";a="190448441" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 05 Aug 2018 20:47:00 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 05 Aug 2018 05:35:18 -0700 Received: from ile419070.sdcorp.global.sandisk.com ([10.0.230.165]) by uls-op-cesaip01.wdc.com with ESMTP; 05 Aug 2018 05:46:58 -0700 From: Ohad Sharabi To: stanislav.nijnikov@wdc.com, avri.altman@wdc.com, alex.lemberg@wdc.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, gregkh@linuxfoundation.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Ohad Sharabi Subject: [PATCH] scsi: ufs: remove unnecessary query(DM) UPIU trace Date: Sun, 5 Aug 2018 15:46:54 +0300 Message-Id: <1533473214-12698-1-git-send-email-ohad.sharabi@sandisk.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch removes redundant trace that occurs when sending Device Management(DM) request (fix behavior in patch https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git/commit/?id=6667e6d91c88a788d5ab1b1e999d245473e84a9) Since the function send_command is called also for DM request, UPIU trace for DM request is called twice- one identified as query_* the other as send/complete. Signed-off-by: Ohad Sharabi --- drivers/scsi/ufs/ufshcd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 397081d..33e6dd0 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -321,18 +321,19 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, sector_t lba = -1; u8 opcode = 0; u32 intr, doorbell; - struct ufshcd_lrb *lrbp; + struct ufshcd_lrb *lrbp = &hba->lrb[tag]; int transfer_len = -1; - /* trace UPIU also */ - ufshcd_add_cmd_upiu_trace(hba, tag, str); - - if (!trace_ufshcd_command_enabled()) + if (!trace_ufshcd_command_enabled()) { + /* trace UPIU W/O tracing command */ + if (lrbp->cmd) + ufshcd_add_cmd_upiu_trace(hba, tag, str); return; - - lrbp = &hba->lrb[tag]; + } if (lrbp->cmd) { /* data phase exists */ + /* trace UPIU also */ + ufshcd_add_cmd_upiu_trace(hba, tag, str); opcode = (u8)(*lrbp->cmd->cmnd); if ((opcode == READ_10) || (opcode == WRITE_10)) { /* -- 1.9.1