* [PATCH] ufs: core: Use scsi_device_busy()
@ 2025-11-13 23:52 Bart Van Assche
2025-11-20 3:02 ` Martin K. Petersen
2025-11-29 3:30 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Bart Van Assche @ 2025-11-13 23:52 UTC (permalink / raw)
To: Martin K . Petersen
Cc: linux-scsi, Bart Van Assche, Peter Wang, James E.J. Bottomley,
Matthias Brugger, AngeloGioacchino Del Regno, Avri Altman,
Bean Huo, Bao D. Nguyen, Adrian Hunter
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>
---
drivers/ufs/core/ufshcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 846d7f1138a8..78dd96c82d20 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -1290,13 +1290,13 @@ static bool ufshcd_is_devfreq_scaling_required(struct ufs_hba *hba,
*/
static u32 ufshcd_pending_cmds(struct ufs_hba *hba)
{
- const struct scsi_device *sdev;
+ struct scsi_device *sdev;
unsigned long flags;
u32 pending = 0;
spin_lock_irqsave(hba->host->host_lock, flags);
__shost_for_each_device(sdev, hba->host)
- pending += sbitmap_weight(&sdev->budget_map);
+ pending += scsi_device_busy(sdev);
spin_unlock_irqrestore(hba->host->host_lock, flags);
return pending;
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ufs: core: Use scsi_device_busy()
2025-11-13 23:52 [PATCH] ufs: core: Use scsi_device_busy() Bart Van Assche
@ 2025-11-20 3:02 ` Martin K. Petersen
2025-11-29 3:30 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-11-20 3:02 UTC (permalink / raw)
To: Bart Van Assche
Cc: Martin K . Petersen, linux-scsi, Peter Wang, James E.J. Bottomley,
Matthias Brugger, AngeloGioacchino Del Regno, Avri Altman,
Bean Huo, Bao D. Nguyen, Adrian Hunter
Bart,
> Use scsi_device_busy() instead of open-coding it. This patch prepares
> for skipping the SCSI device budget map initialization in certain
> cases.
Applied to 6.19/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ufs: core: Use scsi_device_busy()
2025-11-13 23:52 [PATCH] ufs: core: Use scsi_device_busy() Bart Van Assche
2025-11-20 3:02 ` Martin K. Petersen
@ 2025-11-29 3:30 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-11-29 3:30 UTC (permalink / raw)
To: Bart Van Assche
Cc: Martin K . Petersen, linux-scsi, Peter Wang, James E.J. Bottomley,
Matthias Brugger, AngeloGioacchino Del Regno, Avri Altman,
Bean Huo, Bao D. Nguyen, Adrian Hunter
On Thu, 13 Nov 2025 15:52:43 -0800, Bart Van Assche wrote:
> Use scsi_device_busy() instead of open-coding it. This patch prepares
> for skipping the SCSI device budget map initialization in certain cases.
>
>
Applied to 6.19/scsi-queue, thanks!
[1/1] ufs: core: Use scsi_device_busy()
https://git.kernel.org/mkp/scsi/c/31e6e7e54b29
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-29 3:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 23:52 [PATCH] ufs: core: Use scsi_device_busy() Bart Van Assche
2025-11-20 3:02 ` Martin K. Petersen
2025-11-29 3:30 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox