diff options
author | David S. Miller <davem@davemloft.net> | 2012-08-22 14:21:38 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-22 14:21:38 -0700 |
commit | 1304a7343b30fc4f16045412efdbb4179a3d9255 (patch) | |
tree | 83d667ac4f62e30f70305ce4cc7e030e3465f92e /drivers/misc/mei/main.c | |
parent | 1d76efe1577b4323609b1bcbfafa8b731eda071a (diff) | |
parent | 23dcfa61bac244e1200ff9ad19c6e9144dcb6bb5 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r-- | drivers/misc/mei/main.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 09233020886..7422c765284 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -925,6 +925,27 @@ static struct miscdevice mei_misc_device = { }; /** + * mei_quirk_probe - probe for devices that doesn't valid ME interface + * @pdev: PCI device structure + * @ent: entry into pci_device_table + * + * returns true if ME Interface is valid, false otherwise + */ +static bool __devinit mei_quirk_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + u32 reg; + if (ent->device == MEI_DEV_ID_PBG_1) { + pci_read_config_dword(pdev, 0x48, ®); + /* make sure that bit 9 is up and bit 10 is down */ + if ((reg & 0x600) == 0x200) { + dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n"); + return false; + } + } + return true; +} +/** * mei_probe - Device Initialization Routine * * @pdev: PCI device structure @@ -939,6 +960,12 @@ static int __devinit mei_probe(struct pci_dev *pdev, int err; mutex_lock(&mei_mutex); + + if (!mei_quirk_probe(pdev, ent)) { + err = -ENODEV; + goto end; + } + if (mei_device) { err = -EEXIST; goto end; |