aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorMiaoqing Pan <miaoqing@codeaurora.org>2016-03-07 22:19:37 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2016-03-11 07:00:04 -0500
commit181c007dedacefaaf634b72b1f52c3b0415f87c1 (patch)
tree7782b79816d92987185023bf0ee7f1e8a645faca /drivers/net/wireless/ath/ath9k/debug.c
parentc9b260a684d0493238433e08fc2ac7865a89aece (diff)
ath9k: fix reg dump data bus error
Changes: - restrict only dump MAC registers - skip the register memory holes Data bus error, epc == 831d4040, ra == 831d403c Oops[#1]: CPU: 0 PID: 1536 Comm: cat Not tainted 3.14.0 #3 task: 82f87840 ti: 82f88000 task.ti: 82f88000 $ 0 : 00000000 00000001 deadc0de 1000fc03 $ 4 : b8100200 00000200 831e0000 80218788 $ 8 : 00000030 00000003 00000001 09524547 $12 : 00000000 810594f4 00000000 3a206d61 $16 : 831dd3c0 00000081 00000a00 c05ff000 $20 : 00005af6 00000200 00071b39 00071139 $24 : 00000001 80217760 $28 : 82f88000 82f89c60 c05ffa00 831d403c Hi : 00000000 Lo : 453c0000 epc : 831d4040 ath_ahb_exit+0x2198/0x2904 [ath9k] Not tainted ra : 831d403c ath_ahb_exit+0x2194/0x2904 [ath9k] Status: 1000fc03 KERNEL EXL IE Cause : 4080801c PrId : 00019374 (MIPS 24Kc) Stack : 00000001 00000000 0000000e 80475c60 0000000e 800a8ebc 00000000 00000000 00000001 00000007 00000000 800a9678 00000000 00000004 00000002 00000010 00000000 00000000 00000000 00000000 80475c60 0000000e 000009ec c05ff000 831dd3c0 00000080 00000a00 c05ff000 00005af6 00000200 00071b39 0007114d c05ff9ec 800a9904 831dd3c0 82f89d10 00000001 81082194 831d8f0c 82f89d14 ... Call Trace: [<831d4040>] ath_ahb_exit+0x2198/0x2904 [ath9k] [<831d403c>] ath_ahb_exit+0x2194/0x2904 [ath9k] Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 6de64cface3c..c56e40ff35e5 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -916,10 +916,21 @@ static int open_file_regdump(struct inode *inode, struct file *file)
916 struct ath_softc *sc = inode->i_private; 916 struct ath_softc *sc = inode->i_private;
917 unsigned int len = 0; 917 unsigned int len = 0;
918 u8 *buf; 918 u8 *buf;
919 int i; 919 int i, j = 0;
920 unsigned long num_regs, regdump_len, max_reg_offset; 920 unsigned long num_regs, regdump_len, max_reg_offset;
921 const struct reg_hole {
922 u32 start;
923 u32 end;
924 } reg_hole_list[] = {
925 {0x0200, 0x07fc},
926 {0x0c00, 0x0ffc},
927 {0x2000, 0x3ffc},
928 {0x4100, 0x6ffc},
929 {0x705c, 0x7ffc},
930 {0x0000, 0x0000}
931 };
921 932
922 max_reg_offset = AR_SREV_9300_20_OR_LATER(sc->sc_ah) ? 0x16bd4 : 0xb500; 933 max_reg_offset = AR_SREV_9300_20_OR_LATER(sc->sc_ah) ? 0x8800 : 0xb500;
923 num_regs = max_reg_offset / 4 + 1; 934 num_regs = max_reg_offset / 4 + 1;
924 regdump_len = num_regs * REGDUMP_LINE_SIZE + 1; 935 regdump_len = num_regs * REGDUMP_LINE_SIZE + 1;
925 buf = vmalloc(regdump_len); 936 buf = vmalloc(regdump_len);
@@ -927,9 +938,16 @@ static int open_file_regdump(struct inode *inode, struct file *file)
927 return -ENOMEM; 938 return -ENOMEM;
928 939
929 ath9k_ps_wakeup(sc); 940 ath9k_ps_wakeup(sc);
930 for (i = 0; i < num_regs; i++) 941 for (i = 0; i < num_regs; i++) {
942 if (reg_hole_list[j].start == i << 2) {
943 i = reg_hole_list[j].end >> 2;
944 j++;
945 continue;
946 }
947
931 len += scnprintf(buf + len, regdump_len - len, 948 len += scnprintf(buf + len, regdump_len - len,
932 "0x%06x 0x%08x\n", i << 2, REG_READ(sc->sc_ah, i << 2)); 949 "0x%06x 0x%08x\n", i << 2, REG_READ(sc->sc_ah, i << 2));
950 }
933 ath9k_ps_restore(sc); 951 ath9k_ps_restore(sc);
934 952
935 file->private_data = buf; 953 file->private_data = buf;