Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'edac_updates_for_5.9_pt2' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull edac fix from Tony Luck:
"Fix for the ie31200 driver that missed the first pull"

* tag 'edac_updates_for_5.9_pt2' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
EDAC/ie31200: Fallback if host bridge device is already initialized

+47 -3
+47 -3
drivers/edac/ie31200_edac.c
··· 170 170 (n << (28 + (2 * skl) - PAGE_SHIFT)) 171 171 172 172 static int nr_channels; 173 + static struct pci_dev *mci_pdev; 174 + static int ie31200_registered = 1; 173 175 174 176 struct ie31200_priv { 175 177 void __iomem *window; ··· 540 538 static int ie31200_init_one(struct pci_dev *pdev, 541 539 const struct pci_device_id *ent) 542 540 { 543 - edac_dbg(0, "MC:\n"); 541 + int rc; 544 542 543 + edac_dbg(0, "MC:\n"); 545 544 if (pci_enable_device(pdev) < 0) 546 545 return -EIO; 546 + rc = ie31200_probe1(pdev, ent->driver_data); 547 + if (rc == 0 && !mci_pdev) 548 + mci_pdev = pci_dev_get(pdev); 547 549 548 - return ie31200_probe1(pdev, ent->driver_data); 550 + return rc; 549 551 } 550 552 551 553 static void ie31200_remove_one(struct pci_dev *pdev) ··· 558 552 struct ie31200_priv *priv; 559 553 560 554 edac_dbg(0, "\n"); 555 + pci_dev_put(mci_pdev); 556 + mci_pdev = NULL; 561 557 mci = edac_mc_del_mc(&pdev->dev); 562 558 if (!mci) 563 559 return; ··· 601 593 602 594 static int __init ie31200_init(void) 603 595 { 596 + int pci_rc, i; 597 + 604 598 edac_dbg(3, "MC:\n"); 605 599 /* Ensure that the OPSTATE is set correctly for POLL or NMI */ 606 600 opstate_init(); 607 601 608 - return pci_register_driver(&ie31200_driver); 602 + pci_rc = pci_register_driver(&ie31200_driver); 603 + if (pci_rc < 0) 604 + goto fail0; 605 + 606 + if (!mci_pdev) { 607 + ie31200_registered = 0; 608 + for (i = 0; ie31200_pci_tbl[i].vendor != 0; i++) { 609 + mci_pdev = pci_get_device(ie31200_pci_tbl[i].vendor, 610 + ie31200_pci_tbl[i].device, 611 + NULL); 612 + if (mci_pdev) 613 + break; 614 + } 615 + if (!mci_pdev) { 616 + edac_dbg(0, "ie31200 pci_get_device fail\n"); 617 + pci_rc = -ENODEV; 618 + goto fail1; 619 + } 620 + pci_rc = ie31200_init_one(mci_pdev, &ie31200_pci_tbl[i]); 621 + if (pci_rc < 0) { 622 + edac_dbg(0, "ie31200 init fail\n"); 623 + pci_rc = -ENODEV; 624 + goto fail1; 625 + } 626 + } 627 + return 0; 628 + 629 + fail1: 630 + pci_unregister_driver(&ie31200_driver); 631 + fail0: 632 + pci_dev_put(mci_pdev); 633 + 634 + return pci_rc; 609 635 } 610 636 611 637 static void __exit ie31200_exit(void) 612 638 { 613 639 edac_dbg(3, "MC:\n"); 614 640 pci_unregister_driver(&ie31200_driver); 641 + if (!ie31200_registered) 642 + ie31200_remove_one(mci_pdev); 615 643 } 616 644 617 645 module_init(ie31200_init);