All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Kirti Wankhede <kwankhede@nvidia.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	<kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mdev: Send uevents around parent device registration
Date: Thu, 27 Jun 2019 10:21:07 +0200	[thread overview]
Message-ID: <20190627102107.3c7715d9.cohuck@redhat.com> (raw)
In-Reply-To: <a6c2ec9e-b949-4346-13bc-4d7f9c35ea8b@nvidia.com>

On Thu, 27 Jun 2019 00:33:59 +0530
Kirti Wankhede <kwankhede@nvidia.com> wrote:

> On 6/26/2019 11:35 PM, Alex Williamson wrote:
> > On Wed, 26 Jun 2019 23:23:00 +0530
> > Kirti Wankhede <kwankhede@nvidia.com> wrote:
> >   
> >> On 6/26/2019 7:57 PM, Alex Williamson wrote:  
> >>> This allows udev to trigger rules when a parent device is registered
> >>> or unregistered from mdev.
> >>>
> >>> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> >>> ---
> >>>  drivers/vfio/mdev/mdev_core.c |   10 ++++++++--
> >>>  1 file changed, 8 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
> >>> index ae23151442cb..ecec2a3b13cb 100644
> >>> --- a/drivers/vfio/mdev/mdev_core.c
> >>> +++ b/drivers/vfio/mdev/mdev_core.c
> >>> @@ -146,6 +146,8 @@ int mdev_register_device(struct device *dev, const struct mdev_parent_ops *ops)
> >>>  {
> >>>  	int ret;
> >>>  	struct mdev_parent *parent;
> >>> +	char *env_string = "MDEV_STATE=registered";
> >>> +	char *envp[] = { env_string, NULL };
> >>>  
> >>>  	/* check for mandatory ops */
> >>>  	if (!ops || !ops->create || !ops->remove || !ops->supported_type_groups)
> >>> @@ -196,7 +198,8 @@ int mdev_register_device(struct device *dev, const struct mdev_parent_ops *ops)
> >>>  	list_add(&parent->next, &parent_list);
> >>>  	mutex_unlock(&parent_list_lock);
> >>>  
> >>> -	dev_info(dev, "MDEV: Registered\n");
> >>> +	kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
> >>> +    
> >>
> >> Its good to have udev event, but don't remove debug print from dmesg.
> >> Same for unregister.  
> > 
> > Who consumes these?  They seem noisy.  Thanks,
> >   
> 
> I don't think its noisy, its more of logging purpose. This is seen in
> kernel log only when physical device is registered to mdev.

Yes; but why do you want to log success? If you need to log it
somewhere, wouldn't a trace event be a much better choice?

  reply	other threads:[~2019-06-27  8:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 14:27 [PATCH] mdev: Send uevents around parent device registration Alex Williamson
2019-06-26 17:53 ` Kirti Wankhede
2019-06-26 18:05   ` Alex Williamson
2019-06-26 19:03     ` Kirti Wankhede
2019-06-27  8:21       ` Cornelia Huck [this message]
2019-06-27 14:12         ` Kirti Wankhede
2019-07-01  8:10           ` Cornelia Huck
2019-06-27  8:19 ` Cornelia Huck
2019-06-28 15:56   ` Alex Williamson
2019-07-01  8:06     ` Cornelia Huck
2019-07-01  8:11 ` Cornelia Huck

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=20190627102107.3c7715d9.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.