Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225044

[PATCH 02/10] drm/msm/mdp5: Disable hardware translation table walks (MSM8996)

From Stephane Viau <sviau@codeaurora.org>
Newsgroups linux.kernel
Subject [PATCH 02/10] drm/msm/mdp5: Disable hardware translation table walks (MSM8996)
Date 2015-09-15 14:50 +0200
Message-ID <q8XQl-55E-11@gated-at.bofh.it> (permalink)
References <q8XQl-55E-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On certain targets (eg, MSM8996) we need to set the following
domain attribute for correct operation of the SMMU:
DOMAIN_ATTR_COHERENT_HTW_DISABLE.

Setting that attribute is very important on 8996. Without it, we would
see crazy translation faults.

Note:
There could be support for coherent hardware table walks in
the future

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
index bbab6e6..14ac20a 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
@@ -584,6 +584,8 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
 	mdelay(16);
 
 	if (config->platform.iommu) {
+		int rev = mdp5_cfg_get_hw_rev(mdp5_kms->cfg);
+
 		mmu = msm_iommu_new(&pdev->dev, config->platform.iommu);
 		if (IS_ERR(mmu)) {
 			ret = PTR_ERR(mmu);
@@ -591,6 +593,19 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
 			goto fail;
 		}
 
+		/*
+		 * On certain targets (8996, for example) we need to set the
+		 * following domain attribute for correct operation of the SMMU;
+		 * Without it, we would see crazy translation faults..
+		 */
+		if (rev == 7) {
+			int disable_htw = 1;
+
+			iommu_domain_set_attr(config->platform.iommu,
+				DOMAIN_ATTR_COHERENT_HTW_DISABLE, &disable_htw);
+			DBG("coherent hardware translation table walks is off");
+		}
+
 		ret = mmu->funcs->attach(mmu, iommu_ports,
 				ARRAY_SIZE(iommu_ports));
 		if (ret) {
-- 
Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 02/10] drm/msm/mdp5: Disable hardware translation table walks (MSM8996) Stephane Viau <sviau@codeaurora.org> - 2015-09-15 14:50 +0200

csiph-web