Commit Graph

1105 Commits

Author SHA1 Message Date
Olaf Hering fd776ba9ab Staging: hv: vmbus: Show the modalias in /sys/bus/vmbus/devices/*/
Show a modalias file in /sys/bus/vmbus/devices/*/
Add a helper function to print the same content in modalias and uevent.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 12:06:34 -07:00
K. Y. Srinivasan b2451a4907 Staging: hv: Update TODO file
Based on input from Greg, update the TODO file.

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 12:06:33 -07:00
Haiyang Zhang 8bff33ab41 staging: hv: fix some typos in netvsc.c
Reported-by: Joe Perches <joe@perches.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-09-06 11:56:19 -07:00
Haiyang Zhang 669c1fc616 staging: hv: fix the page buffer when rndis data go across page boundary
In rndis_filter_receive_data(), we need to drop the 0th page and move the
rest of pages forward if the rndis data go across page boundary, otherwise
the page offset will overflow.

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-09-06 11:56:19 -07:00
Haiyang Zhang bf769375c9 staging: hv: fix the return status of netvsc_start_xmit()
Fix the return status, so the upper layer will retry if transmission
fails.

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-09-06 11:56:19 -07:00
Haiyang Zhang 8a5f9edc4d staging: hv: fix counting of available buffer slots when send fails
Because the number of available buffer slots doesn't decrease for failed
sends, we should not call netvsc_xmit_completion(), which increase the
count of available slots. In this failed case, just free the memory is
enough.

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-09-06 11:56:19 -07:00
Haiyang Zhang 7db1d946c4 staging: hv: fix counting of #outstanding-sends in failed sends
If the packet failed to be sent, we shouldn't count it as the
number of outstanding sends.

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-09-06 11:56:18 -07:00
Haiyang Zhang 692e084e77 staging: hv: re-order the code in netvsc_probe()
Re-order the code in netvsc_probe() to prevent a guest crash caused by
packets possibly received from NetVSP before call to register_netdev().

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-09-06 11:56:18 -07:00
Haiyang Zhang c4b6a2eaf1 staging: hv: fix a kernel warning in netvsc_linkstatus_callback()
netif_notify_peers() caused a kernel warning in netvsc_linkstatus_callback(),
because netvsc_linkstatus_callback() is within IRQ context. So we move
the first call to netif_notify_peers() into queued work as well, but with
zero delay.

In addition to "staging-next", this should also be back-ported to stable
kernels 2.6.32 and later.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:56:18 -07:00
Haiyang Zhang d987115871 staging: hv: convert dev_<loglevel> to netdev_<loglevel> in netvsc
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-09-06 11:56:17 -07:00
Haiyang Zhang c909ebbd0d staging: hv: add newline to log messages in netvsc
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-09-06 11:56:17 -07:00
Haiyang Zhang a3e8095886 staging: hv: remove unnecessary includes in netvsc
hyperv.h is included by hyperv_net.h already, so no need to include it
again in these C files.

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-09-06 11:56:17 -07:00
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 7341d908af Staging: hv: vmbus: Check for events before messages
The Windows team has informed us that on Windows guests on Hyper-V,
they check for events before messages. They also recommended that we do
the same. This patch addresses this.

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 8b9987e905 Staging: hv: vmbus: Fix a bug in error handling in vmbus_bus_init()
Fix a bug in error handling in vmbus_bus_init().

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 d531babe82 Staging: hv: util: Deal with driver register failures
Properly deal with vmbus_driver_register() failures.

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:50 -07:00
Dan Carpenter 7f9615e6f6 Staging: hv: netvsc: return negative error codes
There was a typo here and we changed the -ENOMEM into +ENOMEM.  The
error codes aren't used, so this is just a cleanup.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:15:23 -07:00
K. Y. Srinivasan bb5da491ff Staging: hv: mousevsc: Fix checkpatch errors and warnings
Fix checkpatch errors and warnings.

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:47 -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 b737b2e00d Staging: hv: vmbus: Fix a checkpatch warning in ring_buffer.c
Fix a checkpatch warning in ring_buffer.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 0bce28b62e Staging: hv: vmbus: Get rid of some dated/redundant comments
Get rid of some dated/redundant comments in vmbus_drv.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:07:00 -07:00
K. Y. Srinivasan 0a4425b65d Staging: hv: vmbus: Fixup indentation in vmbus_acpi_add()
Fixup indentation in vmbus_acpi_add().

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:06:59 -07:00
K. Y. Srinivasan 93511baa06 Staging: hv: vmbus: Do not enable auto eoi
Linux interrupt handling code generates the eoi; don't enable auto eoi.

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:06:59 -07:00
K. Y. Srinivasan ae4636e6c0 Staging: hv: vmbus: Get rid of vmbus_on_isr() by inlining the code
Get rid of vmbus_on_isr() by inlining the code.

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:31 -07:00
K. Y. Srinivasan e61ee14f0e Staging: hv: Fix a bug in vmbus_match()
The recent checkin that add a private pointer to hv_vmbus_device_id
introduced this bug in vmbus_match; fix it.

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:31 -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 95ff7cde91 Staging: hv: util: Adjust guest time in a process context
The current code was adjusting guest time in interrupt context; do this
in process context since we may have to initiate cross-processor
interrupts as part of setting time.

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 ae2a0b42bf Staging: hv: util: Forcefully shutdown when shutdown is requested
When the host requests a "shutdown", make sure we shutdown!

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:29 -07:00
K. Y. Srinivasan 70691ec666 Staging: hv: storvsc: No need to copy from bounce buffer in case of a failure
No need to copy from bounce buffer in case of a failure; cleanup the code
accordingly.

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:01:09 -07:00
K. Y. Srinivasan 2544b79437 Staging: hv: storvsc: In case of scsi errors offline the device
When we do get fatal errors from the host, offline the device since the
host has already tried all possible recovery actions.

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:01:09 -07:00
K. Y. Srinivasan b8de73df1b Staging: hv: storvsc: Fix a typo
Fix a typo in a function name.

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:01:09 -07:00
K. Y. Srinivasan 4ed51a21c0 Staging: hv: storvsc: Fixup srb and scsi status for INQUIRY and MODE_SENSE
The current VHD handler on the Windows Host does not correctly handle
INQUIRY and MODE_SENSE commands with some options. Fixup srb_status
in these cases since the failure is not fatal.

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:01:08 -07:00
K. Y. Srinivasan c1b3d067e4 Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of hyperv_storage.h
Cleanup storvsc_drv.c after adding the contents of hyperv_storage.h.

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:01:08 -07:00
K. Y. Srinivasan f0d79fe9c5 Staging: hv: storvsc: Add the contents of hyperv_storage.h to storvsc_drv.c
As part of further cleanup of storvsc, add the contents of hyperv_storage.h
to storvsc_drv.c and do the necessary adjustments.

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:01:08 -07:00
K. Y. Srinivasan a1be1706ed Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c
Cleanup storvsc_drv.c after adding the contents of storvsc.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:01:07 -07:00
K. Y. Srinivasan 8dcf37d446 Staging: hv: storvsc: Include storvsc.c in storvsc_drv.c
As part of further cleanup of our storage drivers, include the content
of storvsc.c into storvsc_drv.c and delete storvsc.c and do the necessary
adjustments.

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:01:07 -07:00
K. Y. Srinivasan fa23b8c78f Staging: hv: storvsc: Optimize the bounce buffer handling in the "read" case
Optimize the bounce buffer handling in the "read" case.

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:01:07 -07:00
K. Y. Srinivasan 3612ef99b0 Staging: hv: storvsc: Optimize bounce buffer handling for the "write" case
Optimize bounce buffer handling for the "write" case.

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:01:06 -07:00
K. Y. Srinivasan b38cc43432 Staging: hv: blkvsc: Get rid of blkvsc_drv.c as this code is not used
Now that blkvsc driver is no longer needed, remove blkvsc_drv.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:01:06 -07:00
K. Y. Srinivasan 21e3774236 Staging: hv: storvsc: Handle IDE devices using the storvsc driver
Now, enable handling of all IDE devices by extending the storvsc
device id table to handle IDE guid. As part of this cleanup Kconfig
and Hyper-V Makefile to not build the IDE driver (blkvsc).

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:01:06 -07:00
K. Y. Srinivasan bd1f5d6a00 Staging: hv: storvsc: Add code to handle IDE devices using the storvsc driver
Add code to handle IDE devices using the storvsc driver. The storvsc_probe()
is modified so that the storvsc driver can surface all disks presented to the
guest as scsi devices using generic upper level Linux scsi drivers.

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:01:06 -07:00
K. Y. Srinivasan 9d88f33a15 Staging: hv: netvsc: Get rid of the refcnt field in struct netvsc_device
Get rid of the refcnt field in struct netvsc_device. We implement the following
logic to manage the life cycle of the device: If the device is being destroyed,
we do not allow any outgoing traffic. Furthermore, if the device is being
destroyed, we allow incoming traffic only to drain outgoing traffic. Note that
the driver may send some book keeping messages to the host not known to
upper level Linux code.

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:01:05 -07:00
K. Y. Srinivasan 124f506dc1 Staging: hv: netvsc: Get rid of release_inbound_net_device() by inlining the code
Get rid of release_inbound_net_device() by inlining the code.

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:01:05 -07:00
K. Y. Srinivasan 3852409b88 Staging: hv: netvsc: Get rid of release_outbound_net_device() by inlining the code
Get rid of release_outbound_net_device() by inlining the code.

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:01:05 -07:00
K. Y. Srinivasan 2ef7714397 Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed
Prevent outgoing traffic when netvsc dev is destroyed.

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:01:05 -07:00
K. Y. Srinivasan c38b9c7118 Staging: hv: netvsc: Introduce state to manage the lifecycle of net device
Introduce state to manage the lifecycle of net device.

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:01:04 -07:00
K. Y. Srinivasan 509ee3878b Staging: hv: netvsc: Cleanup alloc_net_device()
Cleanup alloc_net_device(); we can directly set the refcnt.

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:01:04 -07:00
K. Y. Srinivasan 356c465719 Staging: hv: netvsc: Inline the code for free_net_device()
Inline the code for free_net_device().

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:01:04 -07:00