aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r--drivers/misc/mei/main.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index 092330208869..7422c7652845 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -925,6 +925,27 @@ static struct miscdevice mei_misc_device = {
925}; 925};
926 926
927/** 927/**
928 * mei_quirk_probe - probe for devices that doesn't valid ME interface
929 * @pdev: PCI device structure
930 * @ent: entry into pci_device_table
931 *
932 * returns true if ME Interface is valid, false otherwise
933 */
934static bool __devinit mei_quirk_probe(struct pci_dev *pdev,
935 const struct pci_device_id *ent)
936{
937 u32 reg;
938 if (ent->device == MEI_DEV_ID_PBG_1) {
939 pci_read_config_dword(pdev, 0x48, &reg);
940 /* make sure that bit 9 is up and bit 10 is down */
941 if ((reg & 0x600) == 0x200) {
942 dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n");
943 return false;
944 }
945 }
946 return true;
947}
948/**
928 * mei_probe - Device Initialization Routine 949 * mei_probe - Device Initialization Routine
929 * 950 *
930 * @pdev: PCI device structure 951 * @pdev: PCI device structure
@@ -939,6 +960,12 @@ static int __devinit mei_probe(struct pci_dev *pdev,
939 int err; 960 int err;
940 961
941 mutex_lock(&mei_mutex); 962 mutex_lock(&mei_mutex);
963
964 if (!mei_quirk_probe(pdev, ent)) {
965 err = -ENODEV;
966 goto end;
967 }
968
942 if (mei_device) { 969 if (mei_device) {
943 err = -EEXIST; 970 err = -EEXIST;
944 goto end; 971 goto end;