staging: wfx: fix comment correctness
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Thu, 13 Jan 2022 08:54:57 +0000 (09:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jan 2022 15:19:40 +0000 (16:19 +0100)
Using DMA with stack allocated buffers is not supported, whatever the
value of CONFIG_VMAP_STACK.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/hwio.c
drivers/staging/wfx/hwio.h

index 30eb888830d2843d9c9414f34d42e5c029a68766..393bcb1e2f4ec20cd848f5803308f79e7ba0fe56 100644 (file)
 #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;
index ff09575dd1aff562488f65a7d74ff57009b1456f..d34baae470174b7b0cfdc3401cdc0d86a7adc885 100644 (file)
 
 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);