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: Use scsi_device_busy()

Use scsi_device_busy() instead of open-coding it. This patch prepares
for skipping the SCSI device budget map initialization in certain cases.

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

authored by

Bart Van Assche and committed by
Martin K. Petersen
31e6e7e5 02b5822d

+2 -2
+2 -2
drivers/ufs/core/ufshcd.c
··· 1290 1290 */ 1291 1291 static u32 ufshcd_pending_cmds(struct ufs_hba *hba) 1292 1292 { 1293 - const struct scsi_device *sdev; 1293 + struct scsi_device *sdev; 1294 1294 unsigned long flags; 1295 1295 u32 pending = 0; 1296 1296 1297 1297 spin_lock_irqsave(hba->host->host_lock, flags); 1298 1298 __shost_for_each_device(sdev, hba->host) 1299 - pending += sbitmap_weight(&sdev->budget_map); 1299 + pending += scsi_device_busy(sdev); 1300 1300 spin_unlock_irqrestore(hba->host->host_lock, flags); 1301 1301 1302 1302 return pending;