Commit baa9e609 authored by Piotr Haber's avatar Piotr Haber Committed by John W. Linville

brcmfmac: read firmware console without trap indication

Firmware console output can be read also when there was
no trap indication.
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarPiotr Haber <phaber@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5f38b683
...@@ -2804,21 +2804,18 @@ static int brcmf_sdio_trap_info(struct brcmf_sdio *bus, struct sdpcm_shared *sh, ...@@ -2804,21 +2804,18 @@ static int brcmf_sdio_trap_info(struct brcmf_sdio *bus, struct sdpcm_shared *sh,
int error, res; int error, res;
char buf[350]; char buf[350];
struct brcmf_trap_info tr; struct brcmf_trap_info tr;
int nbytes;
loff_t pos = 0; loff_t pos = 0;
if ((sh->flags & SDPCM_SHARED_TRAP) == 0) if ((sh->flags & SDPCM_SHARED_TRAP) == 0) {
brcmf_dbg(INFO, "no trap in firmware\n");
return 0; return 0;
}
error = brcmf_sdbrcm_membytes(bus, false, sh->trap_addr, (u8 *)&tr, error = brcmf_sdbrcm_membytes(bus, false, sh->trap_addr, (u8 *)&tr,
sizeof(struct brcmf_trap_info)); sizeof(struct brcmf_trap_info));
if (error < 0) if (error < 0)
return error; return error;
nbytes = brcmf_sdio_dump_console(bus, sh, data, count);
if (nbytes < 0)
return nbytes;
res = scnprintf(buf, sizeof(buf), res = scnprintf(buf, sizeof(buf),
"dongle trap info: type 0x%x @ epc 0x%08x\n" "dongle trap info: type 0x%x @ epc 0x%08x\n"
" cpsr 0x%08x spsr 0x%08x sp 0x%08x\n" " cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
...@@ -2834,12 +2831,7 @@ static int brcmf_sdio_trap_info(struct brcmf_sdio *bus, struct sdpcm_shared *sh, ...@@ -2834,12 +2831,7 @@ static int brcmf_sdio_trap_info(struct brcmf_sdio *bus, struct sdpcm_shared *sh,
le32_to_cpu(tr.r4), le32_to_cpu(tr.r5), le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
le32_to_cpu(tr.r6), le32_to_cpu(tr.r7)); le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
error = simple_read_from_buffer(data+nbytes, count, &pos, buf, res); return simple_read_from_buffer(data, count, &pos, buf, res);
if (error < 0)
return error;
nbytes += error;
return nbytes;
} }
static int brcmf_sdio_assert_info(struct brcmf_sdio *bus, static int brcmf_sdio_assert_info(struct brcmf_sdio *bus,
...@@ -2921,14 +2913,20 @@ static int brcmf_sdbrcm_died_dump(struct brcmf_sdio *bus, char __user *data, ...@@ -2921,14 +2913,20 @@ static int brcmf_sdbrcm_died_dump(struct brcmf_sdio *bus, char __user *data,
error = brcmf_sdio_assert_info(bus, &sh, data, count); error = brcmf_sdio_assert_info(bus, &sh, data, count);
if (error < 0) if (error < 0)
goto done; goto done;
nbytes = error; nbytes = error;
error = brcmf_sdio_trap_info(bus, &sh, data, count);
error = brcmf_sdio_trap_info(bus, &sh, data+nbytes, count);
if (error < 0) if (error < 0)
goto done; goto done;
nbytes += error;
error = brcmf_sdio_dump_console(bus, &sh, data+nbytes, count);
if (error < 0)
goto done;
nbytes += error;
error += nbytes; error = nbytes;
*ppos += error; *ppos += nbytes;
done: done:
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment