diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-18 17:10:34 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-18 17:10:34 -0700 |
| commit | 77933b0a3605d49ac52fd8c04d2f03c80185a432 (patch) | |
| tree | 0d00d80ed275e8f04f239058998fcac3b55c2e1b | |
| parent | 0e3b07b61af8f86b2ed88b1f304e36b5fd1d9999 (diff) | |
| download | patches-77933b0a3605d49ac52fd8c04d2f03c80185a432.tar.gz | |
staging fixes
5 files changed, 264 insertions, 0 deletions
@@ -36,6 +36,10 @@ staging.current/staging-batman-adv-return-efault-on-copy_to_user-errors.patch staging.current/staging-batman-adv-fix-function-prototype.patch staging.current/staging-mrst-touchscreen-fix-dereferencing-free-memory.patch staging.current/staging-comedi-drivers-adl_pci9111-fix-ai-commands-in-trig_follow-case.patch +staging.current/staging-hv-fix-race-condition-on-vmbus-channel-initialization.patch +staging.current/staging-hv-fix-hv_utils-module-to-properly-autoload.patch +staging.current/staging-wlags49_h2-add-missing-linux-string.h-for-strlen.patch +staging.current/staging-wlags49_h2-fix-build-error-when-config_sysfs-is-not-set.patch ##################################################################### diff --git a/staging.current/staging-hv-fix-hv_utils-module-to-properly-autoload.patch b/staging.current/staging-hv-fix-hv_utils-module-to-properly-autoload.patch new file mode 100644 index 00000000000000..8b2b8631208b4f --- /dev/null +++ b/staging.current/staging-hv-fix-hv_utils-module-to-properly-autoload.patch @@ -0,0 +1,70 @@ +From haiyangz@microsoft.com Wed May 19 08:56:34 2010 +From: Haiyang Zhang <haiyangz@microsoft.com> +Date: Wed, 19 May 2010 15:56:28 +0000 +Subject: Staging: hv: fix hv_utils module to properly autoload +To: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>, "'devel@driverdev.osuosl.org'" <devel@driverdev.osuosl.org>, "'virtualization@lists.osdl.org'" <virtualization@lists.osdl.org>, "'gregkh@suse.de'" <gregkh@suse.de> +Cc: Hank Janssen <hjanssen@microsoft.com> +Message-ID: <1FB5E1D5CA062146B38059374562DF7266B8931E@TK5EX14MBXC128.redmond.corp.microsoft.com> + + +From: Haiyang Zhang <haiyangz@microsoft.com> + +Added autoloading based on pci id and dmi strings. + +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> + +--- + drivers/staging/hv/hv_utils.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +--- a/drivers/staging/hv/hv_utils.c ++++ b/drivers/staging/hv/hv_utils.c +@@ -24,6 +24,8 @@ + #include <linux/slab.h> + #include <linux/sysctl.h> + #include <linux/reboot.h> ++#include <linux/dmi.h> ++#include <linux/pci.h> + + #include "logging.h" + #include "osd.h" +@@ -251,10 +253,36 @@ static void heartbeat_onchannelcallback( + DPRINT_EXIT(VMBUS); + } + ++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 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) + { + printk(KERN_INFO "Registering HyperV Utility Driver\n"); + ++ if (!dmi_check_system(hv_utils_dmi_table)) ++ return -ENODEV; ++ + hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback = + &shutdown_onchannelcallback; + hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback; diff --git a/staging.current/staging-hv-fix-race-condition-on-vmbus-channel-initialization.patch b/staging.current/staging-hv-fix-race-condition-on-vmbus-channel-initialization.patch new file mode 100644 index 00000000000000..5778dfd466ad6d --- /dev/null +++ b/staging.current/staging-hv-fix-race-condition-on-vmbus-channel-initialization.patch @@ -0,0 +1,123 @@ +From haiyangz@microsoft.com Fri May 28 16:22:49 2010 +From: Haiyang Zhang <haiyangz@microsoft.com> +Date: Fri, 28 May 2010 23:22:44 +0000 +Subject: Staging: hv: Fix race condition on vmbus channel initialization +Cc: Hank Janssen <hjanssen@microsoft.com> +Message-ID: <1FB5E1D5CA062146B38059374562DF7266B8D340@TK5EX14MBXC128.redmond.corp.microsoft.com> + +From: Haiyang Zhang <haiyangz@microsoft.com> + +Subject: [PATCH] staging: hv: Fix race condition on vmbus channel initialization +There is a possible race condition when hv_utils starts to load immediately +after hv_vmbus is loading - null pointer error could happen. +This patch added wait/completion to ensure all channels are ready before +vmbus loading completes. So another module won't have any uninitialized channel. + +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> + + +--- + drivers/staging/hv/channel_mgmt.c | 41 +++++++++++++++++++++++++++----------- + drivers/staging/hv/vmbus.h | 2 + + drivers/staging/hv/vmbus_drv.c | 3 ++ + 3 files changed, 35 insertions(+), 11 deletions(-) + +--- a/drivers/staging/hv/channel_mgmt.c ++++ b/drivers/staging/hv/channel_mgmt.c +@@ -23,6 +23,7 @@ + #include <linux/slab.h> + #include <linux/list.h> + #include <linux/module.h> ++#include <linux/completion.h> + #include "osd.h" + #include "logging.h" + #include "vmbus_private.h" +@@ -293,6 +294,25 @@ void FreeVmbusChannel(struct vmbus_chann + Channel); + } + ++ ++DECLARE_COMPLETION(hv_channel_ready); ++ ++/* ++ * Count initialized channels, and ensure all channels are ready when hv_vmbus ++ * module loading completes. ++ */ ++static void count_hv_channel(void) ++{ ++ static int counter; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags); ++ if (++counter == MAX_MSG_TYPES) ++ complete(&hv_channel_ready); ++ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags); ++} ++ ++ + /* + * VmbusChannelProcessOffer - Process the offer by creating a channel/device + * associated with this offer +@@ -373,22 +393,21 @@ static void VmbusChannelProcessOffer(voi + * can cleanup properly + */ + newChannel->State = CHANNEL_OPEN_STATE; +- cnt = 0; + +- while (cnt != MAX_MSG_TYPES) { ++ /* Open IC channels */ ++ for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) { + if (memcmp(&newChannel->OfferMsg.Offer.InterfaceType, + &hv_cb_utils[cnt].data, +- sizeof(struct hv_guid)) == 0) { ++ sizeof(struct hv_guid)) == 0 && ++ VmbusChannelOpen(newChannel, 2 * PAGE_SIZE, ++ 2 * PAGE_SIZE, NULL, 0, ++ hv_cb_utils[cnt].callback, ++ newChannel) == 0) { ++ hv_cb_utils[cnt].channel = newChannel; + DPRINT_INFO(VMBUS, "%s", +- hv_cb_utils[cnt].log_msg); +- +- if (VmbusChannelOpen(newChannel, 2 * PAGE_SIZE, +- 2 * PAGE_SIZE, NULL, 0, +- hv_cb_utils[cnt].callback, +- newChannel) == 0) +- hv_cb_utils[cnt].channel = newChannel; ++ hv_cb_utils[cnt].log_msg); ++ count_hv_channel(); + } +- cnt++; + } + } + DPRINT_EXIT(VMBUS); +--- a/drivers/staging/hv/vmbus.h ++++ b/drivers/staging/hv/vmbus.h +@@ -74,4 +74,6 @@ int vmbus_child_driver_register(struct d + void vmbus_child_driver_unregister(struct driver_context *driver_ctx); + void vmbus_get_interface(struct vmbus_channel_interface *interface); + ++extern struct completion hv_channel_ready; ++ + #endif /* _VMBUS_H_ */ +--- a/drivers/staging/hv/vmbus_drv.c ++++ b/drivers/staging/hv/vmbus_drv.c +@@ -27,6 +27,7 @@ + #include <linux/pci.h> + #include <linux/dmi.h> + #include <linux/slab.h> ++#include <linux/completion.h> + #include "version_info.h" + #include "osd.h" + #include "logging.h" +@@ -356,6 +357,8 @@ static int vmbus_bus_init(int (*drv_init + + vmbus_drv_obj->GetChannelOffers(); + ++ wait_for_completion(&hv_channel_ready); ++ + cleanup: + DPRINT_EXIT(VMBUS_DRV); + diff --git a/staging.current/staging-wlags49_h2-add-missing-linux-string.h-for-strlen.patch b/staging.current/staging-wlags49_h2-add-missing-linux-string.h-for-strlen.patch new file mode 100644 index 00000000000000..144afa34ad7a99 --- /dev/null +++ b/staging.current/staging-wlags49_h2-add-missing-linux-string.h-for-strlen.patch @@ -0,0 +1,29 @@ +From jeffm@suse.com Fri Jun 18 17:07:06 2010 +From: Jeff Mahoney <jeffm@suse.com> +Date: Wed, 09 Jun 2010 16:01:10 -0400 +Subject: Staging: wlags49_h2: add missing <linux/string.h> for strlen +To: Greg KH <gregkh@suse.de> +Message-ID: <4C0FF306.9030605@suse.com> + + + +On ia64, the build fails with incompatible implicit definition of strlen. +This patch adds the <linux/string.h> include to get the real prototype. + +Signed-off-by: Jeff Mahoney <jeffm@suse.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/wlags49_h2/wl_enc.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/staging/wlags49_h2/wl_enc.c ++++ b/drivers/staging/wlags49_h2/wl_enc.c +@@ -62,6 +62,7 @@ + /******************************************************************************* + * include files + ******************************************************************************/ ++#include <linux/string.h> + #include <wl_version.h> + + #include <debug.h> diff --git a/staging.current/staging-wlags49_h2-fix-build-error-when-config_sysfs-is-not-set.patch b/staging.current/staging-wlags49_h2-fix-build-error-when-config_sysfs-is-not-set.patch new file mode 100644 index 00000000000000..681ee5b9726e35 --- /dev/null +++ b/staging.current/staging-wlags49_h2-fix-build-error-when-config_sysfs-is-not-set.patch @@ -0,0 +1,38 @@ +From martinez.javier@gmail.com Fri Jun 18 17:08:42 2010 +From: Javier Martinez Canillas <martinez.javier@gmail.com> +Date: Thu, 17 Jun 2010 01:17:44 -0400 +Subject: Staging: wlags49_h2: Fix build error when CONFIG_SYSFS is not set +To: Henk de Groot <pe1dnn@amsat.org>, devel@driverdev.osuosl.org, Greg Kroah-Hartman <gregkh@suse.de>, kernel-janitors <kernel-janitors@vger.kernel.org> +Message-ID: <1276751864.14632.6.camel@lenovo> + +I got a wlags49_h2 driver build error in linux-next when CONFIG_SYSFS is not set. + +CC [M] drivers/staging/wlags49_h2/wl_cs.o +In file included from drivers/staging/wlags49_h2/wl_cs.c:104: +drivers/staging/wlags49_h2/wl_sysfs.h: In function ‘register_wlags_sysfs’: +drivers/staging/wlags49_h2/wl_sysfs.h:5: error: parameter name omitted +drivers/staging/wlags49_h2/wl_sysfs.h: In function ‘unregister_wlags_sysfs’: +drivers/staging/wlags49_h2/wl_sysfs.h:6: error: parameter name omitted +make[1]: *** [drivers/staging/wlags49_h2/wl_cs.o] Error 1 +make: *** [_module_drivers/staging/wlags49_h2] Error 2 + +This is due a wrong function definition (it does not include parameters names). + +Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/wlags49_h2/wl_sysfs.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/staging/wlags49_h2/wl_sysfs.h ++++ b/drivers/staging/wlags49_h2/wl_sysfs.h +@@ -2,6 +2,6 @@ + extern void register_wlags_sysfs(struct net_device *); + extern void unregister_wlags_sysfs(struct net_device *); + #else +-static void register_wlags_sysfs(struct net_device *) { return; }; +-static void unregister_wlags_sysfs(struct net_device *) { return; }; ++static inline void register_wlags_sysfs(struct net_device *net) { } ++static inline void unregister_wlags_sysfs(struct net_device *net) { } + #endif |
