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-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
- Re-enable CONFIG_SCSI_DH in our defconfigs
- Remove unused os_area_db_id_video_mode
- cxl: fix leak of IRQ names in cxl_free_afu_irqs() from Andrew
- cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API from Andrew
- cxl: fix leak of ctx->mapping when releasing kernel API contexts from Andrew
- cxl: Workaround malformed pcie packets on some cards from Philippe
- cxl: Fix number of allocated pages in SPA from Christophe Lombard
- Fix checkstop in native_hpte_clear() with lockdep from Cyril
- Panic on unhandled Machine Check on powernv from Daniel
- selftests/powerpc: Fix build failure of load_unaligned_zeropad test

* tag 'powerpc-4.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
selftests/powerpc: Fix build failure of load_unaligned_zeropad test
powerpc/powernv: Panic on unhandled Machine Check
powerpc: Fix checkstop in native_hpte_clear() with lockdep
cxl: Fix number of allocated pages in SPA
cxl: Workaround malformed pcie packets on some cards
cxl: fix leak of ctx->mapping when releasing kernel API contexts
cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API
cxl: fix leak of IRQ names in cxl_free_afu_irqs()
powerpc/ps3: Remove unused os_area_db_id_video_mode
powerpc/configs: Re-enable CONFIG_SCSI_DH

