public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Leon Romanovsky" <leon@kernel.org>
Cc: "Tariq Toukan" <tariqt@nvidia.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Saeed Mahameed" <saeedm@nvidia.com>,
	"Mark Bloch" <mbloch@nvidia.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>, <driver-core@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, "Gal Pressman" <gal@nvidia.com>,
	"Moshe Shemesh" <moshe@nvidia.com>,
	"Amir Tzin" <amirtz@nvidia.com>
Subject: Re: [PATCH V2] driver core: auxiliary bus: Fix sysfs creation on bind
Date: Fri, 20 Feb 2026 12:14:12 +0100	[thread overview]
Message-ID: <DGJQUDBN8WQ2.BPQRSNNGMH6X@kernel.org> (raw)
In-Reply-To: <20260220080413.GB10607@unreal>

On Fri Feb 20, 2026 at 9:04 AM CET, Leon Romanovsky wrote:
> This init->add->remove->destroy pattern follows standard Linux kernel practice.
> I expect all current review tools to flag any missing function call
> among these three.

I'm not saying that the flow is not logical, goes against existing patterns,
etc., I'm saying that it is unnecessary to expose a new API to drivers, since
this is already handled internally.

I.e. we can easily fix the bug without increasing the API surface exposing a new
API to drivers.

> It is not, atomic is not a replacement for locking and this hunk is
> going to be racy as hell:

No, of course not, but it is sufficient to ensure that something runs only once.

However, you are still right, since sysfs_create_group() can still fail, we
still need the mutex, because we may need to unwind.

> In the proposed patch, locking is handled by the driver, which understands the
> flow far better than the driver core.

I don't think so, the driver core (or actually the auxiliary bus code) is
perfectly aware of the flow, i.e. create the attribute group once actually
needed by auxiliary_device_sysfs_irq_add(), remove it on driver unbind.

  reply	other threads:[~2026-02-20 11:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 21:04 [PATCH V2] driver core: auxiliary bus: Fix sysfs creation on bind Tariq Toukan
2026-02-19 22:21 ` Jacob Keller
2026-02-19 23:59 ` Danilo Krummrich
2026-02-20  6:34   ` Greg Kroah-Hartman
2026-02-20  8:08     ` Leon Romanovsky
2026-02-20  8:04   ` Leon Romanovsky
2026-02-20 11:14     ` Danilo Krummrich [this message]
2026-02-20 14:11       ` Leon Romanovsky

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=DGJQUDBN8WQ2.BPQRSNNGMH6X@kernel.org \
    --to=dakr@kernel.org \
    --cc=amirtz@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=driver-core@lists.linux.dev \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rafael@kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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