|
@@ -3934,15 +3934,25 @@ int cnss_pci_alloc_fw_mem(struct cnss_pci_data *pci_priv)
|
|
|
|
|
|
for (i = 0; i < plat_priv->fw_mem_seg_len; i++) {
|
|
|
if (!fw_mem[i].va && fw_mem[i].size) {
|
|
|
+retry:
|
|
|
fw_mem[i].va =
|
|
|
dma_alloc_attrs(dev, fw_mem[i].size,
|
|
|
&fw_mem[i].pa, GFP_KERNEL,
|
|
|
fw_mem[i].attrs);
|
|
|
|
|
|
if (!fw_mem[i].va) {
|
|
|
+ if ((fw_mem[i].attrs &
|
|
|
+ DMA_ATTR_FORCE_CONTIGUOUS)) {
|
|
|
+ fw_mem[i].attrs &=
|
|
|
+ ~DMA_ATTR_FORCE_CONTIGUOUS;
|
|
|
+
|
|
|
+ cnss_pr_dbg("Fallback to non-contiguous memory for FW, Mem type: %u\n",
|
|
|
+ fw_mem[i].type);
|
|
|
+ goto retry;
|
|
|
+ }
|
|
|
cnss_pr_err("Failed to allocate memory for FW, size: 0x%zx, type: %u\n",
|
|
|
fw_mem[i].size, fw_mem[i].type);
|
|
|
-
|
|
|
+ CNSS_ASSERT(0);
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
}
|
|
@@ -4982,17 +4992,21 @@ void cnss_pci_collect_dump_info(struct cnss_pci_data *pci_priv, bool in_panic)
|
|
|
|
|
|
dump_data->nentries += rddm_image->entries;
|
|
|
|
|
|
- cnss_pr_dbg("Collect remote heap dump segment\n");
|
|
|
-
|
|
|
for (i = 0, j = 0; i < plat_priv->fw_mem_seg_len; i++) {
|
|
|
if (fw_mem[i].type == CNSS_MEM_TYPE_DDR) {
|
|
|
- cnss_pci_add_dump_seg(pci_priv, dump_seg,
|
|
|
- CNSS_FW_REMOTE_HEAP, j,
|
|
|
- fw_mem[i].va, fw_mem[i].pa,
|
|
|
- fw_mem[i].size);
|
|
|
- dump_seg++;
|
|
|
- dump_data->nentries++;
|
|
|
- j++;
|
|
|
+ if (fw_mem[i].attrs & DMA_ATTR_FORCE_CONTIGUOUS) {
|
|
|
+ cnss_pr_dbg("Collect remote heap dump segment\n");
|
|
|
+ cnss_pci_add_dump_seg(pci_priv, dump_seg,
|
|
|
+ CNSS_FW_REMOTE_HEAP, j,
|
|
|
+ fw_mem[i].va,
|
|
|
+ fw_mem[i].pa,
|
|
|
+ fw_mem[i].size);
|
|
|
+ dump_seg++;
|
|
|
+ dump_data->nentries++;
|
|
|
+ j++;
|
|
|
+ } else {
|
|
|
+ cnss_pr_dbg("Skip remote heap dumps as it is non-contiguous\n");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -5037,7 +5051,8 @@ void cnss_pci_clear_dump_info(struct cnss_pci_data *pci_priv)
|
|
|
}
|
|
|
|
|
|
for (i = 0, j = 0; i < plat_priv->fw_mem_seg_len; i++) {
|
|
|
- if (fw_mem[i].type == CNSS_MEM_TYPE_DDR) {
|
|
|
+ if (fw_mem[i].type == CNSS_MEM_TYPE_DDR &&
|
|
|
+ (fw_mem[i].attrs & DMA_ATTR_FORCE_CONTIGUOUS)) {
|
|
|
cnss_pci_remove_dump_seg(pci_priv, dump_seg,
|
|
|
CNSS_FW_REMOTE_HEAP, j,
|
|
|
fw_mem[i].va, fw_mem[i].pa,
|