diff options
author | Lukas Wunner <lukas@wunner.de> | 2019-09-11 12:15:30 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-09-11 15:53:11 +0100 |
commit | 229e6af102e407feada76d3c270395d7cda2cdfe (patch) | |
tree | 69c337a8ce180e90f95de3b08f6b351cf908223b /drivers/spi/spi-bcm2835.c | |
parent | 6f6869dc97e8657e15d728c9a1ee3af2b9343990 (diff) | |
download | lwn-229e6af102e407feada76d3c270395d7cda2cdfe.tar.gz lwn-229e6af102e407feada76d3c270395d7cda2cdfe.zip |
spi: Guarantee cacheline alignment of driver-private data
__spi_alloc_controller() uses a single allocation to accommodate struct
spi_controller and the driver-private data, but places the latter behind
the former. This order does not guarantee cacheline alignment of the
driver-private data. (It does guarantee cacheline alignment of struct
spi_controller but the structure doesn't make any use of that property.)
Round up struct spi_controller to cacheline size. A forthcoming commit
leverages this to grant DMA access to driver-private data of the BCM2835
SPI master.
An alternative, less economical approach would be to use two allocations.
A third approach consists of reversing the order to conserve memory.
But Mark Brown is concerned that it may result in a performance penalty
on architectures that don't like unaligned accesses.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/01625b9b26b93417fb09d2c15ad02dfe9cdbbbe5.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-bcm2835.c')
0 files changed, 0 insertions, 0 deletions