From: Alex Naylor <alex.r.naylor@gmail.com>
To: Frank.Li@oss.nxp.com
Cc: Song Liu <song@kernel.org>, Yu Kuai <yukuai@fygo.io>,
Dan Williams <djbw@kernel.org>,
linux-raid@vger.kernel.org
Subject: Re: [PATCH RFC 2/4] md/raid5-ppl: replace async_tx with synchronous xor
Date: Sun, 18 Oct 2026 17:27:31 -0700 [thread overview]
Message-ID: <ab359253-846e-4a8b-944e-06718b17a315@gmail.com> (raw)
In-Reply-To: <20261015-asycn_tx_remove-v1-2-056a7085e0a1@nxp.com>
Hi Frank,
I encountered a PPL recovery failure that appears relevant to this
proposal, on a QNAP TS-410 (Marvell Kirkwood, ARMv5).
The system runs a custom Linux 6.1-based kernel with CONFIG_MV_XOR=y and
CONFIG_ASYNC_TX_DMA=y, plus a local PCIe startup-reset patch. Storage is
a four-member RAID5 with metadata 1.2, 512 KiB chunks and PPL enabled.
After a power outage, array startup hit:
kernel BUG at crypto/async_tx/async_tx.c:269!
PC: async_tx_quiesce
LR: ppl_xor [raid456]
The call trace included:
async_tx_quiesce
ppl_xor
ppl_recover_entry
ppl_init_log
raid5_run
md_run
do_md_run
All four members had matching event counts and valid superblock
checksums, with no members marked failed.
The apparent issue is that ppl_xor() submits with ASYNC_TX_ACK, then
passes the returned descriptor to async_tx_quiesce(), which asserts that
it is not already acknowledged.
Disabling both Marvell XOR engines through their device-tree status
properties, while retaining the same kernel binary and modules, allowed
the existing array to assemble and the filesystem to recover. No forced
assembly, array recreation or PPL-policy change was used. File transfers
are working again.
I have not tested this RFC or reproduced the crash on a current kernel.
Source inspection found the same ACK/quiesce sequence in v6.1.190 and
current mainline.
I’m sharing this because the ppl_xor() change below removes the exact
ACK/quiesce sequence implicated in my crash. I haven’t tested your
patch, but disabling hardware XOR allowed recovery to complete on the
same kernel.
Thanks,
Alex
On 2026-10-15 12:22, Frank.Li@oss.nxp.com wrote:
> From: Frank Li <Frank.Li@nxp.com>
>
> Remove the async_tx dependency from ops_run_partial_parity() and
> ppl_xor(). The function now returns void and operates synchronously:
>
> - count==1: copy_page() replaces async_memcpy
> - count>1: memcpy + xor_blocks() replaces async_xor
> - ppl_xor(): xor_blocks() replaces async_xor + async_tx_quiesce
>
> Drop #include <linux/async_tx.h> and add #include <linux/xor.h>.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/md/raid5-ppl.c | 40 ++++++++++++++++------------------------
> 1 file changed, 16 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
> index 7f8a9d3fd578d..bd844b4e8b372 100644
> --- a/drivers/md/raid5-ppl.c
> +++ b/drivers/md/raid5-ppl.c
> @@ -8,7 +8,7 @@
> #include <linux/blkdev.h>
> #include <linux/slab.h>
> #include <linux/crc32c.h>
> -#include <linux/async_tx.h>
> +#include <linux/raid/xor.h>
> #include <linux/raid/md_p.h>
> #include "md.h"
> #include "raid5.h"
> @@ -154,14 +154,11 @@ struct ppl_io_unit {
> struct bio_vec biovec[PPL_IO_INLINE_BVECS];
> };
>
> -struct dma_async_tx_descriptor *
> -ops_run_partial_parity(struct stripe_head *sh, struct raid5_percpu *percpu,
> - struct dma_async_tx_descriptor *tx)
> +void ops_run_partial_parity(struct stripe_head *sh, struct raid5_percpu *percpu)
> {
> int disks = sh->disks;
> struct page **srcs = percpu->scribble;
> int count = 0, pd_idx = sh->pd_idx, i;
> - struct async_submit_ctl submit;
>
> pr_debug("%s: stripe %llu\n", __func__, (unsigned long long)sh->sector);
>
> @@ -186,20 +183,20 @@ ops_run_partial_parity(struct stripe_head *sh, struct raid5_percpu *percpu,
> srcs[count++] = dev->page;
> }
> } else {
> - return tx;
> + return;
> }
>
> - init_async_submit(&submit, ASYNC_TX_FENCE|ASYNC_TX_XOR_ZERO_DST, tx,
> - NULL, sh, (void *) (srcs + sh->disks + 2));
> -
> - if (count == 1)
> - tx = async_memcpy(sh->ppl_page, srcs[0], 0, 0, PAGE_SIZE,
> - &submit);
> - else
> - tx = async_xor(sh->ppl_page, srcs, 0, count, PAGE_SIZE,
> - &submit);
> + if (count == 1) {
> + copy_page(page_address(sh->ppl_page), page_address(srcs[0]));
> + } else {
> + void *dest = page_address(sh->ppl_page);
> + void **ptrs = (void **)srcs;
> + int j;
>
> - return tx;
> + for (j = 0; j < count; j++)
> + ptrs[j] = page_address(srcs[j]);
> + xor_gen(dest, ptrs, count, PAGE_SIZE);
> + }
> }
>
> static void *ppl_io_pool_alloc(gfp_t gfp_mask, void *pool_data)
> @@ -706,15 +703,10 @@ void ppl_stripe_write_finished(struct stripe_head *sh)
>
> static void ppl_xor(int size, struct page *page1, struct page *page2)
> {
> - struct async_submit_ctl submit;
> - struct dma_async_tx_descriptor *tx;
> - struct page *xor_srcs[] = { page1, page2 };
> -
> - init_async_submit(&submit, ASYNC_TX_ACK|ASYNC_TX_XOR_DROP_DST,
> - NULL, NULL, NULL, NULL);
> - tx = async_xor(page1, xor_srcs, 0, 2, size, &submit);
> + void *dest = page_address(page1);
> + void *ptrs[2] = { dest, page_address(page2) };
>
> - async_tx_quiesce(&tx);
> + xor_gen(dest, ptrs, 2, size);
> }
>
> /*
>
next prev parent reply other threads:[~2026-10-19 0:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 19:22 [PATCH RFC 0/4] async_tx/md: Remove async_tx framework Frank.Li
2026-10-15 19:22 ` [PATCH RFC 1/4] md/dm-integrity: replace async_tx with synchronous xor for journal Frank.Li
2026-10-22 13:24 ` Mikulas Patocka
2026-10-22 21:44 ` Eric Biggers
2026-10-22 22:11 ` Eric Biggers
2026-10-15 19:22 ` [PATCH RFC 2/4] md/raid5-ppl: replace async_tx with synchronous xor Frank.Li
2026-10-19 0:27 ` Alex Naylor [this message]
2026-10-19 20:58 ` Frank Li
2026-10-15 19:22 ` [PATCH RFC 3/4] md/raid5: replace async_tx with synchronous xor/pq operations Frank.Li
2026-10-15 19:22 ` [PATCH RFC 4/4] crypto: remove async_tx framework Frank.Li
2026-10-15 19:51 ` [PATCH RFC 0/4] async_tx/md: Remove " Eric Biggers
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=ab359253-846e-4a8b-944e-06718b17a315@gmail.com \
--to=alex.r.naylor@gmail.com \
--cc=Frank.Li@oss.nxp.com \
--cc=djbw@kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=yukuai@fygo.io \
/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