From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 A40BD42D75D for ; Mon, 27 Jul 2026 20:31:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785184268; cv=none; b=XgXoa/IHSWwVB8+JW7m7S2pzgyewLTgER20kzExjGyo9VDjNX3RR17lu7SCz3kLU7qfS7cNrteTwBmt9kMEA8khAgMfrTVQ9GSCTaMBNhgShUwx1iipq9RcFNQhz6z8lIaWfgPeENKTbUvPnDeV/ZGIUptZN6v7QqtVAgb44CU8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785184268; c=relaxed/simple; bh=4lKN0zxyyykusIdLDuaYhUaC4CwGpbRa4W2vzb1LEuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LdFmqLln6HPQi4JesOVCCeDmDMLf4wq7eS479GT9SPCy9tIR5uS4Xrh5X8aNciooNp0ZEFoYwRNTrtpGCgmE939aTlVK/q1OufhPwPVrxiz+BWcjAci8e5xIPBt219l5JCjaMR+q5NYCL1i0wcsUf7Cdi36ueZndqa8HqUlf3CA= 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=M7jr5AY2; arc=none smtp.client-ip=209.85.214.181 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="M7jr5AY2" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2cf52d15d88so31918185ad.2 for ; Mon, 27 Jul 2026 13:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785184267; x=1785789067; 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=Sa3tfC8KOPtChDmpcRt2oXEtiFfA9yOH4me4ekfnls4=; b=M7jr5AY2eerGEHJK9T5hO8WMtfD4LwEhjZsxXYkul365MLZ0+yFVd5u2loa6479FHD SRhDieqNZE/MoKpxTmPIDIcksr1KMTrYfdDEdQzAhjR0xz2bJY8404E9Y3rWGuDBpC// aE06QXgT+BzmdbjisOKK/biQXKXU9RytwLRYRDpT67CYZ8Eoh2qEkXfP941Em2zmZr3s faL3SpJzhl8kiwGTkS9z9YX4OcySbfcN+PltsTsPB3uaYXi5s1ZF3lWYfsPRAIwA5G53 OaD8tjJs1R6F38Gju3CoEaaziv/4564b5zLdXFh8zHDyq8NlWNJzj0RZgrJcBxePJv8E ULAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785184267; x=1785789067; 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=Sa3tfC8KOPtChDmpcRt2oXEtiFfA9yOH4me4ekfnls4=; b=g/tf/Zh05Xful2POrtNwzopqtQKyzSep2YDWpeZfMKQioTyGO4Genu0A7EJPPOZSDv o4+1A5WQXD7PFDeBpJHnV2DUT3NmfcQfIWFU+fEbe6VPDFOYhTjPSR0vcDEjm50+pDgX rI2cFFuaIBNZxViIEdJWxzv3UWBEoLrml75WVXL8AuDjikzUPWE6Y6qwzcLbcPph/Nb7 rQwvVhRqxLHemAyMO/U7C1UE2RgggYIm7rH3IHbeygxQNdqTvzb5oS9iuDp83ns8ZlqQ jREckTG46gMzBU4vEFUhR/77YQ7qmfyBrNSf1v+tCxG+OgYQGoeZNH12/7PnMhwitxef 6syQ== X-Forwarded-Encrypted: i=1; AHgh+Rrk6dUODc4yREvlRi7oZHOs6P5lJAtsKlh2OAhQu3TtnP3RAyg7PPVHT6dNemimqctnSUm4tTalHx7Xw4c=@vger.kernel.org X-Gm-Message-State: AOJu0Yxb82PrliapC4iJN5n0YbapPPTV9vlGx7lM/hBNDbX04Ar4xu69 acWjAT93/laJHIkZOpuvqAHXsd7IJxmW/ESM05QoqGzbRrTmqLsIekpp X-Gm-Gg: AR+sD10EnjaPv5hDo3zYyZ20rETAWxDOpIzBMo8eKCtVYz1MX0dPXReaLOI4kSNh/fj sthN9rzOOq5a6ZF4FqMvnxkoXmdbnlqgzHgxIYA3jqHrNm4DiF7lMt2+m9AMs+V12wzuPWLyadA UJ/vNsfpoxc21BioqhKDCk6HgRdGUkFdCvMnyt1qWEoe4qBDrXfwZaiAKbiqo9QUw6qXX8HMPNE jwPyq5U2eJJ1RUsW+hXjVhIwnvZfPzROqUiMxd4+HL3zVgu6y1ccK3gOlbDSO3/t9mHMcYRs8Ir b8zRWLs3DaOwDEeb144sM7Y46lMFZH5Oq2ai26NnN/CMz3NL/OG811YKAtoL43UqWJKP7LwfIiK Z7eOC7HbYasCNIkPgtfVG8EwX8yjiy3WfMzz+YwjHN+uG+BGouIwZc3EvUXTFJIidBg5ppj5dVt hiltVj X-Received: by 2002:a17:902:e810:b0:2c9:c517:d070 with SMTP id d9443c01a7336-2cfde6880d0mr92860635ad.3.1785184266851; Mon, 27 Jul 2026 13:31:06 -0700 (PDT) Received: from cryptic.lan ([2001:569:7fab:e200:3789:64f9:8855:c0af]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cfde59b768sm41551805ad.4.2026.07.27.13.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 13:31:06 -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 , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 04/64] dmaengine: at_xdmac: move irq bottom half to dma_chan BH Date: Mon, 27 Jul 2026 13:28:32 -0700 Message-ID: <06f8d1586f29e59ffa367c04b49400a81c0f16cf.1785183549.git.allen.lkml@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20260108080332.2341725-1-allen.lkml@gmail.com> 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 dma_chan BH helper. The handler continues to run in softirq context while dmaengine owns the common scheduling and teardown mechanism. Signed-off-by: Allen Pais --- drivers/dma/at_xdmac.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 901971e8bae6..aa918043e37e 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -228,7 +228,6 @@ struct at_xdmac_chan { u32 save_cndc; u32 irq_status; unsigned long status; - struct tasklet_struct tasklet; struct dma_slave_config sconfig; spinlock_t lock; @@ -1759,9 +1758,9 @@ static void at_xdmac_handle_error(struct at_xdmac_chan *atchan) /* Then continue with usual descriptor management */ } -static void at_xdmac_tasklet(struct tasklet_struct *t) +static void at_xdmac_tasklet(struct dma_chan *chan) { - struct at_xdmac_chan *atchan = from_tasklet(atchan, t, tasklet); + struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan); struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device); struct at_xdmac_desc *desc; struct dma_async_tx_descriptor *txd; @@ -1865,7 +1864,7 @@ static irqreturn_t at_xdmac_interrupt(int irq, void *dev_id) if (atchan->irq_status & (AT_XDMAC_CIS_RBEIS | AT_XDMAC_CIS_WBEIS)) at_xdmac_write(atxdmac, AT_XDMAC_GD, atchan->mask); - tasklet_schedule(&atchan->tasklet); + dma_chan_schedule_bh(&atchan->chan); ret = IRQ_HANDLED; } @@ -2317,7 +2316,7 @@ static int at_xdmac_probe(struct platform_device *pdev) return PTR_ERR(atxdmac->clk); } - /* Do not use dev res to prevent races with tasklet */ + /* Do not use devm resources to prevent races with the BH worker */ ret = request_irq(atxdmac->irq, at_xdmac_interrupt, 0, "at_xdmac", atxdmac); if (ret) { dev_err(&pdev->dev, "can't request irq\n"); @@ -2397,7 +2396,7 @@ static int at_xdmac_probe(struct platform_device *pdev) spin_lock_init(&atchan->lock); INIT_LIST_HEAD(&atchan->xfers_list); INIT_LIST_HEAD(&atchan->free_descs_list); - tasklet_setup(&atchan->tasklet, at_xdmac_tasklet); + dma_chan_init_bh(&atchan->chan, at_xdmac_tasklet); /* Clear pending interrupts. */ while (at_xdmac_chan_read(atchan, AT_XDMAC_CIS)) @@ -2458,7 +2457,7 @@ static void at_xdmac_remove(struct platform_device *pdev) for (i = 0; i < atxdmac->dma.chancnt; i++) { struct at_xdmac_chan *atchan = &atxdmac->chan[i]; - tasklet_kill(&atchan->tasklet); + dma_chan_kill_bh(&atchan->chan); at_xdmac_free_chan_resources(&atchan->chan); } } -- 2.43.0