On 9/13/2022 3:14 PM, Kalle Valo wrote:
Baochen Qiang <quic_bqiang@xxxxxxxxxxx> writes:
+ u32 i;
+
+ /* for offset beyond BAR + 4K - 32, may
+ * need to wakeup the device to access.
+ */
+ wakeup_required = test_bit(ATH11K_FLAG_DEVICE_INIT_DONE, &ab->dev_flags) &&
+ end >= ATH11K_PCI_ACCESS_ALWAYS_OFF;
+ if (wakeup_required && ab->pci.ops->wakeup) {
+ ret = ab->pci.ops->wakeup(ab);
+ if (ret)
+ ath11k_warn(ab, "%s: failed to do wakeup: %d\n", __func__, ret);
+ }
I changed the error handling so that if wakeup() fails we do not
continue and just return an error.
I prefer to keep the original design, because in that case we still
have something to check after firmware crashes.
I admit that the dump content may be invalid if wakeup fails, but we
can know that by checking kernel log, so we can avoid misleading.
Too late now, I already applied the patch. You need to submit a new
patch to change the logic. And if we really want to ignore the wakeup
failure there should be a proper comment in the code explaining the idea,
and maybe improve the warning message to make it more understandable for
the user.
Sure Kalle, I will send a new patch for that.