linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/77] Staging: hv: Driver cleanup
@ 2011-06-16 20:16 K. Y. Srinivasan
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
  0 siblings, 1 reply; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization; +Cc: K. Y. Srinivasan

Further cleanup of the hv drivers:

	1) On some loaded hosts, we have discovered that the host does not respond to
	   the guest within the specified interval - currently one second. Increase the
	   timeout value in the guest.

	2) Implement code for autoloading the vmbus drivers without using PCI or DMI
	   signatures.

	3) Cleanup error handling across the board and use standard Linux error codes.

	4) General cleanup

	5) Some bug fixes.
	  

Regads,

K. Y 



^ permalink raw reply	[flat|nested] 91+ messages in thread

* [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver
  2011-06-16 20:16 [PATCH 00/77] Staging: hv: Driver cleanup K. Y. Srinivasan
@ 2011-06-16 20:16 ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 02/77] Staging: hv: netvsc: Increase the timeout value in the netvsc driver K. Y. Srinivasan
                     ` (75 more replies)
  0 siblings, 76 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen, stable

On some loaded windows hosts, we have discovered that the host may not 
respond to guest requests within the specified time (one second)
as evidenced by the guest timing out. Fix this problem by increasing
the timeout to 5 seconds. 

It may be useful to apply this patch to the 3.0 kernel as well.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
---
 drivers/staging/hv/channel.c      |    2 +-
 drivers/staging/hv/channel_mgmt.c |    2 +-
 drivers/staging/hv/connection.c   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index cffca7c..455f47a 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -211,7 +211,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&openInfo->waitevent, HZ);
+	t = wait_for_completion_timeout(&openInfo->waitevent, 5*HZ);
 	if (t == 0) {
 		err = -ETIMEDOUT;
 		goto errorout;
diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
index 2d270ce..bf011f3 100644
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -767,7 +767,7 @@ int vmbus_request_offers(void)
 		goto cleanup;
 	}
 
-	t = wait_for_completion_timeout(&msginfo->waitevent, HZ);
+	t = wait_for_completion_timeout(&msginfo->waitevent, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
 		goto cleanup;
diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
index 7e15392..e6b4039 100644
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -135,7 +135,7 @@ int vmbus_connect(void)
 	}
 
 	/* Wait for the connection response */
-	t =  wait_for_completion_timeout(&msginfo->waitevent, HZ);
+	t =  wait_for_completion_timeout(&msginfo->waitevent, 5*HZ);
 	if (t == 0) {
 		spin_lock_irqsave(&vmbus_connection.channelmsg_lock,
 				flags);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 02/77] Staging: hv: netvsc: Increase the timeout value in the netvsc driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 03/77] Staging: hv: storvsc: Increase the timeout value in the storvsc driver K. Y. Srinivasan
                     ` (74 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen, stable

On some loaded windows hosts, we have discovered that the host may not
respond to guest requests within the specified time (one second)
as evidenced by the guest timing out. Fix this problem by increasing
the timeout to 5 seconds. 

It may be useful to apply this patch to the 3.0 kernel as well.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
---
 drivers/staging/hv/netvsc.c       |    4 ++--
 drivers/staging/hv/rndis_filter.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 7b5bf0d..1bd920f 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -270,7 +270,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
 		goto cleanup;
 	}
 
-	t = wait_for_completion_timeout(&net_device->channel_init_wait, HZ);
+	t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
 	BUG_ON(t == 0);
 
 
@@ -357,7 +357,7 @@ static int netvsc_connect_vsp(struct hv_device *device)
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&net_device->channel_init_wait, HZ);
+	t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
 
 	if (t == 0) {
 		ret = -ETIMEDOUT;
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 5674a13..dbb5201 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -452,7 +452,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
 	if (ret != 0)
 		goto Cleanup;
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
 		goto Cleanup;
@@ -528,7 +528,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 	if (ret != 0)
 		goto Cleanup;
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 
 	if (t == 0) {
 		ret = -1;
@@ -585,7 +585,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
 	}
 
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 
 	if (t == 0) {
 		ret = -ETIMEDOUT;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 03/77] Staging: hv: storvsc: Increase the timeout value in the storvsc driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 02/77] Staging: hv: netvsc: Increase the timeout value in the netvsc driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 04/77] Staging: hv: netvsc: Fix a bug in accounting transmit slots K. Y. Srinivasan
                     ` (73 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen, stable

On some loaded windows hosts, we have discovered that the host may not
respond to guest requests within the specified time (one second)
as evidenced by the guest timing out. Fix this problem by increasing
the timeout to 5 seconds. 

It may be useful to apply this patch to the 3.0 kernel as well.
the 3.0 kernel as well.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
---
 drivers/staging/hv/storvsc.c     |    8 ++++----
 drivers/staging/hv/storvsc_drv.c |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 06cd327..3029786 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -135,7 +135,7 @@ static int storvsc_channel_init(struct hv_device *device)
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
 		goto cleanup;
@@ -163,7 +163,7 @@ static int storvsc_channel_init(struct hv_device *device)
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
 		goto cleanup;
@@ -192,7 +192,7 @@ static int storvsc_channel_init(struct hv_device *device)
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
 		goto cleanup;
@@ -222,7 +222,7 @@ static int storvsc_channel_init(struct hv_device *device)
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
 		goto cleanup;
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 2c6d2f2..7effaf3 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -376,7 +376,7 @@ static int storvsc_host_reset(struct hv_device *device)
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&request->wait_event, HZ);
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
 		goto cleanup;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 04/77] Staging: hv: netvsc: Fix a bug in accounting transmit slots
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 02/77] Staging: hv: netvsc: Increase the timeout value in the netvsc driver K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 03/77] Staging: hv: storvsc: Increase the timeout value in the storvsc driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 05/77] Staging: hv: vmbus: Properly handle the error in hv_acpi_init() K. Y. Srinivasan
                     ` (72 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen, stable

The transmit slots were manipulated without proper locking. Fix this bug by 
making the variable tracking the transmit slots atomic.

This patch should be ported to prior stable kernels 2.6.32 and later. 


Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
---
 drivers/staging/hv/netvsc_drv.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 33cab9c..38ca2c2 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -21,6 +21,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/init.h>
+#include <linux/atomic.h>
 #include <linux/module.h>
 #include <linux/highmem.h>
 #include <linux/device.h>
@@ -45,7 +46,7 @@
 struct net_device_context {
 	/* point back to our device context */
 	struct hv_device *device_ctx;
-	unsigned long avail;
+	atomic_t avail;
 	struct delayed_work dwork;
 };
 
@@ -118,8 +119,9 @@ static void netvsc_xmit_completion(void *context)
 
 		dev_kfree_skb_any(skb);
 
-		net_device_ctx->avail += num_pages;
-		if (net_device_ctx->avail >= PACKET_PAGES_HIWATER)
+		atomic_add(num_pages, &net_device_ctx->avail);
+		if (atomic_read(&net_device_ctx->avail) >=
+				PACKET_PAGES_HIWATER)
  			netif_wake_queue(net);
 	}
 }
@@ -133,7 +135,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 
 	/* Add 1 for skb->data and additional one for RNDIS */
 	num_pages = skb_shinfo(skb)->nr_frags + 1 + 1;
-	if (num_pages > net_device_ctx->avail)
+	if (num_pages > atomic_read(&net_device_ctx->avail))
 		return NETDEV_TX_BUSY;
 
 	/* Allocate a netvsc packet based on # of frags. */
@@ -185,8 +187,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 		net->stats.tx_bytes += skb->len;
 		net->stats.tx_packets++;
 
-		net_device_ctx->avail -= num_pages;
-		if (net_device_ctx->avail < PACKET_PAGES_LOWATER)
+		atomic_sub(num_pages, &net_device_ctx->avail);
+		if (atomic_read(&net_device_ctx->avail) < PACKET_PAGES_LOWATER)
 			netif_stop_queue(net);
 	} else {
 		/* we are shutting down or bus overloaded, just drop packet */
@@ -345,7 +347,7 @@ static int netvsc_probe(struct hv_device *dev)
 
 	net_device_ctx = netdev_priv(net);
 	net_device_ctx->device_ctx = dev;
-	net_device_ctx->avail = ring_size;
+	atomic_set(&net_device_ctx->avail, ring_size);
 	dev_set_drvdata(&dev->device, net);
 	INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 05/77] Staging: hv: vmbus: Properly handle the error in hv_acpi_init()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (2 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 04/77] Staging: hv: netvsc: Fix a bug in accounting transmit slots K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 06/77] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature K. Y. Srinivasan
                     ` (71 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Properly handle the error in hv_acpi_init().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index be158be..1c949f5 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -788,7 +788,10 @@ static int __init hv_acpi_init(void)
 		return -ENODEV;
 	}
 
-	return vmbus_bus_init(irq);
+	ret = vmbus_bus_init(irq);
+	if (ret)
+		acpi_bus_unregister_driver(&vmbus_acpi_driver);
+	return ret;
 }
 
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 06/77] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (3 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 05/77] Staging: hv: vmbus: Properly handle the error in hv_acpi_init() K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 07/77] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name K. Y. Srinivasan
                     ` (70 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

VMBUS is an ACPI enumerated device, get rid of the PCI signature.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 1c949f5..559353d 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -28,7 +28,6 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/sysctl.h>
-#include <linux/pci.h>
 #include <linux/dmi.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
@@ -754,18 +753,6 @@ static struct acpi_driver vmbus_acpi_driver = {
 	},
 };
 
-/*
- * We use a PCI table to determine if we should autoload this driver  This is
- * needed by distro tools to determine if the hyperv drivers should be
- * installed and/or configured.  We don't do anything else with the table, but
- * it needs to be present.
- */
-static const struct pci_device_id microsoft_hv_pci_table[] = {
-	{ PCI_DEVICE(0x1414, 0x5353) },	/* VGA compatible controller */
-	{ 0 }
-};
-MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
-
 static int __init hv_acpi_init(void)
 {
 	int ret;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 07/77] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (4 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 06/77] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-07-05 16:01     ` Greg KH
  2011-06-16 20:16   ` [PATCH 08/77] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver K. Y. Srinivasan
                     ` (69 subsequent siblings)
  75 siblings, 1 reply; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

In preparation for introducing machinery to support autoloading vmbus 
drivers, introduce a function to map the dev_type guid to a human readable name.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/channel_mgmt.c |   36 ++++++++++++++++++++++++++++++++++++
 drivers/staging/hv/hyperv.h       |    2 +-
 2 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
index bf011f3..022f32a 100644
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -112,6 +112,42 @@ static const struct hv_guid
 
 };
 
+static const char *blk_dev_type = "hv_block";
+static const char *net_dev_type = "hv_net";
+static const char *scsi_dev_type = "hv_scsi";
+static const char *mouse_dev_type = "hv_mouse";
+static const char *util_dev_type = "hv_util";
+
+/*
+ * Map the dev_type guid to a human readable string for setting
+ * up module aliases. The indices used in this function are based on
+ * the table defined earlier - supported_device_classes[]
+ */
+const char *hv_get_devtype_name(const struct hv_guid *type)
+{
+	int i;
+
+	for (i = 0; i < MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) {
+		if (!memcmp(type, supported_device_classes[i].data,
+				sizeof(struct hv_guid))) {
+			switch (i) {
+			case 0:
+				return scsi_dev_type;
+			case 1:
+				return net_dev_type;
+			case 2:
+				return mouse_dev_type;
+			case 3:
+				return blk_dev_type;
+			}
+		}
+	}
+	/*
+	 * Currently the util driver is used
+	 * to handle all these devices.
+	 */
+	return util_dev_type;
+}
 
 /**
  * prep_negotiate_resp() - Create default response for Hyper-V Negotiate message
diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
index 1747a24..21d9c73 100644
--- a/drivers/staging/hv/hyperv.h
+++ b/drivers/staging/hv/hyperv.h
@@ -944,5 +944,5 @@ extern void prep_negotiate_resp(struct icmsg_hdr *,
 				struct icmsg_negotiate *, u8 *);
 extern void chn_cb_negotiate(void *);
 extern struct hyperv_service_callback hv_cb_utils[];
-
+const char *hv_get_devtype_name(const struct hv_guid *type);
 #endif /* _HYPERV_H */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 08/77] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (5 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 07/77] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 09/77] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver K. Y. Srinivasan
                     ` (68 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

To support autoloading of vmbus drivers, introduce vmbus ID space in
struct hv_driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hyperv.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
index 21d9c73..84f60a3 100644
--- a/drivers/staging/hv/hyperv.h
+++ b/drivers/staging/hv/hyperv.h
@@ -801,12 +801,17 @@ struct hv_device_info {
 	struct hv_dev_port_info outbound;
 };
 
+struct hv_vmbus_device_id {
+	char device_type[32];
+};
+
 /* Base driver object */
 struct hv_driver {
 	const char *name;
 
 	/* the device type supported by this driver */
 	struct hv_guid dev_type;
+	const struct hv_vmbus_device_id *id_table;
 
 	struct device_driver driver;
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 09/77] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (6 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 08/77] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-07-05 16:04     ` Greg KH
  2011-06-16 20:16   ` [PATCH 10/77] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver K. Y. Srinivasan
                     ` (67 subsequent siblings)
  75 siblings, 1 reply; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Setup the newly introduced id_table for the blkvsc driver.:

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/blkvsc_drv.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 3612574..5842db8 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -802,10 +802,15 @@ static void blkvsc_request(struct request_queue *queue)
 	}
 }
 
+static const struct hv_vmbus_device_id id_table[] = {
+	{ "hv_block" },
+	{ "" }
+};
 
 
 /* The one and only one */
 static  struct hv_driver blkvsc_drv = {
+	.id_table = id_table,
 	.probe =  blkvsc_probe,
 	.remove =  blkvsc_remove,
 	.shutdown = blkvsc_shutdown,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 10/77] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (7 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 09/77] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 11/77] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver K. Y. Srinivasan
                     ` (66 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Setup the newly introduced id_table for the storvsc driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc_drv.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 7effaf3..b71764d 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -646,6 +646,10 @@ static struct scsi_host_template scsi_driver = {
 	.dma_boundary =		PAGE_SIZE-1,
 };
 
+static const struct hv_vmbus_device_id id_table[] = {
+	{ "hv_scsi" },
+	{ "" }
+};
 
 /*
  * storvsc_probe - Add a new device for this driver
@@ -720,6 +724,7 @@ static int storvsc_probe(struct hv_device *device)
 /* The one and only one */
 
 static struct hv_driver storvsc_drv = {
+	.id_table = id_table,
 	.probe = storvsc_probe,
 	.remove = storvsc_remove,
 };
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 11/77] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (8 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 10/77] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 12/77] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver K. Y. Srinivasan
                     ` (65 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Setup the newly introduced id_table for the netvsc driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc_drv.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 38ca2c2..3656c0f 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -413,8 +413,14 @@ static int netvsc_remove(struct hv_device *dev)
 	return 0;
 }
 
+static const struct hv_vmbus_device_id id_table[] = {
+	{ "hv_net" },
+	{ "" }
+};
+
 /* The one and only one */
 static struct  hv_driver netvsc_drv = {
+	.id_table = id_table,
 	.probe = netvsc_probe,
 	.remove = netvsc_remove,
 };
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 12/77] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (9 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 11/77] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 13/77] Staging: hv: vmbus: Introduce a human readable device type field to struct hv_device K. Y. Srinivasan
                     ` (64 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Setup the newly introduced id_table for the mouse driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_mouse.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index b191810..cc7f9e8 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -915,8 +915,13 @@ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
 	kfree(hid_dev);
 }
 
