mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Johnston <matt@codeconstruct.com.au>
To: Kenny Hsieh <kenny_hsieh@jabil.com>
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: Wed, 04 Nov 2026 14:44:01 +0800	[thread overview]
Message-ID: <e89969f13177f2e7b3105851d0cf42eaf11bd98e.camel@codeconstruct.com.au> (raw)
In-Reply-To: <DM8PR02MB80878075D2520A9CAD7DF0928E692@DM8PR02MB8087.namprd02.prod.outlook.com>

Hi Kenny,

On Tue, 2026-11-03 at 14:47 +0000, Kenny Hsieh wrote:
> 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

Would it be better to return EEXIST (add) or ENODEV (remove) for those cases?
That could catch mistakes. Usually there'd be a single userspace program
managing it, so it doesn't need to be idempotent?

>   - 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

Those look good.

Cheers,
Matt

  reply	other threads:[~2026-11-04  6:44 UTC|newest]

Thread overview: 7+ 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
2026-11-04  6:44         ` Matt Johnston [this message]
2026-11-04 14:23           ` Kenny Hsieh

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=e89969f13177f2e7b3105851d0cf42eaf11bd98e.camel@codeconstruct.com.au \
    --to=matt@codeconstruct.com.au \
    --cc=andi.shyti@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jk@codeconstruct.com.au \
    --cc=kenny_hsieh@jabil.com \
    --cc=kuba@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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®