+79 -30
+1 -1
arch/powerpc/configs/ppc64_defconfig
··· 111 111 CONFIG_SCSI_QLA_ISCSI=m 112 112 CONFIG_SCSI_LPFC=m 113 113 CONFIG_SCSI_VIRTIO=m 114 - CONFIG_SCSI_DH=m 114 + CONFIG_SCSI_DH=y 115 115 CONFIG_SCSI_DH_RDAC=m 116 116 CONFIG_SCSI_DH_ALUA=m 117 117 CONFIG_ATA=y
+1 -1
arch/powerpc/configs/pseries_defconfig
··· 114 114 CONFIG_SCSI_QLA_ISCSI=m 115 115 CONFIG_SCSI_LPFC=m 116 116 CONFIG_SCSI_VIRTIO=m 117 - CONFIG_SCSI_DH=m 117 + CONFIG_SCSI_DH=y 118 118 CONFIG_SCSI_DH_RDAC=m 119 119 CONFIG_SCSI_DH_ALUA=m 120 120 CONFIG_ATA=y
+7 -2
arch/powerpc/include/asm/machdep.h
··· 61 61 unsigned long addr, 62 62 unsigned char *hpte_slot_array, 63 63 int psize, int ssize, int local); 64 - /* special for kexec, to be called in real mode, linear mapping is 65 - * destroyed as well */ 64 + /* 65 + * Special for kexec. 66 + * To be called in real mode with interrupts disabled. No locks are 67 + * taken as such, concurrent access on pre POWER5 hardware could result 68 + * in a deadlock. 69 + * The linear mapping is destroyed as well. 70 + */ 66 71 void (*hpte_clear_all)(void); 67 72 68 73 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size,
+11 -12
arch/powerpc/mm/hash_native_64.c
··· 582 582 * be when they isi), and we are the only one left. We rely on our kernel 583 583 * mapping being 0xC0's and the hardware ignoring those two real bits. 584 584 * 585 + * This must be called with interrupts disabled. 586 + * 587 + * Taking the native_tlbie_lock is unsafe here due to the possibility of 588 + * lockdep being on. On pre POWER5 hardware, not taking the lock could 589 + * cause deadlock. POWER5 and newer not taking the lock is fine. This only 590 + * gets called during boot before secondary CPUs have come up and during 591 + * crashdump and all bets are off anyway. 592 + * 585 593 * TODO: add batching support when enabled. remember, no dynamic memory here, 586 594 * athough there is the control page available... 587 595 */ 588 596 static void native_hpte_clear(void) 589 597 { 590 598 unsigned long vpn = 0; 591 - unsigned long slot, slots, flags; 599 + unsigned long slot, slots; 592 600 struct hash_pte *hptep = htab_address; 593 601 unsigned long hpte_v; 594 602 unsigned long pteg_count; 595 603 int psize, apsize, ssize; 596 604 597 605 pteg_count = htab_hash_mask + 1; 598 - 599 - local_irq_save(flags); 600 - 601 - /* we take the tlbie lock and hold it. Some hardware will 602 - * deadlock if we try to tlbie from two processors at once. 603 - */ 604 - raw_spin_lock(&native_tlbie_lock); 605 606 606 607 slots = pteg_count * HPTES_PER_GROUP; 607 608 ··· 615 614 hpte_v = be64_to_cpu(hptep->v); 616 615 617 616 /* 618 - * Call __tlbie() here rather than tlbie() since we 619 - * already hold the native_tlbie_lock. 617 + * Call __tlbie() here rather than tlbie() since we can't take the 618 + * native_tlbie_lock. 620 619 */ 621 620 if (hpte_v & HPTE_V_VALID) { 622 621 hpte_decode(hptep, slot, &psize, &apsize, &ssize, &vpn); ··· 626 625 } 627 626 628 627 asm volatile("eieio; tlbsync; ptesync":::"memory"); 629 - raw_spin_unlock(&native_tlbie_lock); 630 - local_irq_restore(flags); 631 628 } 632 629 633 630 /*
+5 -2
arch/powerpc/platforms/powernv/opal.c
··· 487 487 * PRD component would have already got notified about this 488 488 * error through other channels. 489 489 * 490 - * In any case, let us just fall through. We anyway heading 491 - * down to panic path. 490 + * If hardware marked this as an unrecoverable MCE, we are 491 + * going to panic anyway. Even if it didn't, it's not safe to 492 + * continue at this point, so we should explicitly panic. 492 493 */ 494 + 495 + panic("PowerNV Unrecovered Machine Check"); 493 496 return 0; 494 497 } 495 498
-5
arch/powerpc/platforms/ps3/os-area.c
··· 194 194 .key = OS_AREA_DB_KEY_RTC_DIFF 195 195 }; 196 196 197 - static const struct os_area_db_id os_area_db_id_video_mode = { 198 - .owner = OS_AREA_DB_OWNER_LINUX, 199 - .key = OS_AREA_DB_KEY_VIDEO_MODE 200 - }; 201 - 202 197 #define SECONDS_FROM_1970_TO_2000 946684800LL 203 198 204 199 /**
+1
drivers/misc/cxl/api.c
··· 105 105 106 106 void cxl_free_afu_irqs(struct cxl_context *ctx) 107 107 { 108 + afu_irq_name_free(ctx); 108 109 cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter); 109 110 } 110 111 EXPORT_SYMBOL_GPL(cxl_free_afu_irqs);
+3
drivers/misc/cxl/context.c
··· 275 275 if (ctx->kernelapi) 276 276 kfree(ctx->mapping); 277 277 278 + if (ctx->irq_bitmap) 279 + kfree(ctx->irq_bitmap); 280 + 278 281 kfree(ctx); 279 282 } 280 283
+1
drivers/misc/cxl/cxl.h
··· 677 677 void cxl_release_serr_irq(struct cxl_afu *afu); 678 678 int afu_register_irqs(struct cxl_context *ctx, u32 count); 679 679 void afu_release_irqs(struct cxl_context *ctx, void *cookie); 680 + void afu_irq_name_free(struct cxl_context *ctx); 680 681 irqreturn_t cxl_slice_irq_err(int irq, void *data); 681 682 682 683 int cxl_debugfs_init(void);
+10 -3
drivers/misc/cxl/file.c
··· 120 120 __func__, ctx->pe); 121 121 cxl_context_detach(ctx); 122 122 123 - mutex_lock(&ctx->mapping_lock); 124 - ctx->mapping = NULL; 125 - mutex_unlock(&ctx->mapping_lock); 123 + 124 + /* 125 + * Delete the context's mapping pointer, unless it's created by the 126 + * kernel API, in which case leave it so it can be freed by reclaim_ctx() 127 + */ 128 + if (!ctx->kernelapi) { 129 + mutex_lock(&ctx->mapping_lock); 130 + ctx->mapping = NULL; 131 + mutex_unlock(&ctx->mapping_lock); 132 + } 126 133 127 134 put_device(&ctx->afu->dev); 128 135
+1 -3
drivers/misc/cxl/irq.c
··· 414 414 kfree(afu->psl_irq_name); 415 415 } 416 416 417 - static void afu_irq_name_free(struct cxl_context *ctx) 417 + void afu_irq_name_free(struct cxl_context *ctx) 418 418 { 419 419 struct cxl_irq_name *irq_name, *tmp; 420 420 ··· 524 524 afu_irq_name_free(ctx); 525 525 cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter); 526 526 527 - kfree(ctx->irq_bitmap); 528 - ctx->irq_bitmap = NULL; 529 527 ctx->irq_count = 0; 530 528 }
+1 -1
drivers/misc/cxl/native.c
··· 457 457 458 458 dev_info(&afu->dev, "Activating AFU directed mode\n"); 459 459 460 + afu->num_procs = afu->max_procs_virtualised; 460 461 if (afu->spa == NULL) { 461 462 if (cxl_alloc_spa(afu)) 462 463 return -ENOMEM; ··· 469 468 cxl_p1n_write(afu, CXL_PSL_ID_An, CXL_PSL_ID_An_F | CXL_PSL_ID_An_L); 470 469 471 470 afu->current_mode = CXL_MODE_DIRECTED; 472 - afu->num_procs = afu->max_procs_virtualised; 473 471 474 472 if ((rc = cxl_chardev_m_afu_add(afu))) 475 473 return rc;
+28
drivers/misc/cxl/pci.c
··· 1035 1035 return 0; 1036 1036 } 1037 1037 1038 + /* 1039 + * Workaround a PCIe Host Bridge defect on some cards, that can cause 1040 + * malformed Transaction Layer Packet (TLP) errors to be erroneously 1041 + * reported. Mask this error in the Uncorrectable Error Mask Register. 1042 + * 1043 + * The upper nibble of the PSL revision is used to distinguish between 1044 + * different cards. The affected ones have it set to 0. 1045 + */ 1046 + static void cxl_fixup_malformed_tlp(struct cxl *adapter, struct pci_dev *dev) 1047 + { 1048 + int aer; 1049 + u32 data; 1050 + 1051 + if (adapter->psl_rev & 0xf000) 1052 + return; 1053 + if (!(aer = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR))) 1054 + return; 1055 + pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, &data); 1056 + if (data & PCI_ERR_UNC_MALF_TLP) 1057 + if (data & PCI_ERR_UNC_INTN) 1058 + return; 1059 + data |= PCI_ERR_UNC_MALF_TLP; 1060 + data |= PCI_ERR_UNC_INTN; 1061 + pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, data); 1062 + } 1063 + 1038 1064 static int cxl_vsec_looks_ok(struct cxl *adapter, struct pci_dev *dev) 1039 1065 { 1040 1066 if (adapter->vsec_status & CXL_STATUS_SECOND_PORT) ··· 1159 1133 1160 1134 if ((rc = cxl_vsec_looks_ok(adapter, dev))) 1161 1135 return rc; 1136 + 1137 + cxl_fixup_malformed_tlp(adapter, dev); 1162 1138 1163 1139 if ((rc = setup_cxl_bars(dev))) 1164 1140 return rc;
+9
tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
··· 25 25 26 26 #define FIXUP_SECTION ".ex_fixup" 27 27 28 + static inline unsigned long __fls(unsigned long x); 29 + 28 30 #include "word-at-a-time.h" 29 31 30 32 #include "utils.h" 31 33 34 + static inline unsigned long __fls(unsigned long x) 35 + { 36 + int lz; 37 + 38 + asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x)); 39 + return sizeof(unsigned long) - 1 - lz; 40 + } 32 41 33 42 static int page_size; 34 43 static char *mem_region;