From: Frank Li <Frank.li@oss.nxp.com>
To: Rosen Penev <rosenp@gmail.com>
Cc: dmaengine@vger.kernel.org, Vinod Koul <vkoul@kernel.org>,
Frank Li <Frank.Li@kernel.org>,
Harninder Rai <harninder.rai@freescale.com>,
Xuelin Shi <xuelin.shi@freescale.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: fsl_raid: byte-swap cdb32 when programming CDBs
Date: Fri, 11 Sep 2026 10:17:12 -0500 [thread overview]
Message-ID: <aqQbeOV3IWzJc4Q0@SMW015318> (raw)
In-Reply-To: <20260910194324.33697-1-rosenp@gmail.com>
On Thu, Sep 10, 2026 at 12:43:24PM -0700, Rosen Penev wrote:
> The three prep functions write the first word of the command descriptor
> block (cdb32) with a plain u32 assignment, while every other CDB/CF
> descriptor field is written with cpu_to_be32(). The RAID Engine expects
> big-endian descriptors, so the plain assignment produces a corrupted CDB
> on little-endian hosts. Use cpu_to_be32() for cdb32 to match the
> surrounding code.
>
> Fixes: ad80da658bbc ("dmaengine: Driver support for FSL RaidEngine device.")
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/fsl_raid.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c
> index befb4bb69d54..9cc289f7129e 100644
> --- a/drivers/dma/fsl_raid.c
> +++ b/drivers/dma/fsl_raid.c
> @@ -361,7 +361,7 @@ static struct dma_async_tx_descriptor *fsl_re_prep_dma_genq(
> cdb |= FSL_RE_INTR_ON_ERROR << FSL_RE_CDB_ERROR_SHIFT;
> cdb |= FSL_RE_DATA_DEP << FSL_RE_CDB_DEPEND_SHIFT;
> xor = desc->cdb_addr;
> - xor->cdb32 = cdb;
> + xor->cdb32 = cpu_to_be32(cdb);
>
> if (scf) {
> /* compute q = src0*coef0^src1*coef1^..., * is GF(8) mult */
> @@ -481,7 +481,7 @@ static struct dma_async_tx_descriptor *fsl_re_prep_dma_pq(
> cdb |= FSL_RE_DATA_DEP << FSL_RE_CDB_DEPEND_SHIFT;
>
> pq = desc->cdb_addr;
> - pq->cdb32 = cdb;
> + pq->cdb32 = cpu_to_be32(cdb);
>
> p = pq->gfm_q1;
> /* Init gfm_q1[] */
> @@ -564,7 +564,7 @@ static struct dma_async_tx_descriptor *fsl_re_prep_dma_memcpy(
> cdb |= FSL_RE_DATA_DEP << FSL_RE_CDB_DEPEND_SHIFT;
>
> move = desc->cdb_addr;
> - move->cdb32 = cdb;
> + move->cdb32 = cpu_to_be32(cdb);
>
> /* Filling frame 0 of CFD with move CDB */
> cf = desc->cf_addr;
> --
> 2.55.0
>
next prev parent reply other threads:[~2026-09-11 15:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 19:43 Rosen Penev
2026-09-11 15:17 ` Frank Li [this message]
2026-09-15 17:36 ` Vinod Koul
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=aqQbeOV3IWzJc4Q0@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=harninder.rai@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rosenp@gmail.com \
--cc=vkoul@kernel.org \
--cc=xuelin.shi@freescale.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
all inboxes | Powered by JetHome®