diff options
author | Yong Wu <yong.wu@mediatek.com> | 2023-03-16 18:14:45 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-11 23:03:33 +0900 |
commit | 37f689d859ee6a504f0cbe7c9a38babaa5ee6191 (patch) | |
tree | 499f896143ef0259328550b6faca7e77c70fbd69 /drivers/iommu | |
parent | 9163a5b4ed290da4a7d23fa92533e0e81fd0166e (diff) | |
download | linux-stable-37f689d859ee6a504f0cbe7c9a38babaa5ee6191.tar.gz linux-stable-37f689d859ee6a504f0cbe7c9a38babaa5ee6191.tar.bz2 linux-stable-37f689d859ee6a504f0cbe7c9a38babaa5ee6191.zip |
iommu/mediatek: Set dma_mask for PGTABLE_PA_35_EN
[ Upstream commit f045e9df6537175d02565f21616ac1a9dd59b61c ]
When we enable PGTABLE_PA_35_EN, the PA for pgtable may be 35bits.
Thus add dma_mask for it.
Fixes: 301c3ca12576 ("iommu/mediatek: Allow page table PA up to 35bit")
Signed-off-by: Chengci.Xu <chengci.xu@mediatek.com>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230316101445.12443-1-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/mtk_iommu.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 56d007582b6f..e93ca9dc37c8 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1237,6 +1237,14 @@ static int mtk_iommu_probe(struct platform_device *pdev) return PTR_ERR(data->bclk); } + if (MTK_IOMMU_HAS_FLAG(data->plat_data, PGTABLE_PA_35_EN)) { + ret = dma_set_mask(dev, DMA_BIT_MASK(35)); + if (ret) { + dev_err(dev, "Failed to set dma_mask 35.\n"); + return ret; + } + } + pm_runtime_enable(dev); if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_MM)) { |