diff options
| author | Neil Armstrong <[email protected]> | 2024-09-30 14:44:23 +0200 |
|---|---|---|
| committer | Neil Armstrong <[email protected]> | 2024-10-14 08:55:28 +0200 |
| commit | 9c223d8d8b8fbad667971f36eabe203480a8c39b (patch) | |
| tree | 27a23cb6fe09768fbf7fa1326df1542cbd7abc97 /drivers | |
| parent | 580fb5773634c4a01f907a164b2a05961840b4c0 (diff) | |
ufs: allocate descriptors with size aligned with DMA_MINALIGN
Align the allocation size with DMA_MINALIGN to make sure we do not
flush/invalidate data from following allocations.
Reviewed-by: Neha Malcom Francis <[email protected]>
Tested-by: Venkatesh Yadav Abbarapu <[email protected]>
Tested-by: Julius Lehmann <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/ufs/ufs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index be64bf971f1..e005cc90608 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -633,7 +633,9 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba) /* Allocate one Transfer Request Descriptor * Should be aligned to 1k boundary. */ - hba->utrdl = memalign(1024, sizeof(struct utp_transfer_req_desc)); + hba->utrdl = memalign(1024, + ALIGN(sizeof(struct utp_transfer_req_desc), + ARCH_DMA_MINALIGN)); if (!hba->utrdl) { dev_err(hba->dev, "Transfer Descriptor memory allocation failed\n"); return -ENOMEM; @@ -642,7 +644,9 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba) /* Allocate one Command Descriptor * Should be aligned to 1k boundary. */ - hba->ucdl = memalign(1024, sizeof(struct utp_transfer_cmd_desc)); + hba->ucdl = memalign(1024, + ALIGN(sizeof(struct utp_transfer_cmd_desc), + ARCH_DMA_MINALIGN)); if (!hba->ucdl) { dev_err(hba->dev, "Command descriptor memory allocation failed\n"); return -ENOMEM; |
