Commit Graph

42 Commits

Author SHA1 Message Date
K. Y. Srinivasan 24326039b9 Staging: hv: vmbus: Cleanup the code in process_chn_event()
A channel in Hyper-V is equivalent to a device. Thus, a channel is
persistent once it is presented to the guest, even if the driver
managing this device is unloaded. By checking and invoking the driver
specific callback function under the protection of the channel
inbound_lock, we can properly deal with racing driver unloads since an
unloading driver sets the callback to NULL under the protection of this
inbound_lock.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:53:51 -07:00
K. Y. Srinivasan d9add43b48 Staging: hv: vmbus: Fix checkpatch warnings in connection.c
Fix checkpatch warnings in connection.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:10:02 -07:00
K. Y. Srinivasan c2ec81cb3e Staging: hv: vmbus: Get rid of an unnecessary check in vmbus_connect()
Get rid of an unnecessary check in vmbus_connect().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:10:01 -07:00
K. Y. Srinivasan dad76bf73f Staging: hv: vmbus: Properly deal with de-registering channel callback
Ensure that we correctly handle racing invocations of the channel callback
when the channel is being closed. We do this using the channel's inbound_lock.
A side-effect of this strategy is that we avoid repeatedly picking up this lock
as we drain the inbound ring-buffer.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:05:30 -07:00
K. Y. Srinivasan 76c39d429d Staging: hv: vmbus: Check before invoking the channel callback
When we close a channel, we set the corresponding callback function to NULL.
Check before invoking the channel callback.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:05:30 -07:00
K. Y. Srinivasan 5289d3d160 Staging: hv: vmbus: Retry vmbus_post_msg() before giving up
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: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-25 15:23:19 -07:00
K. Y. Srinivasan 7a9462d842 Staging: hv: vmbus: Get rid of unnecessay comments in connection.c
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: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-25 15:22:19 -07:00
K. Y. Srinivasan 2dfde9644f Staging: hv: vmbus: Increase the timeout value in the vmbus driver
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:59:23 -07:00
K. Y. Srinivasan 3a7546d934 Staging: hv: vmbus: Cleanup error codes in connection.c
Cleanup error codes in connection.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:06 -07:00
K. Y. Srinivasan c0e2490fd4 Staging: hv: vmbus: Get rid of an unused function in connection.c
Get rid of an unused function in connection.c

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:01 -07:00
K. Y. Srinivasan df452fa120 Staging: hv: vmbus: Directly invoke the channel callback
Now, directly invoke the channel callback.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:53 -07:00
K. Y. Srinivasan 89b2ca4781 Staging: hv: vmbus_drv: Move the contents of vmbus_private.h to vmbus_hyperv.h
Move the contents of vmbus_private.h to vmbus_hyperv.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:04 -07:00
K. Y. Srinivasan afbdc4a98b Staging: hv: vmbus_drv: Include the contents of hv_api.h in hyperv_vmbus.h
Include the contents of hv_api.h in hyperv_vmbus.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:03 -07:00
K. Y. Srinivasan 0f2a6619ee Staging: hv: vmbus_drv: Create a common header file to build the vmbus driver
Create a common header file to build the vmbus driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:03 -07:00
K. Y. Srinivasan f63c9149d0 Staging: hv: Move the contents of logging.h to hyperv.h
Move the contents of logging.h to hyperv.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 11:46:17 -07:00
K. Y. Srinivasan 3f335ea213 Staging: hv: Include the newly created header file in all of the relevant hyperv files
Include the newly created header file in all of the relevant hyperv files.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 11:46:12 -07:00
K. Y. Srinivasan 6d81d33059 Staging: hv: Get rid of some dead code in connection.c
Get rid some commented code and dated comments.T

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 13:49:17 -07:00
K. Y. Srinivasan b0043863a0 Staging: hv: Change Cleanup to cleanup in connection.c
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 13:49:17 -07:00
K. Y. Srinivasan 9568a1931c Staging: hv: Use completion abstraction to synchronize in vmbus_channel_msginfo
Use completion abstraction to synchronize in vmbus_channel_msginfo.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 13:49:14 -07:00
Olaf Hering 35436487e9 hv: pass u32 to process_chn_event()
Change types in vmbus_on_event() to u32 since the input is u32 as well.
Pass u32 to process_chn_event() instead of casting arg to void* and back.
Update printk to reflect type change.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20 13:40:34 -07:00
Olaf Hering 242b45aa8d hv: Reduce indention in vmbus_on_event
Reduce indention in vmbus_on_event() by converting two
if (var) to if (!var)

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20 13:40:33 -07:00
Greg Kroah-Hartman 32235b07b5 Staging: merge 2.6.39-rc3 into staging-next
This was done to handle a number of conflicts, the majority of which
were caused by the big "fix spelling issues" patch.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-13 12:14:05 -07:00
Hank Janssen 0a46618d58 staging: hv: Replace DPRINT with natives in hv_vmbus
Replace all remaining DPRINT calls (excluding the ringbuffer debug
which is going to be done in a next set of patches) with their
native pr_ calls. And also changed some of the printouts to be more
useful.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-04 22:03:07 -07:00
Hank Janssen 98e087022b staging: hv: Remove all unneeded DPRINT from hv_vmbus
Remove all un-needed DPRINT calls from hv_vmbus. Several
are remaining that will be cleaned up in my next set of patches.
They deal with printing out the ringbuffer debugging which is
going to be implemented slightly differently.

