Просмотр исходного кода

qcacld-3.0: Set DMA mask during before pre-alloc

Currently the DMA mask is set as a part of hif enable
which is called after the datapath memory pre-alloc.
As a part of datapath pre-alloc even dma memory is
pre-alloced, which is attempted with a default dma
mask of 32, since no mask is set by the driver.

To fix this, set the dma mask before datapath memory
pre-allocation is done.

Change-Id: Id850cbd28e2ea88aa68779867db2cb3c9d9a7856
CRs-Fixed: 2845019
Rakesh Pillai 4 лет назад
Родитель
Сommit
aa7638527a
1 измененных файлов с 24 добавлено и 0 удалено
  1. 24 0
      core/hdd/src/wlan_hdd_driver_ops.c

+ 24 - 0
core/hdd/src/wlan_hdd_driver_ops.c

@@ -524,6 +524,26 @@ static void hdd_soc_load_unlock(struct device *dev)
 	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT);
 }
 
+#ifdef DP_MEM_PRE_ALLOC
+/**
+ * hdd_init_dma_mask() - Set the DMA mask for dma memory pre-allocation
+ * @dev: device handle
+ * @bus_type: Bus type for which init is being done
+ *
+ * Return: 0 - success, non-zero on failure
+ */
+static int hdd_init_dma_mask(struct device *dev, enum qdf_bus_type bus_type)
+{
+	return hif_init_dma_mask(dev, bus_type);
+}
+#else
+static inline int
+hdd_init_dma_mask(struct device *dev, enum qdf_bus_type bus_type)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 static int __hdd_soc_probe(struct device *dev,
 			   void *bdev,
 			   const struct hif_bus_id *bid,
@@ -544,6 +564,10 @@ static int __hdd_soc_probe(struct device *dev,
 	if (errno)
 		goto unlock;
 
+	errno = hdd_init_dma_mask(dev, bus_type);
+	if (errno)
+		goto unlock;
+
 	status = dp_prealloc_init();
 
 	if (status != QDF_STATUS_SUCCESS) {