Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2127957ybd; Thu, 27 Jun 2019 07:13:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaWZYIeSsmvrnf08KcdRS85KUo6MNJV9+9zWCSMwQfG7b6nCw4CsBmi3L8yyLeNTO6t373 X-Received: by 2002:a63:2258:: with SMTP id t24mr4004248pgm.236.1561644834666; Thu, 27 Jun 2019 07:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561644834; cv=none; d=google.com; s=arc-20160816; b=k+P3w+ODjS34R8+H4Tp3GEiDUwdzMx8l2mSFdqKTRskB0pHr3ZHpuk+XyFlPr4OoZ8 ZMONXK022MWdTWPmOGcvWuPPBnYCTO8YT+BDpWOHZ/RfI8RBrec7G4wdxiZSZRoVRTPm RxjCkIyLqGRJQBtDR3tQmwefTJXCsvPR/VV047UrbvtD3pDu0jPrHdrZQ6ffBdnDZKJ1 ve0UcJ1uFM0gH7DpYN/gYr6ji08gNBbpX4juSz7893A8/kDnSdIz7DJpI1g8HhvdV9JJ Rqo50x1ALp4DjVIBs0rV61Ra8UxmskcxO7E5HHSF3yPLPHYXrtLrqzjlfn2ZiHpts3wY BURg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject; bh=6NTgqdYmKUB0FuZ5KaLEDAzxkpV0k5+bVycHJQIZ0K8=; b=zKtgzv68yYjJqfnnufQGe4J+iPhroeFYaxubujFBQ72urHvtWjmuEfQA6tqGb0HxY3 NWvTYqktptD0ViyCnpl/+Yfa+Hl7lSJSzHYwKpl6iWPUaQozaxEBJwx9TO2qUu5DDpg8 56+zbnQRKMB54A0cz7VqjQBotBk0mRUD/AXcGWU05ROTi4rHjMGxSZH1XciN4qNFGTcE Shx0SkLCguSDFiYLRHocaj72aPAqjXhD26JnnRnPycs/L+DAv2ROlU/+sydObMlQc/SD Ho4Suxgg721vLQceCG3FF4tv8uTMhkfsvj8IBiihDhYyg6Jgor9GHunKr7J+Senv6sQz n7sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=jNQff2Xd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg11si5102318pjb.72.2019.06.27.07.13.37; Thu, 27 Jun 2019 07:13:54 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=jNQff2Xd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbfF0OMo (ORCPT + 99 others); Thu, 27 Jun 2019 10:12:44 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:6121 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbfF0OMn (ORCPT ); Thu, 27 Jun 2019 10:12:43 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 27 Jun 2019 07:12:40 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 27 Jun 2019 07:12:42 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 27 Jun 2019 07:12:42 -0700 Received: from [10.24.71.89] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 27 Jun 2019 14:12:40 +0000 Subject: Re: [PATCH] mdev: Send uevents around parent device registration To: Cornelia Huck CC: Alex Williamson , , References: <156155924767.11505.11457229921502145577.stgit@gimli.home> <1ea5c171-cd42-1c10-966e-1b82a27351d9@nvidia.com> <20190626120551.788fa5ed@x1.home> <20190627102107.3c7715d9.cohuck@redhat.com> X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: <107cbedf-6c66-a666-d26a-5842d8c24e83@nvidia.com> Date: Thu, 27 Jun 2019 19:42:32 +0530 MIME-Version: 1.0 In-Reply-To: <20190627102107.3c7715d9.cohuck@redhat.com> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL106.nvidia.com (172.18.146.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1561644760; bh=6NTgqdYmKUB0FuZ5KaLEDAzxkpV0k5+bVycHJQIZ0K8=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=jNQff2XdzD/1HxLc4NTYRxK1C4wixFSImTAkzyA3LhMuRyD7AIcG9zF2MuDQTc+9G O9En6hfpBf6Unv7uR/gGIZswozNhEP4BpUymnTcMhEvmDFL6eljPkj4rN5Q9U5PLH6 0rVlnZgR80zyKVfCkmxR9m5KmKl3BhM/S5I9cGVc81JRH354FoOE1/FGUqVyRxDPCq 1GNPpbHAh/XW9DLQAYtJog2SmLWq40TSAuqmZv7J5cBTtv0qSN5GdZ4FpOefyiO/XC g7NqYFNADieFlmgDzBdLBJLLOVrmLDPMjgdEIQNhm+2b9T2YdeRmoiFepYEw8mMQH0 0Z3TTMZZ2JzIw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/27/2019 1:51 PM, Cornelia Huck wrote: > 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? > Trace events are not always collected in production environment, there kernel log helps. Thanks, Kirti