Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1502374 > unrolled thread

[PATCH v2 1/3] vmbus: add support for dynamic device id's

Started byStephen Hemminger <stephen@networkplumber.org>
First post2016-10-17 21:40 +0200
Last post2016-10-21 23:20 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 1/3] vmbus: add support for dynamic device id's Stephen Hemminger <stephen@networkplumber.org> - 2016-10-17 21:40 +0200
    [PATCH v2 3/3] doc: add documentation for uio-hv-generic Stephen Hemminger <stephen@networkplumber.org> - 2016-10-17 21:40 +0200
      Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic Jani Nikula <jani.nikula@linux.intel.com> - 2016-10-18 13:00 +0200
        Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic Markus Heiser <markus.heiser@darmarit.de> - 2016-10-18 13:10 +0200
          Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic Stephen Hemminger <stephen@networkplumber.org> - 2016-10-18 16:00 +0200
            Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic Markus Heiser <markus.heiser@darmarit.de> - 2016-10-18 16:10 +0200
      Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic Jonathan Corbet <corbet@lwn.net> - 2016-10-21 23:20 +0200

#1502374 — [PATCH v2 1/3] vmbus: add support for dynamic device id's

FromStephen Hemminger <stephen@networkplumber.org>
Date2016-10-17 21:40 +0200
Subject[PATCH v2 1/3] vmbus: add support for dynamic device id's
Message-ID<stlVn-7Rn-13@gated-at.bofh.it>
From: Stephen Hemminger <sthemmin@microsoft.com>

This patch adds sysfs interface to dynamically bind new UUID values
to existing VMBus device. This is useful for generic UIO driver to
act similar to uio_pci_generic.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
v2 - allow device driver to have empty id table, and fix bugs

 drivers/hv/vmbus_drv.c | 174 ++++++++++++++++++++++++++++++++++++++++++++++---
 include/linux/hyperv.h |   6 ++
 2 files changed, 172 insertions(+), 8 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index a259e18..d8d34bf 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -45,6 +45,11 @@
 #include <linux/random.h>
 #include "hyperv_vmbus.h"
 
+struct vmbus_dynid {
+	struct list_head node;
+	struct hv_vmbus_device_id id;
+};
+
 static struct acpi_device  *hv_acpi_dev;
 
 static struct completion probe_event;
