Skip to contentSkip to conversation

small PAGE_SIZE related fixes for wl{12,18}xx drivers

PATCH New Vladimir Murzin 2 participants 4 messages Sep 12, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This small series is considering PAGE_SIZE usage into the wl drivers. I have no real HW to test it tightly, probably these drivers will never run on arches with PAGE_SIZE different to 4K. Nevertheless, I hope this mini-series (or some part of it) will be useful for you.

Thanks.
Vladimir

A message that is not in the archive (sent off-list or not yet received): 1378999943-1968-1-git-send-email-murzin.v-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 3/3 wlcore: limit base for output buffer in dev_mem_read

dev_mem_read tries to speed up things a bit by limiting output buffer which can not exceed WLCORE_MAX_BLOCK_SIZE. However, WLCORE_MAX_BLOCK_SIZE is based on PAGE_SIZE which may vary.

Use 4K size base for buffer explicitly.

---
 drivers/net/wireless/ti/wlcore/debugfs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ti/wlcore/debugfs.c +2 -1
index e17630c..6b413a7 100644
@@ -38,7 +38,8 @@
 /* ms */
 #define WL1271_DEBUGFS_STATS_LIFETIME 1000
 
-#define WLCORE_MAX_BLOCK_SIZE ((size_t)(4*PAGE_SIZE))
+#define WLCORE_PAGE_SIZE	4096
+#define WLCORE_MAX_BLOCK_SIZE ((size_t)(4*WLCORE_PAGE_SIZE))
 
 /* debugfs macros idea from mac80211 */
 int wl1271_format_buffer(char __user *userbuf, size_t count,
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 1/3 wlcore: fix frame size overflow warning in wl12xx_spi_raw_write

In reply to Vladimir Murzin

While cross-building for PPC64 I've got

drivers/net/wireless/ti/wlcore/spi.c: In function 'wl12xx_spi_raw_write': drivers/net/wireless/ti/wlcore/spi.c:317:1:
warning: the frame size of 9712 bytes is larger than 2048 bytes [-Wframe-larger-than=]

WSPI_MAX_NUM_OF_CHUNKS depends on SPI_AGGR_BUFFER_SIZE which in turn is based on PAGE_SIZE. For most systems PAGE_SIZE is stands for 4K, but it may vary - in my case PAGE_SIZE is 64K.

Fix calculation by using 4K explicitly.

---
 drivers/net/wireless/ti/wlcore/spi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ti/wlcore/spi.c +2 -1
index 1b0cd98..8dce028 100644
@@ -70,7 +70,8 @@
  * only support SPI for 12xx - this code should be reworked when 18xx
  * support is introduced
  */
-#define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
+#define SPI_PAGE_SIZE	4096
+#define SPI_AGGR_BUFFER_SIZE (4 * SPI_PAGE_SIZE)
 
 #define WSPI_MAX_NUM_OF_CHUNKS (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE)
 
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 2/3 wl12xx/wl18xx: limit base for aggregate buffer size to 4K

In reply to Vladimir Murzin

WL{12,18}XX_AGGR_BUFFER_SIZE is depends on PAGE_SIZE which may be more than 4K. In this case memory might be aggressively wasted.

Use 4K size base for buffer explicitly.

---
 drivers/net/wireless/ti/wl12xx/wl12xx.h |    3 ++-
 drivers/net/wireless/ti/wl18xx/wl18xx.h |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ti/wl12xx/wl12xx.h +2 -1
index 9e5484a..3649d40 100644
@@ -56,7 +56,8 @@
 #define WL128X_SUBTYPE_MR_VER	WLCORE_FW_VER_IGNORE
 #define WL128X_MINOR_MR_VER	42
 
-#define WL12XX_AGGR_BUFFER_SIZE	(4 * PAGE_SIZE)
+#define WL12XX_PAGE_SIZE	4096
+#define WL12XX_AGGR_BUFFER_SIZE	(4 * WL12XX_PAGE_SIZE)
 
 #define WL12XX_NUM_TX_DESCRIPTORS 16
 #define WL12XX_NUM_RX_DESCRIPTORS 8
drivers/net/wireless/ti/wl18xx/wl18xx.h +2 -1
index 9204e07..a3214b4 100644
@@ -33,7 +33,8 @@
 
 #define WL18XX_CMD_MAX_SIZE          740
 
-#define WL18XX_AGGR_BUFFER_SIZE		(13 * PAGE_SIZE)
+#define WL18XX_PAGE_SIZE		4096
+#define WL18XX_AGGR_BUFFER_SIZE		(13 * WL18XX_PAGE_SIZE)
 
 #define WL18XX_NUM_TX_DESCRIPTORS 32
 #define WL18XX_NUM_RX_DESCRIPTORS 32
Signature · 1 line
1.7.10.4