From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 A7D3E42CAF2 for ; Mon, 27 Jul 2026 20:31:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785184267; cv=none; b=rKa63ul8qATsRxabFUesMQWFMBRwqCFRcwA3Vx82imd4Pt1KSdyCQpR2ezI6wbhhtaXyRI4PNRaLWPX3BQQJJC+BWaGXCqCohSohjX9E/RwoWKVHFbCY9ZVoqsW5Eum8cLpZDXoRO6c9UZwaXoio05FVopENQf64c87dShjD0ls= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785184267; c=relaxed/simple; bh=52mgaibdl5c58d3AYAN5WRtXVWbPgmpaRi1q76IfdMM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sQZ2rginaixdb1QiQxw4IUAln0Nx+OXafjLykCAfplANcp9Y5sxFK2dq9lDFqKHAGrqEOrGpJeSarbcsqRC8O4YpUPom4K8jL9fv7x7hkj1KtDMxTLKiDwWNgof4QI85V2bRtbGeJDQI7TKwHILwUYHVbgzSsvbs5GbDFetGBvI= 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=AxeGB8xU; arc=none smtp.client-ip=209.85.214.178 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="AxeGB8xU" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2cacb8416a1so29818945ad.1 for ; Mon, 27 Jul 2026 13:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785184265; x=1785789065; 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=Wtr6C7a2bWw56KI7UgkJ9lIBa9lQozueu7UESTIAJSY=; b=AxeGB8xUztVJYWS1tDkP+zOkHYGxR4OFBN7ZdWb5CNlKMOfzg0J7p73Ns+Bu+0TAog eOrMNFWQhjGm4JROxI8GJQiVvT29iJOWssBy6NJUQt9Ix2h20Zi5nFb5ixRpf/NaEUcx nl/3Htyg3dUS+erkXfk3aXQhcnD/we0lWih0pUAxaizFH2hOudN3zV9X+a9Qkfd5halT IB75vs2WtHYy1dBYKI5t4KBEIgJVSuBHjnMXg9gEypwgJdr2lIftnAH/11n1p+cT2gC6 M0+yItEXzac8zh0+Ir31SAZXB9brLz6DpEV5Z/SZ71YEVzFesbSi0Iq/K+dOjnjhExsR ZrYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785184265; x=1785789065; 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=Wtr6C7a2bWw56KI7UgkJ9lIBa9lQozueu7UESTIAJSY=; b=H33hebiz0pLH94DpQKNGPefVZvGStKzJHx/PpFrEh9dHbrq2bQgkZuKc/M+GnmvCQ6 63HbpwvAluIkeKJS5egvkzA4HhHK30/kaIYYb5LWZIgHJu5OI0KXwwyhAQ1AzNIpbovv 56E84Cqvaf5ZrEEhsGtPQC8jfDIOy/gw+/3zhcIKk1+iyhgeZ8VgGtJ1tF+9F15DiXyQ wJ1++FstOwdR4xlyA0jFvJ6NkC0MgnakJ6i9uaEh7hoW5PlXjxO/OwbHLG/FpKionvGQ VWat7lxPUYGWmzp576squTepDZf4MVWI6XlbF7C5KbRAQ+1ll48EH5qZ/W1iapdRIJC4 EbZg== X-Forwarded-Encrypted: i=1; AHgh+Rp8bPOxgbt768t0BbGqlEpfudRW6VHj6rZSEeFIxuy1GVGmJ51auQS0UF0K7HGcAocFFA+ROTzR4qfyMMw=@vger.kernel.org X-Gm-Message-State: AOJu0YxJjJ83kuE+80zlvcgGktxgesUCBj+iOmphDCVd3nsyCVfmY1ge vry98/j10mxHd441tYDiax0ro0OcL+8zlFlItGeTgv3LjfspEJmkcg+b X-Gm-Gg: AR+sD11H3E1cP8DPf1lg/4zy4aLZct5GmhLllxzkXJmaZg1aMwyXMhnV/iiN5/1azfE RzfX+4DDSxYlUEkzOt2RD5n2xAY4wxUIKTvZjjlARKsR7gZeKk6AjsO2XPz/01RMUPQXlullQMZ TTKLcFwPR8skmod5GmkkVxwZChMMMgJQkO8ComNRlMd4F57B+f5lWER6IwqfiWiVT77n3O2nP/k 1UbGv/431U/dYhMRmEzcwr1wktHUa3TJrr3bVujilrRQyO2hDiF7joiYQZj3xPQWul4WroKZw9J IH4SiUiUX5zLJpH3x5zxyA46oMhct6L4kQEgIrB6YE7Y90FfTrrNawYz/GO8cvxp9KqOsQd4odS 4r1uMvou6eiMHKtUrRZpXMcsWJaXpWv4ydcLIP8wXiXiL9sC7D26PFcDtFFPYT40Z5KAP56Lfms IpEE8+ X-Received: by 2002:a17:902:f547:b0:2cf:9344:b80c with SMTP id d9443c01a7336-2cfde7aca4dmr86641865ad.18.1785184265001; Mon, 27 Jul 2026 13:31:05 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 13:31:04 -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 , Sven Peter , Janne Grunau , Neal Gompa , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 03/64] dmaengine: apple-admac: use dma_chan BH callback Date: Mon, 27 Jul 2026 13:28:31 -0700 Message-ID: <3804b35d529e0b80d8d0898f1dad1fd4cb917fcb.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/apple-admac.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c index 14a5ee14a481..84483247bde6 100644 --- a/drivers/dma/apple-admac.c +++ b/drivers/dma/apple-admac.c @@ -89,7 +89,6 @@ struct admac_chan { unsigned int no; struct admac_data *host; struct dma_chan chan; - struct tasklet_struct tasklet; u32 carveout; @@ -521,10 +520,7 @@ static int admac_terminate_all(struct dma_chan *chan) list_add_tail(&adchan->current_tx->node, &adchan->to_free); adchan->current_tx = NULL; } - /* - * Descriptors can only be freed after the tasklet - * has been killed (in admac_synchronize). - */ + /* Descriptors are released once the BH is flushed in admac_synchronize */ list_splice_tail_init(&adchan->submitted, &adchan->to_free); list_splice_tail_init(&adchan->issued, &adchan->to_free); spin_unlock_irqrestore(&adchan->lock, flags); @@ -543,7 +539,7 @@ static void admac_synchronize(struct dma_chan *chan) list_splice_tail_init(&adchan->to_free, &head); spin_unlock_irqrestore(&adchan->lock, flags); - tasklet_kill(&adchan->tasklet); + dma_chan_kill_bh(&adchan->chan); list_for_each_entry_safe(adtx, _adtx, &head, node) { list_del(&adtx->node); @@ -662,7 +658,7 @@ static void admac_handle_status_desc_done(struct admac_data *ad, int channo) tx->reclaimed_pos %= 2 * tx->buf_len; admac_cyclic_write_desc(ad, channo, tx); - tasklet_schedule(&adchan->tasklet); + dma_chan_schedule_bh(&adchan->chan); } spin_unlock_irqrestore(&adchan->lock, flags); } @@ -712,9 +708,9 @@ static irqreturn_t admac_interrupt(int irq, void *devid) return IRQ_HANDLED; } -static void admac_chan_tasklet(struct tasklet_struct *t) +static void admac_chan_bh(struct dma_chan *chan) { - struct admac_chan *adchan = from_tasklet(adchan, t, tasklet); + struct admac_chan *adchan = to_admac_chan(chan); struct admac_tx *adtx; struct dmaengine_desc_callback cb; struct dmaengine_result tx_result; @@ -886,7 +882,7 @@ static int admac_probe(struct platform_device *pdev) INIT_LIST_HEAD(&adchan->issued); INIT_LIST_HEAD(&adchan->to_free); list_add_tail(&adchan->chan.device_node, &dma->channels); - tasklet_setup(&adchan->tasklet, admac_chan_tasklet); + dma_chan_init_bh(&adchan->chan, admac_chan_bh); } err = reset_control_reset(ad->rstc); -- 2.43.0