+static const struct hv_vmbus_device_id id_table[] = {
+	{ "hv_mouse" },
+	{ "" }
+};
 
 static struct  hv_driver mousevsc_drv = {
+	.id_table = id_table,
 	.probe = mousevsc_probe,
 	.remove = mousevsc_remove,
 };
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 13/77] Staging: hv: vmbus: Introduce a human readable device type field to struct hv_device
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (10 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 12/77] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 14/77] Staging: hv: util: Make hv_utils a vmbus device driver K. Y. Srinivasan
                     ` (63 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Introduce a human readable device type field to struct hv_device.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hyperv.h    |    1 +
 drivers/staging/hv/vmbus_drv.c |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
index 84f60a3..28fe7f9 100644
--- a/drivers/staging/hv/hyperv.h
+++ b/drivers/staging/hv/hyperv.h
@@ -825,6 +825,7 @@ struct hv_driver {
 struct hv_device {
 	/* the device type id of this device */
 	struct hv_guid dev_type;
+	const char *device_type;
 
 	/* the device instance id of this device */
 	struct hv_guid dev_instance;
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 559353d..04a6945 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -645,6 +645,10 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
 
 	child_device_obj->channel = channel;
 	memcpy(&child_device_obj->dev_type, type, sizeof(struct hv_guid));
+	/*
+	 * Get the human readable device type name and stash it away.
+	 */
+	child_device_obj->device_type = hv_get_devtype_name(type);
 	memcpy(&child_device_obj->dev_instance, instance,
 	       sizeof(struct hv_guid));
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 14/77] Staging: hv: util: Make hv_utils a vmbus device driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (11 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 13/77] Staging: hv: vmbus: Introduce a human readable device type field to struct hv_device K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line K. Y. Srinivasan
                     ` (62 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Make hv_utils a vmbus device driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_util.c |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index c164b54..4d2a282 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -36,6 +36,8 @@ static u8 *shut_txf_buf;
 static u8 *time_txf_buf;
 static u8 *hbeat_txf_buf;
 
+static const char *driver_name = "hv_util";
+
 static void shutdown_onchannelcallback(void *context)
 {
 	struct vmbus_channel *channel = context;
@@ -210,6 +212,34 @@ static void heartbeat_onchannelcallback(void *context)
 	}
 }
 
+/*
+ * The devices managed by the util driver don't need any additional
+ * setup.
+ */
+static int util_probe(struct hv_device *dev)
+{
+	return 0;
+}
+
+static int util_remove(struct hv_device *dev)
+{
+	return 0;
+}
+
+
+static const struct hv_vmbus_device_id id_table[] = {
+	{ "hv_util" },
+	{ "" }
+};
+
+
+/* The one and only one */
+static  struct hv_driver util_drv = {
+	.id_table = id_table,
+	.probe =  util_probe,
+	.remove =  util_remove,
+};
+
 static const struct pci_device_id __initconst
 hv_utils_pci_table[] __maybe_unused = {
 	{ PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */
@@ -264,7 +294,9 @@ static int __init init_hyperv_utils(void)
 
 	hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
 
-	return 0;
+	util_drv.driver.name = driver_name;
+
+	return vmbus_child_driver_register(&util_drv.driver);
 }
 
 static void exit_hyperv_utils(void)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (12 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 14/77] Staging: hv: util: Make hv_utils a vmbus device driver K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-07-05 16:06     ` Greg KH
  2011-06-16 20:16   ` [PATCH 16/77] Staging: hv: storvsc: " K. Y. Srinivasan
                     ` (61 subsequent siblings)
  75 siblings, 1 reply; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Add the appropriate MODULE_ALIAS() line to support auto-loading.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/blkvsc_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 5842db8..9496abe 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -1027,5 +1027,6 @@ static void __exit blkvsc_exit(void)
 MODULE_LICENSE("GPL");
 MODULE_VERSION(HV_DRV_VERSION);
 MODULE_DESCRIPTION("Microsoft Hyper-V virtual block driver");
+MODULE_ALIAS("vmbus:hv_block");
 module_init(blkvsc_drv_init);
 module_exit(blkvsc_exit);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 16/77] Staging: hv: storvsc: Add the appropriate MODULE_ALIAS() line
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (13 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 17/77] Staging: hv: netvsc: " K. Y. Srinivasan
                     ` (60 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Add the appropriate MODULE_ALIAS() line to support auto-loading.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index b71764d..dc9b12a 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -793,5 +793,6 @@ static void __exit storvsc_drv_exit(void)
 MODULE_LICENSE("GPL");
 MODULE_VERSION(HV_DRV_VERSION);
 MODULE_DESCRIPTION("Microsoft Hyper-V virtual storage driver");
+MODULE_ALIAS("vmbus:hv_scsi");
 module_init(storvsc_drv_init);
 module_exit(storvsc_drv_exit);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 17/77] Staging: hv: netvsc: Add the appropriate MODULE_ALIAS() line
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (14 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 16/77] Staging: hv: storvsc: " K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 18/77] Staging: hv: mousevsc: " K. Y. Srinivasan
                     ` (59 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Add the appropriate MODULE_ALIAS() line to support auto-loading.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 3656c0f..34b1ed3 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -477,6 +477,7 @@ MODULE_DEVICE_TABLE(pci, hv_netvsc_pci_table);
 MODULE_LICENSE("GPL");
 MODULE_VERSION(HV_DRV_VERSION);
 MODULE_DESCRIPTION("Microsoft Hyper-V network driver");
+MODULE_ALIAS("vmbus:hv_net");
 
 module_init(netvsc_drv_init);
 module_exit(netvsc_drv_exit);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 18/77] Staging: hv: mousevsc: Add the appropriate MODULE_ALIAS() line
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (15 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 17/77] Staging: hv: netvsc: " K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 19/77] Staging: hv: util: " K. Y. Srinivasan
                     ` (58 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Add the appropriate MODULE_ALIAS() line to support auto-loading.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_mouse.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index cc7f9e8..e615041 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -975,6 +975,7 @@ MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
 
 MODULE_LICENSE("GPL");
 MODULE_VERSION(HV_DRV_VERSION);
+MODULE_ALIAS("vmbus:hv_mouse");
 module_init(mousevsc_init);
 module_exit(mousevsc_exit);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 19/77] Staging: hv: util: Add the appropriate MODULE_ALIAS() line
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (16 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 18/77] Staging: hv: mousevsc: " K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 20/77] Staging: hv: vmbus: Cleanup the vmbus_uevent() code K. Y. Srinivasan
                     ` (57 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Add the appropriate MODULE_ALIAS() line to support auto-loading.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_util.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index 4d2a282..09819ff 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -334,5 +334,6 @@ module_init(init_hyperv_utils);
 module_exit(exit_hyperv_utils);
 
 MODULE_DESCRIPTION("Hyper-V Utilities");
+MODULE_ALIAS("vmbus:hv_util");
 MODULE_VERSION(HV_DRV_VERSION);
 MODULE_LICENSE("GPL");
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 20/77] Staging: hv: vmbus: Cleanup the vmbus_uevent() code
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (17 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 19/77] Staging: hv: util: " K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 21/77] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c K. Y. Srinivasan
                     ` (56 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now generate appropriate uevent based on the modalias string. As part of this,
cleanup the existing uevent code.


Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |   50 +--------------------------------------
 1 files changed, 2 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 04a6945..af657a9 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -241,54 +241,8 @@ static struct device_attribute vmbus_device_attrs[] = {
 static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
 {
 	struct hv_device *dev = device_to_hv_device(device);
-	int ret;
-
-	ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={"
-			     "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
-			     "%02x%02x%02x%02x%02x%02x%02x%02x}",
-			     dev->dev_type.data[3],
-			     dev->dev_type.data[2],
-			     dev->dev_type.data[1],
-			     dev->dev_type.data[0],
-			     dev->dev_type.data[5],
-			     dev->dev_type.data[4],
-			     dev->dev_type.data[7],
-			     dev->dev_type.data[6],
-			     dev->dev_type.data[8],
-			     dev->dev_type.data[9],
-			     dev->dev_type.data[10],
-			     dev->dev_type.data[11],
-			     dev->dev_type.data[12],
-			     dev->dev_type.data[13],
-			     dev->dev_type.data[14],
-			     dev->dev_type.data[15]);
-
-	if (ret)
-		return ret;
 
-	ret = add_uevent_var(env, "VMBUS_DEVICE_DEVICE_GUID={"
-			     "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
-			     "%02x%02x%02x%02x%02x%02x%02x%02x}",
-			     dev->dev_instance.data[3],
-			     dev->dev_instance.data[2],
-			     dev->dev_instance.data[1],
-			     dev->dev_instance.data[0],
-			     dev->dev_instance.data[5],
-			     dev->dev_instance.data[4],
-			     dev->dev_instance.data[7],
-			     dev->dev_instance.data[6],
-			     dev->dev_instance.data[8],
-			     dev->dev_instance.data[9],
-			     dev->dev_instance.data[10],
-			     dev->dev_instance.data[11],
-			     dev->dev_instance.data[12],
-			     dev->dev_instance.data[13],
-			     dev->dev_instance.data[14],
-			     dev->dev_instance.data[15]);
-	if (ret)
-		return ret;
-
-	return 0;
+	return add_uevent_var(env, "MODALIAS=vmbus:%s", dev->device_type);
 }
 
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 21/77] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (18 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 20/77] Staging: hv: vmbus: Cleanup the vmbus_uevent() code K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 22/77] Staging: hv: storvsc: Get rid of the DMI signature K. Y. Srinivasan
                     ` (55 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of an unnecessary include line in vmbus_drv.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index af657a9..cbb80ec 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -28,7 +28,6 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/sysctl.h>
-#include <linux/dmi.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 22/77] Staging: hv: storvsc: Get rid of the DMI signature
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (19 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 21/77] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 23/77] Staging: hv: netvsc: Get rid of the PCI signature K. Y. Srinivasan
                     ` (54 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now that we have implemented a vmbus specific mechanism for auto-loading,
get rid of the DMI signature.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc_drv.c |   22 ----------------------
 1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index dc9b12a..7d605c9 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -24,7 +24,6 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/blkdev.h>
-#include <linux/dmi.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_host.h>
@@ -729,27 +728,6 @@ static struct hv_driver storvsc_drv = {
 	.remove = storvsc_remove,
 };
 
-/*
- * We use a DMI table to determine if we should autoload this driver  This is
- * needed by distro tools to determine if the hyperv drivers should be
- * installed and/or configured.  We don't do anything else with the table, but
- * it needs to be present.
- */
-
-static const struct dmi_system_id __initconst
-hv_stor_dmi_table[] __maybe_unused  = {
-	{
-		.ident = "Hyper-V",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
-		},
-	},
-	{ },
-};
-MODULE_DEVICE_TABLE(dmi, hv_stor_dmi_table);
-
 static int __init storvsc_drv_init(void)
 {
 	int ret;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 23/77] Staging: hv: netvsc: Get rid of the PCI signature
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (20 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 22/77] Staging: hv: storvsc: Get rid of the DMI signature K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 24/77] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c K. Y. Srinivasan
                     ` (53 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now that we have implemented a vmbus specific mechanism for auto-loading,
get rid of the PCI signature.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc_drv.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 34b1ed3..c570214 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -34,7 +34,6 @@
 #include <linux/in.h>
 #include <linux/slab.h>
 #include <linux/dmi.h>
-#include <linux/pci.h>
 #include <net/arp.h>
 #include <net/route.h>
 #include <net/sock.h>
@@ -467,13 +466,6 @@ static int __init netvsc_drv_init(void)
 	return ret;
 }
 
-static const struct pci_device_id __initconst
-hv_netvsc_pci_table[] __maybe_unused = {
-	{ PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
-	{ 0 }
-};
-MODULE_DEVICE_TABLE(pci, hv_netvsc_pci_table);
-
 MODULE_LICENSE("GPL");
 MODULE_VERSION(HV_DRV_VERSION);
 MODULE_DESCRIPTION("Microsoft Hyper-V network driver");
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 24/77] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (21 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 23/77] Staging: hv: netvsc: Get rid of the PCI signature K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 25/77] Staging: hv: util: Get rid of the DMI signature in hv_util.c K. Y. Srinivasan
                     ` (52 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now that we have implemented a vmbus specific mechanism for auto-loading, get
rid of the DMI signature.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc_drv.c |   19 -------------------
 1 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index c570214..9075a73 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -33,7 +33,6 @@
 #include <linux/skbuff.h>
 #include <linux/in.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
 #include <net/arp.h>
 #include <net/route.h>
 #include <net/sock.h>
@@ -430,20 +429,6 @@ static void __exit netvsc_drv_exit(void)
 }
 
 
-static const struct dmi_system_id __initconst
-hv_netvsc_dmi_table[] __maybe_unused  = {
-	{
-		.ident = "Hyper-V",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
-		},
-	},
-	{ },
-};
-MODULE_DEVICE_TABLE(dmi, hv_netvsc_dmi_table);
-
 static int __init netvsc_drv_init(void)
 {
 	struct hv_driver *drv = &netvsc_drv;
@@ -451,10 +436,6 @@ static int __init netvsc_drv_init(void)
 
 	pr_info("initializing....");
 
-	if (!dmi_check_system(hv_netvsc_dmi_table))
-		return -ENODEV;
-
-
 	/* Callback to client driver to complete the initialization */
 	netvsc_initialize(drv);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 25/77] Staging: hv: util: Get rid of the DMI signature in hv_util.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (22 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 24/77] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:16   ` [PATCH 26/77] Staging: hv: util: Get rid of the PCI " K. Y. Srinivasan
                     ` (51 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now that we have implemented a vmbus specific mechanism for auto-loading, get
rid of the DMI signature.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_util.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index 09819ff..de6afa0 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -26,7 +26,6 @@
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/reboot.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
 
 #include "hyperv.h"
@@ -247,22 +246,6 @@ hv_utils_pci_table[] __maybe_unused = {
 };
 MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
 
-
-static const struct dmi_system_id __initconst
-hv_utils_dmi_table[] __maybe_unused  = {
-	{
-		.ident = "Hyper-V",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
-		},
-	},
-	{ },
-};
-MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table);
-
-
 static int __init init_hyperv_utils(void)
 {
 	pr_info("Registering HyperV Utility Driver\n");
@@ -271,9 +254,6 @@ static int __init init_hyperv_utils(void)
 		return -ENODEV;
 
 
-	if (!dmi_check_system(hv_utils_dmi_table))
-		return -ENODEV;
-
 	shut_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	time_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	hbeat_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 26/77] Staging: hv: util: Get rid of the PCI signature in hv_util.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (23 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 25/77] Staging: hv: util: Get rid of the DMI signature in hv_util.c K. Y. Srinivasan
