Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1784599ybd; Thu, 27 Jun 2019 01:22:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqNuCHGmUtUo2fcdlarFXfChMdS2gROkUc1naKPzfHfJLfruQoBJi26rj1fQ68JhS1HBzJ X-Received: by 2002:a63:1a5c:: with SMTP id a28mr2584585pgm.418.1561623779365; Thu, 27 Jun 2019 01:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561623779; cv=none; d=google.com; s=arc-20160816; b=VYqBevLqbyigm4IcfNVnww56uPO7Grf9cx2Gonlpxzw7ZzROHnFlPlLLSQbLYcHmLG Q/yXN7Pyu1uGmBuLX1DIkpWLxCUdFsR7W6PMJwP7S6QP4mg2v3pghBzt8WQcY5ch26PR 3364Nx5yIL5atwJkJO8ZqugTZVsM5AdmR/8uQxivLhXN4XkT5R4kVLUlqF2hU7D+OknQ Oe26DKnRTsLKExVkFnKP2h4LDv7+CSimUHdqS+VglGoXyKhHrJRSn0ZLak65Hd8Lyjox PjB2POMJgPDlLq9nsVtlQYZU8M7O3UMb9vAE+yWjaLW2DHOed1usMU97AO9/qXzFvofQ SByg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=r7vgiPrSVkb/z7EPRBlX+/9cMNkXaFxFNj643SittIw=; b=Tf0v+A/S9XfMC7IXegGZF66vHuZ3USPpuG34zAJ1QIQGKX6oQyVh/s4R/ZkFRELux/ 4dmbcJ1XA05W8miDYZiMjRpfcB4HJi3+z8n4dRmGmfNPqtZcw1ClvCI/7EOSpnfqxH0u 2K7TS+HM0sETcJ1bn5ss3Hl4SvXsaLOa5x9PFvESbEoU0UYkOcXI0Bw4Ejv74LU+/HWJ SGAkaBibJexOCmF4FfdUjmLHijLw+2YP4sxF5aTjJ556Q7dkDxFlaPCi0d3iW5JNy2AD ej4TDTfu6vLtN5YBjs8blzufJryFoMpzhhzPE6e3OV3OdmoVmtjJf8dFj8WYhjGjos3F o3sQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si1522782pgi.181.2019.06.27.01.22.40; Thu, 27 Jun 2019 01:22:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbfF0IVN (ORCPT + 99 others); Thu, 27 Jun 2019 04:21:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44988 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbfF0IVM (ORCPT ); Thu, 27 Jun 2019 04:21:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 91C0B309175F; Thu, 27 Jun 2019 08:21:12 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A39660C4E; Thu, 27 Jun 2019 08:21:09 +0000 (UTC) Date: Thu, 27 Jun 2019 10:21:07 +0200 From: Cornelia Huck To: Kirti Wankhede Cc: Alex Williamson , , Subject: Re: [PATCH] mdev: Send uevents around parent device registration Message-ID: <20190627102107.3c7715d9.cohuck@redhat.com> In-Reply-To: References: <156155924767.11505.11457229921502145577.stgit@gimli.home> <1ea5c171-cd42-1c10-966e-1b82a27351d9@nvidia.com> <20190626120551.788fa5ed@x1.home> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 27 Jun 2019 08:21:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Jun 2019 00:33:59 +0530 Kirti Wankhede wrote: > On 6/26/2019 11:35 PM, Alex Williamson wrote: > > On Wed, 26 Jun 2019 23:23:00 +0530 > > Kirti Wankhede 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 > >>> --- > >>> 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?