OSDN Git Service

cnss2: Bypass SMMU stage-1 by default
authorYue Ma <yuem@codeaurora.org>
Wed, 1 Feb 2017 22:22:09 +0000 (14:22 -0800)
committerYue Ma <yuem@codeaurora.org>
Fri, 7 Jul 2017 16:44:28 +0000 (09:44 -0700)
Bypass SMMU stage-1 till it is fully supported by WLAN driver and
device.

Change-Id: I186345c20f9b71171bba6acc8c5eaa689e39b51c
CRs-fixed: 2071634
Signed-off-by: Yue Ma <yuem@codeaurora.org>
drivers/net/wireless/cnss2/pci.c

index 5f2d6bb..f914f43 100644 (file)
@@ -222,6 +222,7 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv)
        struct device *dev;
        struct dma_iommu_mapping *mapping;
        int atomic_ctx = 1;
+       int s1_bypass = 1;
 
        dev = &pci_priv->pci_dev->dev;
 
@@ -243,6 +244,15 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv)
                goto release_mapping;
        }
 
+       ret = iommu_domain_set_attr(mapping->domain,
+                                   DOMAIN_ATTR_S1_BYPASS,
+                                   &s1_bypass);
+       if (ret) {
+               pr_err("Failed to set SMMU s1_bypass attribute, err = %d\n",
+                      ret);
+               goto release_mapping;
+       }
+
        ret = arm_iommu_attach_device(dev, mapping);
        if (ret) {
                pr_err("Failed to attach SMMU device, err = %d\n", ret);