diff mbox series

[3.16-stable,12/14] wlcore: fix 64K page support

Message ID 20170509100502.1358298-13-arnd@arndb.de
State New
Headers show
Series [3.16-stable,01/14] staging: r8192ee: prorperly format warning message | expand

Commit Message

Arnd Bergmann May 9, 2017, 10:05 a.m. UTC
In the stable linux-3.16 branch, I ran into a warning in the
wlcore driver:

drivers/net/wireless/ti/wlcore/spi.c: In function 'wl12xx_spi_raw_write':
drivers/net/wireless/ti/wlcore/spi.c:315:1: error: the frame size of 12848 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

Newer kernels no longer show the warning, but the bug is still there,
as the allocation is based on the CPU page size rather than the
actual capabilities of the hardware.

This replaces the PAGE_SIZE macro with the SZ_4K macro, i.e. 4096 bytes
per buffer.

Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/net/wireless/ti/wlcore/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.0

Comments

Ben Hutchings Nov. 6, 2017, 7:52 p.m. UTC | #1
On Tue, 2017-05-09 at 12:05 +0200, Arnd Bergmann wrote:
> In the stable linux-3.16 branch, I ran into a warning in the

> wlcore driver:

> 

> drivers/net/wireless/ti/wlcore/spi.c: In function 'wl12xx_spi_raw_write':

> drivers/net/wireless/ti/wlcore/spi.c:315:1: error: the frame size of 12848 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

> 

> Newer kernels no longer show the warning, but the bug is still there,

> as the allocation is based on the CPU page size rather than the

> actual capabilities of the hardware.

> 

> This replaces the PAGE_SIZE macro with the SZ_4K macro, i.e. 4096 bytes

> per buffer.


I replaced this with the upstream version (commit
4a4274bf2dbbd1c7a45be0c89a1687c9d2eef4a0).

Ben.

> Cc: stable@vger.kernel.org

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  drivers/net/wireless/ti/wlcore/spi.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c

> index a460fe669443..48559a5baffa 100644

> --- a/drivers/net/wireless/ti/wlcore/spi.c

> +++ b/drivers/net/wireless/ti/wlcore/spi.c

> @@ -71,7 +71,7 @@

>   * 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_AGGR_BUFFER_SIZE (4 * SZ_4K)

>  

>  /* Maximum number of SPI write chunks */

>  #define WSPI_MAX_NUM_OF_CHUNKS \

-- 
Ben Hutchings
It is a miracle that curiosity survives formal education. - Albert
Einstein
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index a460fe669443..48559a5baffa 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -71,7 +71,7 @@ 
  * 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_AGGR_BUFFER_SIZE (4 * SZ_4K)
 
 /* Maximum number of SPI write chunks */
 #define WSPI_MAX_NUM_OF_CHUNKS \