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.

powerpc/eeh: Cleanup on eeh_subsystem_enabled

The patch cleans up variable eeh_subsystem_enabled so that we needn't
refer the variable directly from external. Instead, we will use
function eeh_enabled() and eeh_set_enable() to operate the variable.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Gavin Shan and committed by
Benjamin Herrenschmidt
2ec5a0ad 5b2e198e

+27 -10
+19 -2
arch/powerpc/include/asm/eeh.h
··· 172 172 }; 173 173 174 174 extern struct eeh_ops *eeh_ops; 175 - extern int eeh_subsystem_enabled; 175 + extern bool eeh_subsystem_enabled; 176 176 extern raw_spinlock_t confirm_error_lock; 177 177 extern int eeh_probe_mode; 178 + 179 + static inline bool eeh_enabled(void) 180 + { 181 + return eeh_subsystem_enabled; 182 + } 183 + 184 + static inline void eeh_set_enable(bool mode) 185 + { 186 + eeh_subsystem_enabled = mode; 187 + } 178 188 179 189 #define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */ 180 190 #define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */ ··· 256 246 * If this macro yields TRUE, the caller relays to eeh_check_failure() 257 247 * which does further tests out of line. 258 248 */ 259 - #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_subsystem_enabled) 249 + #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_enabled()) 260 250 261 251 /* 262 252 * Reads from a device which has been isolated by EEH will return ··· 266 256 #define EEH_IO_ERROR_VALUE(size) (~0U >> ((4 - (size)) * 8)) 267 257 268 258 #else /* !CONFIG_EEH */ 259 + 260 + static inline bool eeh_enabled(void) 261 + { 262 + return false; 263 + } 264 + 265 + static inline void eeh_set_enable(bool mode) { } 269 266 270 267 static inline int eeh_init(void) 271 268 {
+6 -6
arch/powerpc/kernel/eeh.c
··· 89 89 /* Platform dependent EEH operations */ 90 90 struct eeh_ops *eeh_ops = NULL; 91 91 92 - int eeh_subsystem_enabled; 92 + bool eeh_subsystem_enabled = false; 93 93 EXPORT_SYMBOL(eeh_subsystem_enabled); 94 94 95 95 /* ··· 364 364 365 365 eeh_stats.total_mmio_ffs++; 366 366 367 - if (!eeh_subsystem_enabled) 367 + if (!eeh_enabled()) 368 368 return 0; 369 369 370 370 if (!edev) { ··· 822 822 return ret; 823 823 } 824 824 825 - if (eeh_subsystem_enabled) 825 + if (eeh_enabled()) 826 826 pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n"); 827 827 else 828 828 pr_warning("EEH: No capable adapters found\n"); ··· 897 897 struct device_node *dn; 898 898 struct eeh_dev *edev; 899 899 900 - if (!dev || !eeh_subsystem_enabled) 900 + if (!dev || !eeh_enabled()) 901 901 return; 902 902 903 903 pr_debug("EEH: Adding device %s\n", pci_name(dev)); ··· 1005 1005 { 1006 1006 struct eeh_dev *edev; 1007 1007 1008 - if (!dev || !eeh_subsystem_enabled) 1008 + if (!dev || !eeh_enabled()) 1009 1009 return; 1010 1010 edev = pci_dev_to_eeh_dev(dev); 1011 1011 ··· 1045 1045 1046 1046 static int proc_eeh_show(struct seq_file *m, void *v) 1047 1047 { 1048 - if (0 == eeh_subsystem_enabled) { 1048 + if (!eeh_enabled()) { 1049 1049 seq_printf(m, "EEH Subsystem is globally disabled\n"); 1050 1050 seq_printf(m, "eeh_total_mmio_ffs=%llu\n", eeh_stats.total_mmio_ffs); 1051 1051 } else {
+1 -1
arch/powerpc/platforms/powernv/eeh-powernv.c
··· 145 145 * Enable EEH explicitly so that we will do EEH check 146 146 * while accessing I/O stuff 147 147 */ 148 - eeh_subsystem_enabled = 1; 148 + eeh_set_enable(true); 149 149 150 150 /* Save memory bars */ 151 151 eeh_save_bars(edev);
+1 -1
arch/powerpc/platforms/pseries/eeh_pseries.c
··· 265 265 enable = 1; 266 266 267 267 if (enable) { 268 - eeh_subsystem_enabled = 1; 268 + eeh_set_enable(true); 269 269 eeh_add_to_parent_pe(edev); 270 270 271 271 pr_debug("%s: EEH enabled on %s PHB#%d-PE#%x, config addr#%x\n",