aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-02 19:48:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-02 19:48:17 +0100
commitfebbe9b9c0b5fd77b03d4c6795ef7b8bcabac984 (patch)
tree13834e9343d69114bcfd7c97d1f513d07960acfa
parentdaaf5286b6d2528a73c651aa2d4059bc1bd67c2e (diff)
parentc83ccdc9586b3e9882da9e27507c046751999d59 (diff)
downloadpercpu-febbe9b9c0b5fd77b03d4c6795ef7b8bcabac984.tar.gz
Merge tag 'counter-fixes-for-6.8b' of https://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus
William writes: First set of Counter fixes for 6.8 One fix to ensure private data in struct counter_device_allochelper has minimum alignment for safe DMA operations. * tag 'counter-fixes-for-6.8b' of https://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter: counter: fix privdata alignment
-rw-r--r--drivers/counter/counter-core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/counter/counter-core.c b/drivers/counter/counter-core.c
index 09c77afb33ca84..3f24481fc04a12 100644
--- a/drivers/counter/counter-core.c
+++ b/drivers/counter/counter-core.c
@@ -31,10 +31,11 @@ struct counter_device_allochelper {
struct counter_device counter;
/*
- * This is cache line aligned to ensure private data behaves like if it
- * were kmalloced separately.
+ * This ensures private data behaves like if it were kmalloced
+ * separately. Also ensures the minimum alignment for safe DMA
+ * operations (which may or may not mean cache alignment).
*/
- unsigned long privdata[] ____cacheline_aligned;
+ unsigned long privdata[] __aligned(ARCH_DMA_MINALIGN);
};
static void counter_device_release(struct device *dev)