Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: core: Only call ufshcd_should_inform_monitor() for SCSI commands

ufshcd_should_inform_monitor() only returns 'true' for SCSI commands.
Instead of checking inside ufshcd_should_inform_monitor() whether its
second argument represents a SCSI command, only call this function for
SCSI commands. This patch prepares for removing the lrbp->cmd member.

Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251031204029.2883185-14-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
ae7bf255 3e7fff3f

+4 -3
+4 -3
drivers/ufs/core/ufshcd.c
··· 2293 2293 return -EINVAL; 2294 2294 } 2295 2295 2296 + /* Must only be called for SCSI commands. */ 2296 2297 static inline bool ufshcd_should_inform_monitor(struct ufs_hba *hba, 2297 2298 struct ufshcd_lrb *lrbp) 2298 2299 { 2299 2300 const struct ufs_hba_monitor *m = &hba->monitor; 2300 2301 2301 - return (m->enabled && lrbp && lrbp->cmd && 2302 + return (m->enabled && 2302 2303 (!m->chunk_size || m->chunk_size == lrbp->cmd->sdb.length) && 2303 2304 ktime_before(hba->monitor.enabled_ts, lrbp->issue_time_stamp)); 2304 2305 } ··· 2369 2368 if (lrbp->cmd) { 2370 2369 ufshcd_add_command_trace(hba, lrbp->cmd, UFS_CMD_SEND); 2371 2370 ufshcd_clk_scaling_start_busy(hba); 2371 + if (unlikely(ufshcd_should_inform_monitor(hba, lrbp))) 2372 + ufshcd_start_monitor(hba, lrbp); 2372 2373 } 2373 - if (unlikely(ufshcd_should_inform_monitor(hba, lrbp))) 2374 - ufshcd_start_monitor(hba, lrbp); 2375 2374 2376 2375 if (hba->mcq_enabled) { 2377 2376 int utrd_size = sizeof(struct utp_transfer_req_desc);