diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2014-03-25 15:25:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-16 15:24:16 -0400 |
commit | 5e6533a6f52f1a8283b2f818f5828be99a417dd6 (patch) | |
tree | 67545420a93a61b87ce975fe3360d98c78b54b60 /drivers/misc/mei | |
parent | 73590a25ba6f55eecde4ffbbbc53835d7ccf5402 (diff) |
mei: me: do not load the driver if the FW doesn't support MEI interface
NM and SPS FW types that may run on ME device on server platforms
do not have valid MEI/HECI interface and driver should not
be bound to it as this might lead to system hung.
In practice not all BIOSes effectively hide such devices from the
OS and in some cases it is not possible.
We determine FW type by examining Host FW status registers in order to
unbind the driver.
In this patch we are adding check for ME on Cougar Point, Lynx Point
Devices
Cc: stable <stable@vger.kernel.org> # 3.10+
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r-- | drivers/misc/mei/hw-me-regs.h | 5 | ||||
-rw-r--r-- | drivers/misc/mei/pci-me.c | 30 |
2 files changed, 28 insertions, 7 deletions
diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h index 66f411a6e8ea..cabc04383685 100644 --- a/drivers/misc/mei/hw-me-regs.h +++ b/drivers/misc/mei/hw-me-regs.h | |||
@@ -115,6 +115,11 @@ | |||
115 | #define MEI_DEV_ID_LPT_HR 0x8CBA /* Lynx Point H Refresh */ | 115 | #define MEI_DEV_ID_LPT_HR 0x8CBA /* Lynx Point H Refresh */ |
116 | 116 | ||
117 | #define MEI_DEV_ID_WPT_LP 0x9CBA /* Wildcat Point LP */ | 117 | #define MEI_DEV_ID_WPT_LP 0x9CBA /* Wildcat Point LP */ |
118 | |||
119 | /* Host Firmware Status Registers in PCI Config Space */ | ||
120 | #define PCI_CFG_HFS_1 0x40 | ||
121 | #define PCI_CFG_HFS_2 0x48 | ||
122 | |||
118 | /* | 123 | /* |
119 | * MEI HW Section | 124 | * MEI HW Section |
120 | */ | 125 | */ |
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index 1c8fd3a3e135..95889e2e31ff 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c | |||
@@ -97,15 +97,31 @@ static bool mei_me_quirk_probe(struct pci_dev *pdev, | |||
97 | const struct pci_device_id *ent) | 97 | const struct pci_device_id *ent) |
98 | { | 98 | { |
99 | u32 reg; | 99 | u32 reg; |
100 | if (ent->device == MEI_DEV_ID_PBG_1) { | 100 | /* Cougar Point || Patsburg */ |
101 | pci_read_config_dword(pdev, 0x48, ®); | 101 | if (ent->device == MEI_DEV_ID_CPT_1 || |
102 | /* make sure that bit 9 is up and bit 10 is down */ | 102 | ent->device == MEI_DEV_ID_PBG_1) { |
103 | if ((reg & 0x600) == 0x200) { | 103 | pci_read_config_dword(pdev, PCI_CFG_HFS_2, ®); |
104 | dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n"); | 104 | /* make sure that bit 9 (NM) is up and bit 10 (DM) is down */ |
105 | return false; | 105 | if ((reg & 0x600) == 0x200) |
106 | } | 106 | goto no_mei; |
107 | } | 107 | } |
108 | |||
109 | /* Lynx Point */ | ||
110 | if (ent->device == MEI_DEV_ID_LPT_H || | ||
111 | ent->device == MEI_DEV_ID_LPT_W || | ||
112 | ent->device == MEI_DEV_ID_LPT_HR) { | ||
113 | /* Read ME FW Status check for SPS Firmware */ | ||
114 | pci_read_config_dword(pdev, PCI_CFG_HFS_1, ®); | ||
115 | /* if bits [19:16] = 15, running SPS Firmware */ | ||
116 | if ((reg & 0xf0000) == 0xf0000) | ||
117 | goto no_mei; | ||
118 | } | ||
119 | |||
108 | return true; | 120 | return true; |
121 | |||
122 | no_mei: | ||
123 | dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n"); | ||
124 | return false; | ||
109 | } | 125 | } |
110 | /** | 126 | /** |
111 | * mei_probe - Device Initialization Routine | 127 | * mei_probe - Device Initialization Routine |