FROMGIT: scsi: ufs: exynos: Fix DMA alignment for PAGE_SIZE != 4096
The Exynos UFS controller only supports scatter/gather list elements that
are aligned on a 4 KiB boundary. Fix DMA alignment in case PAGE_SIZE !=
4096. Rename UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE into
UFSHCD_QUIRK_4KB_DMA_ALIGNMENT.
Cc: Kiwoong Kim <kwmad.kim@samsung.com>
Fixes: 2b2bfc8aa5 ("scsi: ufs: Introduce a quirk to allow only page-aligned sg entries")
Change-Id: Ice7b3d32192e0c7f6f607ad4ca64071062fa8b17
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 86bd0c4a2a5dc4265884648cb92c681646509692 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Bart Van Assche
parent
21a48c99fd
commit
eaebb00d00
@@ -5165,8 +5165,8 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
|
||||
|
||||
blk_queue_flag_set(QUEUE_FLAG_PIPELINE_ZONED_WRITES, q);
|
||||
blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
|
||||
if (hba->quirks & UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE)
|
||||
blk_queue_update_dma_alignment(q, PAGE_SIZE - 1);
|
||||
if (hba->quirks & UFSHCD_QUIRK_4KB_DMA_ALIGNMENT)
|
||||
blk_queue_update_dma_alignment(q, 4096 - 1);
|
||||
/*
|
||||
* Block runtime-pm until all consumers are added.
|
||||
* Refer ufshcd_setup_links().
|
||||
|
||||
@@ -1673,7 +1673,7 @@ static const struct exynos_ufs_drv_data exynos_ufs_drvs = {
|
||||
UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR |
|
||||
UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL |
|
||||
UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING |
|
||||
UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE,
|
||||
UFSHCD_QUIRK_4KB_DMA_ALIGNMENT,
|
||||
.opts = EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL |
|
||||
EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL |
|
||||
EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX |
|
||||
|
||||
@@ -595,9 +595,9 @@ enum ufshcd_quirks {
|
||||
UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING = 1 << 13,
|
||||
|
||||
/*
|
||||
* This quirk allows only sg entries aligned with page size.
|
||||
* Align DMA SG entries on a 4 KiB boundary.
|
||||
*/
|
||||
UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE = 1 << 14,
|
||||
UFSHCD_QUIRK_4KB_DMA_ALIGNMENT = 1 << 14,
|
||||
|
||||
/*
|
||||
* This quirk needs to be enabled if the host controller does not
|
||||
|
||||
Reference in New Issue
Block a user