public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: "Belanger, Martin" <Martin.Belanger@dell.com>,
	Martin Belanger <nitram_67@hotmail.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"kbusch@kernel.org" <kbusch@kernel.org>,
	"hare@suse.de" <hare@suse.de>, "axboe@fb.com" <axboe@fb.com>,
	"hch@lst.de" <hch@lst.de>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"Rose, Charles" <Charles.Rose@dell.com>,
	"Hayes, Stuart" <Stuart.Hayes@dell.com>
Subject: Re: [PATCHv2 3/3] nvme: Expose cntrltype and dctype through sysfs
Date: Sun, 6 Feb 2022 13:02:22 +0100	[thread overview]
Message-ID: <Yf+4zhofzutXLVih@kroah.com> (raw)
In-Reply-To: <b10f199e-83eb-7088-f9ea-44057b59b6cc@grimberg.me>

On Sun, Feb 06, 2022 at 11:09:40AM +0200, Sagi Grimberg wrote:
> 
> > > Hannes suggested that we combine both attributes into a single one that would take the values: "io", "discovery-none", "discovery-ddc", "discovery-cdc", "discovery-reserved", and "admin". But Sagi did not like this proposal and instead proposed the changes that you see here. Basically, we want to be able to re-execute the is_visible() method after we have identified the controller so that we can determine whether the dctype should be exposed.
> 
> Just to note that the same fundamental issue exists in both approaches,
> having the "combined" string change after the controller is identified
> is equivalent to having the separated attribute appear after the device
> is initialized.
> 
> > Nope, that's not how the driver model works and you break all userspace
> > tools by doing this as it only scans the list of attributes when the
> > device is created and announced to userspace.
> > 
> > By changing the files and types and such afterward no one ever notices
> > and so userspace is "blind" to the change unless you want it to
> > constantly walk all of sysfs all the time to find this out (hint, you
> > don't want that...)
> 
> The idea was to add a separate udev announcement that would tell
> userspace that these attributes are stable (it actually serves
> a different purpose, but it does come after that point).

like KOBJECT_CHANGE is there for?

> > So there's a reason you are being forced to add a driver-core change
> > like this, because it's not something you should do :)
> 
> I do agree that its a bit backwards to do this update. But the device
> even today is not fully usable when it is created, so we know no
> userspace program relies on the creation announcement.
> 
> > > So now I'm in a bit of a pickle. Sagi suggested this current patch set, but from what you're saying this is not a good approach. If you could suggest a solution that would satisfy all parties, I would greatly appreciate it.
> > 
> > Wait to create the device when you know the device type.
> 
> The initial proposal was to defer the device creation to after the
> device is fully initialized. That though is a heavier lift because the
> device initialization is something that happens on every reset or
> reconnection after connectivity loss,

That's fine, what's wrong with tearing it all down and bringing it back
up then?  That's what the hardware just did, don't fake things out by
not conveying the same stuff to userspace.

> so if we move the device creation there we have to now check if this
> is the first time we are doing this or not, and also error recovery
> becomes more opinionated...

I still think you should not create anything until you know what it is.

thanks,

greg k-h


  reply	other threads:[~2022-02-06 12:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220203211748.27542-1-nitram_67@hotmail.com>
2022-02-03 21:17 ` [PATCHv2 1/3] nvme: send uevent on connection up Martin Belanger
2022-02-03 21:17 ` [PATCHv2 2/3] nvme: Add device_update_groups() Martin Belanger
2022-02-04  2:22   ` Chaitanya Kulkarni
2022-02-04  7:04   ` driver core patch, was " Christoph Hellwig
2022-02-04  7:45     ` Greg KH
2022-02-04  7:31   ` Hannes Reinecke
2022-02-04  7:42   ` Greg KH
2022-02-03 21:17 ` [PATCHv2 3/3] nvme: Expose cntrltype and dctype through sysfs Martin Belanger
2022-02-04  7:32   ` Hannes Reinecke
2022-02-04  7:43   ` Greg KH
2022-02-04  7:45   ` Greg KH
2022-02-04 13:51     ` Belanger, Martin
2022-02-04 14:05       ` Greg KH
2022-02-06  9:09         ` Sagi Grimberg
2022-02-06 12:02           ` Greg KH [this message]
2022-02-06 15:55             ` Sagi Grimberg
2022-02-06  8:54     ` Sagi Grimberg
2022-02-06 12:00       ` Greg KH
2022-02-06 13:08       ` Hannes Reinecke
2022-02-06 13:15         ` Greg KH

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=Yf+4zhofzutXLVih@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Charles.Rose@dell.com \
    --cc=Martin.Belanger@dell.com \
    --cc=Stuart.Hayes@dell.com \
    --cc=axboe@fb.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nitram_67@hotmail.com \
    --cc=rafael@kernel.org \
    --cc=sagi@grimberg.me \
    /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