mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank.Li@oss.nxp.com
To: Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	 Mikulas Patocka <mpatocka@redhat.com>,
	 Benjamin Marzinski <bmarzins@redhat.com>,
	Song Liu <song@kernel.org>,  Yu Kuai <yukuai@fygo.io>,
	Li Nan <magiclinan@didiglobal.com>,  Xiao Ni <xiao@kernel.org>,
	Dan Williams <djbw@kernel.org>,
	 Herbert Xu <herbert@gondor.apana.org.au>,
	 "David S. Miller" <davem@davemloft.net>,
	Jonathan Corbet <corbet@lwn.net>,
	 Shuah Khan <skhan@linuxfoundation.org>,
	 Randy Dunlap <rdunlap@infradead.org>
Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	 linux-raid@vger.kernel.org, linux-crypto@vger.kernel.org,
	 linux-doc@vger.kernel.org, Anatolij Gustschin <agust@denx.de>,
	 Saeed Bishara <saeed@marvell.com>,
	Rameshwar Prasad Sahu <rsahu@apm.com>,
	 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	 Anup Patel <anup.patel@broadcom.com>,
	Frank Li <Frank.Li@nxp.com>
Subject: [PATCH RFC 2/4] md/raid5-ppl: replace async_tx with synchronous xor
Date: Thu, 15 Oct 2026 15:22:26 -0400	[thread overview]
Message-ID: <20261015-asycn_tx_remove-v1-2-056a7085e0a1@nxp.com> (raw)
In-Reply-To: <20261015-asycn_tx_remove-v1-0-056a7085e0a1@nxp.com>

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);
 }
 
 /*

-- 
2.43.0


  parent reply	other threads:[~2026-10-15 19:23 UTC|newest]

Thread overview: 6+ 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-15 19:22 ` Frank.Li [this message]
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=20261015-asycn_tx_remove-v1-2-056a7085e0a1@nxp.com \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=agk@redhat.com \
    --cc=agust@denx.de \
    --cc=anup.patel@broadcom.com \
    --cc=bmarzins@redhat.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=djbw@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=magiclinan@didiglobal.com \
    --cc=mpatocka@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rsahu@apm.com \
    --cc=saeed@marvell.com \
    --cc=skhan@linuxfoundation.org \
    --cc=snitzer@kernel.org \
    --cc=song@kernel.org \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=xiao@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

all inboxes | Powered by JetHome®