From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Doug Anderson <dianders@chromium.org>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
Robin Murphy <robin.murphy@arm.com>,
Leon Romanovsky <leon@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Eric Dumazet <edumazet@google.com>,
Christoph Hellwig <hch@lst.de>,
Alexey Kardashevskiy <aik@ozlabs.ru>,
Johan Hovold <johan@kernel.org>,
stable@vger.kernel.org, driver-core@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/9] driver core: Don't let a device probe until it's ready
Date: Fri, 3 Apr 2026 19:23:30 +0200 [thread overview]
Message-ID: <2026040322-expert-willow-462d@gregkh> (raw)
In-Reply-To: <CAD=FV=XvqPH7FkRh16u7EE3LAuw-oUYbAdiL1nZxizVft2TqKQ@mail.gmail.com>
On Fri, Apr 03, 2026 at 09:26:58AM -0700, Doug Anderson wrote:
> Hi,
>
> On Fri, Apr 3, 2026 at 8:44 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > > If you wish, I can turn this into something like:
> > >
> > > #define DEV_FLAG_READY_TO_PROBE 0
> > > #define DEV_FLAG_CAN_MATCH 1
> > > #define DEV_FLAG_DMA_IOMMU 2
> > > ...
> > >
> > > ...but that seemed worse (to me) than the enum. Please shout if I
> > > misunderstood or you disagree.
> >
> > If you make it a numbered enum, that's fine (I hate unnumbered ones),
>
> Sounds like a plan.
>
>
> > and a comment somewhere saying we will "max out" at 63, or have a
> > DEV_FLAG_MAX_BIT entry in there.
>
> Sure. To be compatible across all architectures, it should probably
> max at 31, right? Atomic bitops works with an "unsigned long" which
> might be only 32-bits. Oh, actually I should just add "DEV_FLAG_COUNT"
> at the end of the enum and declare flags with DECLARE_BITMAP(). Then
> there is no max.
>
> In total, I've now got this:
>
> enum struct_device_flags {
> DEV_FLAG_READY_TO_PROBE = 0,
> DEV_FLAG_CAN_MATCH = 1,
> DEV_FLAG_DMA_IOMMU = 2,
> DEV_FLAG_DMA_SKIP_SYNC = 3,
> DEV_FLAG_DMA_OPS_BYPASS = 4,
> DEV_FLAG_STATE_SYNCED = 5,
> DEV_FLAG_DMA_COHERENT = 6,
> DEV_FLAG_OF_NODE_REUSED = 7,
> DEV_FLAG_OFFLINE_DISABLED = 8,
> DEV_FLAG_OFFLINE = 9,
>
> DEV_FLAG_COUNT
> };
>
> ...and "flags" is now:
>
> DECLARE_BITMAP(flags, DEV_FLAG_COUNT);
>
> Yell if you want anything changed. I'll restart my allmodconfig
> compile tests now.
That looks much better, thanks!
greg k-h
prev parent reply other threads:[~2026-04-03 17:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260403005005.30424-1-dianders@chromium.org>
2026-04-03 0:49 ` [PATCH v3 1/9] driver core: Don't let a device probe until it's ready Douglas Anderson
2026-04-03 7:04 ` Greg Kroah-Hartman
2026-04-03 15:34 ` Doug Anderson
2026-04-03 15:44 ` Greg Kroah-Hartman
2026-04-03 16:26 ` Doug Anderson
2026-04-03 17:23 ` Greg Kroah-Hartman [this message]
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=2026040322-expert-willow-462d@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=aik@ozlabs.ru \
--cc=aleksander.lobakin@intel.com \
--cc=dakr@kernel.org \
--cc=dianders@chromium.org \
--cc=driver-core@lists.linux.dev \
--cc=edumazet@google.com \
--cc=hch@lst.de \
--cc=johan@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robin.murphy@arm.com \
--cc=saravanak@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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