Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5754623ybp; Tue, 15 Oct 2019 04:39:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/WXPC4ph9ikkLcUfCiCATEo8oktFrzWea+qHncEeBPn3YI8pPLhDkUwkQ8rzjUsDLuUZd X-Received: by 2002:a17:907:4366:: with SMTP id nd6mr32965368ejb.97.1571139577609; Tue, 15 Oct 2019 04:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571139577; cv=none; d=google.com; s=arc-20160816; b=urPg9S5LL+WoP5+k/s5SC7pAb9zIKZpbVnSI6Qnmo9uGSR3jxucqbb52CJALYFwuIw FT9PkY6UoyfJ0hEb3riBtRwF0Fd6r11N1+5pJO5IMAHL60Rx4pyUMJ6kOxcBntmgu/lO iS2E+D4fUIXQwdhhDeeMCtAG45Awc+HBuh2x+FuqNle0Scc379/tr/SkMPIHVUmJJ8O6 pkmvdf0wd6mG0bjlpNAilUCOxGLyeXoYaPky2To3BrtpSNO3UcpfPZ0NFQPm782c5pw2 rRHmK/cSUvbGwqiFM104/TU+GgICBs1nQymDkd1SiAKzLd2We1vbKDfWHzfGT1IXzyIy OQ8A== 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=Dw4PM0MF67daSk+C1lIrS99Zj1CxtIDvKzf479nd+aw=; b=lgI7KGThnnTr/NemaxHjkC3bVh6FW0UGIHGOl0a/kAvvZZs7ps25sQVsV6UUcUzES9 2Hgfl8KZDy9ZozSQ/ZHYG7TVvJq4Rx6c/u5503taYoTcTAO9S11z3SOajpkdQehAmnNP Q13V40+dZNXws6tFjJHdIaViEKRsCFQ3/lpPF6jUZCrsJDHl/agaxMXjNXsvqk3jnzsA Zx71gmb7Dxm5jX2ORLp+lJ/Xmxc1jgl9GbdARDzVBSQUivrctBkctxfcULatZrFZ00tW cuiPywzhgHKJMoQPdMCC/PyvZtUd8yudLAWteKgD6t0eTzlj5NzqdYV6on/bhY173yus F+SA== 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 b15si14407306edm.395.2019.10.15.04.39.06; Tue, 15 Oct 2019 04:39:37 -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 S1730670AbfJOK1Y (ORCPT + 99 others); Tue, 15 Oct 2019 06:27:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57474 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbfJOK1X (ORCPT ); Tue, 15 Oct 2019 06:27:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D882A882EF; Tue, 15 Oct 2019 10:27:22 +0000 (UTC) Received: from gondolin (dhcp-192-233.str.redhat.com [10.33.192.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 888895DA8C; Tue, 15 Oct 2019 10:27:09 +0000 (UTC) Date: Tue, 15 Oct 2019 12:27:07 +0200 From: Cornelia Huck To: Jason Wang Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, kwankhede@nvidia.com, alex.williamson@redhat.com, mst@redhat.com, tiwei.bie@intel.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, maxime.coquelin@redhat.com, cunming.liang@intel.com, zhihong.wang@intel.com, rob.miller@broadcom.com, xiao.w.wang@intel.com, haotian.wang@sifive.com, zhenyuw@linux.intel.com, zhi.a.wang@intel.com, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch, farman@linux.ibm.com, pasic@linux.ibm.com, sebott@linux.ibm.com, oberpar@linux.ibm.com, heiko.carstens@de.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, akrowiak@linux.ibm.com, freude@linux.ibm.com, lingshan.zhu@intel.com, idos@mellanox.com, eperezma@redhat.com, lulu@redhat.com, parav@mellanox.com, christophe.de.dinechin@gmail.com, kevin.tian@intel.com Subject: Re: [PATCH V3 2/7] mdev: bus uevent support Message-ID: <20191015122707.1fd52240.cohuck@redhat.com> In-Reply-To: <20191011081557.28302-3-jasowang@redhat.com> References: <20191011081557.28302-1-jasowang@redhat.com> <20191011081557.28302-3-jasowang@redhat.com> 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 15 Oct 2019 10:27:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 11 Oct 2019 16:15:52 +0800 Jason Wang wrote: > This patch adds bus uevent support for mdev bus in order to allow > cooperation with userspace. > > Signed-off-by: Jason Wang > --- > drivers/vfio/mdev/mdev_driver.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c > index b7c40ce86ee3..319d886ffaf7 100644 > --- a/drivers/vfio/mdev/mdev_driver.c > +++ b/drivers/vfio/mdev/mdev_driver.c > @@ -82,9 +82,17 @@ static int mdev_match(struct device *dev, struct device_driver *drv) > return 0; > } > > +static int mdev_uevent(struct device *dev, struct kobj_uevent_env *env) > +{ > + struct mdev_device *mdev = to_mdev_device(dev); > + > + return add_uevent_var(env, "MODALIAS=mdev:c%02X", mdev->class_id); > +} > + > struct bus_type mdev_bus_type = { > .name = "mdev", > .match = mdev_match, > + .uevent = mdev_uevent, > .probe = mdev_probe, > .remove = mdev_remove, > }; I'd merge that into the previous patch.