We ended up with an ugly conflict between fixes and next in ftrace.h involving multiple nested ifdefs, and the automatic resolution is wrong. So merge fixes into next so we can fix it up.
···246246 Returns 1 if the psl timebase register is synchronized247247 with the core timebase register, 0 otherwise.248248Users: https://github.com/ibm-capi/libcxl249249+250250+What: /sys/class/cxl/<card>/tunneled_ops_supported251251+Date: May 2018252252+Contact: linuxppc-dev@lists.ozlabs.org253253+Description: read only254254+ Returns 1 if tunneled operations are supported in capi mode,255255+ 0 otherwise.256256+Users: https://github.com/ibm-capi/libcxl
+24-9
arch/powerpc/include/asm/ftrace.h
···6565#endif /* CONFIG_FUNCTION_TRACER */66666767#ifndef __ASSEMBLY__6868-#if defined(CONFIG_FTRACE_SYSCALLS) && defined(PPC64_ELF_ABI_v1)6868+#ifdef CONFIG_FTRACE_SYSCALLS6969+/*7070+ * Some syscall entry functions on powerpc start with "ppc_" (fork and clone,7171+ * for instance) or ppc32_/ppc64_. We should also match the sys_ variant with7272+ * those.7373+ */6974#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME7575+#ifdef PPC64_ELF_ABI_v17076static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)7177{7272- /*7373- * Compare the symbol name with the system call name. Skip the .sys or .SyS7474- * prefix from the symbol name and the sys prefix from the system call name and7575- * just match the rest. This is only needed on ppc64 since symbol names on7676- * 32bit do not start with a period so the generic function will work.7777- */7878- return !strcmp(sym + 4, name + 3);7878+ /* We need to skip past the initial dot, and the __se_sys alias */7979+ return !strcmp(sym + 1, name) ||8080+ (!strncmp(sym, ".__se_sys", 9) && !strcmp(sym + 6, name)) ||8181+ (!strncmp(sym, ".ppc_", 5) && !strcmp(sym + 5, name + 4)) ||8282+ (!strncmp(sym, ".ppc32_", 7) && !strcmp(sym + 7, name + 4)) ||8383+ (!strncmp(sym, ".ppc64_", 7) && !strcmp(sym + 7, name + 4));7984}8080-#endif /* CONFIG_FTRACE_SYSCALLS && PPC64_ELF_ABI_v1 */8585+#else8686+static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)8787+{8888+ return !strcmp(sym, name) ||8989+ (!strncmp(sym, "__se_sys", 8) && !strcmp(sym + 5, name)) ||9090+ (!strncmp(sym, "ppc_", 4) && !strcmp(sym + 4, name + 4)) ||9191+ (!strncmp(sym, "ppc32_", 6) && !strcmp(sym + 6, name + 4)) ||9292+ (!strncmp(sym, "ppc64_", 6) && !strcmp(sym + 6, name + 4));9393+}9494+#endif /* PPC64_ELF_ABI_v1 */9595+#endif /* CONFIG_FTRACE_SYSCALLS */81968297#ifdef CONFIG_PPC648398#include <asm/paca.h>
-1
arch/powerpc/include/asm/paca.h
···165165 u64 saved_msr; /* MSR saved here by enter_rtas */166166 u16 trap_save; /* Used when bad stack is encountered */167167 u8 irq_soft_mask; /* mask for irq soft masking */168168- u8 soft_enabled; /* irq soft-enable flag */169168 u8 irq_happened; /* irq happened while soft-disabled */170169 u8 io_sync; /* writel() needs spin_unlock sync */171170 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */
+5-8
arch/powerpc/include/asm/topology.h
···9191extern int stop_topology_update(void);9292extern int prrn_is_enabled(void);9393extern int find_and_online_cpu_nid(int cpu);9494+extern int timed_topology_update(int nsecs);9495#else9596static inline int start_topology_update(void)9697{···109108{110109 return 0;111110}111111+static inline int timed_topology_update(int nsecs)112112+{113113+ return 0;114114+}112115#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */113113-114114-#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_NEED_MULTIPLE_NODES)115115-#if defined(CONFIG_PPC_SPLPAR)116116-extern int timed_topology_update(int nsecs);117117-#else118118-#define timed_topology_update(nsecs)119119-#endif /* CONFIG_PPC_SPLPAR */120120-#endif /* CONFIG_HOTPLUG_CPU || CONFIG_NEED_MULTIPLE_NODES */121116122117#include <asm-generic/topology.h>123118
+6
arch/powerpc/kernel/cpu_setup_power.S
···2828 beqlr2929 li r0,03030 mtspr SPRN_LPID,r03131+ mtspr SPRN_PCR,r03132 mfspr r3,SPRN_LPCR3233 li r4,(LPCR_LPES1 >> LPCR_LPES_SH)3334 bl __init_LPCR_ISA206···4241 beqlr4342 li r0,04443 mtspr SPRN_LPID,r04444+ mtspr SPRN_PCR,r04545 mfspr r3,SPRN_LPCR4646 li r4,(LPCR_LPES1 >> LPCR_LPES_SH)4747 bl __init_LPCR_ISA206···5957 beqlr6058 li r0,06159 mtspr SPRN_LPID,r06060+ mtspr SPRN_PCR,r06261 mfspr r3,SPRN_LPCR6362 ori r3, r3, LPCR_PECEDH6463 li r4,0 /* LPES = 0 */···8178 beqlr8279 li r0,08380 mtspr SPRN_LPID,r08181+ mtspr SPRN_PCR,r08482 mfspr r3,SPRN_LPCR8583 ori r3, r3, LPCR_PECEDH8684 li r4,0 /* LPES = 0 */···10399 mtspr SPRN_PSSCR,r0104100 mtspr SPRN_LPID,r0105101 mtspr SPRN_PID,r0102102+ mtspr SPRN_PCR,r0106103 mfspr r3,SPRN_LPCR107104 LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC)108105 or r3, r3, r4···128123 mtspr SPRN_PSSCR,r0129124 mtspr SPRN_LPID,r0130125 mtspr SPRN_PID,r0126126+ mtspr SPRN_PCR,r0131127 mfspr r3,SPRN_LPCR132128 LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC)133129 or r3, r3, r4
···4444 return count;4545}46464747+/*4848+ * This can be called in the panic path with interrupts off, so use4949+ * mdelay in that case.5050+ */4751static ssize_t opal_nvram_write(char *buf, size_t count, loff_t *index)4852{4953 s64 rc = OPAL_BUSY;···6258 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {6359 rc = opal_write_nvram(__pa(buf), count, off);6460 if (rc == OPAL_BUSY_EVENT) {6565- msleep(OPAL_BUSY_DELAY_MS);6161+ if (in_interrupt() || irqs_disabled())6262+ mdelay(OPAL_BUSY_DELAY_MS);6363+ else6464+ msleep(OPAL_BUSY_DELAY_MS);6665 opal_poll_events(NULL);6766 } else if (rc == OPAL_BUSY) {6868- msleep(OPAL_BUSY_DELAY_MS);6767+ if (in_interrupt() || irqs_disabled())6868+ mdelay(OPAL_BUSY_DELAY_MS);6969+ else7070+ msleep(OPAL_BUSY_DELAY_MS);6971 }7072 }7173
+1
drivers/misc/cxl/cxl.h
···717717 bool perst_select_user;718718 bool perst_same_image;719719 bool psl_timebase_synced;720720+ bool tunneled_ops_supported;720721721722 /*722723 * number of contexts mapped on to this card. Possible values are:
+12
drivers/misc/cxl/pci.c
···17421742 /* Required for devices using CAPP DMA mode, harmless for others */17431743 pci_set_master(dev);1744174417451745+ adapter->tunneled_ops_supported = false;17461746+17471747+ if (cxl_is_power9()) {17481748+ if (pnv_pci_set_tunnel_bar(dev, 0x00020000E0000000ull, 1))17491749+ dev_info(&dev->dev, "Tunneled operations unsupported\n");17501750+ else17511751+ adapter->tunneled_ops_supported = true;17521752+ }17531753+17451754 if ((rc = pnv_phb_to_cxl_mode(dev, adapter->native->sl_ops->capi_mode)))17461755 goto err;17471756···17761767static void cxl_deconfigure_adapter(struct cxl *adapter)17771768{17781769 struct pci_dev *pdev = to_pci_dev(adapter->dev.parent);17701770+17711771+ if (cxl_is_power9())17721772+ pnv_pci_set_tunnel_bar(pdev, 0x00020000E0000000ull, 0);1779177317801774 cxl_native_release_psl_err_irq(adapter);17811775 cxl_unmap_adapter_regs(adapter);