netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* small PAGE_SIZE related fixes for wl{12,18}xx drivers
@ 2013-09-12 15:32 Vladimir Murzin
  2013-09-12 15:32 ` [PATCH 1/3] wlcore: fix frame size overflow warning in wl12xx_spi_raw_write Vladimir Murzin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Murzin @ 2013-09-12 15:32 UTC (permalink / raw)
  To: linux-wireless, netdev; +Cc: coelho, linville


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] wlcore: fix frame size overflow warning in wl12xx_spi_raw_write
  2013-09-12 15:32 small PAGE_SIZE related fixes for wl{12,18}xx drivers Vladimir Murzin
@ 2013-09-12 15:32 ` Vladimir Murzin
  2013-09-12 15:32 ` [PATCH 2/3] wl12xx/wl18xx: limit base for aggregate buffer size to 4K Vladimir Murzin
       [not found] ` <1378999943-1968-1-git-send-email-murzin.v-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Murzin @ 2013-09-12 15:32 UTC (permalink / raw)
  To: linux-wireless, netdev; +Cc: coelho, linville, 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.

Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
---
 drivers/net/wireless/ti/wlcore/spi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 1b0cd98..8dce028 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -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)
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] wl12xx/wl18xx: limit base for aggregate buffer size to 4K
  2013-09-12 15:32 small PAGE_SIZE related fixes for wl{12,18}xx drivers Vladimir Murzin
  2013-09-12 15:32 ` [PATCH 1/3] wlcore: fix frame size overflow warning in wl12xx_spi_raw_write Vladimir Murzin
@ 2013-09-12 15:32 ` Vladimir Murzin
       [not found] ` <1378999943-1968-1-git-send-email-murzin.v-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Murzin @ 2013-09-12 15:32 UTC (permalink / raw)
  To: linux-wireless, netdev; +Cc: coelho, linville, 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.

Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
---
 drivers/net/wireless/ti/wl12xx/wl12xx.h |    3 ++-
 drivers/net/wireless/ti/wl18xx/wl18xx.h |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ti/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h
index 9e5484a..3649d40 100644
--- a/drivers/net/wireless/ti/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h
@@ -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
diff --git a/drivers/net/wireless/ti/wl18xx/wl18xx.h b/drivers/net/wireless/ti/wl18xx/wl18xx.h
index 9204e07..a3214b4 100644
--- a/drivers/net/wireless/ti/wl18xx/wl18xx.h
+++ b/drivers/net/wireless/ti/wl18xx/wl18xx.h
@@ -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
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] wlcore: limit base for output buffer in dev_mem_read
       [not found] ` <1378999943-1968-1-git-send-email-murzin.v-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-09-12 15:32   ` Vladimir Murzin
  0 siblings, 0 replies; 4+ messages in thread
From: Vladimir Murzin @ 2013-09-12 15:32 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: coelho-l0cyMroinI0, linville-2XuSBdqkA4R54TAoqtyWWQ,
	Vladimir Murzin

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.

Signed-off-by: Vladimir Murzin <murzin.v-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/net/wireless/ti/wlcore/debugfs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index e17630c..6b413a7 100644
--- a/drivers/net/wireless/ti/wlcore/debugfs.c
+++ b/drivers/net/wireless/ti/wlcore/debugfs.c
@@ -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,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-12 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12 15:32 small PAGE_SIZE related fixes for wl{12,18}xx drivers Vladimir Murzin
2013-09-12 15:32 ` [PATCH 1/3] wlcore: fix frame size overflow warning in wl12xx_spi_raw_write Vladimir Murzin
2013-09-12 15:32 ` [PATCH 2/3] wl12xx/wl18xx: limit base for aggregate buffer size to 4K Vladimir Murzin
     [not found] ` <1378999943-1968-1-git-send-email-murzin.v-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-12 15:32   ` [PATCH 3/3] wlcore: limit base for output buffer in dev_mem_read Vladimir Murzin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).