Commit 7a1fa8a4 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: fix comment correctness

Using DMA with stack allocated buffers is not supported, whatever the
value of CONFIG_VMAP_STACK.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-5-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8589360
......@@ -14,18 +14,6 @@
#include "bus.h"
#include "traces.h"
/*
* Internal helpers.
*
* About CONFIG_VMAP_STACK:
* When CONFIG_VMAP_STACK is enabled, it is not possible to run DMA on stack
* allocated data. Functions below that work with registers (aka functions
* ending with "32") automatically reallocate buffers with kmalloc. However,
* functions that work with arbitrary length buffers let's caller to handle
* memory location. In doubt, enable CONFIG_DEBUG_SG to detect badly located
* buffer.
*/
static int read32(struct wfx_dev *wdev, int reg, u32 *val)
{
int ret;
......
......@@ -12,6 +12,10 @@
struct wfx_dev;
/* Caution: in the functions below, 'buf' will used with a DMA. So, it must be
* kmalloc'd (do not use stack allocated buffers). In doubt, enable
* CONFIG_DEBUG_SG to detect badly located buffer.
*/
int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t buf_len);
int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t buf_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment