Skip to content

Commit e675a4f

Browse files
Yihang Limartinkpetersen
authored andcommitted
scsi: libsas: Align SMP request allocation to ARCH_DMA_MINALIGN
This series [1] reduced the kmalloc() minimum alignment on arm64 to 8 bytes (from 128). In libsas, this will cause SMP requests to be 8-byte aligned through kmalloc() allocation. However, for hisi_sas hardware, all command addresses must be 16-byte-aligned. Otherwise, the commands fail to be executed. ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations, so use ARCH_DMA_MINALIGN as the alignment for SMP request. Link: https://lkml.kernel.org/r/[email protected] [1] Signed-off-by: Yihang Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Jason Yan <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 0296bea commit e675a4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/libsas/sas_expander.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
135135

136136
static inline void *alloc_smp_req(int size)
137137
{
138-
u8 *p = kzalloc(size, GFP_KERNEL);
138+
u8 *p = kzalloc(ALIGN(size, ARCH_DMA_MINALIGN), GFP_KERNEL);
139139
if (p)
140140
p[0] = SMP_REQUEST;
141141
return p;

0 commit comments

Comments
 (0)