drivers/base: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN

JIRA: https://issues.redhat.com/browse/RHEL-10094
Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

commit be6a5b5e9e47a7402083d931e18d594338f1849a
Author: Catalin Marinas <catalin.marinas@arm.com>
Date:   Mon Jun 12 16:31:49 2023 +0100

    drivers/base: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN

    ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA
    operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects
    alignment.

    Link: https://lkml.kernel.org/r/20230612153201.554742-6-catalin.marinas@arm.com
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Tested-by: Isaac J. Manjarres <isaacmanjarres@google.com>
    Cc: "Rafael J. Wysocki" <rafael@kernel.org>
    Cc: Alasdair Kergon <agk@redhat.com>
    Cc: Ard Biesheuvel <ardb@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Daniel Vetter <daniel@ffwll.ch>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Cc: Jerry Snitselaar <jsnitsel@redhat.com>
    Cc: Joerg Roedel <joro@8bytes.org>
    Cc: Jonathan Cameron <jic23@kernel.org>
    Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Cc: Lars-Peter Clausen <lars@metafoo.de>
    Cc: Logan Gunthorpe <logang@deltatee.com>
    Cc: Marc Zyngier <maz@kernel.org>
    Cc: Mark Brown <broonie@kernel.org>
    Cc: Mike Snitzer <snitzer@kernel.org>
    Cc: Robin Murphy <robin.murphy@arm.com>
    Cc: Saravana Kannan <saravanak@google.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit be6a5b5e9e47a7402083d931e18d594338f1849a)
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
This commit is contained in:
Jerry Snitselaar 2023-06-12 16:31:49 +01:00
parent 9c7a94cafe
commit 9ce527ae24
1 changed files with 3 additions and 3 deletions

View File

@ -29,10 +29,10 @@ struct devres {
* Some archs want to perform DMA into kmalloc caches
* and need a guaranteed alignment larger than
* the alignment of a 64-bit integer.
* Thus we use ARCH_KMALLOC_MINALIGN here and get exactly the same
* buffer alignment as if it was allocated by plain kmalloc().
* Thus we use ARCH_DMA_MINALIGN for data[] which will force the same
* alignment for struct devres when allocated by kmalloc().
*/
u8 __aligned(ARCH_KMALLOC_MINALIGN) data[];
u8 __aligned(ARCH_DMA_MINALIGN) data[];
};
struct devres_group {