Skip to content

Commit 5adca38

Browse files
Merge patch series "Enable DMA clustering in the UFS driver"
Bart Van Assche <[email protected]> says: The third patch in this series enables DMA clustering in the UFS driver since UFS host controllers support DMA clustering. The first two patches fix bugs in the Exynos host controller driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents 5a5ef64 + 13f8798 commit 5adca38

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5107,8 +5107,8 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
51075107
ufshcd_hpb_configure(hba, sdev);
51085108

51095109
blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
5110-
if (hba->quirks & UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE)
5111-
blk_queue_update_dma_alignment(q, PAGE_SIZE - 1);
5110+
if (hba->quirks & UFSHCD_QUIRK_4KB_DMA_ALIGNMENT)
5111+
blk_queue_update_dma_alignment(q, 4096 - 1);
51125112
/*
51135113
* Block runtime-pm until all consumers are added.
51145114
* Refer ufshcd_setup_links().
@@ -8724,7 +8724,6 @@ static struct scsi_host_template ufshcd_driver_template = {
87248724
.max_host_blocked = 1,
87258725
.track_queue_depth = 1,
87268726
.sdev_groups = ufshcd_driver_groups,
8727-
.dma_boundary = PAGE_SIZE - 1,
87288727
.rpm_autosuspend_delay = RPM_AUTOSUSPEND_DELAY_MS,
87298728
};
87308729

drivers/ufs/host/ufs-exynos.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,14 @@ static int exynos_ufs_hce_enable_notify(struct ufs_hba *hba,
13001300

13011301
switch (status) {
13021302
case PRE_CHANGE:
1303+
/*
1304+
* The maximum segment size must be set after scsi_host_alloc()
1305+
* has been called and before LUN scanning starts
1306+
* (ufshcd_async_scan()). Note: this callback may also be called
1307+
* from other functions than ufshcd_init().
1308+
*/
1309+
hba->host->max_segment_size = 4096;
1310+
13031311
if (ufs->drv_data->pre_hce_enable) {
13041312
ret = ufs->drv_data->pre_hce_enable(ufs);
13051313
if (ret)
@@ -1673,7 +1681,7 @@ static const struct exynos_ufs_drv_data exynos_ufs_drvs = {
16731681
UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR |
16741682
UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL |
16751683
UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING |
1676-
UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE,
1684+
UFSHCD_QUIRK_4KB_DMA_ALIGNMENT,
16771685
.opts = EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL |
16781686
EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL |
16791687
EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX |

include/ufs/ufshcd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,9 @@ enum ufshcd_quirks {
583583
UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING = 1 << 13,
584584

585585
/*
586-
* This quirk allows only sg entries aligned with page size.
586+
* Align DMA SG entries on a 4 KiB boundary.
587587
*/
588-
UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE = 1 << 14,
588+
UFSHCD_QUIRK_4KB_DMA_ALIGNMENT = 1 << 14,
589589

590590
/*
591591
* This quirk needs to be enabled if the host controller does not

0 commit comments

Comments
 (0)