Skip to content

Commit

Permalink
UBUNTU: SAUCE: ath10k: don't fail if IRAM write fails
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1939937

After reboot with kernel & firmware updates I found `failed to copy
target iram contents:` in dmesg and missing wlan interfaces for both
of my QCA9984 compex cards. Rolling back kernel/firmware didn't fixed
it, so while I have no idea what's actually happening, I don't see why
we should fail in this case, looks like some optional firmware ability
that could be skipped.

Also with additional logging there is
```
[    6.839858] ath10k_pci 0000:04:00.0: No hardware memory
[    6.841205] ath10k_pci 0000:04:00.0: failed to copy target iram contents: -12
[    6.873578] ath10k_pci 0000:07:00.0: No hardware memory
[    6.875052] ath10k_pci 0000:07:00.0: failed to copy target iram contents: -12
```
so exact branch could be seen.

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
Tested-by: Axel Rasmussen <axelrasmussen@google.com>
(cherry picked from http://lists.infradead.org/pipermail/ath10k/2021-July/012729.html)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
  • Loading branch information
Slava Kardakov authored and Timo Aaltonen committed Aug 23, 2021
1 parent ef4c638 commit 3aca304
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2691,8 +2691,10 @@ static int ath10k_core_copy_target_iram(struct ath10k *ar)
u32 len, remaining_len;

hw_mem = ath10k_coredump_get_mem_layout(ar);
if (!hw_mem)
if (!hw_mem) {
ath10k_warn(ar, "No hardware memory");
return -ENOMEM;
}

for (i = 0; i < hw_mem->region_table.size; i++) {
tmp = &hw_mem->region_table.regions[i];
Expand All @@ -2702,8 +2704,10 @@ static int ath10k_core_copy_target_iram(struct ath10k *ar)
}
}

if (!mem_region)
if (!mem_region) {
ath10k_warn(ar, "No memory region");
return -ENOMEM;
}

for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
if (ar->wmi.mem_chunks[i].req_id ==
Expand Down Expand Up @@ -2917,7 +2921,6 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
if (status) {
ath10k_warn(ar, "failed to copy target iram contents: %d",
status);
goto err_hif_stop;
}
}

Expand Down

0 comments on commit 3aca304

Please sign in to comment.