mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kenny Hsieh <kenny_hsieh@jabil.com>
To: Matt Johnston <matt@codeconstruct.com.au>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jk@codeconstruct.com.au" <jk@codeconstruct.com.au>,
	"andi.shyti@kernel.org" <andi.shyti@kernel.org>,
	"peda@lysator.liu.se" <peda@lysator.liu.se>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@kernel.org" <edumazet@kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2] mctp i2c: add sysfs control for mux child netdevs
Date: Tue, 3 Nov 2026 14:47:29 +0000	[thread overview]
Message-ID: <DM8PR02MB80878075D2520A9CAD7DF0928E692@DM8PR02MB8087.namprd02.prod.outlook.com> (raw)
In-Reply-To: <7486b1fc4dbcca755dd2f6b6de54d17919af873a.camel@codeconstruct.com.au>

Hi Matt,

On Mon, 2026-11-02 at 17:04 +0800, Matt Johnston wrote:
> An alternative could be to create sysfs attributes under the mctp-i2c device
> instance itself (the i2c slave).
>
> Mux buses could have mctp-i2c netdevs instantiated with
>
> echo "i2c-6" > /sys/bus/i2c/devices/2-1060/add_mctp_controller
>
> (where i2c-6 is a child mux bus of i2c-2, and i2c-2 0x60 is a mctp-i2c i2c
> device).
>
> "echo i2c-6 > .../2-1060/remove_mctp_controller" would remove the mctp-i2c
> netdev.
> Setting a root node as an mctp controller would involve writing its own name
> to the attribute file.
>
> How does that look to you?

I like that a lot better. Since the attributes live on the mctp-i2c
device, they can just go in dev_groups and the driver core creates and
removes them for us. So I can drop the per-adapter tracking list, and
the remove ordering and probe walk races Sashiko found go away with it.

Let me know if you'd rather have any of these differently:

  - adding a bus that already has a netdev, or removing one that
    doesn't, just returns success
  - a bus that isn't in this controller's mux tree gets -EINVAL
  - a bus name that doesn't exist, e.g. i2c-9999, gets -ENODEV

BR,
Kenny

      reply	other threads:[~2026-11-03 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  8:13 Kenny Hsieh
2026-10-19  8:38 ` netdev-bot+sashiko
2026-10-27  8:58   ` Kenny Hsieh
2026-11-02  9:04     ` Matt Johnston
2026-11-03 14:47       ` Kenny Hsieh [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=DM8PR02MB80878075D2520A9CAD7DF0928E692@DM8PR02MB8087.namprd02.prod.outlook.com \
    --to=kenny_hsieh@jabil.com \
    --cc=andi.shyti@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jk@codeconstruct.com.au \
    --cc=kuba@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peda@lysator.liu.se \
    /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

all inboxes | Powered by JetHome®