@@ -500,7 +505,7 @@ static ssize_t device_show(struct device *dev,
 static DEVICE_ATTR_RO(device);
 
 /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */
-static struct attribute *vmbus_attrs[] = {
+static struct attribute *vmbus_dev_attrs[] = {
 	&dev_attr_id.attr,
 	&dev_attr_state.attr,
 	&dev_attr_monitor_id.attr,
@@ -528,7 +533,7 @@ static struct attribute *vmbus_attrs[] = {
 	&dev_attr_device.attr,
 	NULL,
 };
-ATTRIBUTE_GROUPS(vmbus);
+ATTRIBUTE_GROUPS(vmbus_dev);
 
 /*
  * vmbus_uevent - add uevent for our device
@@ -565,10 +570,29 @@ static inline bool is_null_guid(const uuid_le *guid)
  * Return a matching hv_vmbus_device_id pointer.
  * If there is no match, return NULL.
  */
-static const struct hv_vmbus_device_id *hv_vmbus_get_id(
-					const struct hv_vmbus_device_id *id,
+static const struct hv_vmbus_device_id *hv_vmbus_get_id(struct hv_driver *drv,
 					const uuid_le *guid)
 {
+	const struct hv_vmbus_device_id *id = NULL;
+	struct vmbus_dynid *dynid;
+
+	/* Look at the dynamic ids first, before the static ones */
+	spin_lock(&drv->dynids.lock);
+	list_for_each_entry(dynid, &drv->dynids.list, node) {
+		if (!uuid_le_cmp(dynid->id.guid, *guid)) {
+			id = &dynid->id;
+			break;
+		}
+	}
+	spin_unlock(&drv->dynids.lock);
+
+	if (id)
+		return id;
+
+	id = drv->id_table;
+	if (id == NULL)
+		return NULL; /* empty device table */
+
 	for (; !is_null_guid(&id->guid); id++)
 		if (!uuid_le_cmp(id->guid, *guid))
 			return id;
@@ -576,6 +600,134 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(
 	return NULL;
 }
 
+/* vmbus_add_dynid - add a new device ID to this driver and re-probe devices */
+static int vmbus_add_dynid(struct hv_driver *drv, uuid_le *guid)
+{
+	struct vmbus_dynid *dynid;
+
+	dynid = kzalloc(sizeof(*dynid), GFP_KERNEL);
+	if (!dynid)
+		return -ENOMEM;
+
+	dynid->id.guid = *guid;
+
+	spin_lock(&drv->dynids.lock);
+	list_add_tail(&dynid->node, &drv->dynids.list);
+	spin_unlock(&drv->dynids.lock);
+
+	return driver_attach(&drv->driver);
+}
+
+static void vmbus_free_dynids(struct hv_driver *drv)
+{
+	struct vmbus_dynid *dynid, *n;
+
+	spin_lock(&drv->dynids.lock);
+	list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) {
+		list_del(&dynid->node);
+		kfree(dynid);
+	}
+	spin_unlock(&drv->dynids.lock);
+}
+
+/* Parse string of form: 1b4e28ba-2fa1-11d2-883f-b9a761bde3f */
+static int get_uuid_le(const char *str, uuid_le *uu)
+{
+	unsigned int b[16];
+	int i;
+
+	if (strlen(str) < 37)
+		return -1;
+
+	for (i = 0; i < 36; i++) {
+		switch (i) {
+		case 8: case 13: case 18: case 23:
+			if (str[i] != '-')
+				return -1;
+			break;
+		default:
+			if (!isxdigit(str[i]))
+				return -1;
+		}
+	}
+
+	/* unparse little endian output byte order */
+	if (sscanf(str,
+		   "%2x%2x%2x%2x-%2x%2x-%2x%2x-%2x%2x-%2x%2x%2x%2x%2x%2x",
+		   &b[3], &b[2], &b[1], &b[0],
+		   &b[5], &b[4], &b[7], &b[6], &b[8], &b[9],
+		   &b[10], &b[11], &b[12], &b[13], &b[14], &b[15]) != 16)
+		return -1;
+
+	for (i = 0; i < 16; i++)
+		uu->b[i] = b[i];
+	return 0;
+}
+
+/*
+ * store_new_id - sysfs frontend to vmbus_add_dynid()
+ *
+ * Allow GUIDs to be added to an existing driver via sysfs.
+ */
+static ssize_t store_new_id(struct device_driver *driver, const char *buf,
+			    size_t count)
+{
+	struct hv_driver *drv = drv_to_hv_drv(driver);
+	uuid_le guid = NULL_UUID_LE;
+	ssize_t retval;
+
+	if (get_uuid_le(buf, &guid) != 0)
+		return -EINVAL;
+
+	if (hv_vmbus_get_id(drv, &guid))
+		return -EEXIST;
+
+	retval = vmbus_add_dynid(drv, &guid);
+	if (retval)
+		return retval;
+	return count;
+}
+static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id);
+
+/*
+ * store_remove_id - remove a PCI device ID from this driver
+ *
+ * Removes a dynamic pci device ID to this driver.
+ */
+static ssize_t store_remove_id(struct device_driver *driver, const char *buf,
+			       size_t count)
+{
+	struct hv_driver *drv = drv_to_hv_drv(driver);
+	struct vmbus_dynid *dynid, *n;
+	uuid_le guid = NULL_UUID_LE;
+	size_t retval = -ENODEV;
+
+	if (get_uuid_le(buf, &guid))
+		return -EINVAL;
+
+	spin_lock(&drv->dynids.lock);
+	list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) {
+		struct hv_vmbus_device_id *id = &dynid->id;
+
+		if (!uuid_le_cmp(id->guid, guid)) {
+			list_del(&dynid->node);
+			kfree(dynid);
+			retval = count;
+			break;
+		}
+	}
+	spin_unlock(&drv->dynids.lock);
+
+	return retval;
+}
+static DRIVER_ATTR(remove_id, S_IWUSR, NULL, store_remove_id);
+
+static struct attribute *vmbus_drv_attrs[] = {
+	&driver_attr_new_id.attr,
+	&driver_attr_remove_id.attr,
+	NULL,
+};
+ATTRIBUTE_GROUPS(vmbus_drv);
 
 
 /*
@@ -590,7 +742,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
 	if (is_hvsock_channel(hv_dev->channel))
 		return drv->hvsock;
 
-	if (hv_vmbus_get_id(drv->id_table, &hv_dev->dev_type))
+	if (hv_vmbus_get_id(drv, &hv_dev->dev_type))
 		return 1;
 
 	return 0;
@@ -607,7 +759,7 @@ static int vmbus_probe(struct device *child_device)
 	struct hv_device *dev = device_to_hv_device(child_device);
 	const struct hv_vmbus_device_id *dev_id;
 
-	dev_id = hv_vmbus_get_id(drv->id_table, &dev->dev_type);
+	dev_id = hv_vmbus_get_id(drv, &dev->dev_type);
 	if (drv->probe) {
 		ret = drv->probe(dev, dev_id);
 		if (ret != 0)
@@ -684,7 +836,8 @@ static struct bus_type  hv_bus = {
 	.remove =		vmbus_remove,
 	.probe =		vmbus_probe,
 	.uevent =		vmbus_uevent,
-	.dev_groups =		vmbus_groups,
+	.dev_groups =		vmbus_dev_groups,
+	.drv_groups =		vmbus_drv_groups,
 };
 
 struct onmessage_work_context {
@@ -905,6 +1058,9 @@ int __vmbus_driver_register(struct hv_driver *hv_driver, struct module *owner, c
 	hv_driver->driver.mod_name = mod_name;
 	hv_driver->driver.bus = &hv_bus;
 
+	spin_lock_init(&hv_driver->dynids.lock);
+	INIT_LIST_HEAD(&hv_driver->dynids.list);
+
 	ret = driver_register(&hv_driver->driver);
 
 	return ret;
@@ -923,8 +1079,10 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver)
 {
 	pr_info("unregistering driver %s\n", hv_driver->name);
 
-	if (!vmbus_exists())
+	if (!vmbus_exists()) {
 		driver_unregister(&hv_driver->driver);
+		vmbus_free_dynids(hv_driver);
+	}
 }
 EXPORT_SYMBOL_GPL(vmbus_driver_unregister);
 
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 6824556..737ac0d 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1119,6 +1119,12 @@ struct hv_driver {
 
 	struct device_driver driver;
 
+	/* dynamic device GUID's */
+	struct  {
+		spinlock_t lock;
+		struct list_head list;
+	} dynids;
+
 	int (*probe)(struct hv_device *, const struct hv_vmbus_device_id *);
 	int (*remove)(struct hv_device *);
 	void (*shutdown)(struct hv_device *);
-- 
2.9.3

[toc] | [next] | [standalone]


#1502377 — [PATCH v2 3/3] doc: add documentation for uio-hv-generic

FromStephen Hemminger <stephen@networkplumber.org>
Date2016-10-17 21:40 +0200
Subject[PATCH v2 3/3] doc: add documentation for uio-hv-generic
Message-ID<stlVo-7Rn-47@gated-at.bofh.it>
In reply to#1502374
From: Stephen Hemminger <sthemmin@microsoft.com>

Update UIO documentation to include basic information about
uio_hv_generic.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 Documentation/DocBook/uio-howto.tmpl | 62 ++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
index cd0e452..5210f8a 100644
--- a/Documentation/DocBook/uio-howto.tmpl
+++ b/Documentation/DocBook/uio-howto.tmpl
@@ -46,6 +46,13 @@ GPL version 2.
 
 <revhistory>
 	<revision>
+	<revnumber>0.10</revnumber>
+	<date>2016-10-17</date>
+	<authorinitials>sch</authorinitials>
+	<revremark>Added generic hyperv driver
+		</revremark>
+	</revision>
+	<revision>
 	<revnumber>0.9</revnumber>
 	<date>2009-07-16</date>
 	<authorinitials>mst</authorinitials>
@@ -1033,6 +1040,61 @@ int main()
 
 </chapter>
 
+<chapter id="uio_hv_generic" xreflabel="Using Generic driver for Hyper-V VMBUS">
+<?dbhtml filename="uio_hv_generic.html"?>
+<title>Generic Hyper-V UIO driver</title>
+	<para>
+	The generic driver is a kernel module named uio_hv_generic.
+	It supports devices on the Hyper-V VMBus similar to uio_pci_generic
+	on PCI bus.
+	</para>
+
+<sect1 id="uio_hv_generic_binding">
+<title>Making the driver recognize the device</title>
+	<para>
+Since the driver does not declare any device GUID's, it will not get loaded
+automatically and will not automatically bind to any devices, you must load it
+and allocate id to the driver yourself. For example, to use the network device
+GUID:
+	<programlisting>
+ modprobe uio_hv_generic
+ echo &quot;f8615163-df3e-46c5-913f-f2d2f965ed0e&quot; &gt; /sys/bus/vmbus/drivers/uio_hv_generic/new_id
+	</programlisting>
+	</para>
+	<para>
+If there already is a hardware specific kernel driver for the device, the
+generic driver still won't bind to it, in this case if you want to use the
+generic driver (why would you?) you'll have to manually unbind the hardware
+specific driver and bind the generic driver, like this:
+	<programlisting>
+	  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 &gt; /sys/bus/vmbus/drivers/hv_netvsc/unbind
+	  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 &gt; /sys/bus/vmbus/drivers/uio_hv_generic/bind
+	</programlisting>
+	</para>
+	<para>
+You can verify that the device has been bound to the driver
+by looking for it in sysfs, for example like the following:
+	<programlisting>
+    ls -l /sys/bus/vmbus/devices/vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver
+	</programlisting>
+Which if successful should print
+	<programlisting>
+  .../vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -&gt; ../../../bus/vmbus/drivers/uio_hv_generic
+	</programlisting>
+	</para>
+</sect1>
+
+<sect1 id="uio_hv_generic_internals">
+<title>Things to know about uio_hv_generic</title>
+	<para>
+On each interrupt, uio_hv_generic sets the Interrupt Disable bit.
+This prevents the device from generating further interrupts
+until the bit is cleared. The userspace driver should clear this
+bit before blocking and waiting for more interrupts.
+	</para>
+</sect1>
+</chapter>
+
 <appendix id="app1">
 <title>Further information</title>
 <itemizedlist>
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1502892 — Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic

FromJani Nikula <jani.nikula@linux.intel.com>
Date2016-10-18 13:00 +0200
SubjectRe: [PATCH v2 3/3] doc: add documentation for uio-hv-generic
Message-ID<stAhH-w3-7@gated-at.bofh.it>
In reply to#1502377
On Mon, 17 Oct 2016, Stephen Hemminger <stephen@networkplumber.org> wrote:
> From: Stephen Hemminger <sthemmin@microsoft.com>
>
> Update UIO documentation to include basic information about
> uio_hv_generic.

How about converting to Sphinx/reStructuredText first...? It's not a big
file...

BR,
Jani.



>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
>  Documentation/DocBook/uio-howto.tmpl | 62 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>
> diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
> index cd0e452..5210f8a 100644
> --- a/Documentation/DocBook/uio-howto.tmpl
> +++ b/Documentation/DocBook/uio-howto.tmpl
> @@ -46,6 +46,13 @@ GPL version 2.
>  
>  <revhistory>
>  	<revision>
> +	<revnumber>0.10</revnumber>
> +	<date>2016-10-17</date>
> +	<authorinitials>sch</authorinitials>
> +	<revremark>Added generic hyperv driver
> +		</revremark>
> +	</revision>
> +	<revision>
>  	<revnumber>0.9</revnumber>
>  	<date>2009-07-16</date>
>  	<authorinitials>mst</authorinitials>
> @@ -1033,6 +1040,61 @@ int main()
>  
>  </chapter>
>  
> +<chapter id="uio_hv_generic" xreflabel="Using Generic driver for Hyper-V VMBUS">
> +<?dbhtml filename="uio_hv_generic.html"?>
> +<title>Generic Hyper-V UIO driver</title>
> +	<para>
> +	The generic driver is a kernel module named uio_hv_generic.
> +	It supports devices on the Hyper-V VMBus similar to uio_pci_generic
> +	on PCI bus.
> +	</para>
> +
> +<sect1 id="uio_hv_generic_binding">
> +<title>Making the driver recognize the device</title>
> +	<para>
> +Since the driver does not declare any device GUID's, it will not get loaded
> +automatically and will not automatically bind to any devices, you must load it
> +and allocate id to the driver yourself. For example, to use the network device
> +GUID:
> +	<programlisting>
> + modprobe uio_hv_generic
> + echo &quot;f8615163-df3e-46c5-913f-f2d2f965ed0e&quot; &gt; /sys/bus/vmbus/drivers/uio_hv_generic/new_id
> +	</programlisting>
> +	</para>
> +	<para>
> +If there already is a hardware specific kernel driver for the device, the
> +generic driver still won't bind to it, in this case if you want to use the
> +generic driver (why would you?) you'll have to manually unbind the hardware
> +specific driver and bind the generic driver, like this:
> +	<programlisting>
> +	  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 &gt; /sys/bus/vmbus/drivers/hv_netvsc/unbind
> +	  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 &gt; /sys/bus/vmbus/drivers/uio_hv_generic/bind
> +	</programlisting>
> +	</para>
> +	<para>
> +You can verify that the device has been bound to the driver
> +by looking for it in sysfs, for example like the following:
> +	<programlisting>
> +    ls -l /sys/bus/vmbus/devices/vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver
> +	</programlisting>
> +Which if successful should print
> +	<programlisting>
> +  .../vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -&gt; ../../../bus/vmbus/drivers/uio_hv_generic
> +	</programlisting>
> +	</para>
> +</sect1>
> +
> +<sect1 id="uio_hv_generic_internals">
> +<title>Things to know about uio_hv_generic</title>
> +	<para>
> +On each interrupt, uio_hv_generic sets the Interrupt Disable bit.
> +This prevents the device from generating further interrupts
> +until the bit is cleared. The userspace driver should clear this
> +bit before blocking and waiting for more interrupts.
> +	</para>
> +</sect1>
> +</chapter>
> +
>  <appendix id="app1">
>  <title>Further information</title>
>  <itemizedlist>

-- 
Jani Nikula, Intel Open Source Technology Center

[toc] | [prev] | [next] | [standalone]


#1502895 — Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic

FromMarkus Heiser <markus.heiser@darmarit.de>
Date2016-10-18 13:10 +0200
SubjectRe: [PATCH v2 3/3] doc: add documentation for uio-hv-generic
Message-ID<stAro-Pg-11@gated-at.bofh.it>
In reply to#1502892
Am 18.10.2016 um 12:54 schrieb Jani Nikula <jani.nikula@linux.intel.com>:

> On Mon, 17 Oct 2016, Stephen Hemminger <stephen@networkplumber.org> wrote:
>> From: Stephen Hemminger <sthemmin@microsoft.com>
>> 
>> Update UIO documentation to include basic information about
>> uio_hv_generic.
> 
> How about converting to Sphinx/reStructuredText first...? It's not a big
> file...
> 

The files from :

 https://github.com/return42/sphkerneldoc/tree/master/doc/Documentation/books_migrated/uio-howto

might be a good starting point for migration / if you use them, 
please drop the comments at the end of each file.

--M--

> BR,
> Jani.
> 
> 
> 
>> 
>> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
>> ---
>> Documentation/DocBook/uio-howto.tmpl | 62 ++++++++++++++++++++++++++++++++++++
>> 1 file changed, 62 insertions(+)
>> 
>> diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
>> index cd0e452..5210f8a 100644
>> --- a/Documentation/DocBook/uio-howto.tmpl
>> +++ b/Documentation/DocBook/uio-howto.tmpl
>> @@ -46,6 +46,13 @@ GPL version 2.
>> 
>> <revhistory>
>> 	<revision>
>> +	<revnumber>0.10</revnumber>
>> +	<date>2016-10-17</date>
>> +	<authorinitials>sch</authorinitials>
>> +	<revremark>Added generic hyperv driver
>> +		</revremark>
>> +	</revision>
>> +	<revision>
>> 	<revnumber>0.9</revnumber>
>> 	<date>2009-07-16</date>
>> 	<authorinitials>mst</authorinitials>
>> @@ -1033,6 +1040,61 @@ int main()
>> 
>> </chapter>
>> 
>> +<chapter id="uio_hv_generic" xreflabel="Using Generic driver for Hyper-V VMBUS">
>> +<?dbhtml filename="uio_hv_generic.html"?>
>> +<title>Generic Hyper-V UIO driver</title>
>> +	<para>
>> +	The generic driver is a kernel module named uio_hv_generic.
>> +	It supports devices on the Hyper-V VMBus similar to uio_pci_generic
>> +	on PCI bus.
>> +	</para>
>> +
>> +<sect1 id="uio_hv_generic_binding">
>> +<title>Making the driver recognize the device</title>
>> +	<para>
>> +Since the driver does not declare any device GUID's, it will not get loaded
>> +automatically and will not automatically bind to any devices, you must load it
>> +and allocate id to the driver yourself. For example, to use the network device
>> +GUID:
>> +	<programlisting>
>> + modprobe uio_hv_generic
>> + echo &quot;f8615163-df3e-46c5-913f-f2d2f965ed0e&quot; &gt; /sys/bus/vmbus/drivers/uio_hv_generic/new_id
>> +	</programlisting>
>> +	</para>
>> +	<para>
>> +If there already is a hardware specific kernel driver for the device, the
>> +generic driver still won't bind to it, in this case if you want to use the
>> +generic driver (why would you?) you'll have to manually unbind the hardware
>> +specific driver and bind the generic driver, like this:
>> +	<programlisting>
>> +	  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 &gt; /sys/bus/vmbus/drivers/hv_netvsc/unbind
>> +	  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 &gt; /sys/bus/vmbus/drivers/uio_hv_generic/bind
>> +	</programlisting>
>> +	</para>
>> +	<para>
>> +You can verify that the device has been bound to the driver
>> +by looking for it in sysfs, for example like the following:
>> +	<programlisting>
>> +    ls -l /sys/bus/vmbus/devices/vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver
>> +	</programlisting>
>> +Which if successful should print
>> +	<programlisting>
>> +  .../vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -&gt; ../../../bus/vmbus/drivers/uio_hv_generic
>> +	</programlisting>
>> +	</para>
>> +</sect1>
>> +
>> +<sect1 id="uio_hv_generic_internals">
>> +<title>Things to know about uio_hv_generic</title>
>> +	<para>
>> +On each interrupt, uio_hv_generic sets the Interrupt Disable bit.
>> +This prevents the device from generating further interrupts
>> +until the bit is cleared. The userspace driver should clear this
>> +bit before blocking and waiting for more interrupts.
>> +	</para>
>> +</sect1>
>> +</chapter>
>> +
>> <appendix id="app1">
>> <title>Further information</title>
>> <itemizedlist>
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
> --
> To unsubscribe from this list: send the line "unsubscribe linux-doc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [next] | [standalone]


#1503012 — Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic

FromStephen Hemminger <stephen@networkplumber.org>
Date2016-10-18 16:00 +0200
SubjectRe: [PATCH v2 3/3] doc: add documentation for uio-hv-generic
Message-ID<stD5U-2pf-31@gated-at.bofh.it>
In reply to#1502895
On Tue, 18 Oct 2016 13:01:20 +0200
Markus Heiser <markus.heiser@darmarit.de> wrote:

> Am 18.10.2016 um 12:54 schrieb Jani Nikula <jani.nikula@linux.intel.com>:
> 
> > On Mon, 17 Oct 2016, Stephen Hemminger <stephen@networkplumber.org> wrote:  
> >> From: Stephen Hemminger <sthemmin@microsoft.com>
> >> 
> >> Update UIO documentation to include basic information about
> >> uio_hv_generic.  
> > 
> > How about converting to Sphinx/reStructuredText first...? It's not a big
> > file...
> >   
> 
> The files from :
> 
>  https://github.com/return42/sphkerneldoc/tree/master/doc/Documentation/books_migrated/uio-howto
> 
> might be a good starting point for migration / if you use them, 
> please drop the comments at the end of each file.
> 
> --M--

Sure, you are welcome to do this. I just wanted to add to existing documentation in existing
format.

[toc] | [prev] | [next] | [standalone]


#1503017 — Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic

FromMarkus Heiser <markus.heiser@darmarit.de>
Date2016-10-18 16:10 +0200
SubjectRe: [PATCH v2 3/3] doc: add documentation for uio-hv-generic
Message-ID<stDfB-2Jc-67@gated-at.bofh.it>
In reply to#1503012
Am 18.10.2016 um 15:59 schrieb Stephen Hemminger <stephen@networkplumber.org>:

> On Tue, 18 Oct 2016 13:01:20 +0200
> Markus Heiser <markus.heiser@darmarit.de> wrote:
> 
>> Am 18.10.2016 um 12:54 schrieb Jani Nikula <jani.nikula@linux.intel.com>:
>> 
>>> On Mon, 17 Oct 2016, Stephen Hemminger <stephen@networkplumber.org> wrote:  
>>>> From: Stephen Hemminger <sthemmin@microsoft.com>
>>>> 
>>>> Update UIO documentation to include basic information about
>>>> uio_hv_generic.  
>>> 
>>> How about converting to Sphinx/reStructuredText first...? It's not a big
>>> file...
>>> 
>> 
>> The files from :
>> 
>> https://github.com/return42/sphkerneldoc/tree/master/doc/Documentation/books_migrated/uio-howto
>> 
>> might be a good starting point for migration / if you use them, 
>> please drop the comments at the end of each file.
>> 
>> --M--
> 
> Sure, you are welcome to do this. I just wanted to add to existing documentation in existing
> format.

OK, I will send a patch / hope Greck and you will give me your acked ;-)

--M--

[toc] | [prev] | [next] | [standalone]


#1506297 — Re: [PATCH v2 3/3] doc: add documentation for uio-hv-generic

FromJonathan Corbet <corbet@lwn.net>
Date2016-10-21 23:20 +0200
SubjectRe: [PATCH v2 3/3] doc: add documentation for uio-hv-generic
Message-ID<suPom-2G3-7@gated-at.bofh.it>
In reply to#1502377
On Mon, 17 Oct 2016 12:33:19 -0700
Stephen Hemminger <stephen@networkplumber.org> wrote:

> From: Stephen Hemminger <sthemmin@microsoft.com>
> 
> Update UIO documentation to include basic information about
> uio_hv_generic.

I've applied this to the docs tree, thanks.

jon

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web