]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.103/ath10k-ignore-configuring-the-incorrect-board_id.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.103 / ath10k-ignore-configuring-the-incorrect-board_id.patch
1 From foo@baz Tue Nov 28 10:56:34 CET 2017
2 From: Ryan Hsu <ryanhsu@qca.qualcomm.com>
3 Date: Thu, 22 Dec 2016 15:02:37 -0800
4 Subject: ath10k: ignore configuring the incorrect board_id
5
6 From: Ryan Hsu <ryanhsu@qca.qualcomm.com>
7
8
9 [ Upstream commit d2e202c06ca42d353d95df12437740921a6d05b5 ]
10
11 With command to get board_id from otp, in the case of following
12
13 boot get otp board id result 0x00000000 board_id 0 chip_id 0
14 boot using board name 'bus=pci,bmi-chip-id=0,bmi-board-id=0"
15 ...
16 failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-board-id=0 from
17 ath10k/QCA6174/hw3.0/board-2.bin
18
19 The invalid board_id=0 will be used as index to search in the board-2.bin.
20
21 Ignore the case with board_id=0, as it means the otp is not carrying
22 the board id information.
23
24 Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
25 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
26 Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 ---
29 drivers/net/wireless/ath/ath10k/core.c | 5 ++++-
30 1 file changed, 4 insertions(+), 1 deletion(-)
31
32 --- a/drivers/net/wireless/ath/ath10k/core.c
33 +++ b/drivers/net/wireless/ath/ath10k/core.c
34 @@ -548,8 +548,11 @@ static int ath10k_core_get_board_id_from
35 "boot get otp board id result 0x%08x board_id %d chip_id %d\n",
36 result, board_id, chip_id);
37
38 - if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0)
39 + if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 ||
40 + (board_id == 0)) {
41 + ath10k_warn(ar, "board id is not exist in otp, ignore it\n");
42 return -EOPNOTSUPP;
43 + }
44
45 ar->id.bmi_ids_valid = true;
46 ar->id.bmi_board_id = board_id;