powerpc/eeh: EEH post initialization operation
authorGavin Shan <shangw@linux.vnet.ibm.com>
Thu, 20 Jun 2013 05:20:57 +0000 (13:20 +0800)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Jun 2013 07:05:51 +0000 (17:05 +1000)
The patch adds new EEH operation post_init. It's used to notify
the platform that EEH core has completed the EEH probe. By that,
PowerNV platform starts to use the services supplied by EEH
functionality.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/eeh.h
arch/powerpc/kernel/eeh.c

index beb3cbcb76f8677b8cf7b58430ff58eaceb18cbc..beec7883d93e6f0b6fe205f5c9e04d026d648b40 100644 (file)
@@ -131,6 +131,7 @@ static inline struct pci_dev *eeh_dev_to_pci_dev(struct eeh_dev *edev)
 struct eeh_ops {
        char *name;
        int (*init)(void);
+       int (*post_init)(void);
        void* (*of_probe)(struct device_node *dn, void *flag);
        int (*dev_probe)(struct pci_dev *dev, void *flag);
        int (*set_option)(struct eeh_pe *pe, int option);
index c865c5f54b1855650e8d458e50589501dc32d95d..a29cf473fadfff7b011eb2d1fc3bf545c512307c 100644 (file)
@@ -720,6 +720,17 @@ int __init eeh_init(void)
                return -EINVAL;
        }
 
+       /*
+        * Call platform post-initialization. Actually, It's good chance
+        * to inform platform that EEH is ready to supply service if the
+        * I/O cache stuff has been built up.
+        */
+       if (eeh_ops->post_init) {
+               ret = eeh_ops->post_init();
+               if (ret)
+                       return ret;
+       }
+
        if (eeh_subsystem_enabled)
                pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n");
        else