Two reference counting fixes for two Intel EDAC drivers.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTEFf7AAoJEBLB8Bhh3lVKaUQQAK3AKsL/YlA74Msk2GfTgp9v
 XWfIiAIdfHLK3riZ20OIZ1VWGNB1rQYsviAelvXsLvLz93lFkDAS2Xdu/GCqUKaT
 KpkkYx1vF3f5/NCJJgZEMh71hSpY6jFETBPCbwRsTc5LV3Io4zvtBPqG7m1dQeNl
 rJKUJmpgJwd4w2jpnXctAYXvvNmEnivzSaaOriQ8tQ3DZFG+qKQmM0y4ls0RUCt8
 O+mycFJIz8Un05mmLHjeFaihi6jgwSFsxrjF3SPS2XCVkkQapEdmTGMvPI1huso/
 kfYc7+q1O0cxpIZ5ZwnNogqwGpImD0LxKTOr/BlFQWortycxh1QHm+DOqgQ7Jdpf
 +sc0m6cpbnq9q8xfxuSJE/kVThPX+CHysLwjDweU+MPsfmEgiMk2zAgoTgICBvRq
 jAbhONUAmcJmvJB71PLqACIZpEyuWsA2qrQWx1rUiNoIZb9qNjozmtB44ipHX6JS
 qJO+2zksZfvQT1xbkqdDlYD7e/BcoWXiLsy88C6KrgKfphaUugUq4X6U/24h8nbN
 DuXCeSiRva909kINyx+C61H1F04l9Y74C/8AaHuzGpDAXp8Le7Tv5ANhBIzD0jO7
 E6Ur5Jf8twV1WQLu3+a1PwejPB2qGvJPdjbNTpQ737QbWUX2+9ymyecETNdoU25D
 LKaEaMo5RJA3rR7TbCNd
 =/c/2
 -----END PGP SIGNATURE-----

Merge tag 'edac_fixes_for_3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp

Pull EDAC fixes from Borislav Petkov:
 "Two fixes below for PCI devices disappearing when a reference count
  underflow happens after a couple of insmod/rmmod cycles in succession"

* tag 'edac_fixes_for_3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  i7300_edac: Fix device reference count
  i7core_edac: Fix PCI device reference count
This commit is contained in:
Linus Torvalds 2014-02-28 11:49:09 -08:00
commit 04b5225216
2 changed files with 27 additions and 20 deletions

View File

@ -943,33 +943,35 @@ static int i7300_get_devices(struct mem_ctl_info *mci)
/* Attempt to 'get' the MCH register we want */
pdev = NULL;
while (!pvt->pci_dev_16_1_fsb_addr_map ||
!pvt->pci_dev_16_2_fsb_err_regs) {
pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev);
if (!pdev) {
/* End of list, leave */
i7300_printk(KERN_ERR,
"'system address,Process Bus' "
"device not found:"
"vendor 0x%x device 0x%x ERR funcs "
"(broken BIOS?)\n",
PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_I7300_MCH_ERR);
goto error;
}
while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_I7300_MCH_ERR,
pdev))) {
/* Store device 16 funcs 1 and 2 */
switch (PCI_FUNC(pdev->devfn)) {
case 1:
pvt->pci_dev_16_1_fsb_addr_map = pdev;
if (!pvt->pci_dev_16_1_fsb_addr_map)
pvt->pci_dev_16_1_fsb_addr_map =
pci_dev_get(pdev);
break;
case 2:
pvt->pci_dev_16_2_fsb_err_regs = pdev;
if (!pvt->pci_dev_16_2_fsb_err_regs)
pvt->pci_dev_16_2_fsb_err_regs =
pci_dev_get(pdev);
break;
}
}
if (!pvt->pci_dev_16_1_fsb_addr_map ||
!pvt->pci_dev_16_2_fsb_err_regs) {
/* At least one device was not found */
i7300_printk(KERN_ERR,
"'system address,Process Bus' device not found:"
"vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n",
PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_I7300_MCH_ERR);
goto error;
}
edac_dbg(1, "System Address, processor bus- PCI Bus ID: %s %x:%x\n",
pci_name(pvt->pci_dev_16_0_fsb_ctlr),
pvt->pci_dev_16_0_fsb_ctlr->vendor,

View File

@ -1334,14 +1334,19 @@ static int i7core_get_onedevice(struct pci_dev **prev,
* is at addr 8086:2c40, instead of 8086:2c41. So, we need
* to probe for the alternate address in case of failure
*/
if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev)
if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) {
pci_dev_get(*prev); /* pci_get_device will put it */
pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT, *prev);
}
if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev)
if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE &&
!pdev) {
pci_dev_get(*prev); /* pci_get_device will put it */
pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT,
*prev);
}
if (!pdev) {
if (*prev) {