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.

Merge tag 'powerpc-4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Fix 32-bit TCE table init in kdump kernel from Nish

- Fix kdump with non-power-of-2 crashkernel= from Nish

- Abort cxl_pci_enable_device_hook() if PCI channel is offline from
Andrew

- Fix to release DRC when configure_connector() fails from Bharata

- Wire up sys_userfaultfd()

- Fix race condition in tearing down MSI interrupts from Paul

- Fix unbalanced pci_dev_get() in cxl_probe() from Daniel

- Fix cxl build failure due to -Wunused-variable gcc behaviour change
from Ian

- Tell the toolchain to use ABI v2 when building an LE boot wrapper
from Benh

- Fix THP to recompute hash value after a failed update from Aneesh

- 32-bit memcpy/memset: only use dcbz once cache is enabled from
Christophe

* tag 'powerpc-4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc32: memset: only use dcbz once cache is enabled
powerpc32: memcpy: only use dcbz once cache is enabled
powerpc/mm: Recompute hash value after a failed update
powerpc/boot: Specify ABI v2 when building an LE boot wrapper
cxl: Fix build failure due to -Wunused-variable behaviour change
cxl: Fix unbalanced pci_dev_get in cxl_probe
powerpc/MSI: Fix race condition in tearing down MSI interrupts
powerpc: Wire up sys_userfaultfd()
powerpc/pseries: Release DRC when configure_connector fails
cxl: abort cxl_pci_enable_device_hook() if PCI channel is offline
powerpc/powernv/pci-ioda: fix kdump with non-power-of-2 crashkernel=
powerpc/powernv/pci-ioda: fix 32-bit TCE table init in kdump kernel

