Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge patch series "Enable DMA clustering in the UFS driver"

Bart Van Assche <bvanassche@acm.org> 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/20230112234215.2630817-1-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+13 -6
+2 -3
drivers/ufs/core/ufshcd.c
··· 5107 5107 ufshcd_hpb_configure(hba, sdev); 5108 5108 5109 5109 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); 5112 5112 /* 5113 5113 * Block runtime-pm until all consumers are added. 5114 5114 * Refer ufshcd_setup_links(). ··· 8724 8724 .max_host_blocked = 1, 8725 8725 .track_queue_depth = 1, 8726 8726 .sdev_groups = ufshcd_driver_groups, 8727 - .dma_boundary = PAGE_SIZE - 1, 8728 8727 .rpm_autosuspend_delay = RPM_AUTOSUSPEND_DELAY_MS, 8729 8728 }; 8730 8729
+9 -1
drivers/ufs/host/ufs-exynos.c
··· 1300 1300 1301 1301 switch (status) { 1302 1302 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 + 1303 1311 if (ufs->drv_data->pre_hce_enable) { 1304 1312 ret = ufs->drv_data->pre_hce_enable(ufs); 1305 1313 if (ret) ··· 1681 1673 UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR | 1682 1674 UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL | 1683 1675 UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING | 1684 - UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE, 1676 + UFSHCD_QUIRK_4KB_DMA_ALIGNMENT, 1685 1677 .opts = EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL | 1686 1678 EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL | 1687 1679 EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX |
+2 -2
include/ufs/ufshcd.h
··· 583 583 UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING = 1 << 13, 584 584 585 585 /* 586 - * This quirk allows only sg entries aligned with page size. 586 + * Align DMA SG entries on a 4 KiB boundary. 587 587 */ 588 - UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE = 1 << 14, 588 + UFSHCD_QUIRK_4KB_DMA_ALIGNMENT = 1 << 14, 589 589 590 590 /* 591 591 * This quirk needs to be enabled if the host controller does not