From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA99E41168B for ; Mon, 10 Aug 2026 18:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786385512; cv=none; b=l32ETtA2KyN0yF+YPaXtnAdi311+hVwBD6V89FSAfIhbAd7HTtAhtx8y534rAhzbpYIl26G1YyjZTFEzcfFxbWtDD1TwUEKOaPYP/BszmxRb/hfd65ymVt2pTtbSRjegZ9W1464/3PHU2z3lk8JLdJ8uD9hcMh4X/KlK/cLU7yU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786385512; c=relaxed/simple; bh=Aqbd7GzBuzE8rI9O2NgJ3ZT7ebKglGTUt9a1gqEF4hM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tsR0dOIxoD78ZHPlCQUDHygW8ZNoTyA5XBPW60m0JFBMbEHWs/9lKkYV5DRJ2GVxYxCBsUYOhzYhhJAxJFUBk/YOSmLG2Mvj0JCkSca8m2HPYETKoOElR1rOREwd0vPgqGzfYGFhheESmBilmzukbZInkOmnsBuTyD4chcO6GMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WUcYvuaY; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WUcYvuaY" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-38de840f2f0so1559424a91.0 for ; Mon, 10 Aug 2026 11:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786385510; x=1786990310; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uvni5rvIbNookZfZcgjA1SBuMYV8QNEvigVrBM/wZOg=; b=WUcYvuaYcvWfZ9AheS4omq7+Zivvo+2G+ApDGybFhD36iVvVlXY9rtVOqVHUmVXd0a Y4NkVf04GjfBWm/pr5t+kHk0CWe8HqNJJ8DcseU2Az0KVgQwi7lbDk7jD+C1nCpEnY7h Ac23k5r7f3CimFtm2AkQj820Izj3YJDFipsnBiz4qNfL/WsPm+l/aaoAQjBDXjIQhj8b P1fTEvSRiHMVs4EwVLxqgUkHdx4Jj3Pl20/N5i0oolGIhALFB2K77OhFFEWuBG4NWfmh FczKJbv1BZPgd9dRv+bDXTYYS+zGmvElsDtfU0M8Me/GStqT1Bplm9+TlPXV9yIGJ07S IuDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786385510; x=1786990310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=uvni5rvIbNookZfZcgjA1SBuMYV8QNEvigVrBM/wZOg=; b=X/s9d1da7TCm57KYsVn4uEEy0oR0BCvTnR9P9bO3ZdDnyO0h+bajcIPdRHh8j8T0FL gWHUIXUQk4BJNhZ0fb8QPUhdIfM5ysdbO9SN0JBvknbPdjU6yH/QWZP336l6dJQklje2 uqTtCvKHo0IfY3K1W5uJdg57vlzpw9h8hvpbtQ4CwcTy47vUs4AWAhbPsyLUinrJbTEb wa6wwmzkU3V2HAsHJLeCerOPbIW0o3iCe7nYJr0xTeXRuwgbD2mhy/WStwcN3y3GUphT 8Eu6e8wRNBtpjvJa93O7B7MZjBHI1/czFbhEDmNgZ+jl/3VYCAWKCttEfOx76OT+NIDt wQzg== X-Forwarded-Encrypted: i=1; AHgh+RouHIzKLiCuj8z6a1sWqZkh9/ETulCIeLolZFid5VtLP+WVzdfG7HcCdKicLnBx999krjaOQ/OremmbgFQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx39frJ0BUa34SQilSjMAVoTk7W6QlWw+PjYSlGP6zpFRKKgLQj KfOvrpN7igkrWYMwpfYqppZA+Cys7uxqhlYyrpQ8lbGiTScbr23c4JdU X-Gm-Gg: AR+sD13DOH5NakdH975BGMPz2eJE4pDVSFkGhgYULg0TuHNMSyOBrI6LsaLg1DoPMTb Fbv5fOIiZ03wFkKk5C+CSsHxMQxe/TNNSW2D9Y/MKAKULv4hQaiKhhF66p5xtEuNJzsSkY2tOqt JPEniSbL9BtM4/SsLeZUToeL5p+hUWH1NbJBOxm4PqsNCcZcBgoTh3VzRI6boOOCTFewEzyxq66 yKeGs8N/6sZM1HKideoTvyxTyOgcNLo9IidGLxkne+34RFEv/zbmr9VjdDyOLFFAAlEycpcqSJw pLYET13Zynvdi5aI8Mz0fg4oIYmx5SNHSMBQ4R/336U+VayVHRHknMVKFcaFKriLxMpOuq0+Vmc awup/OYtpJYeknP+q1cUBUSXQqb0+T9NMo0UpNKqKfdjzlGTzyc4hYPotXHjPqhazb7G9Ma0Q2t gdAE1FU2dTl90p1OAELcMi4+HDV57/GSRSbBrd+HQdzXR1k49KNXgWMEVBFORNNwQ= X-Received: by 2002:a17:90b:3b4e:b0:38e:5c6:4db9 with SMTP id 98e67ed59e1d1-392823702d4mr16298190a91.11.1786385510167; Mon, 10 Aug 2026 11:11:50 -0700 (PDT) Received: from cryptic.lan ([2001:569:7fa9:fa00:b1a9:6513:83c6:1d23]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-392d53b873asm472795a91.17.2026.08.10.11.11.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2026 11:11:49 -0700 (PDT) From: Allen Pais To: Vinod Koul , Frank Li Cc: Allen Pais , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Kees Cook , Dave Jiang , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Alex Williamson , David Matlack , Lukas Wunner , Bjorn Helgaas , Giovanni Cabiddu Subject: [PATCH v3 09/34] dmaengine: ioat: convert cleanup tasklet to dmaengine BH Date: Mon, 10 Aug 2026 11:09:10 -0700 Message-ID: <00e0c9c2fea2a0b00a2f3a91bcea240c6021648a.1786384168.git.allen.lkml@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Replace the per-channel tasklet with the shared dmaengine BH helper. The handler continues to run in softirq context while dmaengine owns the common scheduling and teardown mechanism. Signed-off-by: Allen Pais Acked-by: Dave Jiang --- drivers/dma/ioat/dma.c | 14 +++++++------- drivers/dma/ioat/dma.h | 3 +-- drivers/dma/ioat/init.c | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index ee93b029f9e3..c7a63dbac6e2 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -110,7 +110,7 @@ irqreturn_t ioat_dma_do_interrupt(int irq, void *data) for_each_set_bit(bit, &attnstatus, BITS_PER_LONG) { ioat_chan = ioat_chan_by_index(instance, bit); if (test_bit(IOAT_RUN, &ioat_chan->state)) - tasklet_schedule(&ioat_chan->cleanup_task); + dmaengine_schedule_bh(&ioat_chan->dma_chan); } writeb(intrctrl, instance->reg_base + IOAT_INTRCTRL_OFFSET); @@ -127,7 +127,7 @@ irqreturn_t ioat_dma_do_interrupt_msix(int irq, void *data) struct ioatdma_chan *ioat_chan = data; if (test_bit(IOAT_RUN, &ioat_chan->state)) - tasklet_schedule(&ioat_chan->cleanup_task); + dmaengine_schedule_bh(&ioat_chan->dma_chan); return IRQ_HANDLED; } @@ -161,11 +161,11 @@ void ioat_stop(struct ioatdma_chan *ioat_chan) /* flush inflight timers */ timer_delete_sync(&ioat_chan->timer); - /* flush inflight tasklet runs */ - tasklet_kill(&ioat_chan->cleanup_task); + /* flush inflight BH runs */ + dmaengine_kill_bh(&ioat_chan->dma_chan); /* final cleanup now that everything is quiesced and can't re-arm */ - ioat_cleanup_event(&ioat_chan->cleanup_task); + ioat_cleanup_event(&ioat_chan->dma_chan); } static void __ioat_issue_pending(struct ioatdma_chan *ioat_chan) @@ -690,9 +690,9 @@ static void ioat_cleanup(struct ioatdma_chan *ioat_chan) spin_unlock_bh(&ioat_chan->cleanup_lock); } -void ioat_cleanup_event(struct tasklet_struct *t) +void ioat_cleanup_event(struct dma_chan *c) { - struct ioatdma_chan *ioat_chan = from_tasklet(ioat_chan, t, cleanup_task); + struct ioatdma_chan *ioat_chan = to_ioat_chan(c); ioat_cleanup(ioat_chan); if (!test_bit(IOAT_RUN, &ioat_chan->state)) diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h index e8a880f338c6..4bdb1ae937e4 100644 --- a/drivers/dma/ioat/dma.h +++ b/drivers/dma/ioat/dma.h @@ -111,7 +111,6 @@ struct ioatdma_chan { struct ioatdma_device *ioat_dma; dma_addr_t completion_dma; u64 *completion; - struct tasklet_struct cleanup_task; struct kobject kobj; /* ioat v2 / v3 channel attributes @@ -385,7 +384,7 @@ int ioat_reset_hw(struct ioatdma_chan *ioat_chan); enum dma_status ioat_tx_status(struct dma_chan *c, dma_cookie_t cookie, struct dma_tx_state *txstate); -void ioat_cleanup_event(struct tasklet_struct *t); +void ioat_cleanup_event(struct dma_chan *c); void ioat_timer_event(struct timer_list *t); int ioat_check_space_lock(struct ioatdma_chan *ioat_chan, int num_descs); void ioat_issue_pending(struct dma_chan *chan); diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c index 737496391109..788927820d86 100644 --- a/drivers/dma/ioat/init.c +++ b/drivers/dma/ioat/init.c @@ -765,7 +765,7 @@ ioat_init_channel(struct ioatdma_device *ioat_dma, list_add_tail(&ioat_chan->dma_chan.device_node, &dma->channels); ioat_dma->idx[idx] = ioat_chan; timer_setup(&ioat_chan->timer, ioat_timer_event, 0); - tasklet_setup(&ioat_chan->cleanup_task, ioat_cleanup_event); + dmaengine_init_bh(&ioat_chan->dma_chan, ioat_cleanup_event); } #define IOAT_NUM_SRC_TEST 6 /* must be <= 8 */ -- 2.43.0