Skip to content

Commit 01de6fe

Browse files
Russell KingKalle Valo
authored andcommitted
wlcore: fix read pointer update
When reading the fw_log structure from the device's memory, we could race with the firmware updating the actual_buff_size and buff_write_ptr members of this structure. This would lead to bytes being dropped from the log. Fix this by writing back the actual - now fixed - clear_ptr which reflects where we read up to in the buffer. This also means that we must not check that the clear_ptr matches the current write pointer, so remove that check. Signed-off-by: Russell King <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 87ab9cb commit 01de6fe

File tree

1 file changed

+2
-8
lines changed
  • drivers/net/wireless/ti/wlcore

1 file changed

+2
-8
lines changed

drivers/net/wireless/ti/wlcore/event.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,9 @@ int wlcore_event_fw_logger(struct wl1271 *wl)
9696
clear_ptr = addr_ptr + WL18XX_LOGGER_BUFF_OFFSET + len;
9797
}
9898

99-
/* double check that clear address and write pointer are the same */
100-
if (clear_ptr != le32_to_cpu(fw_log.buff_write_ptr)) {
101-
wl1271_error("Calculate of clear addr Clear = %x, write = %x",
102-
clear_ptr, le32_to_cpu(fw_log.buff_write_ptr));
103-
}
104-
105-
/* indicate FW about Clear buffer */
99+
/* Update the read pointer */
106100
ret = wlcore_write32(wl, addr + WL18XX_LOGGER_READ_POINT_OFFSET,
107-
fw_log.buff_write_ptr);
101+
clear_ptr);
108102
free_out:
109103
kfree(buffer);
110104
out:

0 commit comments

Comments
 (0)