From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 55EF742BEB0 for ; Mon, 27 Jul 2026 20:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785184289; cv=none; b=Fc9IVJS4CBU+1w7WQLYBaBpMoqTpqaW46AvkxK+QCTTh/UpWq2qiOgBfXowk784kjInl/ZMhGZ/jMWtihcYnkDL4qgOlDzcOZ/mbo/9ghRYTBAIAUJ2Q3uchWjeR73x+10kS/N0Hz6LAzpCisQnYeTC0nlOFz8HbOg7ZMBS8OLg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785184289; c=relaxed/simple; bh=icfVyDF9BoilFSxgEpIKcsFKPbm6k6jIWjASHyQnqII=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gXcPa+XsLDiVdBENRqgpEcyveFlZ1tX5znnM7NmphZ9G2IuRte+SqdxYpB+sq+txYYL0e1Pm/aKvP+GbLvQ0+kvVG4rRHiNi15rfkOcx7ZE7ieypUcJhW305pjUFwWw41HitydwQun/ExMB60Usf2RO9xo3kIC+mo9pNWEM2+zo= 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=q52yO8+C; arc=none smtp.client-ip=209.85.214.182 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="q52yO8+C" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2cf50c6f235so38243815ad.0 for ; Mon, 27 Jul 2026 13:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785184288; x=1785789088; 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=0a8MYcKw5JTNHHIrN3K1TaKhBFHL7HNLhSi2FpFsKc0=; b=q52yO8+CICP6WqMpb0yM5NYcpcnpflEVRExHaAHkuuCLw5dERFwaE2RWY/XNlF6pCU Sd6pE3vUnlrZ37gM4DUq0kU2MtCKfnua0Lsqd3wXWbumgUokr8oxp8ydxKJUhvE6X4tF LHKpBj5yDy3zlBJMwWlWVesPXs8mVeajpmzTseKosbP68B5mpxcmzpJ8z3UAq4LXlQE3 oEEKd1lr0Nt15iwppjXXgeK2CL5LVTArfYQ3Hkqg/qhxQek5s3ktVkxQPcciUI3thheH Vzf6GOfvfgiocQtux8v6v7mP7yXLJIcBGwIowOlG8J1YJhSUXoXNGuF4in0hToQwhL16 cLEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785184288; x=1785789088; 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=0a8MYcKw5JTNHHIrN3K1TaKhBFHL7HNLhSi2FpFsKc0=; b=pdiYXiYWAkbHOsfK9/iB50flu4YAAdmTX+ugqNlJfElCbhKpnRStc5lp9/8RejBL3g OuRg6C7AbUcWGBfgbvU4vi5MTUjRqKuhGr8ku/H2gWu5Q8Koh5XpIat2rLX4h+v5NIJw kqxARJ6po/RI67/M3u1/cXC1gK0ZQDqG+q2Vynw5N8RTwfB0It8AYyHCBzS2hsm0lFe/ JdI8pgICKv6nl7Dk0XYab/gsl/5rUTtFDuHr3j36CIuiKi8eHSb4DVRUvXoCcrcDB9IZ UPeiUbCFBOPvj+M9vGR4bH7xXoOwmsublYjt5r5SdcmuAxbkgNjhAWwfg36gTF+wHJMw lM2A== X-Forwarded-Encrypted: i=1; AHgh+RpGQPab58yKmLfAUcvljEVAWlUFXMH3tqXJCyQ3ueFOVLJORtFmW9k0rD+GT+zFUT5ny3NOJO9zKmR5BQM=@vger.kernel.org X-Gm-Message-State: AOJu0YxoskFJXtW2eccm7j95aAqkhQRe8MjMlZquZpYBgt/P6+Mo1Kww zdgj48Qw0TKVTEwBfzPTKkEnUx3CMImfx6enJLGCTq9LWVaLS3ssSW/o X-Gm-Gg: AR+sD126Bn7C3gAvM4a42fz9C+3A+OXVBdal1joTzD1R6vxLBWb/VhleZppK4U+Lqkm 7Cn0IymuL5pCPoMWNNEi8NSWHNVWGhtwfwqmw7At7CgdFqjCzD5JmDF0ingeKy6DzNpI+BOzlB/ 5fqRpnYfPJhA8Q8NMpZBMm4tsWf85B1tR4Hydj6Grhgd9QeUes/BDdGOtb0uUtL4KMLicdtf1n9 Vu91N7aI3LlQznnIpIaTNSVDS2iZFAdVMl9BIHsyAgjKfmVh7+Ui6BRwd12YeAoWfEdGw7A/R03 cG+oT62cadmea7zY2zTOlcMG+btjDS4Uzyllct1AMyK7CtuDr9Lr0ztw+JOdWETlMo0Wdh4z5v/ Ko8b1OZ/TJ6tkvUpI6KKShgYbR2Mh3KZSRSnfZTgR0VrVFalJlgBN3IRPKNXf/Bwfmoa96JqTpO qess1v57PeiGJD/pc= X-Received: by 2002:a17:902:e843:b0:2cf:dc6f:cc42 with SMTP id d9443c01a7336-2d00f5da251mr7142445ad.46.1785184287499; Mon, 27 Jul 2026 13:31:27 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 13:31:23 -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 , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 08/64] dmaengine: imx-dma: flip per-chan tasklet to dma_chan BH Date: Mon, 27 Jul 2026 13:28:36 -0700 Message-ID: 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/imx-dma.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 81c6276436f8..3ff0bfbfa5ff 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -145,7 +145,6 @@ struct imxdma_channel { struct imxdma_engine *imxdma; unsigned int channel; - struct tasklet_struct dma_tasklet; struct list_head ld_free; struct list_head ld_queue; struct list_head ld_active; @@ -344,8 +343,8 @@ static void imxdma_watchdog(struct timer_list *t) imx_dmav1_writel(imxdma, 0, DMA_CCR(channel)); - /* Tasklet watchdog error handler */ - tasklet_schedule(&imxdmac->dma_tasklet); + /* BH watchdog error handler */ + dma_chan_schedule_bh(&imxdmac->chan); dev_dbg(imxdma->dev, "channel %d: watchdog timeout!\n", imxdmac->channel); } @@ -390,8 +389,8 @@ static irqreturn_t imxdma_err_handler(int irq, void *dev_id) imx_dmav1_writel(imxdma, 1 << i, DMA_DBOSR); errcode |= IMX_DMA_ERR_BUFFER; } - /* Tasklet error handler */ - tasklet_schedule(&imxdma->channel[i].dma_tasklet); + /* BH error handler */ + dma_chan_schedule_bh(&imxdma->channel[i].chan); dev_warn(imxdma->dev, "DMA timeout on channel %d -%s%s%s%s\n", i, @@ -448,8 +447,8 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac) imx_dmav1_writel(imxdma, tmp, DMA_CCR(chno)); if (imxdma_chan_is_doing_cyclic(imxdmac)) - /* Tasklet progression */ - tasklet_schedule(&imxdmac->dma_tasklet); + /* BH progression */ + dma_chan_schedule_bh(&imxdmac->chan); return; } @@ -462,8 +461,8 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac) out: imx_dmav1_writel(imxdma, 0, DMA_CCR(chno)); - /* Tasklet irq */ - tasklet_schedule(&imxdmac->dma_tasklet); + /* Schedule the IRQ BH */ + dma_chan_schedule_bh(&imxdmac->chan); } static irqreturn_t dma_irq_handler(int irq, void *dev_id) @@ -592,9 +591,10 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) return 0; } -static void imxdma_tasklet(struct tasklet_struct *t) +static void imxdma_tasklet(struct dma_chan *chan) { - struct imxdma_channel *imxdmac = from_tasklet(imxdmac, t, dma_tasklet); + struct imxdma_channel *imxdmac = container_of(chan, struct imxdma_channel, + chan); struct imxdma_engine *imxdma = imxdmac->imxdma; struct imxdma_desc *desc, *next_desc; unsigned long flags; @@ -1142,7 +1142,7 @@ static int __init imxdma_probe(struct platform_device *pdev) INIT_LIST_HEAD(&imxdmac->ld_free); INIT_LIST_HEAD(&imxdmac->ld_active); - tasklet_setup(&imxdmac->dma_tasklet, imxdma_tasklet); + dma_chan_init_bh(&imxdmac->chan, imxdma_tasklet); imxdmac->chan.device = &imxdma->dma_device; dma_cookie_init(&imxdmac->chan); imxdmac->channel = i; @@ -1211,7 +1211,7 @@ static void imxdma_free_irq(struct platform_device *pdev, struct imxdma_engine * if (!is_imx1_dma(imxdma)) disable_irq(imxdmac->irq); - tasklet_kill(&imxdmac->dma_tasklet); + dma_chan_kill_bh(&imxdmac->chan); } } -- 2.43.0