powerpc/eeh: Add restore_config operation
authorGavin Shan <shangw@linux.vnet.ibm.com>
Fri, 3 Jan 2014 09:47:12 +0000 (17:47 +0800)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 15 Jan 2014 02:46:46 +0000 (13:46 +1100)
After reset on the specific PE or PHB, we never configure AER
correctly on PowerNV platform. We needn't care it on pSeries
platform. The patch introduces additional EEH operation eeh_ops::
restore_config() so that we have chance to configure AER correctly
for PowerNV platform.

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_pe.c
arch/powerpc/platforms/powernv/eeh-powernv.c
arch/powerpc/platforms/pseries/eeh_pseries.c

index d3e5e9bc8f946fa3fd7158a3ecc931561c71c1a3..7f8adc848cd6fd45ac3bdc339c7c8e1bf1819b3b 100644 (file)
@@ -157,6 +157,7 @@ struct eeh_ops {
        int (*read_config)(struct device_node *dn, int where, int size, u32 *val);
        int (*write_config)(struct device_node *dn, int where, int size, u32 val);
        int (*next_error)(struct eeh_pe **pe);
+       int (*restore_config)(struct device_node *dn);
 };
 
 extern struct eeh_ops *eeh_ops;
index 1feccd64f955b4f3446ddbb5ee667edcf8873a1f..f0c353fa655a3a5a742e2de674851ab3ca88006a 100644 (file)
@@ -736,6 +736,9 @@ static void *eeh_restore_one_device_bars(void *data, void *flag)
        else
                eeh_restore_device_bars(edev, dn);
 
+       if (eeh_ops->restore_config)
+               eeh_ops->restore_config(dn);
+
        return NULL;
 }
 
index 73b981438cc583e0ba4345129046d56b72a8b9c1..ab91e6a34afac9346e3c68bab9e583ef60146de1 100644 (file)
@@ -359,7 +359,8 @@ static struct eeh_ops powernv_eeh_ops = {
        .configure_bridge       = powernv_eeh_configure_bridge,
        .read_config            = pnv_pci_cfg_read,
        .write_config           = pnv_pci_cfg_write,
-       .next_error             = powernv_eeh_next_error
+       .next_error             = powernv_eeh_next_error,
+       .restore_config         = NULL
 };
 
 /**
index ccb633e077b16d6c7a57bb6cfd4372ca87ceeb6a..9ef3cc8ebc11c7f533a3bc966d90bd6c085d891d 100644 (file)
@@ -689,7 +689,9 @@ static struct eeh_ops pseries_eeh_ops = {
        .get_log                = pseries_eeh_get_log,
        .configure_bridge       = pseries_eeh_configure_bridge,
        .read_config            = pseries_eeh_read_config,
-       .write_config           = pseries_eeh_write_config
+       .write_config           = pseries_eeh_write_config,
+       .next_error             = NULL,
+       .restore_config         = NULL
 };
 
 /**