[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tndv7ezryq5m57r5iyoyr5suq5lliy37ciqluia7gh6znaecry@nfwbtzmsvcyn>
Date: Thu, 8 Jan 2026 10:20:03 -0600
From: John Groves <John@...ves.net>
To: Jonathan Cameron <jonathan.cameron@...wei.com>
Cc: Miklos Szeredi <miklos@...redi.hu>,
Dan Williams <dan.j.williams@...el.com>, Bernd Schubert <bschubert@....com>,
Alison Schofield <alison.schofield@...el.com>, John Groves <jgroves@...ron.com>,
Jonathan Corbet <corbet@....net>, Vishal Verma <vishal.l.verma@...el.com>,
Dave Jiang <dave.jiang@...el.com>, Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
Alexander Viro <viro@...iv.linux.org.uk>, David Hildenbrand <david@...nel.org>,
Christian Brauner <brauner@...nel.org>, "Darrick J . Wong" <djwong@...nel.org>,
Randy Dunlap <rdunlap@...radead.org>, Jeff Layton <jlayton@...nel.org>,
Amir Goldstein <amir73il@...il.com>, Stefan Hajnoczi <shajnocz@...hat.com>,
Joanne Koong <joannelkoong@...il.com>, Josef Bacik <josef@...icpanda.com>,
Bagas Sanjaya <bagasdotme@...il.com>, Chen Linxuan <chenlinxuan@...ontech.com>,
James Morse <james.morse@....com>, Fuad Tabba <tabba@...gle.com>,
Sean Christopherson <seanjc@...gle.com>, Shivank Garg <shivankg@....com>,
Ackerley Tng <ackerleytng@...gle.com>, Gregory Price <gourry@...rry.net>,
Aravind Ramesh <arramesh@...ron.com>, Ajay Joshi <ajayjoshi@...ron.com>, venkataravis@...ron.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-cxl@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH V3 05/21] dax: Add dax_set_ops() for setting
dax_operations at bind time
On 26/01/08 12:06PM, Jonathan Cameron wrote:
> On Wed, 7 Jan 2026 09:33:14 -0600
> John Groves <John@...ves.net> wrote:
>
> > From: John Groves <John@...ves.net>
> >
> > The dax_device is created (in the non-pmem case) at hmem probe time via
> > devm_create_dev_dax(), before we know which driver (device_dax,
> > fsdev_dax, or kmem) will bind - by calling alloc_dax() with NULL ops,
> > drivers (i.e. fsdev_dax) that need specific dax_operations must set
> > them later.
> >
> > Add dax_set_ops() exported function so fsdev_dax can set its ops at
> > probe time and clear them on remove. device_dax doesn't need ops since
> > it uses the mmap fault path directly.
> >
> > Use cmpxchg() to atomically set ops only if currently NULL, returning
> > -EBUSY if ops are already set. This prevents accidental double-binding.
> > Clearing ops (NULL) always succeeds.
> >
> > Signed-off-by: John Groves <john@...ves.net>
> Hi John
>
> This one runs into the fun mess of mixing devm and other calls.
> I'd advise you just don't do it because it makes code much harder
> to review and hits the 'smells bad' button.
>
> Jonathan
If I don't stink up something, I'm not trying hard enough :D
Next iteration will be full-devm.
[ ... ]
Thanks,
John
Powered by blists - more mailing lists