Skip to content

Commit bf2160b

Browse files
bvanasschekawasaki
authored andcommitted
scsi: ufs: Inform the block layer about write ordering
From the UFSHCI 4.0 specification, about the MCQ mode: "Command Submission 1. Host SW writes an Entry to SQ 2. Host SW updates SQ doorbell tail pointer Command Processing 3. After fetching the Entry, Host Controller updates SQ doorbell head pointer 4. Host controller sends COMMAND UPIU to UFS device" In other words, in MCQ mode, UFS controllers are required to forward commands to the UFS device in the order these commands have been received from the host. This patch improves performance as follows on a test setup with UFSHCI 4.0 controller: - When not using an I/O scheduler: 2.3x more IOPS for small writes. - With the mq-deadline scheduler: 2.0x more IOPS for small writes. Reviewed-by: Avri Altman <[email protected]> Cc: Bao D. Nguyen <[email protected]> Cc: Can Guo <[email protected]> Cc: Martin K. Petersen <[email protected]> Signed-off-by: Bart Van Assche <[email protected]>
1 parent 06fea0b commit bf2160b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5281,6 +5281,12 @@ static int ufshcd_sdev_configure(struct scsi_device *sdev,
52815281
struct ufs_hba *hba = shost_priv(sdev->host);
52825282
struct request_queue *q = sdev->request_queue;
52835283

5284+
/*
5285+
* The write order is preserved per MCQ. Without MCQ, auto-hibernation
5286+
* may cause write reordering that results in unaligned write errors.
5287+
*/
5288+
lim->driver_preserves_write_order = hba->mcq_enabled;
5289+
52845290
lim->dma_pad_mask = PRDT_DATA_BYTE_COUNT_PAD - 1;
52855291

52865292
/*

0 commit comments

Comments
 (0)