Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1831312pxu; Sun, 6 Dec 2020 08:46:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3QypYnJi3jNQbz4fw7z72WQztJUBMr0qlzzl/A8yiJmgfcvFmrUH9TUOWnN8emESGo0ld X-Received: by 2002:a17:906:447:: with SMTP id e7mr8467887eja.172.1607273169010; Sun, 06 Dec 2020 08:46:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607273169; cv=none; d=google.com; s=arc-20160816; b=mLGVyz9lQ3Tb3yiZAIsSRwOZCV2jtepFNioWgqZj6cRMwabLUm5T1VpIln/zJeSqXW x/KQuWLvmwJRNHLmgJy7UjRfjvdpuhNf4w18dPBnbrC/OIuIHU7ZvggJtzX/s2qdAK0u oJXTYeGrSq4ZZttptoyMpBL6hlB9x1n72UJCZ9i1JFXeDhD7q/7t1r1keXM4F90Zqgv7 ngof2Y8zMOKw2GrsuiA2uppheNPEcln5lXgIwP72mnSEEC/bB3+B2tWYEIVnTqDUCko+ FIEXcYxdr4dUpKPSvnh4lSqBDyka0Ud19dKeMx/ZYY0V7cBByQk8jzzD6SUZziPGRMOv ALWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=fv94yoCjxFMyCGDFrOP0JP4fAzP6SX6Q5aROorrzmI4=; b=gJRP+HZIQcu8eHzjB36CNPwykO1iomt+W8fRuzc2oSZJSbP6BLO/LhdqAno25Vb4SS VN8KAGhLFAhLZSyl3nxhzA6F5eu5AeBAPbJdAgJ6eEAb5pfUXDOS/mihppWHqo9gf7iy oWqzos/QlAqIe76T48G/glrOMaiZOcBZH4biIV5Q6VUCuaJL7uoKwC3IwSbF5JtYAS2c LskguI/iJwWwyhqUVWb9RsEC4ybPP6JjICnUoCQc5J65jxtj/YRMRZrV55XjJ+MaBqfI xEG0FVEhhmImp5Z44yXD9NqGQYDWimNyMJkaqOR4eKup7NW15rvC4rLhxrXo6v63Z8s4 yjBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GQgG2/43"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si6030477edi.38.2020.12.06.08.45.45; Sun, 06 Dec 2020 08:46:08 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="GQgG2/43"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727511AbgLFQnZ (ORCPT + 99 others); Sun, 6 Dec 2020 11:43:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbgLFQnY (ORCPT ); Sun, 6 Dec 2020 11:43:24 -0500 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11BA5C0613D1; Sun, 6 Dec 2020 08:42:44 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id c7so11125702edv.6; Sun, 06 Dec 2020 08:42:43 -0800 (PST) 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; bh=fv94yoCjxFMyCGDFrOP0JP4fAzP6SX6Q5aROorrzmI4=; b=GQgG2/43YsN3y3crytPcgsnYCX4/d6xwY86yz7zklXbRfqRRFlsf6E/5n2jySE/0Rb ME1SyFzkn+KOT1nsGKiEXLso20VMUf7m3ZfzXC2OfKuB5f5Hrs5qXAP6E2Y/g4Hlm59e DdIGzM4wLLU5uhwpI3UQgyKFGVFZIHH/HoLKY0Btlrodimkw5Exrqgl/pxyMigv8QY5o RypZBlJDHWOd7D3TtfZzCmK8R1vNF2Sic1eh/pDxBM6fVGn4SEPNmewTWGFSi3AZem/f CYMhOb0BDOqrsSqvUYAUhQQfQ3vHGEtUttTtnwmmVBEXLRFpowgXZrHQPlVr5n17+Epg l0+A== 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; bh=fv94yoCjxFMyCGDFrOP0JP4fAzP6SX6Q5aROorrzmI4=; b=nMxej7lu7QRQI3JJfFgD3TbzOtZXNXaaHlpw10FI+2zEO/mrZKf98sC+AonWnvguQw WTaReGVSjJKi9B9GLwnWf3P5RG6LPwUCClbw0db4x6Rn95PivybxSX0VjzC+Njsuw1HH X7+QHiLdiachA/Q/EdI7irnQnq9kvey17sguhbPbDPV0iGQlwvMhXVrRPt9/5wt2bQKd kcTrURfGK23dkYdZwHFlErmshrbbXdC1fZVaLoWf8DafrUu0KrIPd/jtpkQeC6hsgefS D19ubBeKeaIqwFtvc4ntrl/+5MFyykyOBA5ag3PE08zOaL62u64u/pmg3dS7sxTpo/Ay Cl0Q== X-Gm-Message-State: AOAM5309cGS1EsM5whlifCKaXYhtHc6uM/UpUglevOwwoIz/FZdyXRZd OJ9m5R4ZbHJQ6Yr3xXCkBSg= X-Received: by 2002:a50:fd88:: with SMTP id o8mr16699498edt.386.1607272962793; Sun, 06 Dec 2020 08:42:42 -0800 (PST) Received: from localhost.localdomain (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.gmail.com with ESMTPSA id e19sm9157524edr.61.2020.12.06.08.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2020 08:42:42 -0800 (PST) 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, rostedt@goodmis.org Subject: [PATCH v1 1/3] scsi: ufs: Distinguish between query REQ and query RSP in query trace Date: Sun, 6 Dec 2020 17:42:24 +0100 Message-Id: <20201206164226.6595-2-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201206164226.6595-1-huobean@gmail.com> References: <20201206164226.6595-1-huobean@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo Currently, in the query completion trace print, since we use hba->lrb[tag].ucd_req_ptr and didn't differentiate UPIU between request and response, thus header and transaction-specific field in UPIU printed by query trace are identical. This is not very practical. As below: query_send: HDR:16 00 00 0e 00 81 00 00 00 00 00 00, CDB:06 0e 03 00 00 00 00 00 00 00 00 00 00 00 00 00 query_complete: HDR:16 00 00 0e 00 81 00 00 00 00 00 00, CDB:06 0e 03 00 00 00 00 00 00 00 00 00 00 00 00 00 For the failure analysis, we want to understand the real response reported by the UFS device, however, the current query trace tells us nothing. After this patch, the query trace on the query_send, and the above a pair of query_send and query_complete will be: query_send: HDR:16 00 00 0e 00 81 00 00 00 00 00 00, CDB:06 0e 03 00 00 00 00 00 00 00 00 00 00 00 00 00 ufshcd_upiu: HDR:36 00 00 0e 00 81 00 00 00 00 00 00, CDB:06 0e 03 00 00 00 00 00 00 00 00 01 00 00 00 00 Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ceb562accc39..e10de94adb3f 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -321,9 +321,15 @@ static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int tag, static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int tag, const char *str) { - struct utp_upiu_req *rq = hba->lrb[tag].ucd_req_ptr; + struct utp_upiu_req *rq_rsp; + + if (!strcmp("query_send", str)) + 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, &rq->header, &rq->qr); + trace_ufshcd_upiu(dev_name(hba->dev), str, &rq_rsp->header, + &rq_rsp->qr); } static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag, -- 2.17.1