aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-02-25 19:43:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-15 12:06:04 -0400
commite5c79cb177f440c4c6ed1ac63d09370da92a2a8d (patch)
treedd5a2e97ab38af3a9b5d39988ed5f8d9aa17c44b
parent896d0d640ce75542d0697b4b25c2b1d85c859967 (diff)
Staging: hv: match on DMI values to know if we should run.
commit c22090facd354749cfe99a46e903449c7ac07788 upstream. The HV core mucks around with specific irqs and other low-level stuff and takes forever to determine that it really shouldn't be running on a machine. So instead, trigger off of the DMI system information and error out much sooner. This also allows the module loading tools to recognize that this code should be loaded on this type of system. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/hv/vmbus_drv.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 090b32d5d37a..6acc49a55a57 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -25,6 +25,7 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/sysctl.h> 26#include <linux/sysctl.h>
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/dmi.h>
28#include "osd.h" 29#include "osd.h"
29#include "logging.h" 30#include "logging.h"
30#include "vmbus.h" 31#include "vmbus.h"
@@ -947,6 +948,19 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
947 } 948 }
948} 949}
949 950
951static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = {
952 {
953 .ident = "Hyper-V",
954 .matches = {
955 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
956 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
957 DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
958 },
959 },
960 { },
961};
962MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table);
963
950static int __init vmbus_init(void) 964static int __init vmbus_init(void)
951{ 965{
952 int ret = 0; 966 int ret = 0;
@@ -958,6 +972,9 @@ static int __init vmbus_init(void)
958 vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel)); 972 vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel));
959 /* Todo: it is used for loglevel, to be ported to new kernel. */ 973 /* Todo: it is used for loglevel, to be ported to new kernel. */
960 974
975 if (!dmi_check_system(microsoft_hv_dmi_table))
976 return -ENODEV;
977
961 ret = vmbus_bus_init(VmbusInitialize); 978 ret = vmbus_bus_init(VmbusInitialize);
962 979
963 DPRINT_EXIT(VMBUS_DRV); 980 DPRINT_EXIT(VMBUS_DRV);
@@ -979,10 +996,6 @@ static void __exit vmbus_exit(void)
979 * needed by distro tools to determine if the hyperv drivers should be 996 * needed by distro tools to determine if the hyperv drivers should be
980 * installed and/or configured. We don't do anything else with the table, but 997 * installed and/or configured. We don't do anything else with the table, but
981 * it needs to be present. 998 * it needs to be present.
982 *
983 * We might consider triggering off of DMI table info as well, as that does
984 * decribe the virtual machine being run on, but not all configuration tools
985 * seem to be able to handle DMI device ids properly.
986 */ 999 */
987const static struct pci_device_id microsoft_hv_pci_table[] = { 1000const static struct pci_device_id microsoft_hv_pci_table[] = {
988 { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */ 1001 { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */