diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-22 21:48:29 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-10 10:44:46 -0400 |
commit | 87d1d272ba25a1863e40ebb1df4bc0eed7a8fd11 (patch) | |
tree | 5d20ad1e3edfc95ca38a71350833ba345637eb63 /drivers/edac | |
parent | 7b029d03c36e5b06e067884aaefcee2c1c62efc7 (diff) |
i7core_edac: need mci->edac_check, otherwise module removal doesn't work
There are some locking troubles with edac_core: if you don't declare an
edac_check, module may suffer from soft lock.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i7core_edac.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 0c17db673065..190596af601a 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -880,6 +880,15 @@ static int i7core_get_devices(struct mem_ctl_info *mci, struct pci_dev *mcidev) | |||
880 | } | 880 | } |
881 | 881 | ||
882 | /* | 882 | /* |
883 | * i7core_check_error Retrieve and process errors reported by the | ||
884 | * hardware. Called by the Core module. | ||
885 | */ | ||
886 | static void i7core_check_error(struct mem_ctl_info *mci) | ||
887 | { | ||
888 | /* FIXME: need a real code here */ | ||
889 | } | ||
890 | |||
891 | /* | ||
883 | * i7core_probe Probe for ONE instance of device to see if it is | 892 | * i7core_probe Probe for ONE instance of device to see if it is |
884 | * present. | 893 | * present. |
885 | * return: | 894 | * return: |
@@ -912,8 +921,11 @@ static int __devinit i7core_probe(struct pci_dev *pdev, | |||
912 | 921 | ||
913 | debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci); | 922 | debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci); |
914 | 923 | ||
924 | /* 'get' the pci devices we want to reserve for our use */ | ||
925 | if (i7core_get_devices(mci, pdev)) | ||
926 | goto fail0; | ||
927 | |||
915 | mci->dev = &pdev->dev; /* record ptr to the generic device */ | 928 | mci->dev = &pdev->dev; /* record ptr to the generic device */ |
916 | dev_set_drvdata(mci->dev, mci); | ||
917 | 929 | ||
918 | pvt = mci->pvt_info; | 930 | pvt = mci->pvt_info; |
919 | 931 | ||
@@ -932,9 +944,8 @@ static int __devinit i7core_probe(struct pci_dev *pdev, | |||
932 | mci->ctl_page_to_phys = NULL; | 944 | mci->ctl_page_to_phys = NULL; |
933 | mci->mc_driver_sysfs_attributes = i7core_inj_attrs; | 945 | mci->mc_driver_sysfs_attributes = i7core_inj_attrs; |
934 | 946 | ||
935 | /* 'get' the pci devices we want to reserve for our use */ | 947 | /* Set the function pointer to an actual operation function */ |
936 | if (i7core_get_devices(mci, pdev)) | 948 | mci->edac_check = i7core_check_error; |
937 | goto fail0; | ||
938 | 949 | ||
939 | /* add this new MC control structure to EDAC's list of MCs */ | 950 | /* add this new MC control structure to EDAC's list of MCs */ |
940 | if (edac_mc_add_mc(mci)) { | 951 | if (edac_mc_add_mc(mci)) { |
@@ -992,6 +1003,7 @@ static void __devexit i7core_remove(struct pci_dev *pdev) | |||
992 | edac_pci_release_generic_ctl(i7core_pci); | 1003 | edac_pci_release_generic_ctl(i7core_pci); |
993 | 1004 | ||
994 | mci = edac_mc_del_mc(&pdev->dev); | 1005 | mci = edac_mc_del_mc(&pdev->dev); |
1006 | |||
995 | if (!mci) | 1007 | if (!mci) |
996 | return; | 1008 | return; |
997 | 1009 | ||