[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1lolvi-0003Ri-39@rmk-PC.armlinux.org.uk>
Date: Thu, 03 Jun 2021 12:54:30 +0100
From: Russell King <rmk+kernel@...linux.org.uk>
To: Kalle Valo <kvalo@...eaurora.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH wireless-drivers-next 4/4] net: 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 <rmk+kernel@...linux.org.uk>
---
drivers/net/wireless/ti/wlcore/event.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c
index 8a67a708c96e..46ab69eab26a 100644
--- a/drivers/net/wireless/ti/wlcore/event.c
+++ b/drivers/net/wireless/ti/wlcore/event.c
@@ -96,15 +96,9 @@ int wlcore_event_fw_logger(struct wl1271 *wl)
clear_ptr = addr_ptr + WL18XX_LOGGER_BUFF_OFFSET + len;
}
- /* double check that clear address and write pointer are the same */
- if (clear_ptr != le32_to_cpu(fw_log.buff_write_ptr)) {
- wl1271_error("Calculate of clear addr Clear = %x, write = %x",
- clear_ptr, le32_to_cpu(fw_log.buff_write_ptr));
- }
-
- /* indicate FW about Clear buffer */
+ /* Update the read pointer */
ret = wlcore_write32(wl, addr + WL18XX_LOGGER_READ_POINT_OFFSET,
- fw_log.buff_write_ptr);
+ clear_ptr);
free_out:
kfree(buffer);
out:
--
2.20.1
Powered by blists - more mailing lists