From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E75FC433F5 for ; Wed, 25 May 2022 18:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343621AbiEYSEQ (ORCPT ); Wed, 25 May 2022 14:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343622AbiEYSEP (ORCPT ); Wed, 25 May 2022 14:04:15 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 33E279CF43; Wed, 25 May 2022 11:04:14 -0700 (PDT) Received: from smtpclient.apple (d66-183-91-182.bchsia.telus.net [66.183.91.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 676BE20B71D5; Wed, 25 May 2022 11:04:12 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 676BE20B71D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1653501853; bh=AIZAMiCEajIHhQ0xzFaRPG9svaWeXfFXVXfyfZDYgF8=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=qkPq7ZxKLUX+Js2XTpprB3QG78Q+FVPrOwQe4D4uDbsxi4xBnu1SohxxB30+ZmQYa vH5+kwVx+y32vqBI4OjdS/hhilI25YmpsA3nweMp+1Tl2JQcYd/mpLkjV/QuvUwFGz yBllJU5p5jUsgst9RiU/mkvW0F4DnJwkJyQrECg0= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: [RFC 1/1] drivers/dma/*: replace tasklets with workqueue From: Allen Pais In-Reply-To: Date: Wed, 25 May 2022 11:04:11 -0700 Cc: David Laight , Linus Walleij , Vincent Guittot , "olivier.dautricourt@orolia.com" , Stefan Roese , Vinod Koul , Kees Cook , "linux-hardening@vger.kernel.org" , Ludovic Desroches , Tudor Ambarus , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list , Nicolas Saenz Julienne , Paul Cercueil , "Eugeniy.Paltsev@synopsys.com" , Gustavo Pimentel , Viresh Kumar , Andy Shevchenko , Leo Li , "zw@zh-kernel.org" , Zhou Wang , Shawn Guo , Sascha Hauer , Sean Wang , Matthias Brugger , =?utf-8?Q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Logan Gunthorpe , Sanjay R Mehta , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Andy Gross , Bjorn Andersson , Krzysztof Kozlowski , "green.wan@sifive.com" , Orson Zhai , Baolin Wang , Lyra Zhang , Patrice CHOTARD , Chen-Yu Tsai , =?utf-8?Q?Jernej_=C5=A0krabec?= , Samuel Holland , "dmaengine@vger.kernel.org" , Linux Kernel Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <45597969-0419-4CEE-B80C-4D2917943837@linux.microsoft.com> References: <20220419211658.11403-1-apais@linux.microsoft.com> <20220419211658.11403-2-apais@linux.microsoft.com> <9947cfa64667406996de191f07b9e8b9@AcuMS.aculab.com> <6E248F41-6687-4F2B-B847-DB5459BA1344@linux.microsoft.com> To: Arnd Bergmann X-Mailer: Apple Mail (2.3696.80.82.1.1) Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org >>=20 >> Thank you Linus, Arnd, Vincent and David for the feedback. >>=20 >> This is a lot more than a just conversion of API=E2=80=99s. I am in = the process >> Of replacing tasklets with threaded irq=E2=80=99s and hopefully that = should be >> A better solution than using workqueues. >=20 > I don't think that is much better for the case of the DMA engine > callbacks than the work queue, the problem I pointed out here > is scheduling into task context, which may be too expensive > in some cases, but whether it is or not depends on the slave > driver, not the dmaengine driver. Fair point. Deferring all callbacks to task context is not the ideal Way forward. I will work on the approach you shared, >1. add helper functions to call the callback functions from a >tasklet locally defined in drivers/dma/dmaengine.c to allow >deferring it from hardirq context >2. Change all tasklets that are not part of the callback >mechanism to work queue functions, I only see >xilinx_dpdma_chan_err_task in the patch, but there >may be more >3. change all drivers to move their custom tasklets back into >hardirq context and instead call the new helper for deferring >the callback. >4. Extend the dmaengine callback API to let slave drivers >pick hardirq, tasklet or task context for the callback. >task context can mean either a workqueue, or a threaded >IRQ here, with the default remaining the tasklet version. >5. Change slave drivers to pick either hardirq or task context >depending on their requirements >6. Remove the tasklet version. Thanks. >=20 > Even if all the slave drivers are better off using task context > (threaded irq or workqueue), you need to look at the slave > drivers first before you can convert the dmaengine drivers. >=20