@ 2011-06-16 20:16   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 27/77] Staging: hv: vmbus: Cleanup vmbus_match() function K. Y. Srinivasan
                     ` (50 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:16 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now that we have implemented a vmbus specific mechanism for auto-loading, get
rid of the PCI signature.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_util.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index de6afa0..f5d1f80 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -26,7 +26,6 @@
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/reboot.h>
-#include <linux/pci.h>
 
 #include "hyperv.h"
 #include "hv_kvp.h"
@@ -239,13 +238,6 @@ static  struct hv_driver util_drv = {
 	.remove =  util_remove,
 };
 
-static const struct pci_device_id __initconst
-hv_utils_pci_table[] __maybe_unused = {
-	{ PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */
-	{ 0 }
-};
-MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
-
 static int __init init_hyperv_utils(void)
 {
 	pr_info("Registering HyperV Utility Driver\n");
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 27/77] Staging: hv: vmbus: Cleanup vmbus_match() function
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (24 preceding siblings ...)
  2011-06-16 20:16   ` [PATCH 26/77] Staging: hv: util: Get rid of the PCI " K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 28/77] Staging: hv: blkvsc: Get rid of the dev_type guid from blkvsc_drv.c K. Y. Srinivasan
                     ` (49 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now, based on the newly introduved id_table, cleanup the 
vmbus_match function. This mechanism will also permit us to handle
multiple device types using a common driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index cbb80ec..0e1a13c 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -250,16 +250,16 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
  */
 static int vmbus_match(struct device *device, struct device_driver *driver)
 {
-	int match = 0;
 	struct hv_driver *drv = drv_to_hv_drv(driver);
 	struct hv_device *hv_dev = device_to_hv_device(device);
+	const struct hv_vmbus_device_id *id_array = drv->id_table;
 
-	/* We found our driver ? */
-	if (memcmp(&hv_dev->dev_type, &drv->dev_type,
-		   sizeof(struct hv_guid)) == 0)
-		match = 1;
+	for (; *id_array->device_type != '\0'; id_array++) {
+		if (!strcmp(id_array->device_type, hv_dev->device_type))
+			return 1;
+	}
 
-	return match;
+	return 0;
 }
 
 /*
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 28/77] Staging: hv: blkvsc: Get rid of the dev_type guid from blkvsc_drv.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (25 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 27/77] Staging: hv: vmbus: Cleanup vmbus_match() function K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 29/77] Staging: hv: storvsc: Get rid of the device type guid from storvsc_drv.c K. Y. Srinivasan
                     ` (48 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of the dev_type guid from blkvsc_drv.c as it is no longer used.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/blkvsc_drv.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 9496abe..1abe7f4 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -111,13 +111,6 @@ struct block_device_context {
 
 static const char *drv_name = "blkvsc";
 
-/* {32412632-86cb-44a2-9b5c-50d1417354f5} */
-static const struct hv_guid dev_type = {
-	.data = {
-		0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
-		0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
-	}
-};
 
 /*
  * There is a circular dependency involving blkvsc_request_completion()
@@ -834,7 +827,6 @@ static int blkvsc_drv_init(void)
 
 	BUILD_BUG_ON(sizeof(sector_t) != 8);
 
-	memcpy(&drv->dev_type, &dev_type, sizeof(struct hv_guid));
 	drv->driver.name = drv_name;
 
 	/* The driver belongs to vmbus */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 29/77] Staging: hv: storvsc: Get rid of the device type guid from storvsc_drv.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (26 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 28/77] Staging: hv: blkvsc: Get rid of the dev_type guid from blkvsc_drv.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 30/77] Staging: hv: netvsc: Get rid of the dev_type guid from netvsc.c K. Y. Srinivasan
                     ` (47 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of the device type guid from storvsc_drv.c as it is no longer used.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc_drv.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 7d605c9..c908fd8 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -43,14 +43,6 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
 
 static const char *driver_name = "storvsc";
 
-/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
-static const struct hv_guid stor_vsci_device_type = {
-	.data = {
-		0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
-		0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
-	}
-};
-
 struct hv_host_device {
 	struct hv_device *dev;
 	struct kmem_cache *request_pool;
@@ -747,8 +739,6 @@ static int __init storvsc_drv_init(void)
 	sizeof(struct vstor_packet) + sizeof(u64),
 	sizeof(u64)));
 
-	memcpy(&drv->dev_type, &stor_vsci_device_type,
-	       sizeof(struct hv_guid));
 
 	if (max_outstanding_req_per_channel <
 	    STORVSC_MAX_IO_REQUESTS)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 30/77] Staging: hv: netvsc: Get rid of the dev_type guid from netvsc.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (27 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 29/77] Staging: hv: storvsc: Get rid of the device type guid from storvsc_drv.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 31/77] Staging: hv: netvsc: Initialize the driver name directly K. Y. Srinivasan
                     ` (46 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of the dev_type guid from netvsc.c, as it is no longer used.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 1bd920f..d59b9bd 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -35,15 +35,6 @@
 /* Globals */
 static const char *driver_name = "netvsc";
 
-/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
-static const struct hv_guid netvsc_device_type = {
-	.data = {
-		0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
-		0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
-	}
-};
-
-
 static struct netvsc_device *alloc_net_device(struct hv_device *device)
 {
 	struct netvsc_device *net_device;
@@ -1009,7 +1000,6 @@ int netvsc_initialize(struct hv_driver *drv)
 {
 
 	drv->name = driver_name;
-	memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid));
 
 	return 0;
 }
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 31/77] Staging: hv: netvsc: Initialize the driver name directly
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (28 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 30/77] Staging: hv: netvsc: Get rid of the dev_type guid from netvsc.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 32/77] Staging: hv: netvsc: Get rid of the driver name initialization in netvsc.c K. Y. Srinivasan
                     ` (45 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Initialize the driver name directly in netvsc_drv.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc_drv.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 9075a73..05d8e32 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -41,6 +41,8 @@
 #include "hyperv.h"
 #include "hyperv_net.h"
 
+static const char *driver_name = "netvsc";
+
 struct net_device_context {
 	/* point back to our device context */
 	struct hv_device *device_ctx;
@@ -439,7 +441,7 @@ static int __init netvsc_drv_init(void)
 	/* Callback to client driver to complete the initialization */
 	netvsc_initialize(drv);
 
-	drv->driver.name = drv->name;
+	drv->driver.name = driver_name;
 
 	/* The driver belongs to vmbus */
 	ret = vmbus_child_driver_register(&drv->driver);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 32/77] Staging: hv: netvsc: Get rid of the driver name initialization in netvsc.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (29 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 31/77] Staging: hv: netvsc: Initialize the driver name directly K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 33/77] Staging: hv: netvsc: Get rid of the empty function netvsc_initialize() K. Y. Srinivasan
                     ` (44 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now, get rid of the driver name initialization in struct hv_driver. 

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index d59b9bd..763358a 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -32,9 +32,6 @@
 #include "hyperv_net.h"
 
 
-/* Globals */
-static const char *driver_name = "netvsc";
-
 static struct netvsc_device *alloc_net_device(struct hv_device *device)
 {
 	struct netvsc_device *net_device;
@@ -999,7 +996,5 @@ cleanup:
 int netvsc_initialize(struct hv_driver *drv)
 {
 
-	drv->name = driver_name;
-
 	return 0;
 }
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 33/77] Staging: hv: netvsc: Get rid of the empty function netvsc_initialize()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (30 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 32/77] Staging: hv: netvsc: Get rid of the driver name initialization in netvsc.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 34/77] Staging: hv: vmbus: Get rid of the unused name field in struct hv_driver K. Y. Srinivasan
                     ` (43 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now, get rid of the empty function netvsc_initialize().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hyperv_net.h |    1 -
 drivers/staging/hv/netvsc.c     |    9 ---------
 drivers/staging/hv/netvsc_drv.c |    3 ---
 3 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/hv/hyperv_net.h b/drivers/staging/hv/hyperv_net.h
index 27f987b..5782fea 100644
--- a/drivers/staging/hv/hyperv_net.h
+++ b/drivers/staging/hv/hyperv_net.h
@@ -96,7 +96,6 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
 				unsigned int status);
 int netvsc_recv_callback(struct hv_device *device_obj,
 			struct hv_netvsc_packet *packet);
-int netvsc_initialize(struct hv_driver *drv);
 int rndis_filter_open(struct hv_device *dev);
 int rndis_filter_close(struct hv_device *dev);
 int rndis_filter_device_add(struct hv_device *dev,
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 763358a..944dcdc 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -989,12 +989,3 @@ cleanup:
 
 	return ret;
 }
-
-/*
- * netvsc_initialize - Main entry point
- */
-int netvsc_initialize(struct hv_driver *drv)
-{
-
-	return 0;
-}
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 05d8e32..cd66e8d 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -438,9 +438,6 @@ static int __init netvsc_drv_init(void)
 
 	pr_info("initializing....");
 
-	/* Callback to client driver to complete the initialization */
-	netvsc_initialize(drv);
-
 	drv->driver.name = driver_name;
 
 	/* The driver belongs to vmbus */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 34/77] Staging: hv: vmbus: Get rid of the unused name field in struct hv_driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (31 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 33/77] Staging: hv: netvsc: Get rid of the empty function netvsc_initialize() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 35/77] Staging: hv: mouse: Get rid of the dev_type guid in hv_mouse.c K. Y. Srinivasan
                     ` (42 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of the unused name field in struct hv_driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hyperv.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
index 28fe7f9..3bf1c46 100644
--- a/drivers/staging/hv/hyperv.h
+++ b/drivers/staging/hv/hyperv.h
@@ -807,8 +807,6 @@ struct hv_vmbus_device_id {
 
 /* Base driver object */
 struct hv_driver {
-	const char *name;
-
 	/* the device type supported by this driver */
 	struct hv_guid dev_type;
 	const struct hv_vmbus_device_id *id_table;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 35/77] Staging: hv: mouse: Get rid of the dev_type guid in hv_mouse.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (32 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 34/77] Staging: hv: vmbus: Get rid of the unused name field in struct hv_driver K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 36/77] Staging: hv: vmbus: Cleanup the code displaying class_id K. Y. Srinivasan
                     ` (41 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of the dev_type guid in hv_mouse.c, as it is not used.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_mouse.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index e615041..b902e0e 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -179,12 +179,6 @@ struct mousevsc_dev {
 
 static const char *driver_name = "mousevsc";
 
-/* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
-static const struct hv_guid mouse_guid = {
-	.data = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
-		 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A}
-};
-
 static void deviceinfo_callback(struct hv_device *dev, struct hv_input_dev_info *info);
 static void inputreport_callback(struct hv_device *dev, void *packet, u32 len);
 static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
@@ -937,9 +931,6 @@ static int __init mousevsc_init(void)
 
 	DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing.");
 
-	memcpy(&drv->dev_type, &mouse_guid,
-	       sizeof(struct hv_guid));
-
 	drv->driver.name = driver_name;
 
 	/* The driver belongs to vmbus */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 36/77] Staging: hv: vmbus: Cleanup the code displaying class_id
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (33 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 35/77] Staging: hv: mouse: Get rid of the dev_type guid in hv_mouse.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 37/77] Staging: hv: vmbus: Do not initialize dev_type guid in vmbus_child_device_create() K. Y. Srinivasan
                     ` (40 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now that we have a human readable device_type, use that and get rid of the
guid based device type.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |   19 +------------------
 1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 0e1a13c..6ec6ef3 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -113,24 +113,7 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
 	get_channel_info(hv_dev, &device_info);
 
 	if (!strcmp(dev_attr->attr.name, "class_id")) {
-		return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
-			       "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
-			       device_info.chn_type.data[3],
-			       device_info.chn_type.data[2],
-			       device_info.chn_type.data[1],
-			       device_info.chn_type.data[0],
-			       device_info.chn_type.data[5],
-			       device_info.chn_type.data[4],
-			       device_info.chn_type.data[7],
-			       device_info.chn_type.data[6],
-			       device_info.chn_type.data[8],
-			       device_info.chn_type.data[9],
-			       device_info.chn_type.data[10],
-			       device_info.chn_type.data[11],
-			       device_info.chn_type.data[12],
-			       device_info.chn_type.data[13],
-			       device_info.chn_type.data[14],
-			       device_info.chn_type.data[15]);
+		return sprintf(buf, "%s\n", hv_dev->device_type);
 	} else if (!strcmp(dev_attr->attr.name, "device_id")) {
 		return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
 			       "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 37/77] Staging: hv: vmbus: Do not initialize dev_type guid in vmbus_child_device_create()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (34 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 36/77] Staging: hv: vmbus: Cleanup the code displaying class_id K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 38/77] Staging: hv: vmbus: Get rid of the unused dev_type field in hv_device and hv_driver K. Y. Srinivasan
                     ` (39 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Do not initialize dev_type guid in vmbus_child_device_create(), as this is
not used.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 6ec6ef3..2702c48 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -580,7 +580,6 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
 	}
 
 	child_device_obj->channel = channel;
-	memcpy(&child_device_obj->dev_type, type, sizeof(struct hv_guid));
 	/*
 	 * Get the human readable device type name and stash it away.
 	 */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 38/77] Staging: hv: vmbus: Get rid of the unused dev_type field in hv_device and hv_driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (35 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 37/77] Staging: hv: vmbus: Do not initialize dev_type guid in vmbus_child_device_create() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 39/77] Staging: hv: vmbus: Get rid of the device_id attribute K. Y. Srinivasan
                     ` (38 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Now, get rid of the unused dev_type field in hv_device and hv_driver as they
are not used.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hyperv.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
index 3bf1c46..370b096 100644
--- a/drivers/staging/hv/hyperv.h
+++ b/drivers/staging/hv/hyperv.h
@@ -808,7 +808,6 @@ struct hv_vmbus_device_id {
 /* Base driver object */
 struct hv_driver {
 	/* the device type supported by this driver */
-	struct hv_guid dev_type;
 	const struct hv_vmbus_device_id *id_table;
 
 	struct device_driver driver;
@@ -822,7 +821,6 @@ struct hv_driver {
 /* Base device object */
 struct hv_device {
 	/* the device type id of this device */
-	struct hv_guid dev_type;
 	const char *device_type;
 
 	/* the device instance id of this device */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 39/77] Staging: hv: vmbus: Get rid of the  device_id attribute
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (36 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 38/77] Staging: hv: vmbus: Get rid of the unused dev_type field in hv_device and hv_driver K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 40/77] Staging: hv: vmbus: Get rid of some unnecessary comments K. Y. Srinivasan
                     ` (37 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

The guid based instance data is not very useful. There is enough information
to identify the device. Get rid of this attribute.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 2702c48..36bba44 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -114,25 +114,6 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
 
 	if (!strcmp(dev_attr->attr.name, "class_id")) {
 		return sprintf(buf, "%s\n", hv_dev->device_type);
-	} else if (!strcmp(dev_attr->attr.name, "device_id")) {
-		return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
-			       "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
-			       device_info.chn_instance.data[3],
-			       device_info.chn_instance.data[2],
-			       device_info.chn_instance.data[1],
-			       device_info.chn_instance.data[0],
-			       device_info.chn_instance.data[5],
-			       device_info.chn_instance.data[4],
-			       device_info.chn_instance.data[7],
-			       device_info.chn_instance.data[6],
-			       device_info.chn_instance.data[8],
-			       device_info.chn_instance.data[9],
-			       device_info.chn_instance.data[10],
-			       device_info.chn_instance.data[11],
-			       device_info.chn_instance.data[12],
-			       device_info.chn_instance.data[13],
-			       device_info.chn_instance.data[14],
-			       device_info.chn_instance.data[15]);
 	} else if (!strcmp(dev_attr->attr.name, "state")) {
 		return sprintf(buf, "%d\n", device_info.chn_state);
 	} else if (!strcmp(dev_attr->attr.name, "id")) {
@@ -187,7 +168,6 @@ static struct device_attribute vmbus_device_attrs[] = {
 	__ATTR(id, S_IRUGO, vmbus_show_device_attr, NULL),
 	__ATTR(state, S_IRUGO, vmbus_show_device_attr, NULL),
 	__ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL),
-	__ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL),
 	__ATTR(monitor_id, S_IRUGO, vmbus_show_device_attr, NULL),
 
 	__ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL),
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 40/77] Staging: hv: vmbus: Get rid of some unnecessary comments
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (37 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 39/77] Staging: hv: vmbus: Get rid of the device_id attribute K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 41/77] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c K. Y. Srinivasan
                     ` (36 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of some unnecessary comments.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 36bba44..2e6bfc1 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -44,8 +44,6 @@ static struct tasklet_struct event_dpc;
 
 unsigned int vmbus_loglevel = (ALL_MODULES << 16 | INFO_LVL);
 EXPORT_SYMBOL(vmbus_loglevel);
-	/* (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); */
-	/* (((VMBUS | VMBUS_DRV)<<16) | DEBUG_LVL_ENTEREXIT); */
 
 static struct completion probe_event;
 static int irq;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 41/77] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (38 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 40/77] Staging: hv: vmbus: Get rid of some unnecessary comments K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 42/77] Staging: hv: vmbus: Cleanup error handling in hv_init() K. Y. Srinivasan
                     ` (35 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Cleanup unnecessary comments in hv.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
index 824f816..2f94880 100644
--- a/drivers/staging/hv/hv.c
+++ b/drivers/staging/hv/hv.c
@@ -164,11 +164,7 @@ int hv_init(void)
 		goto cleanup;
 
 	max_leaf = query_hypervisor_info();
-	/* HvQueryHypervisorFeatures(maxLeaf); */
 
-	/*
-	 * We only support running on top of Hyper-V
-	 */
 	rdmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid);
 
 	if (hv_context.guestid != 0)
@@ -181,10 +177,6 @@ int hv_init(void)
 	/* See if the hypercall page is already set */
 	rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
 
-	/*
-	* Allocate the hypercall page memory
-	* virtaddr = osd_page_alloc(1);
-	*/
 	virtaddr = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
 
 	if (!virtaddr)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 42/77] Staging: hv: vmbus: Cleanup error handling in hv_init()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (39 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 41/77] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 43/77] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c K. Y. Srinivasan
                     ` (34 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
index 2f94880..e733173 100644
--- a/drivers/staging/hv/hv.c
+++ b/drivers/staging/hv/hv.c
@@ -225,8 +225,8 @@ cleanup:
 
 		vfree(virtaddr);
 	}
-	ret = -1;
-	return ret;
+
+	return -ENOTSUPP;
 }
 
 /*
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 43/77] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (40 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 42/77] Staging: hv: vmbus: Cleanup error handling in hv_init() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 44/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_body() K. Y. Srinivasan
                     ` (33 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of unnecessay comments in connection.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/connection.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
index e6b4039..0e7efce 100644
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -215,8 +215,6 @@ static void process_chn_event(u32 relid)
 {
 	struct vmbus_channel *channel;
 
-	/* ASSERT(relId > 0); */
-
 	/*
 	 * Find the channel based on this relid and invokes the
 	 * channel callback to process the event
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 44/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_body()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (41 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 43/77] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 45/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_header() K. Y. Srinivasan
                     ` (32 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of the function dump_gpadl_body() since it adds no value and actually is 
in the data path.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/channel.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 455f47a..4f158f8 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -239,24 +239,6 @@ errorout:
 }
 EXPORT_SYMBOL_GPL(vmbus_open);
 
-/*
- * dump_gpadl_body - Dump the gpadl body message to the console for
- * debugging purposes.
- */
-static void dump_gpadl_body(struct vmbus_channel_gpadl_body *gpadl, u32 len)
-{
-	int i;
-	int pfncount;
-
-	pfncount = (len - sizeof(struct vmbus_channel_gpadl_body)) /
-		   sizeof(u64);
-
-	DPRINT_DBG(VMBUS, "gpadl body - len %d pfn count %d", len, pfncount);
-
-	for (i = 0; i < pfncount; i++)
-		DPRINT_DBG(VMBUS, "gpadl body  - %d) pfn %llu",
-			   i, gpadl->pfn[i]);
-}
 
 /*
  * dump_gpadl_header - Dump the gpadl header message to the console for
@@ -485,8 +467,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
 				CHANNELMSG_GPADL_BODY;
 			gpadl_body->gpadl = next_gpadl_handle;
 
-			dump_gpadl_body(gpadl_body, submsginfo->msgsize -
-				      sizeof(*submsginfo));
 			ret = vmbus_post_msg(gpadl_body,
 					       submsginfo->msgsize -
 					       sizeof(*submsginfo));
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 45/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_header()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (42 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 44/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_body() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 46/77] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c K. Y. Srinivasan
                     ` (31 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of the function dump_gpadl_header() as this adds no value.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/channel.c |   28 ----------------------------
 1 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 4f158f8..6a780f2 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -239,33 +239,6 @@ errorout:
 }
 EXPORT_SYMBOL_GPL(vmbus_open);
 
-
-/*
- * dump_gpadl_header - Dump the gpadl header message to the console for
- * debugging purposes.
- */
-static void dump_gpadl_header(struct vmbus_channel_gpadl_header *gpadl)
-{
-	int i, j;
-	int pagecount;
-
-	DPRINT_DBG(VMBUS,
-		   "gpadl header - relid %d, range count %d, range buflen %d",
-		   gpadl->child_relid, gpadl->rangecount, gpadl->range_buflen);
-	for (i = 0; i < gpadl->rangecount; i++) {
-		pagecount = gpadl->range[i].byte_count >> PAGE_SHIFT;
-		pagecount = (pagecount > 26) ? 26 : pagecount;
-
-		DPRINT_DBG(VMBUS, "gpadl range %d - len %d offset %d "
-			   "page count %d", i, gpadl->range[i].byte_count,
-			   gpadl->range[i].byte_offset, pagecount);
-
-		for (j = 0; j < pagecount; j++)
-			DPRINT_DBG(VMBUS, "%d) pfn %llu", j,
-				   gpadl->range[i].pfn_array[j]);
-	}
-}
-
 /*
  * create_gpadl_header - Creates a gpadl for the specified buffer
  */
@@ -443,7 +416,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
 	gpadlmsg->child_relid = channel->offermsg.child_relid;
 	gpadlmsg->gpadl = next_gpadl_handle;
 
-	dump_gpadl_header(gpadlmsg);
 
 	spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
 	list_add_tail(&msginfo->msglistentry,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 46/77] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (43 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 45/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_header() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 47/77] Staging: hv: vmbus: Get rid of unnecessary comments " K. Y. Srinivasan
                     ` (30 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Rename openMsg to open_msg in channel.c

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/channel.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 6a780f2..1d6143a 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -119,7 +119,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 		     u32 recv_ringbuffer_size, void *userdata, u32 userdatalen,
 		     void (*onchannelcallback)(void *context), void *context)
 {
-	struct vmbus_channel_open_channel *openMsg;
+	struct vmbus_channel_open_channel *open_msg;
 	struct vmbus_channel_msginfo *openInfo = NULL;
 	void *in, *out;
 	unsigned long flags;
@@ -183,14 +183,14 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 
 	init_completion(&openInfo->waitevent);
 
-	openMsg = (struct vmbus_channel_open_channel *)openInfo->msg;
-	openMsg->header.msgtype = CHANNELMSG_OPENCHANNEL;
-	openMsg->openid = newchannel->offermsg.child_relid;
-	openMsg->child_relid = newchannel->offermsg.child_relid;
-	openMsg->ringbuffer_gpadlhandle = newchannel->ringbuffer_gpadlhandle;
-	openMsg->downstream_ringbuffer_pageoffset = send_ringbuffer_size >>
+	open_msg = (struct vmbus_channel_open_channel *)openInfo->msg;
+	open_msg->header.msgtype = CHANNELMSG_OPENCHANNEL;
+	open_msg->openid = newchannel->offermsg.child_relid;
+	open_msg->child_relid = newchannel->offermsg.child_relid;
+	open_msg->ringbuffer_gpadlhandle = newchannel->ringbuffer_gpadlhandle;
+	open_msg->downstream_ringbuffer_pageoffset = send_ringbuffer_size >>
 						  PAGE_SHIFT;
-	openMsg->server_contextarea_gpadlhandle = 0;
+	open_msg->server_contextarea_gpadlhandle = 0;
 
 	if (userdatalen > MAX_USER_DEFINED_BYTES) {
 		err = -EINVAL;
@@ -198,14 +198,14 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 	}
 
 	if (userdatalen)
-		memcpy(openMsg->userdata, userdata, userdatalen);
+		memcpy(open_msg->userdata, userdata, userdatalen);
 
 	spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
 	list_add_tail(&openInfo->msglistentry,
 		      &vmbus_connection.chn_msg_list);
 	spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
 
-	ret = vmbus_post_msg(openMsg,
+	ret = vmbus_post_msg(open_msg,
 			       sizeof(struct vmbus_channel_open_channel));
 
 	if (ret != 0)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 47/77] Staging: hv: vmbus: Get rid of unnecessary comments in channel.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (44 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 46/77] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 48/77] Staging: hv: vmbus: Change the variable name openInfo to open_info " K. Y. Srinivasan
                     ` (29 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of unnecessary comments in channel.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/channel.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 1d6143a..8065775 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -76,7 +76,6 @@ void vmbus_get_debug_info(struct vmbus_channel *channel,
 	struct hv_monitor_page *monitorpage;
 	u8 monitor_group = (u8)channel->offermsg.monitorid / 32;
 	u8 monitor_offset = (u8)channel->offermsg.monitorid % 32;
-	/* u32 monitorBit	= 1 << monitorOffset; */
 
 	debuginfo->relid = channel->offermsg.child_relid;
 	debuginfo->state = channel->state;
@@ -392,7 +391,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
 {
 	struct vmbus_channel_gpadl_header *gpadlmsg;
 	struct vmbus_channel_gpadl_body *gpadl_body;
-	/* struct vmbus_channel_gpadl_created *gpadlCreated; */
 	struct vmbus_channel_msginfo *msginfo = NULL;
 	struct vmbus_channel_msginfo *submsginfo;
 	u32 msgcount;
@@ -474,8 +472,6 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
 	unsigned long flags;
 	int ret, t;
 
-	/* ASSERT(gpadl_handle != 0); */
-
 	info = kmalloc(sizeof(*info) +
 		       sizeof(struct vmbus_channel_gpadl_teardown), GFP_KERNEL);
 	if (!info)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 48/77] Staging: hv: vmbus: Change the variable name openInfo to open_info in channel.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (45 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 47/77] Staging: hv: vmbus: Get rid of unnecessary comments " K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 49/77] Staging: hv: vmbus: Cleanup error values in ringbuffer.c K. Y. Srinivasan
                     ` (28 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Change the variable name openInfo to open_info in channel.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/channel.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 8065775..5476863 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -119,7 +119,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 		     void (*onchannelcallback)(void *context), void *context)
 {
 	struct vmbus_channel_open_channel *open_msg;
-	struct vmbus_channel_msginfo *openInfo = NULL;
+	struct vmbus_channel_msginfo *open_info = NULL;
 	void *in, *out;
 	unsigned long flags;
 	int ret, t, err = 0;
@@ -172,17 +172,17 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 	}
 
 	/* Create and init the channel open message */
-	openInfo = kmalloc(sizeof(*openInfo) +
+	open_info = kmalloc(sizeof(*open_info) +
 			   sizeof(struct vmbus_channel_open_channel),
 			   GFP_KERNEL);
-	if (!openInfo) {
+	if (!open_info) {
 		err = -ENOMEM;
 		goto errorout;
 	}
 
-	init_completion(&openInfo->waitevent);
+	init_completion(&open_info->waitevent);
 
-	open_msg = (struct vmbus_channel_open_channel *)openInfo->msg;
+	open_msg = (struct vmbus_channel_open_channel *)open_info->msg;
 	open_msg->header.msgtype = CHANNELMSG_OPENCHANNEL;
 	open_msg->openid = newchannel->offermsg.child_relid;
 	open_msg->child_relid = newchannel->offermsg.child_relid;
@@ -200,7 +200,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 		memcpy(open_msg->userdata, userdata, userdatalen);
 
 	spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
-	list_add_tail(&openInfo->msglistentry,
+	list_add_tail(&open_info->msglistentry,
 		      &vmbus_connection.chn_msg_list);
 	spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
 
@@ -210,22 +210,22 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 	if (ret != 0)
 		goto cleanup;
 
-	t = wait_for_completion_timeout(&openInfo->waitevent, 5*HZ);
+	t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ);
 	if (t == 0) {
 		err = -ETIMEDOUT;
 		goto errorout;
 	}
 
 
-	if (openInfo->response.open_result.status)
-		err = openInfo->response.open_result.status;
+	if (open_info->response.open_result.status)
+		err = open_info->response.open_result.status;
 
 cleanup:
 	spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
-	list_del(&openInfo->msglistentry);
+	list_del(&open_info->msglistentry);
 	spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
 
-	kfree(openInfo);
+	kfree(open_info);
 	return err;
 
 errorout:
@@ -233,7 +233,7 @@ errorout:
 	hv_ringbuffer_cleanup(&newchannel->inbound);
 	free_pages((unsigned long)out,
 		get_order(send_ringbuffer_size + recv_ringbuffer_size));
-	kfree(openInfo);
+	kfree(open_info);
 	return err;
 }
 EXPORT_SYMBOL_GPL(vmbus_open);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 49/77] Staging: hv: vmbus: Cleanup error values in ringbuffer.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (46 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 48/77] Staging: hv: vmbus: Change the variable name openInfo to open_info " K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 50/77] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw() K. Y. Srinivasan
                     ` (27 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux errno values.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/blkvsc_drv.c  |    2 +-
 drivers/staging/hv/netvsc.c      |    2 +-
 drivers/staging/hv/ring_buffer.c |    6 +++---
 drivers/staging/hv/storvsc_drv.c |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 1abe7f4..9898ea3 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -727,7 +727,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
 		} else {
 			ret = blkvsc_submit_request(blkvsc_req,
 						    blkvsc_request_completion);
-			if (ret == -1) {
+			if (ret == -EAGAIN) {
 				pending = 1;
 				list_add_tail(&blkvsc_req->pend_entry,
 					      &blkdev->pending_list);
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 944dcdc..c060b28 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -565,7 +565,7 @@ retry_send_cmplt:
 	if (ret == 0) {
 		/* success */
 		/* no-op */
-	} else if (ret == -1) {
+	} else if (ret == -EAGAIN) {
 		/* no more room...wait a bit and attempt to retry 3 times */
 		retries++;
 		dev_err(&device->device, "unable to send receive completion pkt"
diff --git a/drivers/staging/hv/ring_buffer.c b/drivers/staging/hv/ring_buffer.c
index 42f7672..9212699 100644
--- a/drivers/staging/hv/ring_buffer.c
+++ b/drivers/staging/hv/ring_buffer.c
@@ -390,7 +390,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
 	/* is empty since the read index == write index */
 	if (bytes_avail_towrite <= totalbytes_towrite) {
 		spin_unlock_irqrestore(&outring_info->ring_lock, flags);
-		return -1;
+		return -EAGAIN;
 	}
 
 	/* Write to the ring buffer */
@@ -450,7 +450,7 @@ int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info,
 
 		spin_unlock_irqrestore(&Inring_info->ring_lock, flags);
 
-		return -1;
+		return -EAGAIN;
 	}
 
 	/* Convert to byte offset */
@@ -496,7 +496,7 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
 	if (bytes_avail_toread < buflen) {
 		spin_unlock_irqrestore(&inring_info->ring_lock, flags);
 
-		return -1;
+		return -EAGAIN;
 	}
 
 	next_read_location =
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index c908fd8..1028689 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -580,7 +580,7 @@ retry_request:
 	/* Invokes the vsc to start an IO */
 	ret = storvsc_do_io(dev, &cmd_request->request);
 
-	if (ret == -1) {
+	if (ret == -EAGAIN) {
 		/* no more space */
 
 		if (cmd_request->bounce_sgl_count) {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 50/77] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (47 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 49/77] Staging: hv: vmbus: Cleanup error values in ringbuffer.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 51/77] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe() K. Y. Srinivasan
                     ` (26 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux errno values.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/channel.c  |    2 +-
 drivers/staging/hv/hv_mouse.c |    2 +-
 drivers/staging/hv/netvsc.c   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 5476863..dd34c33 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -811,7 +811,7 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
 		pr_err("Buffer too small - needed %d bytes but "
 			"got space for only %d bytes\n",
 			packetlen, bufferlen);
-		return -2;
+		return -ENOBUFS;
 	}
 
 	*requestid = desc.trans_id;
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index b902e0e..0338030 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -542,7 +542,7 @@ static void mousevsc_on_channel_callback(void *context)
 				}
 				break;
 			}
-		} else if (ret == -2) {
+		} else if (ret == -ENOBUFS) {
 			/* Handle large packet */
 			bufferlen = bytes_recvd;
 			buffer = kzalloc(bytes_recvd, GFP_KERNEL);
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index c060b28..34b62ed 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -884,7 +884,7 @@ static void netvsc_channel_cb(void *context)
 
 				break;
 			}
-		} else if (ret == -2) {
+		} else if (ret == -ENOBUFS) {
 			/* Handle large packet */
 			buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
 			if (buffer == NULL) {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 51/77] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (48 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 50/77] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 52/77] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up K. Y. Srinivasan
                     ` (25 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of an unnecessary print statement in netvsc_probe(). Furthermore,
this fixes a bug since netdev_err is being invoked after the device has
been freed.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc_drv.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index cd66e8d..58115b3 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -357,8 +357,6 @@ static int netvsc_probe(struct hv_device *dev)
 	if (ret != 0) {
 		free_netdev(net);
 		dev_set_drvdata(&dev->device, NULL);
-
-		netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
 		return ret;
 	}
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 52/77] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (49 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 51/77] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 53/77] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add() K. Y. Srinivasan
                     ` (24 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

The function hv_post_msg() can fail because of transient resource
conditions. It may be useful to retry the operation.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 arch/x86/include/asm/hyperv.h   |    1 +
 drivers/staging/hv/connection.c |   18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/hyperv.h b/arch/x86/include/asm/hyperv.h
index 5df477a..b80420b 100644
--- a/arch/x86/include/asm/hyperv.h
+++ b/arch/x86/include/asm/hyperv.h
@@ -189,5 +189,6 @@
 #define HV_STATUS_INVALID_HYPERCALL_CODE	2
 #define HV_STATUS_INVALID_HYPERCALL_INPUT	3
 #define HV_STATUS_INVALID_ALIGNMENT		4
+#define HV_STATUS_INSUFFICIENT_BUFFERS		19
 
 #endif
diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
index 0e7efce..a88ad70 100644
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -25,6 +25,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/wait.h>
+#include <linux/delay.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
@@ -268,10 +269,25 @@ void vmbus_on_event(unsigned long data)
 int vmbus_post_msg(void *buffer, size_t buflen)
 {
 	union hv_connection_id conn_id;
+	int ret = 0;
+	int retries = 0;
 
 	conn_id.asu32 = 0;
 	conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID;
-	return hv_post_message(conn_id, 1, buffer, buflen);
+
+	/*
+	 * hv_post_message() can have transient failures because of
+	 * insufficient resources. Retry the operation a couple of
+	 * times before giving up.
+	 */
+	while (retries < 3) {
+		ret =  hv_post_message(conn_id, 1, buffer, buflen);
+		if (ret != HV_STATUS_INSUFFICIENT_BUFFERS)
+			return ret;
+		retries++;
+		msleep(100);
+	}
+	return ret;
 }
 
 /*
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 53/77] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (50 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 52/77] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 54/77] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init() K. Y. Srinivasan
                     ` (23 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen, andre.bartke

Use standard Linux error values and cleanup error handling. I would like
to acknowledge Andre Bartke (andre.bartke@gmail.com) for highlighting this
problem.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Cc: andre.bartke@gmail.com
---
 drivers/staging/hv/storvsc.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 3029786..915aeee 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -392,10 +392,8 @@ int storvsc_dev_add(struct hv_device *device,
 
 	device_info = (struct storvsc_device_info *)additional_info;
 	stor_device = alloc_stor_device(device);
-	if (!stor_device) {
-		ret = -1;
-		goto cleanup;
-	}
+	if (!stor_device)
+		return -ENOMEM;
 
 	/* Save the channel properties to our storvsc channel */
 
@@ -409,11 +407,13 @@ int storvsc_dev_add(struct hv_device *device,
 	stor_device->port_number = device_info->port_number;
 	/* Send it back up */
 	ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
-
+	if (ret) {
+		free_stor_device(stor_device);
+		return ret;
+	}
 	device_info->path_id = stor_device->path_id;
 	device_info->target_id = stor_device->target_id;
 
-cleanup:
 	return ret;
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 54/77] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (51 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 53/77] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 55/77] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp() K. Y. Srinivasan
                     ` (22 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index e5e5e25..1470ccf 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -111,7 +111,7 @@ static int storvsc_channel_init(struct hv_device *device)
 
 	stor_device = get_stor_device(device);
 	if (!stor_device)
-		return -1;
+		return -ENODEV;
 
 	request = &stor_device->init_request;
 	vstor_packet = &request->vstor_packet;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 55/77] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (52 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 54/77] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 56/77] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io() K. Y. Srinivasan
                     ` (21 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Cleanup error handling in storvsc_connect_to_vsp().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 1470ccf..04b14e6 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -376,7 +376,7 @@ static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size)
 			 storvsc_on_channel_callback, device);
 
 	if (ret != 0)
-		return -1;
+		return ret;
 
 	ret = storvsc_channel_init(device);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 56/77] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (53 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 55/77] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 57/77] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c K. Y. Srinivasan
                     ` (20 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 04b14e6..d961663 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -451,7 +451,7 @@ int storvsc_do_io(struct hv_device *device,
 	stor_device = get_stor_device(device);
 
 	if (!stor_device)
-		return -2;
+		return -ENODEV;
 
 
 	request->device  = device;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 57/77] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (54 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 56/77] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 58/77] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c K. Y. Srinivasan
                     ` (19 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of some unnecessary DPRINTs from storvsc.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index d961663..b3506f6 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -125,8 +125,6 @@ static int storvsc_channel_init(struct hv_device *device)
 	vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION;
 	vstor_packet->flags = REQUEST_COMPLETION_FLAG;
 
-	DPRINT_INFO(STORVSC, "BEGIN_INITIALIZATION_OPERATION...");
-
 	ret = vmbus_sendpacket(device->channel, vstor_packet,
 			       sizeof(struct vstor_packet),
 			       (unsigned long)request,
@@ -145,7 +143,6 @@ static int storvsc_channel_init(struct hv_device *device)
 	    vstor_packet->status != 0)
 		goto cleanup;
 
-	DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
 
 	/* reuse the packet for version range supported */
 	memset(vstor_packet, 0, sizeof(struct vstor_packet));
@@ -174,8 +171,6 @@ static int storvsc_channel_init(struct hv_device *device)
 	    vstor_packet->status != 0)
 		goto cleanup;
 
-	/* Query channel properties */
-	DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
 
 	memset(vstor_packet, 0, sizeof(struct vstor_packet));
 	vstor_packet->operation = VSTOR_OPERATION_QUERY_PROPERTIES;
@@ -207,8 +202,6 @@ static int storvsc_channel_init(struct hv_device *device)
 	stor_device->target_id
 		= vstor_packet->storage_channel_properties.target_id;
 
-	DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
-
 	memset(vstor_packet, 0, sizeof(struct vstor_packet));
 	vstor_packet->operation = VSTOR_OPERATION_END_INITIALIZATION;
 	vstor_packet->flags = REQUEST_COMPLETION_FLAG;
@@ -232,7 +225,6 @@ static int storvsc_channel_init(struct hv_device *device)
 	    vstor_packet->status != 0)
 		goto cleanup;
 
-	DPRINT_INFO(STORVSC, "**** storage channel up and running!! ****");
 
 cleanup:
 	put_stor_device(device);
@@ -305,13 +297,8 @@ static void storvsc_on_receive(struct hv_device *device,
 		storvsc_on_io_completion(device, vstor_packet, request);
 		break;
 	case VSTOR_OPERATION_REMOVE_DEVICE:
-		DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION");
-		/* TODO: */
-		break;
 
 	default:
-		DPRINT_INFO(STORVSC, "Unknown operation received - %d",
-			    vstor_packet->operation);
 		break;
 	}
 }
@@ -418,9 +405,6 @@ int storvsc_dev_remove(struct hv_device *device)
 {
 	struct storvsc_device *stor_device;
 
-	DPRINT_INFO(STORVSC, "disabling storage device (%p)...",
-		    device->ext);
-
 	stor_device = release_stor_device(device);
 
 	/*
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 58/77] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (55 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 57/77] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 59/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset() K. Y. Srinivasan
                     ` (18 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Fix/cleanup some dated comments in storvsc.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index b3506f6..89de5b5 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -166,7 +166,6 @@ static int storvsc_channel_init(struct hv_device *device)
 		goto cleanup;
 	}
 
-	/* TODO: Check returned version */
 	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
 	    vstor_packet->status != 0)
 		goto cleanup;
@@ -193,7 +192,6 @@ static int storvsc_channel_init(struct hv_device *device)
 		goto cleanup;
 	}
 
-	/* TODO: Check returned version */
 	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
 	    vstor_packet->status != 0)
 		goto cleanup;
@@ -384,11 +382,12 @@ int storvsc_dev_add(struct hv_device *device,
 
 	/* Save the channel properties to our storvsc channel */
 
-	/* FIXME: */
 	/*
 	 * If we support more than 1 scsi channel, we need to set the
 	 * port number here to the scsi channel but how do we get the
-	 * scsi channel prior to the bus scan
+	 * scsi channel prior to the bus scan.
+	 *
+	 * The host does not support this.
 	 */
 
 	stor_device->port_number = device_info->port_number;
@@ -542,4 +541,3 @@ int storvsc_get_major_info(struct storvsc_device_info *device_info,
 
 	return -ENODEV;
 }
-
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 59/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (56 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 58/77] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 60/77] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe() K. Y. Srinivasan
                     ` (17 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 1028689..03ca79e 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -348,7 +348,7 @@ static int storvsc_host_reset(struct hv_device *device)
 
 	stor_device = get_stor_device(device);
 	if (!stor_device)
-		return -1;
+		return -ENODEV;
 
 	request = &stor_device->reset_request;
 	vstor_packet = &request->vstor_packet;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 60/77] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (57 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 59/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 61/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init() K. Y. Srinivasan
                     ` (16 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc_drv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 03ca79e..97ef81d 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -684,7 +684,7 @@ static int storvsc_probe(struct hv_device *device)
 	if (ret != 0) {
 		kmem_cache_destroy(host_dev->request_pool);
 		scsi_host_put(host);
-		return -1;
+		return -ENODEV;
 	}
 
 	host_dev->path = device_info.path_id;
@@ -705,7 +705,7 @@ static int storvsc_probe(struct hv_device *device)
 
 		kmem_cache_destroy(host_dev->request_pool);
 		scsi_host_put(host);
-		return -1;
+		return -ENODEV;
 	}
 
 	scsi_scan_host(host);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 61/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (58 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 60/77] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 62/77] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe() K. Y. Srinivasan
                     ` (15 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/storvsc_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 97ef81d..7db5246 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -742,7 +742,7 @@ static int __init storvsc_drv_init(void)
 
 	if (max_outstanding_req_per_channel <
 	    STORVSC_MAX_IO_REQUESTS)
-		return -1;
+		return -EINVAL;
 
 	drv->driver.name = driver_name;
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 62/77] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (59 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 61/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 63/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf() K. Y. Srinivasan
                     ` (14 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 58115b3..b339acc 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -340,7 +340,7 @@ static int netvsc_probe(struct hv_device *dev)
 
 	net = alloc_etherdev(sizeof(struct net_device_context));
 	if (!net)
-		return -1;
+		return -ENOMEM;
 
 	/* Set initial state */
 	netif_carrier_off(net);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 63/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (60 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 62/77] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 64/77] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf() K. Y. Srinivasan
                     ` (13 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Cleanup error return codes in netvsc_destroy_recv_buf().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 34b62ed..14c2203 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -160,7 +160,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
 		if (ret != 0) {
 			dev_err(&net_device->dev->device, "unable to send "
 				"revoke receive buffer to netvsp");
-			return -1;
+			return ret;
 		}
 	}
 
@@ -175,7 +175,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
 		if (ret != 0) {
 			dev_err(&net_device->dev->device,
 				   "unable to teardown receive buffer's gpadl");
-			return -1;
+			return -ret;
 		}
 		net_device->recv_buf_gpadl_handle = 0;
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 64/77] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (61 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 63/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 65/77] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() K. Y. Srinivasan
                     ` (12 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 14c2203..b640e08 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -207,7 +207,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
 	if (!net_device) {
 		dev_err(&device->device, "unable to get net device..."
 			   "device being destroyed?");
-		return -1;
+		return -ENODEV;
 	}
 
 	net_device->recv_buf =
@@ -216,7 +216,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
 	if (!net_device->recv_buf) {
 		dev_err(&device->device, "unable to allocate receive "
 			"buffer of size %d", net_device->recv_buf_size);
-		ret = -1;
+		ret = -ENOMEM;
 		goto cleanup;
 	}
 
@@ -269,7 +269,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
 			   "initialzation with NetVsp - status %d",
 			   init_packet->msg.v1_msg.
 			   send_recv_buf_complete.status);
-		ret = -1;
+		ret = -EINVAL;
 		goto cleanup;
 	}
 
@@ -281,7 +281,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
 	net_device->recv_section = kmalloc(net_device->recv_section_cnt
 		* sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL);
 	if (net_device->recv_section == NULL) {
-		ret = -1;
+		ret = -EINVAL;
 		goto cleanup;
 	}
 
@@ -297,7 +297,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
 	 */
 	if (net_device->recv_section_cnt != 1 ||
 	    net_device->recv_section->offset != 0) {
-		ret = -1;
+		ret = -EINVAL;
 		goto cleanup;
 	}
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 65/77] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (62 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 64/77] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 66/77] Staging: hv: netvsc: Cleanup error return values in netvsc_send() K. Y. Srinivasan
                     ` (11 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index b640e08..1bca667 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -323,7 +323,7 @@ static int netvsc_connect_vsp(struct hv_device *device)
 	if (!net_device) {
 		dev_err(&device->device, "unable to get net device..."
 			   "device being destroyed?");
-		return -1;
+		return -ENODEV;
 	}
 
 	init_packet = &net_device->channel_init_pkt;
@@ -354,13 +354,13 @@ static int netvsc_connect_vsp(struct hv_device *device)
 
 	if (init_packet->msg.init_msg.init_complete.status !=
 	    NVSP_STAT_SUCCESS) {
-		ret = -1;
+		ret = -EINVAL;
 		goto cleanup;
 	}
 
 	if (init_packet->msg.init_msg.init_complete.
 	    negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) {
-		ret = -1;
+		ret = -EPROTO;
 		goto cleanup;
 	}
 	/* Send the ndis version */
@@ -381,10 +381,8 @@ static int netvsc_connect_vsp(struct hv_device *device)
 				sizeof(struct nvsp_message),
 				(unsigned long)init_packet,
 				VM_PKT_DATA_INBAND, 0);
-	if (ret != 0) {
-		ret = -1;
+	if (ret != 0)
 		goto cleanup;
-	}
 
 	/* Post the big receive buffer to NetVSP */
 	ret = netvsc_init_recv_buf(device);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 66/77] Staging: hv: netvsc: Cleanup error return values in netvsc_send()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (63 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 65/77] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 67/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add() K. Y. Srinivasan
                     ` (10 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 1bca667..e3a2891 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -409,7 +409,7 @@ int netvsc_device_remove(struct hv_device *device)
 	net_device = release_outbound_net_device(device);
 	if (!net_device) {
 		dev_err(&device->device, "No net device present!!");
-		return -1;
+		return -ENODEV;
 	}
 
 	/* Wait for all send completions */
@@ -499,7 +499,7 @@ int netvsc_send(struct hv_device *device,
 	if (!net_device) {
 		dev_err(&device->device, "net device (%p) shutting down..."
 			   "ignoring outbound packets", net_device);
-		return -2;
+		return -ENODEV;
 	}
 
 	sendMessage.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 67/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (64 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 66/77] Staging: hv: netvsc: Cleanup error return values in netvsc_send() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 68/77] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive() K. Y. Srinivasan
                     ` (9 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/netvsc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index e3a2891..0ae35e7 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -918,7 +918,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 
 	net_device = alloc_net_device(device);
 	if (!net_device) {
-		ret = -1;
+		ret = -ENOMEM;
 		goto cleanup;
 	}
 
@@ -947,7 +947,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 
 	if (ret != 0) {
 		dev_err(&device->device, "unable to open channel: %d", ret);
-		ret = -1;
 		goto cleanup;
 	}
 
@@ -959,7 +958,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 	if (ret != 0) {
 		dev_err(&device->device,
 			"unable to connect to NetVSP - %d", ret);
-		ret = -1;
 		goto close;
 	}
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 68/77] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (65 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 67/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 69/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device() K. Y. Srinivasan
                     ` (8 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/rndis_filter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index dbb5201..8e1ef00 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -358,14 +358,14 @@ int rndis_filter_receive(struct hv_device *dev,
 	if (!net_dev->extension) {
 		dev_err(&dev->device, "got rndis message but no rndis device - "
 			  "dropping this message!\n");
-		return -1;
+		return -ENODEV;
 	}
 
 	rndis_dev = (struct rndis_device *)net_dev->extension;
 	if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
 		dev_err(&dev->device, "got rndis message but rndis device "
 			   "uninitialized...dropping this message!\n");
-		return -1;
+		return -ENODEV;
 	}
 
 	rndis_hdr = (struct rndis_message *)kmap_atomic(
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 69/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (66 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 68/77] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 70/77] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter() K. Y. Srinivasan
                     ` (7 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/rndis_filter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 8e1ef00..f26886d 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -437,7 +437,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
 	request = get_rndis_request(dev, REMOTE_NDIS_QUERY_MSG,
 			RNDIS_MESSAGE_SIZE(struct rndis_query_request));
 	if (!request) {
-		ret = -1;
+		ret = -ENOMEM;
 		goto Cleanup;
 	}
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 70/77] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (67 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 69/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 71/77] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device() K. Y. Srinivasan
                     ` (6 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes and cleanup some error paths.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/rndis_filter.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index f26886d..f5f3052 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -511,7 +511,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 			RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
 			sizeof(u32));
 	if (!request) {
-		ret = -1;
+		ret = -ENOMEM;
 		goto Cleanup;
 	}
 
@@ -531,7 +531,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 
 	if (t == 0) {
-		ret = -1;
 		dev_err(&dev->net_dev->dev->device,
 			"timeout before we got a set response...\n");
 		/*
@@ -540,8 +539,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 		 */
 		goto Exit;
 	} else {
-		if (ret > 0)
-			ret = 0;
 		set_complete = &request->response_msg.msg.set_complete;
 		status = set_complete->status;
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 71/77] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (68 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 70/77] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 72/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add() K. Y. Srinivasan
                     ` (5 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/rndis_filter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index f5f3052..a71f29d 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -562,7 +562,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
 	request = get_rndis_request(dev, REMOTE_NDIS_INITIALIZE_MSG,
 			RNDIS_MESSAGE_SIZE(struct rndis_initialize_request));
 	if (!request) {
-		ret = -1;
+		ret = -ENOMEM;
 		goto Cleanup;
 	}
 
@@ -596,7 +596,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
 		ret = 0;
 	} else {
 		dev->state = RNDIS_DEV_UNINITIALIZED;
-		ret = -1;
+		ret = -EINVAL;
 	}
 
 Cleanup:
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 72/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add()
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (69 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 71/77] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 73/77] Staging: hv: mouse: Change the jump label Cleanup to cleanup K. Y. Srinivasan
                     ` (4 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Use standard Linux error codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/rndis_filter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index a71f29d..f0d1362 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -673,7 +673,7 @@ int rndis_filter_device_add(struct hv_device *dev,
 
 	rndisDevice = get_rndis_device();
 	if (!rndisDevice)
-		return -1;
+		return -ENODEV;
 
 	/*
 	 * Let the inner driver handle this first to create the netvsc channel
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 73/77] Staging: hv: mouse: Change the jump label Cleanup to cleanup
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (70 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 72/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add() K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 74/77] Staging: hv: mouse: Get rid of the unused PCI signature K. Y. Srinivasan
                     ` (3 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Change the jump label Cleanup to cleanup.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_mouse.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 0338030..b04ba2c 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -339,7 +339,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
 
 	if (!input_device->hid_desc) {
 		pr_err("unable to allocate hid descriptor - size %d", desc->bLength);
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	memcpy(input_device->hid_desc, desc, desc->bLength);
@@ -352,7 +352,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
 	if (!input_device->report_desc) {
 		pr_err("unable to allocate report descriptor - size %d",
 			   input_device->report_desc_size);
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	memcpy(input_device->report_desc,
@@ -379,7 +379,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
 	if (ret != 0) {
 		pr_err("unable to send synthhid device info ack - ret %d",
 			   ret);
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	input_device->device_wait_condition = 1;
@@ -387,7 +387,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
 
 	return;
 
-Cleanup:
+cleanup:
 	kfree(input_device->hid_desc);
 	input_device->hid_desc = NULL;
 
@@ -606,7 +606,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
 					VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
 	if (ret != 0) {
 		pr_err("unable to send synthhid protocol request.");
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	input_dev->protocol_wait_condition = 0;
@@ -614,7 +614,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
 		input_dev->protocol_wait_condition, msecs_to_jiffies(1000));
 	if (input_dev->protocol_wait_condition == 0) {
 		ret = -ETIMEDOUT;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	response = &input_dev->protocol_resp;
@@ -623,7 +623,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
 		pr_err("synthhid protocol request failed (version %d)",
 		       SYNTHHID_INPUT_VERSION);
 		ret = -1;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	input_dev->device_wait_condition = 0;
@@ -631,7 +631,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
 		input_dev->device_wait_condition, msecs_to_jiffies(1000));
 	if (input_dev->device_wait_condition == 0) {
 		ret = -ETIMEDOUT;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	/*
@@ -643,7 +643,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
 	else
 		ret = -1;
 
-Cleanup:
+cleanup:
 	put_input_device(device);
 
 	return ret;
@@ -661,7 +661,7 @@ static int mousevsc_on_device_add(struct hv_device *device,
 
 	if (!input_dev) {
 		ret = -1;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	input_dev->init_complete = false;
@@ -714,7 +714,7 @@ static int mousevsc_on_device_add(struct hv_device *device,
 
 	input_dev->init_complete = true;
 
-Cleanup:
+cleanup:
 	return ret;
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 74/77] Staging: hv: mouse: Get rid of  the unused  PCI signature
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (71 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 73/77] Staging: hv: mouse: Change the jump label Cleanup to cleanup K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver K. Y. Srinivasan
                     ` (2 subsequent siblings)
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Get rid of  the unused  PCI signature.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_mouse.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index b04ba2c..1b30f26 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -22,8 +22,6 @@
 #include <linux/input.h>
 #include <linux/hid.h>
 #include <linux/hiddev.h>
-#include <linux/pci.h>
-#include <linux/dmi.h>
 #include <linux/delay.h>
 
 #include "hyperv.h"
@@ -949,20 +947,6 @@ static void __exit mousevsc_exit(void)
  * broken.  It's safe if you want to load it yourself manually, but
  * don't inflict it on unsuspecting users, that's just mean.
  */
-#if 0
-
-/*
- * We use a PCI table to determine if we should autoload this driver  This is
- * needed by distro tools to determine if the hyperv drivers should be
- * installed and/or configured.  We don't do anything else with the table, but
- * it needs to be present.
- */
-const static struct pci_device_id microsoft_hv_pci_table[] = {
-	{ PCI_DEVICE(0x1414, 0x5353) },	/* VGA compatible controller */
-	{ 0 }
-};
-MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
-#endif
 
 MODULE_LICENSE("GPL");
 MODULE_VERSION(HV_DRV_VERSION);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (72 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 74/77] Staging: hv: mouse: Get rid of the unused PCI signature K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-07-05 15:57     ` Greg KH
  2011-06-16 20:17   ` [PATCH 76/77] Staging: hv: netvsc: Change the jump label Cleanup to cleanup K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 77/77] Staging: hv: netvsc: Change the jump lable Exit to exit K. Y. Srinivasan
  75 siblings, 1 reply; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Disable auto-loading of the mouse driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/hv_mouse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 1b30f26..ab5f1da 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -950,7 +950,7 @@ static void __exit mousevsc_exit(void)
 
 MODULE_LICENSE("GPL");
 MODULE_VERSION(HV_DRV_VERSION);
-MODULE_ALIAS("vmbus:hv_mouse");
+/*MODULE_ALIAS("vmbus:hv_mouse");*/
 module_init(mousevsc_init);
 module_exit(mousevsc_exit);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 76/77] Staging: hv: netvsc: Change the jump label Cleanup to cleanup
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (73 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  2011-06-16 20:17   ` [PATCH 77/77] Staging: hv: netvsc: Change the jump lable Exit to exit K. Y. Srinivasan
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Change the jump label Cleanup to cleanup.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/rndis_filter.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index f0d1362..79dfe78 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -438,7 +438,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
 			RNDIS_MESSAGE_SIZE(struct rndis_query_request));
 	if (!request) {
 		ret = -ENOMEM;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	/* Setup the rndis query */
@@ -450,12 +450,12 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
 
 	ret = rndis_filter_send_request(dev, request);
 	if (ret != 0)
-		goto Cleanup;
+		goto cleanup;
 
 	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 	if (t == 0) {
 		ret = -ETIMEDOUT;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	/* Copy the response back */
@@ -463,7 +463,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
 
 	if (query_complete->info_buflen > inresult_size) {
 		ret = -1;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	memcpy(result,
@@ -473,7 +473,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
 
 	*result_size = query_complete->info_buflen;
 
-Cleanup:
+cleanup:
 	if (request)
 		put_rndis_request(dev, request);
 
@@ -512,7 +512,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 			sizeof(u32));
 	if (!request) {
 		ret = -ENOMEM;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	/* Setup the rndis set */
@@ -526,7 +526,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 
 	ret = rndis_filter_send_request(dev, request);
 	if (ret != 0)
-		goto Cleanup;
+		goto cleanup;
 
 	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 
@@ -543,7 +543,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 		status = set_complete->status;
 	}
 
-Cleanup:
+cleanup:
 	if (request)
 		put_rndis_request(dev, request);
 Exit:
@@ -563,7 +563,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
 			RNDIS_MESSAGE_SIZE(struct rndis_initialize_request));
 	if (!request) {
 		ret = -ENOMEM;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	/* Setup the rndis set */
@@ -578,7 +578,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
 	ret = rndis_filter_send_request(dev, request);
 	if (ret != 0) {
 		dev->state = RNDIS_DEV_UNINITIALIZED;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 
@@ -586,7 +586,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
 
 	if (t == 0) {
 		ret = -ETIMEDOUT;
-		goto Cleanup;
+		goto cleanup;
 	}
 
 	init_complete = &request->response_msg.msg.init_complete;
@@ -599,7 +599,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
 		ret = -EINVAL;
 	}
 
-Cleanup:
+cleanup:
 	if (request)
 		put_rndis_request(dev, request);
 
@@ -615,7 +615,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
 	request = get_rndis_request(dev, REMOTE_NDIS_HALT_MSG,
 				RNDIS_MESSAGE_SIZE(struct rndis_halt_request));
 	if (!request)
-		goto Cleanup;
+		goto cleanup;
 
 	/* Setup the rndis set */
 	halt = &request->request_msg.msg.halt_req;
@@ -626,7 +626,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
 
 	dev->state = RNDIS_DEV_UNINITIALIZED;
 
-Cleanup:
+cleanup:
 	if (request)
 		put_rndis_request(dev, request);
 	return;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* [PATCH 77/77] Staging: hv: netvsc: Change the jump lable Exit to exit
  2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
                     ` (74 preceding siblings ...)
  2011-06-16 20:17   ` [PATCH 76/77] Staging: hv: netvsc: Change the jump label Cleanup to cleanup K. Y. Srinivasan
@ 2011-06-16 20:17   ` K. Y. Srinivasan
  75 siblings, 0 replies; 91+ messages in thread
From: K. Y. Srinivasan @ 2011-06-16 20:17 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization
  Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen

Change the jump lable Exit to exit.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/rndis_filter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 79dfe78..6db48b9 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -537,7 +537,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 		 * We can't deallocate the request since we may still receive a
 		 * send completion for it.
 		 */
-		goto Exit;
+		goto exit;
 	} else {
 		set_complete = &request->response_msg.msg.set_complete;
 		status = set_complete->status;
@@ -546,7 +546,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
 cleanup:
 	if (request)
 		put_rndis_request(dev, request);
-Exit:
+exit:
 	return ret;
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 91+ messages in thread

* Re: [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver
  2011-06-16 20:17   ` [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver K. Y. Srinivasan
@ 2011-07-05 15:57     ` Greg KH
  2011-07-05 16:10       ` KY Srinivasan
  0 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2011-07-05 15:57 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen

On Thu, Jun 16, 2011 at 01:17:48PM -0700, K. Y. Srinivasan wrote:
> Disable auto-loading of the mouse driver.
> 
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
> ---
>  drivers/staging/hv/hv_mouse.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
> index 1b30f26..ab5f1da 100644
> --- a/drivers/staging/hv/hv_mouse.c
> +++ b/drivers/staging/hv/hv_mouse.c
> @@ -950,7 +950,7 @@ static void __exit mousevsc_exit(void)
>  
>  MODULE_LICENSE("GPL");
>  MODULE_VERSION(HV_DRV_VERSION);
> -MODULE_ALIAS("vmbus:hv_mouse");
> +/*MODULE_ALIAS("vmbus:hv_mouse");*/

Why?

{hint, I think I know why, but you need to tell us why in the changelog
comment}

Dropped.


^ permalink raw reply	[flat|nested] 91+ messages in thread

* Re: [PATCH 07/77] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name
  2011-06-16 20:16   ` [PATCH 07/77] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name K. Y. Srinivasan
@ 2011-07-05 16:01     ` Greg KH
  0 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-07-05 16:01 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen

On Thu, Jun 16, 2011 at 01:16:40PM -0700, K. Y. Srinivasan wrote:
> In preparation for introducing machinery to support autoloading vmbus 
> drivers, introduce a function to map the dev_type guid to a human readable name.

"Human readable"?

<snip>

> +static const char *blk_dev_type = "hv_block";
> +static const char *net_dev_type = "hv_net";
> +static const char *scsi_dev_type = "hv_scsi";
> +static const char *mouse_dev_type = "hv_mouse";
> +static const char *util_dev_type = "hv_util";

It looks like these are the module names, which aren't the most "human
readable" around.

> +/*
> + * Map the dev_type guid to a human readable string for setting
> + * up module aliases. The indices used in this function are based on
> + * the table defined earlier - supported_device_classes[]
> + */
> +const char *hv_get_devtype_name(const struct hv_guid *type)
> +{
> +	int i;
> +
> +	for (i = 0; i < MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) {
> +		if (!memcmp(type, supported_device_classes[i].data,
> +				sizeof(struct hv_guid))) {
> +			switch (i) {
> +			case 0:
> +				return scsi_dev_type;
> +			case 1:
> +				return net_dev_type;
> +			case 2:
> +				return mouse_dev_type;
> +			case 3:
> +				return blk_dev_type;
> +			}
> +		}
> +	}
> +	/*
> +	 * Currently the util driver is used
> +	 * to handle all these devices.
> +	 */
> +	return util_dev_type;
> +}

Ok, you create a function to return a string, but I'm really afraid of
what you are going to do in the next patch with this...


^ permalink raw reply	[flat|nested] 91+ messages in thread

* Re: [PATCH 09/77] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver
  2011-06-16 20:16   ` [PATCH 09/77] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver K. Y. Srinivasan
@ 2011-07-05 16:04     ` Greg KH
  0 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-07-05 16:04 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen

On Thu, Jun 16, 2011 at 01:16:42PM -0700, K. Y. Srinivasan wrote:
> Setup the newly introduced id_table for the blkvsc driver.:
> 
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
> ---
>  drivers/staging/hv/blkvsc_drv.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
> index 3612574..5842db8 100644
> --- a/drivers/staging/hv/blkvsc_drv.c
> +++ b/drivers/staging/hv/blkvsc_drv.c
> @@ -802,10 +802,15 @@ static void blkvsc_request(struct request_queue *queue)
>  	}
>  }
>  
> +static const struct hv_vmbus_device_id id_table[] = {
> +	{ "hv_block" },
> +	{ "" }
> +};

Ick.  Yeah, I was afraid of this :(

You are trying to use a "human" name here, which you could just use the
macro for the module name.

But, we don't care about the module name, we just care about what GUID
this driver says it supports.  So put that in the driver, then use the
module alias for that GUID and have modprobe figure out what module to
load based on when the GUID is seen by the vmbus and exposed to
userspace through the hotplug event.

Think of the GUID as a PCI vendor/device/class signature, that's all it
is.  None of this wierd "names" that you have to keep track of in the
core, and in the driver, and hope to keep them all in sync all the time.

So no, this isn't the way to do this sorry, please redo it like
PCI/USB/the entire rest of the kernel does it.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 91+ messages in thread

* Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-06-16 20:16   ` [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line K. Y. Srinivasan
@ 2011-07-05 16:06     ` Greg KH
  2011-07-06  0:40       ` KY Srinivasan
  0 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2011-07-05 16:06 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen

On Thu, Jun 16, 2011 at 01:16:48PM -0700, K. Y. Srinivasan wrote:
> Add the appropriate MODULE_ALIAS() line to support auto-loading.
> 
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
> ---
>  drivers/staging/hv/blkvsc_drv.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
> index 5842db8..9496abe 100644
> --- a/drivers/staging/hv/blkvsc_drv.c
> +++ b/drivers/staging/hv/blkvsc_drv.c
> @@ -1027,5 +1027,6 @@ static void __exit blkvsc_exit(void)
>  MODULE_LICENSE("GPL");
>  MODULE_VERSION(HV_DRV_VERSION);
>  MODULE_DESCRIPTION("Microsoft Hyper-V virtual block driver");
> +MODULE_ALIAS("vmbus:hv_block");

No, these should be automagically generated with the MODULE_DEVICE_ID()
macro that you use in the module with the GUID there, instead of this.

Don't look at platform drivers as any semblance of how you should ever
do anything (I'm guessing you just copied their way of doing things
here).  You have a real bus here (or at least a half-way version of a
bus) that can autodetect devices and tell userspace that you now have
them.  Use that, don't try to model the code after the old, broken, and
hopefully-someday-in-my-dreams-will-go-away platform code.

greg k-h

^ permalink raw reply	[flat|nested] 91+ messages in thread

* RE: [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver
  2011-07-05 15:57     ` Greg KH
@ 2011-07-05 16:10       ` KY Srinivasan
  2011-07-05 16:18         ` Greg KH
  0 siblings, 1 reply; 91+ messages in thread
From: KY Srinivasan @ 2011-07-05 16:10 UTC (permalink / raw)
  To: Greg KH
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen



> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Tuesday, July 05, 2011 11:58 AM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang; Hank
> Janssen
> Subject: Re: [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the
> mouse driver
> 
> On Thu, Jun 16, 2011 at 01:17:48PM -0700, K. Y. Srinivasan wrote:
> > Disable auto-loading of the mouse driver.
> >
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> > Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
> > ---
> >  drivers/staging/hv/hv_mouse.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
> > index 1b30f26..ab5f1da 100644
> > --- a/drivers/staging/hv/hv_mouse.c
> > +++ b/drivers/staging/hv/hv_mouse.c
> > @@ -950,7 +950,7 @@ static void __exit mousevsc_exit(void)
> >
> >  MODULE_LICENSE("GPL");
> >  MODULE_VERSION(HV_DRV_VERSION);
> > -MODULE_ALIAS("vmbus:hv_mouse");
> > +/*MODULE_ALIAS("vmbus:hv_mouse");*/
> 
> Why?
> 
> {hint, I think I know why, but you need to tell us why in the changelog
> comment}
> 
> Dropped.

I will re-submit this with appropriate comments. Have you also dropped
all remaining patches  submitted in this patch-set as well as the patch-set
that I had submitted subsequently. 

Regards,

K. Y
 



^ permalink raw reply	[flat|nested] 91+ messages in thread

* Re: [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver
  2011-07-05 16:10       ` KY Srinivasan
@ 2011-07-05 16:18         ` Greg KH
  0 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-07-05 16:18 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: Greg KH, linux-kernel, devel, virtualization, Haiyang Zhang,
	Hank Janssen

On Tue, Jul 05, 2011 at 04:10:46PM +0000, KY Srinivasan wrote:
> 
> 
> > -----Original Message-----
> > From: Greg KH [mailto:greg@kroah.com]
> > Sent: Tuesday, July 05, 2011 11:58 AM
> > To: KY Srinivasan
> > Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> > devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang; Hank
> > Janssen
> > Subject: Re: [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the
> > mouse driver
> > 
> > On Thu, Jun 16, 2011 at 01:17:48PM -0700, K. Y. Srinivasan wrote:
> > > Disable auto-loading of the mouse driver.
> > >
> > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> > > Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
> > > ---
> > >  drivers/staging/hv/hv_mouse.c |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
> > > index 1b30f26..ab5f1da 100644
> > > --- a/drivers/staging/hv/hv_mouse.c
> > > +++ b/drivers/staging/hv/hv_mouse.c
> > > @@ -950,7 +950,7 @@ static void __exit mousevsc_exit(void)
> > >
> > >  MODULE_LICENSE("GPL");
> > >  MODULE_VERSION(HV_DRV_VERSION);
> > > -MODULE_ALIAS("vmbus:hv_mouse");
> > > +/*MODULE_ALIAS("vmbus:hv_mouse");*/
> > 
> > Why?
> > 
> > {hint, I think I know why, but you need to tell us why in the changelog
> > comment}
> > 
> > Dropped.
> 
> I will re-submit this with appropriate comments. Have you also dropped
> all remaining patches  submitted in this patch-set as well as the patch-set
> that I had submitted subsequently. 

I have now applied all of the drivers/staging/hv/ patches in my
"to-apply" queue that I am going to apply, so feel free to rebase now
and redo and resend.

greg k-h

^ permalink raw reply	[flat|nested] 91+ messages in thread

* RE: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-07-05 16:06     ` Greg KH
@ 2011-07-06  0:40       ` KY Srinivasan
  2011-07-06  3:42         ` Greg KH
  0 siblings, 1 reply; 91+ messages in thread
From: KY Srinivasan @ 2011-07-06  0:40 UTC (permalink / raw)
  To: Greg KH
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen



> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Tuesday, July 05, 2011 12:06 PM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang; Hank
> Janssen
> Subject: Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate
> MODULE_ALIAS() line
> 
> On Thu, Jun 16, 2011 at 01:16:48PM -0700, K. Y. Srinivasan wrote:
> > Add the appropriate MODULE_ALIAS() line to support auto-loading.
> >
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> > Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
> > ---
> >  drivers/staging/hv/blkvsc_drv.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
> > index 5842db8..9496abe 100644
> > --- a/drivers/staging/hv/blkvsc_drv.c
> > +++ b/drivers/staging/hv/blkvsc_drv.c
> > @@ -1027,5 +1027,6 @@ static void __exit blkvsc_exit(void)
> >  MODULE_LICENSE("GPL");
> >  MODULE_VERSION(HV_DRV_VERSION);
> >  MODULE_DESCRIPTION("Microsoft Hyper-V virtual block driver");
> > +MODULE_ALIAS("vmbus:hv_block");
> 
> No, these should be automagically generated with the MODULE_DEVICE_ID()
> macro that you use in the module with the GUID there, instead of this.

I think you mean MODULE_DEVICE_TABLE()? I actually went down that path first
adding code  to  file2alias.c for parsing the vmbus ID table. Given that this approach
would make it  impossible to support auto-loading of these drivers
on many of the released kernels, I chose to go with the MODULE_ALIAS() macro
that did not need any changes outside our drivers. In both methods, the formatting
of the name is bus specific since I would be writing the code to parse the table in
file2alias.c.

Granted, I have been quite unimaginative in my alias names, but I thought they were
reasonably descriptive. If at all possible, for the reasons listed above, I would prefer to use
the MODULE_ALIAS() macro (I could embed all or part of the guid in the alias). Let me know.

Regards,

K. Y  


^ permalink raw reply	[flat|nested] 91+ messages in thread

* Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-07-06  0:40       ` KY Srinivasan
@ 2011-07-06  3:42         ` Greg KH
  2011-07-06 14:55           ` KY Srinivasan
  0 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2011-07-06  3:42 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen

On Wed, Jul 06, 2011 at 12:40:42AM +0000, KY Srinivasan wrote:
> > > diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
> > > index 5842db8..9496abe 100644
> > > --- a/drivers/staging/hv/blkvsc_drv.c
> > > +++ b/drivers/staging/hv/blkvsc_drv.c
> > > @@ -1027,5 +1027,6 @@ static void __exit blkvsc_exit(void)
> > >  MODULE_LICENSE("GPL");
> > >  MODULE_VERSION(HV_DRV_VERSION);
> > >  MODULE_DESCRIPTION("Microsoft Hyper-V virtual block driver");
> > > +MODULE_ALIAS("vmbus:hv_block");
> > 
> > No, these should be automagically generated with the MODULE_DEVICE_ID()
> > macro that you use in the module with the GUID there, instead of this.
> 
> I think you mean MODULE_DEVICE_TABLE()?

Yes, sorry for the typo.

> I actually went down that path first
> adding code  to  file2alias.c for parsing the vmbus ID table. Given that this approach
> would make it  impossible to support auto-loading of these drivers
> on many of the released kernels,

Wait, what?  What is a "released kernel"?  We are working on the
in-kernel patch, we don't care about older distros/releases for this
work at all.  Also, it doesn't make sense at all, why would the change I
asked for make any difference on older distros/kernels?

> I chose to go with the MODULE_ALIAS() macro that did not need any
> changes outside our drivers. In both methods, the formatting of the
> name is bus specific since I would be writing the code to parse the
> table in file2alias.c.

Yes, that is what is needed to be done.

> Granted, I have been quite unimaginative in my alias names, but I
> thought they were reasonably descriptive. If at all possible, for the
> reasons listed above, I would prefer to use the MODULE_ALIAS() macro
> (I could embed all or part of the guid in the alias). Let me know.

Please do the correct thing and use MODULE_DEVICE_TABLE().

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 91+ messages in thread

* RE: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-07-06  3:42         ` Greg KH
@ 2011-07-06 14:55           ` KY Srinivasan
  2011-07-06 15:02             ` Greg KH
  0 siblings, 1 reply; 91+ messages in thread
From: KY Srinivasan @ 2011-07-06 14:55 UTC (permalink / raw)
  To: Greg KH
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen



> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Tuesday, July 05, 2011 11:42 PM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang; Hank
> Janssen
> Subject: Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate
> MODULE_ALIAS() line
> 
> On Wed, Jul 06, 2011 at 12:40:42AM +0000, KY Srinivasan wrote:
> > > > diff --git a/drivers/staging/hv/blkvsc_drv.c
> b/drivers/staging/hv/blkvsc_drv.c
> > > > index 5842db8..9496abe 100644
> > > > --- a/drivers/staging/hv/blkvsc_drv.c
> > > > +++ b/drivers/staging/hv/blkvsc_drv.c
> > > > @@ -1027,5 +1027,6 @@ static void __exit blkvsc_exit(void)
> > > >  MODULE_LICENSE("GPL");
> > > >  MODULE_VERSION(HV_DRV_VERSION);
> > > >  MODULE_DESCRIPTION("Microsoft Hyper-V virtual block driver");
> > > > +MODULE_ALIAS("vmbus:hv_block");
> > >
> > > No, these should be automagically generated with the MODULE_DEVICE_ID()
> > > macro that you use in the module with the GUID there, instead of this.
> >
> > I think you mean MODULE_DEVICE_TABLE()?
> 
> Yes, sorry for the typo.
> 
> > I actually went down that path first
> > adding code  to  file2alias.c for parsing the vmbus ID table. Given that this
> approach
> > would make it  impossible to support auto-loading of these drivers
> > on many of the released kernels,
> 
> Wait, what?  What is a "released kernel"?  We are working on the
> in-kernel patch, we don't care about older distros/releases for this
> work at all.  Also, it doesn't make sense at all, why would the change I
> asked for make any difference on older distros/kernels?

I understand we don't care here about older kernels and I will do what you
have suggested. I just wanted to give you the rationale for choices I made:
We are currently supporting older distros/kernels using these upstream bits.
With the MODULE_ALIAS() approach, since I did not have to change any code
outside the hv directory, this was possible. I was mostly concerned about 
having to make changes to code outside the hv directory and figuring out 
how to build and propagate these changes (file2alias.c) in older kernels. 


> 
> > I chose to go with the MODULE_ALIAS() macro that did not need any
> > changes outside our drivers. In both methods, the formatting of the
> > name is bus specific since I would be writing the code to parse the
> > table in file2alias.c.
> 
> Yes, that is what is needed to be done.
> 
> > Granted, I have been quite unimaginative in my alias names, but I
> > thought they were reasonably descriptive. If at all possible, for the
> > reasons listed above, I would prefer to use the MODULE_ALIAS() macro
> > (I could embed all or part of the guid in the alias). Let me know.
> 
> Please do the correct thing and use MODULE_DEVICE_TABLE().

We have four drivers now excluding vmbus and soon we will have only three
drivers with the merge of block and stor drivers. Would you still recommend I use the
full guid to name these drivers. Rather than embedding the entire 128bit guid in module
aliases, I was thinking of setting up a more reasonable namespace for these drivers
(like what virtio has done for instance). Let me know if this is ok with you if I took that
route (mapping the guid to small integers and having these integers be used in alias strings).

Regards,

K. Y  


^ permalink raw reply	[flat|nested] 91+ messages in thread

* Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-07-06 14:55           ` KY Srinivasan
@ 2011-07-06 15:02             ` Greg KH
  2011-07-06 15:17               ` KY Srinivasan
  0 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2011-07-06 15:02 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen

On Wed, Jul 06, 2011 at 02:55:12PM +0000, KY Srinivasan wrote:
> > > I think you mean MODULE_DEVICE_TABLE()?
> > 
> > Yes, sorry for the typo.
> > 
> > > I actually went down that path first
> > > adding code  to  file2alias.c for parsing the vmbus ID table. Given that this
> > approach
> > > would make it  impossible to support auto-loading of these drivers
> > > on many of the released kernels,
> > 
> > Wait, what?  What is a "released kernel"?  We are working on the
> > in-kernel patch, we don't care about older distros/releases for this
> > work at all.  Also, it doesn't make sense at all, why would the change I
> > asked for make any difference on older distros/kernels?
> 
> I understand we don't care here about older kernels and I will do what you
> have suggested. I just wanted to give you the rationale for choices I made:
> We are currently supporting older distros/kernels using these upstream bits.
> With the MODULE_ALIAS() approach, since I did not have to change any code
> outside the hv directory, this was possible. I was mostly concerned about 
> having to make changes to code outside the hv directory and figuring out 
> how to build and propagate these changes (file2alias.c) in older kernels. 

You create a patch like any other patch and give it to the people who
are stuck with those older kernels.  It shouldn't be that hard, and it
also shouldn't be something that matters for this mainline work either.

> > > I chose to go with the MODULE_ALIAS() macro that did not need any
> > > changes outside our drivers. In both methods, the formatting of the
> > > name is bus specific since I would be writing the code to parse the
> > > table in file2alias.c.
> > 
> > Yes, that is what is needed to be done.
> > 
> > > Granted, I have been quite unimaginative in my alias names, but I
> > > thought they were reasonably descriptive. If at all possible, for the
> > > reasons listed above, I would prefer to use the MODULE_ALIAS() macro
> > > (I could embed all or part of the guid in the alias). Let me know.
> > 
> > Please do the correct thing and use MODULE_DEVICE_TABLE().
> 
> We have four drivers now excluding vmbus and soon we will have only three
> drivers with the merge of block and stor drivers. Would you still recommend I use the
> full guid to name these drivers.

Yes, why not?

> Rather than embedding the entire 128bit guid in module aliases, I was
> thinking of setting up a more reasonable namespace for these drivers
> (like what virtio has done for instance). Let me know if this is ok
> with you if I took that route (mapping the guid to small integers and
> having these integers be used in alias strings).

What's the big deal of having a large number as an alias?  Is there some
constraint here that I am not aware of?

greg k-h

^ permalink raw reply	[flat|nested] 91+ messages in thread

* RE: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-07-06 15:02             ` Greg KH
@ 2011-07-06 15:17               ` KY Srinivasan
  2011-07-06 15:29                 ` Greg KH
  0 siblings, 1 reply; 91+ messages in thread
From: KY Srinivasan @ 2011-07-06 15:17 UTC (permalink / raw)
  To: Greg KH
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen



> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Wednesday, July 06, 2011 11:02 AM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang; Hank
> Janssen
> Subject: Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate
> MODULE_ALIAS() line
> 
> On Wed, Jul 06, 2011 at 02:55:12PM +0000, KY Srinivasan wrote:
> > > > I think you mean MODULE_DEVICE_TABLE()?
> > >
> > > Yes, sorry for the typo.
> > >
> > > > I actually went down that path first
> > > > adding code  to  file2alias.c for parsing the vmbus ID table. Given that this
> > > approach
> > > > would make it  impossible to support auto-loading of these drivers
> > > > on many of the released kernels,
> > >
> > > Wait, what?  What is a "released kernel"?  We are working on the
> > > in-kernel patch, we don't care about older distros/releases for this
> > > work at all.  Also, it doesn't make sense at all, why would the change I
> > > asked for make any difference on older distros/kernels?
> >
> > I understand we don't care here about older kernels and I will do what you
> > have suggested. I just wanted to give you the rationale for choices I made:
> > We are currently supporting older distros/kernels using these upstream bits.
> > With the MODULE_ALIAS() approach, since I did not have to change any code
> > outside the hv directory, this was possible. I was mostly concerned about
> > having to make changes to code outside the hv directory and figuring out
> > how to build and propagate these changes (file2alias.c) in older kernels.
> 
> You create a patch like any other patch and give it to the people who
> are stuck with those older kernels.  It shouldn't be that hard, and it
> also shouldn't be something that matters for this mainline work either.
> 
> > > > I chose to go with the MODULE_ALIAS() macro that did not need any
> > > > changes outside our drivers. In both methods, the formatting of the
> > > > name is bus specific since I would be writing the code to parse the
> > > > table in file2alias.c.
> > >
> > > Yes, that is what is needed to be done.
> > >
> > > > Granted, I have been quite unimaginative in my alias names, but I
> > > > thought they were reasonably descriptive. If at all possible, for the
> > > > reasons listed above, I would prefer to use the MODULE_ALIAS() macro
> > > > (I could embed all or part of the guid in the alias). Let me know.
> > >
> > > Please do the correct thing and use MODULE_DEVICE_TABLE().
> >
> > We have four drivers now excluding vmbus and soon we will have only three
> > drivers with the merge of block and stor drivers. Would you still recommend I
> use the
> > full guid to name these drivers.
> 
> Yes, why not?
> 
> > Rather than embedding the entire 128bit guid in module aliases, I was
> > thinking of setting up a more reasonable namespace for these drivers
> > (like what virtio has done for instance). Let me know if this is ok
> > with you if I took that route (mapping the guid to small integers and
> > having these integers be used in alias strings).
> 
> What's the big deal of having a large number as an alias?  Is there some
> constraint here that I am not aware of?

It is certainly easier to deal with a small integer than with 128bit giud and there is
no added benefit dealing with guids since the number of drivers we will support
under vmbus will never exceed a very small number. Having said that, I will go ahead
and embed full guids as you have suggested. So, the aliases for these drivers will be:
vmbus:device guid.

Regards,

K. Y


^ permalink raw reply	[flat|nested] 91+ messages in thread

* Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-07-06 15:17               ` KY Srinivasan
@ 2011-07-06 15:29                 ` Greg KH
  2011-07-06 15:47                   ` KY Srinivasan
  0 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2011-07-06 15:29 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen

On Wed, Jul 06, 2011 at 03:17:37PM +0000, KY Srinivasan wrote:
> It is certainly easier to deal with a small integer than with 128bit giud and there is
> no added benefit dealing with guids since the number of drivers we will support
> under vmbus will never exceed a very small number. Having said that, I will go ahead
> and embed full guids as you have suggested. So, the aliases for these drivers will be:
> vmbus:device guid.

Wait, no, you will never be typing "MODULE_ALIAS()" in your driver at
all, it will be created automatically for you by the proper macro fun
with the MODULE_DEVICE_TABLE() line.  The same variable you use in that
macro will be used to register the driver with the vmbus core.

No one ever sees module aliases in the "raw" anymore, except for the
platform legacy crud.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 91+ messages in thread

* RE: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line
  2011-07-06 15:29                 ` Greg KH
@ 2011-07-06 15:47                   ` KY Srinivasan
  0 siblings, 0 replies; 91+ messages in thread
From: KY Srinivasan @ 2011-07-06 15:47 UTC (permalink / raw)
  To: Greg KH
  Cc: gregkh, linux-kernel, devel, virtualization, Haiyang Zhang, Hank Janssen



> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Wednesday, July 06, 2011 11:29 AM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang; Hank
> Janssen
> Subject: Re: [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate
> MODULE_ALIAS() line
> 
> On Wed, Jul 06, 2011 at 03:17:37PM +0000, KY Srinivasan wrote:
> > It is certainly easier to deal with a small integer than with 128bit giud and there
> is
> > no added benefit dealing with guids since the number of drivers we will support
> > under vmbus will never exceed a very small number. Having said that, I will go
> ahead
> > and embed full guids as you have suggested. So, the aliases for these drivers
> will be:
> > vmbus:device guid.
> 
> Wait, no, you will never be typing "MODULE_ALIAS()" in your driver at
> all, it will be created automatically for you by the proper macro fun
> with the MODULE_DEVICE_TABLE() line.  The same variable you use in that
> macro will be used to register the driver with the vmbus core.

I was referring to the name that would be generated by the parsing code
In file2alias.c. I have an id_table field in the struct hv_driver and this will point
to the table that will setup. This table will be used in the vmbus match function
as well as to generate hotplug events.

Regards,

K. Y


^ permalink raw reply	[flat|nested] 91+ messages in thread

end of thread, other threads:[~2011-07-06 15:47 UTC | newest]

Thread overview: 91+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-16 20:16 [PATCH 00/77] Staging: hv: Driver cleanup K. Y. Srinivasan
2011-06-16 20:16 ` [PATCH 01/77] Staging: hv: vmbus: Increase the timeout value in the vmbus driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 02/77] Staging: hv: netvsc: Increase the timeout value in the netvsc driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 03/77] Staging: hv: storvsc: Increase the timeout value in the storvsc driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 04/77] Staging: hv: netvsc: Fix a bug in accounting transmit slots K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 05/77] Staging: hv: vmbus: Properly handle the error in hv_acpi_init() K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 06/77] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 07/77] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name K. Y. Srinivasan
2011-07-05 16:01     ` Greg KH
2011-06-16 20:16   ` [PATCH 08/77] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 09/77] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver K. Y. Srinivasan
2011-07-05 16:04     ` Greg KH
2011-06-16 20:16   ` [PATCH 10/77] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 11/77] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 12/77] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 13/77] Staging: hv: vmbus: Introduce a human readable device type field to struct hv_device K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 14/77] Staging: hv: util: Make hv_utils a vmbus device driver K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 15/77] Staging: hv: blkvsc: Add the appropriate MODULE_ALIAS() line K. Y. Srinivasan
2011-07-05 16:06     ` Greg KH
2011-07-06  0:40       ` KY Srinivasan
2011-07-06  3:42         ` Greg KH
2011-07-06 14:55           ` KY Srinivasan
2011-07-06 15:02             ` Greg KH
2011-07-06 15:17               ` KY Srinivasan
2011-07-06 15:29                 ` Greg KH
2011-07-06 15:47                   ` KY Srinivasan
2011-06-16 20:16   ` [PATCH 16/77] Staging: hv: storvsc: " K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 17/77] Staging: hv: netvsc: " K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 18/77] Staging: hv: mousevsc: " K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 19/77] Staging: hv: util: " K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 20/77] Staging: hv: vmbus: Cleanup the vmbus_uevent() code K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 21/77] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 22/77] Staging: hv: storvsc: Get rid of the DMI signature K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 23/77] Staging: hv: netvsc: Get rid of the PCI signature K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 24/77] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 25/77] Staging: hv: util: Get rid of the DMI signature in hv_util.c K. Y. Srinivasan
2011-06-16 20:16   ` [PATCH 26/77] Staging: hv: util: Get rid of the PCI " K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 27/77] Staging: hv: vmbus: Cleanup vmbus_match() function K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 28/77] Staging: hv: blkvsc: Get rid of the dev_type guid from blkvsc_drv.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 29/77] Staging: hv: storvsc: Get rid of the device type guid from storvsc_drv.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 30/77] Staging: hv: netvsc: Get rid of the dev_type guid from netvsc.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 31/77] Staging: hv: netvsc: Initialize the driver name directly K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 32/77] Staging: hv: netvsc: Get rid of the driver name initialization in netvsc.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 33/77] Staging: hv: netvsc: Get rid of the empty function netvsc_initialize() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 34/77] Staging: hv: vmbus: Get rid of the unused name field in struct hv_driver K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 35/77] Staging: hv: mouse: Get rid of the dev_type guid in hv_mouse.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 36/77] Staging: hv: vmbus: Cleanup the code displaying class_id K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 37/77] Staging: hv: vmbus: Do not initialize dev_type guid in vmbus_child_device_create() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 38/77] Staging: hv: vmbus: Get rid of the unused dev_type field in hv_device and hv_driver K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 39/77] Staging: hv: vmbus: Get rid of the device_id attribute K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 40/77] Staging: hv: vmbus: Get rid of some unnecessary comments K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 41/77] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 42/77] Staging: hv: vmbus: Cleanup error handling in hv_init() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 43/77] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 44/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_body() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 45/77] Staging: hv: vmbus: Get rid of the function dump_gpadl_header() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 46/77] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 47/77] Staging: hv: vmbus: Get rid of unnecessary comments " K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 48/77] Staging: hv: vmbus: Change the variable name openInfo to open_info " K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 49/77] Staging: hv: vmbus: Cleanup error values in ringbuffer.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 50/77] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 51/77] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 52/77] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 53/77] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 54/77] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 55/77] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 56/77] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 57/77] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 58/77] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 59/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 60/77] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 61/77] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 62/77] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 63/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 64/77] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 65/77] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 66/77] Staging: hv: netvsc: Cleanup error return values in netvsc_send() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 67/77] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 68/77] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 69/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 70/77] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 71/77] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 72/77] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add() K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 73/77] Staging: hv: mouse: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 74/77] Staging: hv: mouse: Get rid of the unused PCI signature K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 75/77] Staging: hv: mouse: Disable auto-loading of the mouse driver K. Y. Srinivasan
2011-07-05 15:57     ` Greg KH
2011-07-05 16:10       ` KY Srinivasan
2011-07-05 16:18         ` Greg KH
2011-06-16 20:17   ` [PATCH 76/77] Staging: hv: netvsc: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-06-16 20:17   ` [PATCH 77/77] Staging: hv: netvsc: Change the jump lable Exit to exit K. Y. Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).