From: Jason Gunthorpe <jgg@ziepe.ca>
To: Christoph Hellwig <hch@lst.de>
Cc: Kirti Wankhede <kwankhede@nvidia.com>,
Tony Krowiak <akrowiak@linux.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>,
Jason Herne <jjherne@linux.ibm.com>,
Eric Farman <farman@linux.ibm.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Zhenyu Wang <zhenyuw@linux.intel.com>,
Zhi Wang <zhi.a.wang@intel.com>,
Alex Williamson <alex.williamson@redhat.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org,
intel-gvt-dev@lists.freedesktop.org
Subject: Re: [PATCH 3/8] vfio/mdev: simplify mdev_type handling
Date: Mon, 6 Jun 2022 20:38:08 -0300 [thread overview]
Message-ID: <20220606233808.GD3932382@ziepe.ca> (raw)
In-Reply-To: <20220603063328.3715-4-hch@lst.de>
On Fri, Jun 03, 2022 at 08:33:23AM +0200, Christoph Hellwig wrote:
> @@ -112,9 +88,10 @@ int mdev_register_parent(struct mdev_parent *parent, struct device *dev,
> return -ENOMEM;
> }
>
> - ret = parent_create_sysfs_files(parent);
> - if (ret)
> - return ret;
> + parent->mdev_types_kset = kset_create_and_add("mdev_supported_types",
> + NULL, &parent->dev->kobj);
> + if (!parent->mdev_types_kset)
> + return -ENOMEM;
>
> ret = class_compat_create_link(mdev_bus_compat_class, dev, NULL);
> if (ret)
[..]
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
This changes the ordering with respect to this udev event, now the
mdev_supported_types directory is created but the directory is empty,
then the driver fills it after the KOBJ_CHANGE event is triggered.
Granted this whole abusing some other struct device's sysfs thing is
inherently wrong - I'm not really sure what impact this has. Though at
least someone seemed to care since their is this uevent here...
Maybe we need a 'finish register' call to trigger the uevent? Or
perhaps trigger the uevent when each add_type is done?
Everything else looks fine though, I looked at this for a while a long
time ago and didn't see this nice final arrangement :\
Jason
next prev parent reply other threads:[~2022-06-06 23:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 6:33 simplify the mdev interface Christoph Hellwig
2022-06-03 6:33 ` [PATCH 1/8] vfio/mdev: make mdev.h standalone includable Christoph Hellwig
2022-06-06 23:21 ` Jason Gunthorpe
2022-06-09 6:43 ` Tian, Kevin
2022-06-03 6:33 ` [PATCH 2/8] vfio/mdev: embedd struct mdev_parent in the parent data structure Christoph Hellwig
2022-06-06 19:22 ` Kirti Wankhede
2022-06-07 5:48 ` Christoph Hellwig
2022-06-09 6:52 ` Tian, Kevin
2022-06-03 6:33 ` [PATCH 3/8] vfio/mdev: simplify mdev_type handling Christoph Hellwig
2022-06-06 19:22 ` Kirti Wankhede
2022-06-07 5:50 ` Christoph Hellwig
2022-06-08 17:57 ` Kirti Wankhede
2022-06-09 7:16 ` Christoph Hellwig
2022-06-06 23:38 ` Jason Gunthorpe [this message]
2022-06-07 5:56 ` Christoph Hellwig
2022-06-03 6:33 ` [PATCH 4/8] vfio/mdev: remove mdev_{create,remove}_sysfs_files Christoph Hellwig
2022-06-06 23:38 ` Jason Gunthorpe
2022-06-09 6:55 ` Tian, Kevin
2022-06-03 6:33 ` [PATCH 5/8] vfio/mdev: remove mdev_from_dev Christoph Hellwig
2022-06-06 23:45 ` Jason Gunthorpe
2022-06-09 6:56 ` Tian, Kevin
2022-06-03 6:33 ` [PATCH 6/8] vfio/mdev: unexport mdev_bus_type Christoph Hellwig
2022-06-06 23:46 ` Jason Gunthorpe
2022-06-09 6:57 ` Tian, Kevin
2022-06-03 6:33 ` [PATCH 7/8] vfio/mdev: remove mdev_parent_dev Christoph Hellwig
2022-06-06 23:46 ` Jason Gunthorpe
2022-06-09 6:58 ` Tian, Kevin
2022-06-03 6:33 ` [PATCH 8/8] vfio/mdev: remove mtype_get_parent_dev Christoph Hellwig
2022-06-06 23:46 ` Jason Gunthorpe
2022-06-09 6:58 ` Tian, Kevin
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=20220606233808.GD3932382@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=farman@linux.ibm.com \
--cc=hch@lst.de \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jjherne@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.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