This patch deals with hv_vmbus only.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-04 22:03:05 -07:00
Olaf Hering 2235658571 staging: hv: use sync_bitops when interacting with the hypervisor
Locking is required when tweaking bits located in a shared page, use the
sync_ version of bitops. Without this change vmbus_on_event() will miss
events and as a result, vmbus_isr() will not schedule the receive tasklet.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: stable <stable@kernel.org>
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
Acked-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-04 21:33:25 -07:00
Ilia Mirkin dd9b15dc03 staging: hv: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Mike Sterling <mike.sterling@microsoft.com>
Cc: Abhishek Kane <v-abkane@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 12:36:14 -07:00
K. Y. Srinivasan 6de3d6aa9a Staging: hv: Eliminate vmbus_event_dpc()
vmbus_event_dpc() was a wrapper function not adding any value;
get rid of it.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Mike Sterling <mike.sterling@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 12:29:57 -07:00
K. Y. Srinivasan e3fe0bb65b Staging: hv: Remove osd layer
The OSD layer was a wrapper around native interfaces
adding little value and was infact buggy -
refer to the osd_wait.patch for details.
This patch gets rid of the OSD abstraction.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:11:03 -08:00
K. Y. Srinivasan 0c3b7b2f75 Staging: hv: Use native wait primitives
In preperation for getting rid of the osd layer; change
the code to use native wait interfaces. As part of this,
fixed the buggy implementation in the osd_wait_primitive
where the condition was cleared potentially after the
condition was signalled.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:11:03 -08:00
K. Y. Srinivasan df3493e0b3 Staging: hv: Use native page allocation/free functions
In preperation for getting rid of the osd.[ch] files;
change all page allocation/free functions to use native interfaces.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:11:03 -08:00
Haiyang Zhang da9fcb7260 staging: hv: Convert camel cased struct fields in vmbus_private.h to lower cases
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31 13:42:49 -08:00
Haiyang Zhang c69776771f staging: hv: Convert camel cased functions in connection.c to lower cases
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31 13:42:48 -08:00
Haiyang Zhang 15b2f6479b staging: hv: Convert camel cased variables in connection.c to lower cases
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31 13:42:47 -08:00
Haiyang Zhang 203df82d81 staging: hv: Convert camel cased functions in osd.c to lower cases
staging: hv: Convert camel cased functions in osd.c to lower cases

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 16:42:11 -08:00
Haiyang Zhang d44890c8d2 staging: hv: Convert camel cased functions in hv.c to lower cases
staging: hv: Convert camel cased functions in hv.c to lower cases

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 16:42:11 -08:00
Haiyang Zhang f6feebe073 staging: hv: Convert camel cased struct fields in hv_api.h to lower cases
staging: hv: Convert camel cased struct fields in hv_api.h to lower cases

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 16:42:10 -08:00
Haiyang Zhang c50f7fb284 staging: hv: Convert camel cased struct fields in channel_mgmt.h to lower cases
staging: hv: Convert camel cased struct fields in channel_mgmt.h to lower cases

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 16:42:09 -08:00
Haiyang Zhang fff41b2e30 staging: hv: Rename camel cased functions in channel.c to lowercase
Rename camel cased functions in channel.c to lowercase

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-07 14:43:02 -07:00
Greg Kroah-Hartman 83c720ea39 Staging: hv: remove DPRINT_EXIT macro
No need for it, use the built-in kernel function tracing instead
if you really need something like this.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 15:14:04 -07:00
Greg Kroah-Hartman 2acadc269f Staging: hv: remove DPRINT_ENTER macro
We have ftrace to look at function traces if its really
needed.  Don't roll custom macros for this.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 15:00:18 -07:00
Greg Kroah-Hartman 72daf320fb Staging: hv: rename VmbusPrivate.h to vmbus_private.h
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:17 -07:00
Greg Kroah-Hartman 55e9643e6c Staging: hv: rename Connection.c to connection.c
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:16 -07:00