Patch "iommu/mediatek: Fix share pgtable for iova over 4GB" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iommu/mediatek: Fix share pgtable for iova over 4GB

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iommu-mediatek-fix-share-pgtable-for-iova-over-4gb.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f132e3618f90770d9d2bc1fee1bfb1d764ba6231
Author: Yong Wu <yong.wu@xxxxxxxxxxxx>
Date:   Sat Aug 19 16:14:43 2023 +0800

    iommu/mediatek: Fix share pgtable for iova over 4GB
    
    [ Upstream commit b07eba71a512eb196cbcc29765c29c8c29b11b59 ]
    
    In mt8192/mt8186, there is only one MM IOMMU that supports 16GB iova
    space, which is shared by display, vcodec and camera. These two SoC use
    one pgtable and have not the flag SHARE_PGTABLE, we should also keep
    share pgtable for this case.
    
    In mtk_iommu_domain_finalise, MM IOMMU always share pgtable, thus remove
    the flag SHARE_PGTABLE checking. Infra IOMMU always uses independent
    pgtable.
    
    Fixes: cf69ef46dbd9 ("iommu/mediatek: Fix two IOMMU share pagetable issue")
    Reported-by: Laura Nao <laura.nao@xxxxxxxxxxxxx>
    Closes: https://lore.kernel.org/linux-iommu/20230818154156.314742-1-laura.nao@xxxxxxxxxxxxx/
    Signed-off-by: Yong Wu <yong.wu@xxxxxxxxxxxx>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
    Tested-by: Laura Nao <laura.nao@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230819081443.8333-1-yong.wu@xxxxxxxxxxxx
    Signed-off-by: Joerg Roedel <jroedel@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index c2764891a779c..ef27f9f1e17ef 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -258,7 +258,7 @@ struct mtk_iommu_data {
 	struct device			*smicomm_dev;
 
 	struct mtk_iommu_bank_data	*bank;
-	struct mtk_iommu_domain		*share_dom; /* For 2 HWs share pgtable */
+	struct mtk_iommu_domain		*share_dom;
 
 	struct regmap			*pericfg;
 	struct mutex			mutex; /* Protect m4u_group/m4u_dom above */
@@ -625,8 +625,8 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu_domain *dom,
 	struct mtk_iommu_domain	*share_dom = data->share_dom;
 	const struct mtk_iommu_iova_region *region;
 
-	/* Always use share domain in sharing pgtable case */
-	if (MTK_IOMMU_HAS_FLAG(data->plat_data, SHARE_PGTABLE) && share_dom) {
+	/* Share pgtable when 2 MM IOMMU share the pgtable or one IOMMU use multiple iova ranges */
+	if (share_dom) {
 		dom->iop = share_dom->iop;
 		dom->cfg = share_dom->cfg;
 		dom->domain.pgsize_bitmap = share_dom->cfg.pgsize_bitmap;
@@ -659,8 +659,7 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu_domain *dom,
 	/* Update our support page sizes bitmap */
 	dom->domain.pgsize_bitmap = dom->cfg.pgsize_bitmap;
 
-	if (MTK_IOMMU_HAS_FLAG(data->plat_data, SHARE_PGTABLE))
-		data->share_dom = dom;
+	data->share_dom = dom;
 
 update_iova_region:
 	/* Update the iova region for this domain */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux