[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230816195235.GA15421@wunner.de>
Date: Wed, 16 Aug 2023 21:52:35 +0200
From: Lukas Wunner <lukas@...ner.de>
To: stuart hayes <stuart.w.hayes@...il.com>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Tanjore Suresh <tansuresh@...gle.com>,
Martin Belanger <Martin.Belanger@...l.com>,
Oliver O'Halloran <oohall@...il.com>,
Daniel Wagner <dwagner@...e.de>,
Keith Busch <kbusch@...nel.org>
Subject: Re: [PATCH] driver core: shut down devices asynchronously
On Wed, Aug 16, 2023 at 02:42:26PM -0500, stuart hayes wrote:
> On 8/16/2023 10:54 AM, Lukas Wunner wrote:
> > Is there a particular reason why you're not using the infrastructure
> > provided by kernel/async.c and <async.h>, such as async_schedule()?
> > It wraps all the work_struct plumbing and also has helpers to await
> > completion. I imagine using that might reduce LoC in this patch.
>
> Not a good one. Let me look into this, thank you.
A word of caution on async_synchronize_cookie(), it awaits the cookies
*before* the one you're passing into the function, so depending on the
use case it may be necessary to add + 1 to the cookie:
https://lore.kernel.org/intel-gfx/20160621075704.GB1821@nuc-i3427.alporthouse.com/
It's a nasty gotcha. Just so you're aware of it. :)
Thanks,
Lukas
Powered by blists - more mailing lists