lkml.org 
[lkml]   [2021]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v12 3/3] ufs: set max_bio_bytes with queue max sectors
Date
Set max_bio_bytes same with queue max sectors. It will lead to fast bio
submit when bio size is over than queue max sectors. And it might be helpful
to align submit bio size in some case.

Signed-off-by: Changheun Lee <nanich.lee@samsung.com>
---
drivers/scsi/ufs/ufshcd.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 3eb54937f1d8..37365a726517 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4858,6 +4858,7 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
{
struct ufs_hba *hba = shost_priv(sdev->host);
struct request_queue *q = sdev->request_queue;
+ unsigned int max_bio_bytes;

blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
if (hba->quirks & UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE)
@@ -4868,6 +4869,10 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)

ufshcd_crypto_setup_rq_keyslot_manager(hba, q);

+ if (!check_shl_overflow(queue_max_sectors(q),
+ SECTOR_SHIFT, &max_bio_bytes))
+ blk_queue_max_bio_bytes(q, max_bio_bytes);
+
return 0;
}

--
2.29.0
\
 
 \ /
  Last update: 2021-06-04 07:23    [W:0.329 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site