Received: from 004.mia.mailroute.net (004.mia.mailroute.net [199.89.3.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 930892BE02A for ; Tue, 14 Oct 2025 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.3.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760473149; cv=none; b=Xj6NJCc68RjUerfa/mblvjICIKOI1xVi1Pn2N2uwQo8UeBNbk5XcgiqURtMaUVZmHX/crNzd8CmbQ9Fn2hZTRWGOXvPt+KApYqjdhFl10VRjHGimcP5nsNPl4mBmrqenZeueWXeqYm5Xbz0HkQkRzV4VMaXufajpgDpasEhFavY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760473149; c=relaxed/simple; bh=mAsg7PQfRIZmFkzDEcxO83WxjeC3Spav+FmR2LIB0PU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fAsQxMPVLB08m+0qeBM9RufOcvWxkEM0CDhKCkxfDD5z3Bhda99zTNadLlY8mYdVZ53hspm4ER2bhtAT7c9lT/EfdPCMfa3D1GUKwZuFhS6EaCbg4qh4Z4UVvjb6xRdvx0w7bYXceWlmBbn+tZWhyC7jzwK78gw9lV2mwLsfVuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=Yw18gWR/; arc=none smtp.client-ip=199.89.3.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="Yw18gWR/" Received: from localhost (localhost [127.0.0.1]) by 004.mia.mailroute.net (Postfix) with ESMTP id 4cmQXp2dxzzm0yVS; Tue, 14 Oct 2025 20:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1760473144; x=1763065145; bh=rTzGO jJLQ5TjrIqrM0k418N9NYqnMFSCidjG6YUHrs4=; b=Yw18gWR/mkj9Roaoz+vsO K/fwz0gPXmDgH0L7pHaYPyHrMLm+I5N2rvkYul42BoYWkx0tzLwp7xm9Io8JH020 nUvFKzC30nQC1c+fTyXdmmPckIVWtvBLwmZNcEdlaeLkkyS6LmXH4bxr2abLW6PC hV2gz/vBVeZjpJpSWngmOXpwQX1ehJigOOyAvhsgFOtVCPNJ1t5L57rMVXlChHKx UV4N1x1fWPEoMD7W1k1FA/FsZoCf95abb4N4uAbnWo+3/D2BoiCVIoNJkWJWkqii ohYome7D0b1PzNzFpMiMlauA7kKS4ZwfTKFx/PnIauFHUV3NjMcMmeKx80S6+kHn g== X-Virus-Scanned: by MailRoute Received: from 004.mia.mailroute.net ([127.0.0.1]) by localhost (004.mia [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id YTGWj--YwYso; Tue, 14 Oct 2025 20:19:04 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.180.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 004.mia.mailroute.net (Postfix) with ESMTPSA id 4cmQXf1ff1zm0yVM; Tue, 14 Oct 2025 20:18:57 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Avri Altman , Peter Wang , "James E.J. Bottomley" , Matthias Brugger , AngeloGioacchino Del Regno , Bean Huo Subject: [PATCH v6 10/28] ufs: core: Only call ufshcd_add_command_trace() for SCSI commands Date: Tue, 14 Oct 2025 13:15:52 -0700 Message-ID: <20251014201707.3396650-11-bvanassche@acm.org> X-Mailer: git-send-email 2.51.0.788.g6d19910ace-goog In-Reply-To: <20251014201707.3396650-1-bvanassche@acm.org> References: <20251014201707.3396650-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Instead of checking inside ufshcd_add_command_trace() whether 'cmd' point= s at a SCSI command, let the caller perform that check. This patch prepares for removing the lrbp->cmd pointer. Reviewed-by: Avri Altman Reviewed-by: Peter Wang Signed-off-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 0677438a2b06..0d57deb9b724 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -486,9 +486,6 @@ static void ufshcd_add_command_trace(struct ufs_hba *= hba, unsigned int tag, struct request *rq =3D scsi_cmd_to_rq(cmd); int transfer_len =3D -1; =20 - if (!cmd) - return; - /* trace UPIU also */ ufshcd_add_cmd_upiu_trace(hba, lrbp, str_t); if (!trace_ufshcd_command_enabled()) @@ -2368,9 +2365,10 @@ void ufshcd_send_command(struct ufs_hba *hba, unsi= gned int task_tag, lrbp->compl_time_stamp =3D ktime_set(0, 0); lrbp->compl_time_stamp_local_clock =3D 0; } - ufshcd_add_command_trace(hba, task_tag, UFS_CMD_SEND); - if (lrbp->cmd) + if (lrbp->cmd) { + ufshcd_add_command_trace(hba, task_tag, UFS_CMD_SEND); ufshcd_clk_scaling_start_busy(hba); + } if (unlikely(ufshcd_should_inform_monitor(hba, lrbp))) ufshcd_start_monitor(hba, lrbp); =20