From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Anilkumar Kolli <akolli@codeaurora.org>,
Kalle Valo <kvalo@codeaurora.org>,
Sasha Levin <sashal@kernel.org>,
ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.3 024/292] ath10k: fix backtrace on coredump
Date: Tue, 10 Dec 2019 16:20:43 -0500 [thread overview]
Message-ID: <20191210212511.11392-24-sashal@kernel.org> (raw)
In-Reply-To: <20191210212511.11392-1-sashal@kernel.org>
From: Anilkumar Kolli <akolli@codeaurora.org>
[ Upstream commit d98ddae85a4a57124f87960047b1b6419312147f ]
In a multiradio board with one QCA9984 and one AR9987
after enabling the crashdump with module parameter
coredump_mask=7, below backtrace is seen.
vmalloc: allocation failure: 0 bytes
kworker/u4:0: page allocation failure: order:0, mode:0x80d2
CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 3.14.77 #130
Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core]
(unwind_backtrace) from [<c021abf8>] (show_stack+0x10/0x14)
(dump_stack+0x80/0xa0)
(warn_alloc_failed+0xd0/0xfc)
(__vmalloc_node_range+0x1b4/0x1d8)
(__vmalloc_node+0x34/0x40)
(vzalloc+0x24/0x30)
(ath10k_coredump_register+0x6c/0x88 [ath10k_core])
(ath10k_core_register_work+0x350/0xb34 [ath10k_core])
(process_one_work+0x20c/0x32c)
(worker_thread+0x228/0x360)
This is due to ath10k_hw_mem_layout is not defined for AR9987.
For coredump undefined hw ramdump_size is 0.
Check for the ramdump_size before allocation memory.
Tested on: AR9987, QCA9984
FW version: 10.4-3.9.0.2-00044
Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath10k/coredump.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/coredump.c b/drivers/net/wireless/ath/ath10k/coredump.c
index b6d2932383cf6..1cfe75a2d0c3a 100644
--- a/drivers/net/wireless/ath/ath10k/coredump.c
+++ b/drivers/net/wireless/ath/ath10k/coredump.c
@@ -1208,9 +1208,11 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
dump_tlv = (struct ath10k_tlv_dump_data *)(buf + sofar);
dump_tlv->type = cpu_to_le32(ATH10K_FW_CRASH_DUMP_RAM_DATA);
dump_tlv->tlv_len = cpu_to_le32(crash_data->ramdump_buf_len);
- memcpy(dump_tlv->tlv_data, crash_data->ramdump_buf,
- crash_data->ramdump_buf_len);
- sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len;
+ if (crash_data->ramdump_buf_len) {
+ memcpy(dump_tlv->tlv_data, crash_data->ramdump_buf,
+ crash_data->ramdump_buf_len);
+ sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len;
+ }
}
mutex_unlock(&ar->dump_mutex);
@@ -1257,6 +1259,9 @@ int ath10k_coredump_register(struct ath10k *ar)
if (test_bit(ATH10K_FW_CRASH_DUMP_RAM_DATA, &ath10k_coredump_mask)) {
crash_data->ramdump_buf_len = ath10k_coredump_get_ramdump_size(ar);
+ if (!crash_data->ramdump_buf_len)
+ return 0;
+
crash_data->ramdump_buf = vzalloc(crash_data->ramdump_buf_len);
if (!crash_data->ramdump_buf)
return -ENOMEM;
--
2.20.1
next prev parent reply other threads:[~2019-12-10 21:25 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 21:20 [PATCH AUTOSEL 5.3 001/292] drm/vc4/vc4_hdmi: fill in connector info Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 002/292] drm: mst: Fix query_payload ack reply struct Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 003/292] drm/mipi-dbi: fix a loop in debugfs code Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 004/292] drm/panel: Add missing drm_panel_init() in panel drivers Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 005/292] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 006/292] drm/amd/display: verify stream link before link test Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 007/292] drm/bridge: analogix-anx78xx: silence -EPROBE_DEFER warnings Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 008/292] iio: max31856: add missing of_node and parent references to iio_dev Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 009/292] iio: light: bh1750: Resolve compiler warning and make code more readable Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 010/292] drm/amdgpu/sriov: add ring_stop before ring_create in psp v11 code Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 011/292] drm/amdgpu: grab the id mgr lock while accessing passid_mapping Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 012/292] ath10k: add cleanup in ath10k_sta_state() Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 013/292] drm/amd/display: Handle virtual signal type in disable_link() Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 014/292] iio: tcs3414: fix iio_triggered_buffer_{pre,post}enable positions Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 015/292] ath10k: Check if station exists before forwarding tx airtime report Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 016/292] spi: Add call to spi_slave_abort() function when spidev driver is released Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 017/292] staging: rtl8192u: fix multiple memory leaks on error path Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 018/292] staging: rtl8188eu: fix possible null dereference Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 019/292] objtool: add kunit_try_catch_throw to the noreturn list Sasha Levin
2019-12-10 21:31 ` Brendan Higgins
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 020/292] rtlwifi: prevent memory leak in rtl_usb_probe Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 021/292] libertas: fix a potential NULL pointer dereference Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 022/292] Revert "pinctrl: sh-pfc: r8a77990: Fix MOD_SEL1 bit30 when using SSI_SCK2 and SSI_WS2" Sasha Levin
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 023/292] Revert "pinctrl: sh-pfc: r8a77990: Fix MOD_SEL1 bit31 when using SIM0_D" Sasha Levin
2019-12-10 21:20 ` Sasha Levin [this message]
2019-12-10 21:20 ` [PATCH AUTOSEL 5.3 025/292] IB/iser: bound protection_sg size by data_sg size Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191210212511.11392-24-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=akolli@codeaurora.org \
--cc=ath10k@lists.infradead.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox