Commit Graph

440 Commits

Author SHA1 Message Date
Hank Janssen 45241e50e3 Staging: hv: Use only one txf buffer per channel and kmalloc/GFP_KERNEL on initialize
Correct issue with not checking kmalloc return value.
This fix now only uses one receive buffer for all hv_utils
channels, and will do only one kmalloc on init and will return
with a -ENOMEM if kmalloc fails on initialize.

And properly clean up memory on failure.

Thanks to Evgeniy Polyakov <zbr@ioremap.net> for pointing this out.
And thanks to Jesper Juhl <jj@chaosbits.net> and Ky Srinivasan
<ksrinivasan@novell.com> for suggesting a better implementation of
my original patch.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Reviewed-by: Jesper Juhl <jj@chaosbits.net>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Jesper Juhl <jj@chaosbits.net>
Cc: Ky Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 12:37:51 -08:00
Timo Teräs 244ba85606 staging: hv: remove unneeded osd_schedule_callback
No one calls it anymore, so remove it.

Reviewed-By: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 12:35:15 -08:00
Timo Teräs 4b2f9abea5 staging: hv: convert channel_mgmt.c to not call osd_schedule_callback
The additional abstraction is unneeded.

The three calls are assumed to not be pending simultaneously:
 - vmbus_onoffer queues work exactly once when a new channel is
   created, the channel is not attached to lists until the work
   is executed
 - vmbus_onoffer_rescind is received only when the channel is
   active it is enough to process the work once
 - free_channel is called exactly once when the channel is getting
   destroyed; I assumed that vmbus_process_rescind_offer cannot be
   pending while free_channel is called

Reviewed-By: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 12:35:15 -08:00
Timo Teräs bf6506f60c staging: hv: convert vmbus_on_msg_dpc to not call osd_schedule_callback
The additional abstraction is unneeded. This also fixes a sleeping
while atomic issue as osd_schedule_callback can sleep which is
not allowed for vmbus_on_msg_dpc running in a tasklet.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16701

Reviewed-By: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 12:35:14 -08:00
Haiyang Zhang a388eb1727 staging: hv: Convert camel cased struct fields in rndis.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-12-13 10:31:52 -08:00
Haiyang Zhang 53d21fdbf4 staging: hv: Convert camel cased struct fields in netvsc.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-12-13 10:31:52 -08:00
Haiyang Zhang 72a2f5bd53 staging: hv: Convert camel cased struct fields in netvsc_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-12-13 10:31:51 -08:00
Haiyang Zhang 9c26aa0d76 staging: hv: Convert camel cased functions in rndis_filter.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-12-13 10:31:51 -08:00
Haiyang Zhang c2a4efddc7 staging: hv: Convert camel cased variables in rndis_filter.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-12-13 10:31:51 -08:00
Haiyang Zhang 5a71ae303c staging: hv: Convert camel cased functions in netvsc.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-12-13 10:31:51 -08:00
Haiyang Zhang 85799a3755 staging: hv: Convert camel cased variables in netvsc.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-12-13 10:31:50 -08:00
Greg Kroah-Hartman ea3398a1ae Staging: Merge 2.6.37-rc5 into staging-next
This was done to handle a number of conflicts in the batman-adv
and winbond drivers properly.  It also now allows us to fix up the sysfs
attributes properly that were not in the .37 release due to them being
only in this tree at the time.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-07 10:47:56 -08:00
Hank Janssen 03fa6fc5a6 staging: hv: Convert camel case local variables in blkvsc.c to lowercase
Convert camel case local variables in blkvsc.c to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:10 -08:00
Hank Janssen 2e6484acd2 staging: hv: Convert camel case function names in blkvsc.c to lowercase
Convert camel case function names in blkvsc.c to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:09 -08:00
Hank Janssen f638859e32 staging: hv: Convert camel case local variables in storvsc.c to lowercase
Convert camel case local variables in storvsc.c to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:09 -08:00
Hank Janssen 02e37db714 staging: hv: Convert camel case function names in storvsc.c to lowercase
Convert camel case function names in storvsc.c to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:09 -08:00
Hank Janssen 3d8cdf22b3 staging: hv: Convert camel case struct fields in storvsc.c to lowercase
Convert camel cased struct fields in storvsc.c to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:08 -08:00
Hank Janssen eb4f3e0aa6 staging: hv: Convert camel case functions in storvsc_api.h to lowercase
Convert camel case functions in storvsc_api.h to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:08 -08:00
Hank Janssen 8a046024a7 staging: hv: Convert camel case struct fields in storvsc_api.h to lowercase
Convert camel case struct fields in vstorage.h to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:07 -08:00
Hank Janssen d2aaba455f staging: hv: Convert camel case struct fields in vstorage.h to lowercase
Convert camel case struct fields in vstorage.h to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
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-12-06 16:11:07 -08:00
Greg Kroah-Hartman bafbb8df07 Staging: hv: remove vmbus_on_event_dpc()
Just call VmbusOnEvents() as that's all the function did, so we can
remove it.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 12:12:46 -08:00
Greg Kroah-Hartman cef6dbfa8e Staging: hv: make some vmbus_drv functions static
Now that vmbus_drv.c is merged with vmbus.c, some of the newly global
functions can now be marked static.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 12:11:25 -08:00
Greg Kroah-Hartman 6d26e38fa2 Staging: hv: merge VmbusInitialize into vmbus_bus_init
No need to have two functions for this.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 12:08:08 -08:00
Greg Kroah-Hartman 0bdb250c69 Staging: hv: remove gDriver variable
It's only set and never used anymore, so remove it.

Gotta love static variables with a "global" hungarian notatation on the
name...

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 12:04:59 -08:00
Greg Kroah-Hartman 6c884555f2 Staging: hv: call VmbusInitialize directly from vmbus_bus_init()
No need to pass a function pointer to a function in the same file.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 12:04:00 -08:00
Greg Kroah-Hartman 36199a992a Staging: hv: remove vmbus.c
Merge the functions into vmbus_drv.c as there's no need to have them
separate anymore.  It will also make unwinding some of the function and
pointer mess easier, as well as making functions static in the future.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 11:59:22 -08:00
Greg Kroah-Hartman 1953ecfc29 Staging: hv: rename the vmbus to "hyperv"
This changes the name of the bus in sysfs from "vmbus" to "hyperv" which
is the name it should show (vmbus is way to generic).

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 11:28:28 -08:00
Greg Kroah-Hartman a69a6691d7 Staging: hv: remove struct vmbus_driver
It's only a wrapper for the struct hv_driver structure, so just use that
instead, as there are no other fields left in it at the moment.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 09:42:18 -08:00
Greg Kroah-Hartman 98293a279c Staging: hv: remove OnChildDeviceAdd vmbus_driver callback
It's only ever set to one function, so just call that function instead.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 09:16:04 -08:00
Greg Kroah-Hartman 2d6e882bad Staging: hv: remove GetChannelOffers vmbus_driver callback
It's only ever set to one function, so just call that function instead.
Actually, that wrapper function only ever called vmbus_request_offers()
so just call that function instead, no need for a do-nothing
intermediate step here.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 08:50:58 -08:00
Greg Kroah-Hartman c722bd3e2c Staging: hv: remove OnEventDpc vmbus_driver callback
It's only ever set to one function, so just call that function instead.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 08:47:11 -08:00
Greg Kroah-Hartman 4a1494fc10 Staging: hv: remove OnMsgDpc vmbus_driver callback
It's only ever set to one function, so just call that function instead.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 08:44:48 -08:00
Greg Kroah-Hartman 097e310329 Staging: hv: remove OnIsr vmbus_driver callback
It's only ever set to one function, so just call that function instead.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 08:41:05 -08:00
Greg Kroah-Hartman 9d8bd71ad4 Staging: hv: remove OnChildDeviceRemove vmbus_driver callback
It's only ever set to one function, so just call that function instead.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 08:34:45 -08:00
Greg Kroah-Hartman 9205307cd8 Staging: hv: remove OnChildDeviceDestroy vmbus_driver callback
No one ever calls it so get rid of it, it's pointless.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 08:25:17 -08:00
Greg Kroah-Hartman 89733aa9cc Staging: hv: remove OnChildDeviceCreate vmbus_driver callback
It's only ever set to one function, so just call that function instead.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02 08:24:55 -08:00
Jeff Garzik f281233d3e SCSI host lock push-down
Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation.  No locking or other behavior should change
with this patch.  All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
	struct Scsi_Host *
and remove one parameter from queuecommand,
	void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change.  Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-16 13:33:23 -08:00
Brandon Philips 0ff36f69bd staging: hv: add explanation of no-op set_multicast_list
I was going to remove netvsc_set_multicast_list() so I think it is worth
adding a comment since it isn't immediately clear why you would want
this.

Signed-off-by: Brandon Philips <brandon@ifup.org>
Acked-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:06:47 -08:00
Greg Kroah-Hartman 491acf0032 Staging: Merge 2.6.37-rc2 into staging-next
This was necessary in order  to resolve some conflicts that happened
between -rc1 and -rc2 with the following files:
	drivers/staging/bcm/Bcmchar.c
	drivers/staging/intel_sst/intel_sst_app_interface.c

All should be resolved now.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 10:44:50 -08:00
Haiyang Zhang 1ac586445d staging: hv: Convert camel cased functions in ring_buffer.c to lower cases
staging: hv: Convert camel cased functions in ring_buffer.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:12 -08:00
Haiyang Zhang fc8c72ebfa staging: hv: Convert camel cased local variables in ring_buffer.c to lower cases
staging: hv: Convert camel cased local variables in ring_buffer.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:12 -08:00
Haiyang Zhang 82f8bd40a0 staging: hv: Convert camel cased struct fields in ring_buffer.h to lower cases
staging: hv: Convert camel cased struct fields in ring_buffer.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:12 -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 d39f12866d staging: hv: Convert camel cased local variables in osd.c to lower cases
staging: hv: Convert camel cased local variables 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 b8dfb264f4 staging: hv: Convert camel cased local variables in hv.c to lower cases
staging: hv: Convert camel cased local variables 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:10 -08:00
Haiyang Zhang 6a0aaa1850 staging: hv: Convert camel cased struct fields in hv.h to lower cases
staging: hv: Convert camel cased struct fields in hv.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 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
Julia Lawall 61241d97db drivers/staging: delete double assignment
Delete successive assignments to the same location.  In three of the cases,
the two assignments are identical.  In the case of the file
rt2860/common/cmm_aes.c, the assigned variable i is never used, so both
assignments are dropped.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 14:05:22 -08:00