+65 -17
+3
arch/powerpc/boot/Makefile
··· 28 28 endif 29 29 ifdef CONFIG_CPU_BIG_ENDIAN 30 30 BOOTCFLAGS += -mbig-endian 31 + else 32 + BOOTCFLAGS += -mlittle-endian 33 + BOOTCFLAGS += $(call cc-option,-mabi=elfv2) 31 34 endif 32 35 33 36 BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
+1
arch/powerpc/include/asm/systbl.h
··· 368 368 SYSCALL_SPU(bpf) 369 369 COMPAT_SYS(execveat) 370 370 PPC64ONLY(switch_endian) 371 + SYSCALL_SPU(userfaultfd)
+1 -1
arch/powerpc/include/asm/unistd.h
··· 12 12 #include <uapi/asm/unistd.h> 13 13 14 14 15 - #define __NR_syscalls 364 15 + #define __NR_syscalls 365 16 16 17 17 #define __NR__exit __NR_exit 18 18 #define NR_syscalls __NR_syscalls
+1
arch/powerpc/include/uapi/asm/unistd.h
··· 386 386 #define __NR_bpf 361 387 387 #define __NR_execveat 362 388 388 #define __NR_switch_endian 363 389 + #define __NR_userfaultfd 364 389 390 390 391 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
+6
arch/powerpc/kernel/setup_32.c
··· 38 38 #include <asm/udbg.h> 39 39 #include <asm/mmu_context.h> 40 40 #include <asm/epapr_hcalls.h> 41 + #include <asm/code-patching.h> 41 42 42 43 #define DBG(fmt...) 43 44 ··· 110 109 * This is called very early on the boot process, after a minimal 111 110 * MMU environment has been set up but before MMU_init is called. 112 111 */ 112 + extern unsigned int memset_nocache_branch; /* Insn to be replaced by NOP */ 113 + 113 114 notrace void __init machine_init(u64 dt_ptr) 114 115 { 115 116 lockdep_init(); 116 117 117 118 /* Enable early debugging if any specified (see udbg.h) */ 118 119 udbg_early_init(); 120 + 121 + patch_instruction((unsigned int *)&memcpy, PPC_INST_NOP); 122 + patch_instruction(&memset_nocache_branch, PPC_INST_NOP); 119 123 120 124 /* Do some early initialization based on the flat device tree */ 121 125 early_init_devtree(__va(dt_ptr));
+11
arch/powerpc/lib/copy_32.S
··· 73 73 * Use dcbz on the complete cache lines in the destination 74 74 * to set them to zero. This requires that the destination 75 75 * area is cacheable. -- paulus 76 + * 77 + * During early init, cache might not be active yet, so dcbz cannot be used. 78 + * We therefore skip the optimised bloc that uses dcbz. This jump is 79 + * replaced by a nop once cache is active. This is done in machine_init() 76 80 */ 77 81 _GLOBAL(memset) 78 82 rlwimi r4,r4,8,16,23 ··· 92 88 subf r6,r0,r6 93 89 cmplwi 0,r4,0 94 90 bne 2f /* Use normal procedure if r4 is not zero */ 91 + _GLOBAL(memset_nocache_branch) 92 + b 2f /* Skip optimised bloc until cache is enabled */ 95 93 96 94 clrlwi r7,r6,32-LG_CACHELINE_BYTES 97 95 add r8,r7,r5 ··· 134 128 * the destination area is cacheable. 135 129 * We only use this version if the source and dest don't overlap. 136 130 * -- paulus. 131 + * 132 + * During early init, cache might not be active yet, so dcbz cannot be used. 133 + * We therefore jump to generic_memcpy which doesn't use dcbz. This jump is 134 + * replaced by a nop once cache is active. This is done in machine_init() 137 135 */ 138 136 _GLOBAL(memmove) 139 137 cmplw 0,r3,r4 ··· 145 135 /* fall through */ 146 136 147 137 _GLOBAL(memcpy) 138 + b generic_memcpy 148 139 add r7,r3,r5 /* test if the src & dst overlap */ 149 140 add r8,r4,r5 150 141 cmplw 0,r4,r7
+2 -1
arch/powerpc/mm/hugepage-hash64.c
··· 85 85 BUG_ON(index >= 4096); 86 86 87 87 vpn = hpt_vpn(ea, vsid, ssize); 88 - hash = hpt_hash(vpn, shift, ssize); 89 88 hpte_slot_array = get_hpte_slot_array(pmdp); 90 89 if (psize == MMU_PAGE_4K) { 91 90 /* ··· 100 101 valid = hpte_valid(hpte_slot_array, index); 101 102 if (valid) { 102 103 /* update the hpte bits */ 104 + hash = hpt_hash(vpn, shift, ssize); 103 105 hidx = hpte_hash_index(hpte_slot_array, index); 104 106 if (hidx & _PTEIDX_SECONDARY) 105 107 hash = ~hash; ··· 126 126 if (!valid) { 127 127 unsigned long hpte_group; 128 128 129 + hash = hpt_hash(vpn, shift, ssize); 129 130 /* insert new entry */ 130 131 pa = pmd_pfn(__pmd(old_pmd)) << PAGE_SHIFT; 131 132 new_pmd |= _PAGE_HASHPTE;
+3 -2
arch/powerpc/platforms/pasemi/msi.c
··· 63 63 static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) 64 64 { 65 65 struct msi_desc *entry; 66 + irq_hw_number_t hwirq; 66 67 67 68 pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); 68 69 ··· 71 70 if (entry->irq == NO_IRQ) 72 71 continue; 73 72 73 + hwirq = virq_to_hw(entry->irq); 74 74 irq_set_msi_desc(entry->irq, NULL); 75 - msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, 76 - virq_to_hw(entry->irq), ALLOC_CHUNK); 77 75 irq_dispose_mapping(entry->irq); 76 + msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, ALLOC_CHUNK); 78 77 } 79 78 80 79 return;
+15 -1
arch/powerpc/platforms/powernv/pci-ioda.c
··· 2049 2049 struct iommu_table *tbl = NULL; 2050 2050 long rc; 2051 2051 2052 + /* 2053 + * crashkernel= specifies the kdump kernel's maximum memory at 2054 + * some offset and there is no guaranteed the result is a power 2055 + * of 2, which will cause errors later. 2056 + */ 2057 + const u64 max_memory = __rounddown_pow_of_two(memory_hotplug_max()); 2058 + 2059 + /* 2060 + * In memory constrained environments, e.g. kdump kernel, the 2061 + * DMA window can be larger than available memory, which will 2062 + * cause errors later. 2063 + */ 2064 + const u64 window_size = min((u64)pe->table_group.tce32_size, max_memory); 2065 + 2052 2066 rc = pnv_pci_ioda2_create_table(&pe->table_group, 0, 2053 2067 IOMMU_PAGE_SHIFT_4K, 2054 - pe->table_group.tce32_size, 2068 + window_size, 2055 2069 POWERNV_IOMMU_DEFAULT_LEVELS, &tbl); 2056 2070 if (rc) { 2057 2071 pe_err(pe, "Failed to create 32-bit TCE table, err %ld",
+3 -2
arch/powerpc/platforms/powernv/pci.c
··· 99 99 struct pci_controller *hose = pci_bus_to_host(pdev->bus); 100 100 struct pnv_phb *phb = hose->private_data; 101 101 struct msi_desc *entry; 102 + irq_hw_number_t hwirq; 102 103 103 104 if (WARN_ON(!phb)) 104 105 return; ··· 107 106 for_each_pci_msi_entry(entry, pdev) { 108 107 if (entry->irq == NO_IRQ) 109 108 continue; 109 + hwirq = virq_to_hw(entry->irq); 110 110 irq_set_msi_desc(entry->irq, NULL); 111 - msi_bitmap_free_hwirqs(&phb->msi_bmp, 112 - virq_to_hw(entry->irq) - phb->msi_base, 1); 113 111 irq_dispose_mapping(entry->irq); 112 + msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq - phb->msi_base, 1); 114 113 } 115 114 } 116 115 #endif /* CONFIG_PCI_MSI */
+3 -1
arch/powerpc/platforms/pseries/dlpar.c
··· 422 422 423 423 dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); 424 424 of_node_put(parent); 425 - if (!dn) 425 + if (!dn) { 426 + dlpar_release_drc(drc_index); 426 427 return -EINVAL; 428 + } 427 429 428 430 rc = dlpar_attach_node(dn); 429 431 if (rc) {
+3 -2
arch/powerpc/sysdev/fsl_msi.c
··· 128 128 { 129 129 struct msi_desc *entry; 130 130 struct fsl_msi *msi_data; 131 + irq_hw_number_t hwirq; 131 132 132 133 for_each_pci_msi_entry(entry, pdev) { 133 134 if (entry->irq == NO_IRQ) 134 135 continue; 136 + hwirq = virq_to_hw(entry->irq); 135 137 msi_data = irq_get_chip_data(entry->irq); 136 138 irq_set_msi_desc(entry->irq, NULL); 137 - msi_bitmap_free_hwirqs(&msi_data->bitmap, 138 - virq_to_hw(entry->irq), 1); 139 139 irq_dispose_mapping(entry->irq); 140 + msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); 140 141 } 141 142 142 143 return;
+3 -2
arch/powerpc/sysdev/mpic_u3msi.c
··· 107 107 static void u3msi_teardown_msi_irqs(struct pci_dev *pdev) 108 108 { 109 109 struct msi_desc *entry; 110 + irq_hw_number_t hwirq; 110 111 111 112 for_each_pci_msi_entry(entry, pdev) { 112 113 if (entry->irq == NO_IRQ) 113 114 continue; 114 115 116 + hwirq = virq_to_hw(entry->irq); 115 117 irq_set_msi_desc(entry->irq, NULL); 116 - msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, 117 - virq_to_hw(entry->irq), 1); 118 118 irq_dispose_mapping(entry->irq); 119 + msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); 119 120 } 120 121 121 122 return;
+3 -2
arch/powerpc/sysdev/ppc4xx_msi.c
··· 124 124 { 125 125 struct msi_desc *entry; 126 126 struct ppc4xx_msi *msi_data = &ppc4xx_msi; 127 + irq_hw_number_t hwirq; 127 128 128 129 dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); 129 130 130 131 for_each_pci_msi_entry(entry, dev) { 131 132 if (entry->irq == NO_IRQ) 132 133 continue; 134 + hwirq = virq_to_hw(entry->irq); 133 135 irq_set_msi_desc(entry->irq, NULL); 134 - msi_bitmap_free_hwirqs(&msi_data->bitmap, 135 - virq_to_hw(entry->irq), 1); 136 136 irq_dispose_mapping(entry->irq); 137 + msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); 137 138 } 138 139 } 139 140
+1 -1
drivers/misc/cxl/Makefile
··· 1 - ccflags-y := -Werror 1 + ccflags-y := -Werror -Wno-unused-const-variable 2 2 3 3 cxl-y += main.o file.o irq.o fault.o native.o 4 4 cxl-y += context.o sysfs.o debugfs.o pci.o trace.o
-2
drivers/misc/cxl/pci.c
··· 1249 1249 int slice; 1250 1250 int rc; 1251 1251 1252 - pci_dev_get(dev); 1253 - 1254 1252 if (cxl_verbose) 1255 1253 dump_cxl_config_space(dev); 1256 1254
+6
drivers/misc/cxl/vphb.c
··· 48 48 49 49 phb = pci_bus_to_host(dev->bus); 50 50 afu = (struct cxl_afu *)phb->private_data; 51 + 52 + if (!cxl_adapter_link_ok(afu->adapter)) { 53 + dev_warn(&dev->dev, "%s: Device link is down, refusing to enable AFU\n", __func__); 54 + return false; 55 + } 56 + 51 57 set_dma_ops(&dev->dev, &dma_direct_ops); 52 58 set_dma_offset(&dev->dev, PAGE_OFFSET); 53 59