From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Yihang Li <liyihang9@huawei.com>,
Damien Le Moal <dlemoal@kernel.org>,
John Garry <john.g.garry@oracle.com>,
Jason Yan <yanaijie@huawei.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sasha Levin <sashal@kernel.org>,
jejb@linux.ibm.com, yangxingui@huawei.com,
linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 6.6 05/12] scsi: libsas: Align SMP request allocation to ARCH_DMA_MINALIGN
Date: Mon, 15 Apr 2024 06:03:40 -0400 [thread overview]
Message-ID: <20240415100358.3127162-5-sashal@kernel.org> (raw)
In-Reply-To: <20240415100358.3127162-1-sashal@kernel.org>
From: Yihang Li <liyihang9@huawei.com>
[ Upstream commit e675a4fd6d1f8990d3bed5dada3d20edfa000423 ]
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/20230612153201.554742-1-catalin.marinas@arm.com [1]
Signed-off-by: Yihang Li <liyihang9@huawei.com>
Link: https://lore.kernel.org/r/20240328090626.621147-1-liyihang9@huawei.com
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/libsas/sas_expander.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 5c261005b74e4..f6e6db8b8aba9 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -135,7 +135,7 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
static inline void *alloc_smp_req(int size)
{
- u8 *p = kzalloc(size, GFP_KERNEL);
+ u8 *p = kzalloc(ALIGN(size, ARCH_DMA_MINALIGN), GFP_KERNEL);
if (p)
p[0] = SMP_REQUEST;
return p;
--
2.43.0
next prev parent reply other threads:[~2024-04-15 12:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 10:03 [PATCH AUTOSEL 6.6 01/12] ASoC: SOF: Intel: hda-dsp: Skip IMR boot on ACE platforms in case of S3 suspend Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 02/12] regulator: tps65132: Add of_match table Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 03/12] bpf: put uprobe link's path and task in release callback Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 04/12] scsi: ufs: core: WLUN suspend dev/link state error recovery Sasha Levin
2024-04-15 10:03 ` Sasha Levin [this message]
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 06/12] scsi: ufs: core: Fix MCQ mode dev command timeout Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 07/12] ALSA: line6: Zero-initialize message buffers Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 08/12] block: fix overflow in blk_ioctl_discard() Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 09/12] net: bcmgenet: Reset RBUF on first open Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 10/12] vboxsf: explicitly deny setlease attempts Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 11/12] ata: sata_gemini: Check clk_enable() result Sasha Levin
2024-04-15 10:03 ` [PATCH AUTOSEL 6.6 12/12] firewire: ohci: mask bus reset interrupts between ISR and bottom half Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240415100358.3127162-5-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=dlemoal@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=john.g.garry@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=liyihang9@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
--cc=yanaijie@huawei.com \
--cc=yangxingui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox