msm: kgsl: Retry setting the SMMU aperture on A6XX targets

Instead of depending on qcom_scm_kgsl_set_smmu_aperture_available
to set the SMMU aperture, we only set the aperture on A6XX targets.
Also retry setting the SMMU aperture if qcom_scm_kgsl_set_smmu_aperture
returns -EBUSY.

Change-Id: I61028e2681342befcdc40b5a11e3f6da41e85a9a
Signed-off-by: Raghu Ananya Arabolu <rarabolu@codeaurora.org>
This commit is contained in:
Raghu Ananya Arabolu 2020-03-23 10:33:20 -07:00
commit 568ee81597
3 changed files with 12 additions and 2 deletions

View file

@ -1412,6 +1412,12 @@ static int adreno_bind(struct device *dev)
if (adreno_support_64bit(adreno_dev))
kgsl_mmu_set_feature(device, KGSL_MMU_64BIT);
/*
* Set the SMMU aperture on A6XX targets to use per-process pagetables.
*/
if (adreno_is_a6xx(adreno_dev))
kgsl_mmu_set_feature(device, KGSL_MMU_SMMU_APERTURE);
device->pwrctrl.bus_width = adreno_dev->gpucore->bus_width;
device->mmu.secured = (IS_ENABLED(CONFIG_QCOM_SECURE_BUFFER) &&

View file

@ -1084,13 +1084,15 @@ static int set_smmu_aperture(struct kgsl_device *device, int cb_num)
{
int ret;
if (!qcom_scm_kgsl_set_smmu_aperture_available())
if (!test_bit(KGSL_MMU_SMMU_APERTURE, &device->mmu.features))
return 0;
ret = qcom_scm_kgsl_set_smmu_aperture(cb_num);
if (ret == -EBUSY)
ret = qcom_scm_kgsl_set_smmu_aperture(cb_num);
if (ret)
dev_err(device->dev, "Unable to set the SMMU aperture: %d\n",
dev_err(device->dev, "Unable to set the SMMU aperture: %d. The aperture needs to be set to use per-process pagetables\n",
ret);
return ret;

View file

@ -126,6 +126,8 @@ enum kgsl_mmu_feature {
KGSL_MMU_SECURE_CB_ALT,
/** @KGSL_MMU_LLC_ENABLE: Set if LLC is activated for the target */
KGSL_MMU_LLCC_ENABLE,
/** @KGSL_MMU_SMMU_APERTURE: Set the SMMU aperture */
KGSL_MMU_SMMU_APERTURE,
};
/**