public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: stuart hayes <stuart.w.hayes@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Tanjore Suresh <tansuresh@google.com>,
	Martin Belanger <Martin.Belanger@dell.com>,
	Oliver O'Halloran <oohall@gmail.com>,
	Daniel Wagner <dwagner@suse.de>, Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] driver core: shut down devices asynchronously
Date: Wed, 16 Aug 2023 21:52:35 +0200	[thread overview]
Message-ID: <20230816195235.GA15421@wunner.de> (raw)
In-Reply-To: <653f62d4-277b-7cdb-39ba-03e0e7dfc1c0@gmail.com>

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

  reply	other threads:[~2023-08-16 19:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 15:45 [PATCH] driver core: shut down devices asynchronously Stuart Hayes
2023-08-16 15:54 ` Lukas Wunner
2023-08-16 19:42   ` stuart hayes
2023-08-16 19:52     ` Lukas Wunner [this message]
2023-08-16 22:07 ` kernel test robot
2023-08-17  0:10 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230816195235.GA15421@wunner.de \
    --to=lukas@wunner.de \
    --cc=Martin.Belanger@dell.com \
    --cc=dwagner@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oohall@gmail.com \
    --cc=rafael@kernel.org \
    --cc=stuart.w.hayes@gmail.com \
    --cc=tansuresh@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox