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

Pull powerpc fixes from Michael Ellerman:
"Fixes for code merged this cycle:

- Fix restore of SPRs upon wake up from hypervisor state loss from
Gautham R Shenoy
- Fix the state of root PE from Gavin Shan
- Detach from PE on releasing PCI device from Gavin Shan
- Fix size of NUM_CPU_FTR_KEYS on 32-bit
- Fix missed TCE invalidations that should fallback to OPAL"

* tag 'powerpc-4.8-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/powernv/pci: Fix missed TCE invalidations that should fallback to OPAL
powerpc/powernv: Detach from PE on releasing PCI device
powerpc/powernv: Fix the state of root PE
powerpc/kernel: Fix size of NUM_CPU_FTR_KEYS on 32-bit
powerpc/powernv: Fix restore of SPRs upon wake up from hypervisor state loss

+29 -9
+1 -1
arch/powerpc/include/asm/cpu_has_feature.h
··· 15 15 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS 16 16 #include <linux/jump_label.h> 17 17 18 - #define NUM_CPU_FTR_KEYS 64 18 + #define NUM_CPU_FTR_KEYS BITS_PER_LONG 19 19 20 20 extern struct static_key_true cpu_feature_keys[NUM_CPU_FTR_KEYS]; 21 21
+5 -5
arch/powerpc/kernel/idle_book3s.S
··· 411 411 * 412 412 * r13 - PACA 413 413 * cr3 - gt if waking up with partial/complete hypervisor state loss 414 - * cr4 - eq if waking up from complete hypervisor state loss. 414 + * cr4 - gt or eq if waking up from complete hypervisor state loss. 415 415 */ 416 416 _GLOBAL(pnv_wakeup_tb_loss) 417 417 ld r1,PACAR1(r13) ··· 453 453 * At this stage 454 454 * cr2 - eq if first thread to wakeup in core 455 455 * cr3- gt if waking up with partial/complete hypervisor state loss 456 - * cr4 - eq if waking up from complete hypervisor state loss. 456 + * cr4 - gt or eq if waking up from complete hypervisor state loss. 457 457 */ 458 458 459 459 ori r15,r15,PNV_CORE_IDLE_LOCK_BIT ··· 481 481 * If waking up from sleep, subcore state is not lost. Hence 482 482 * skip subcore state restore 483 483 */ 484 - bne cr4,subcore_state_restored 484 + blt cr4,subcore_state_restored 485 485 486 486 /* Restore per-subcore state */ 487 487 ld r4,_SDR1(r1) ··· 526 526 * If waking up from sleep, per core state is not lost, skip to 527 527 * clear_lock. 528 528 */ 529 - bne cr4,clear_lock 529 + blt cr4,clear_lock 530 530 531 531 /* 532 532 * First thread in the core to wake up and its waking up with ··· 557 557 * If waking up from sleep, hypervisor state is not lost. Hence 558 558 * skip hypervisor state restore. 559 559 */ 560 - bne cr4,hypervisor_state_restored 560 + blt cr4,hypervisor_state_restored 561 561 562 562 /* Waking up from winkle */ 563 563
+23 -3
arch/powerpc/platforms/powernv/pci-ioda.c
··· 2217 2217 2218 2218 pnv_pci_link_table_and_group(phb->hose->node, num, 2219 2219 tbl, &pe->table_group); 2220 - pnv_pci_phb3_tce_invalidate_pe(pe); 2220 + pnv_pci_ioda2_tce_invalidate_pe(pe); 2221 2221 2222 2222 return 0; 2223 2223 } ··· 2355 2355 if (ret) 2356 2356 pe_warn(pe, "Unmapping failed, ret = %ld\n", ret); 2357 2357 else 2358 - pnv_pci_phb3_tce_invalidate_pe(pe); 2358 + pnv_pci_ioda2_tce_invalidate_pe(pe); 2359 2359 2360 2360 pnv_pci_unlink_table_and_group(table_group->tables[num], table_group); 2361 2361 ··· 3426 3426 } 3427 3427 } 3428 3428 3429 - pnv_ioda_free_pe(pe); 3429 + /* 3430 + * The PE for root bus can be removed because of hotplug in EEH 3431 + * recovery for fenced PHB error. We need to mark the PE dead so 3432 + * that it can be populated again in PCI hot add path. The PE 3433 + * shouldn't be destroyed as it's the global reserved resource. 3434 + */ 3435 + if (phb->ioda.root_pe_populated && 3436 + phb->ioda.root_pe_idx == pe->pe_number) 3437 + phb->ioda.root_pe_populated = false; 3438 + else 3439 + pnv_ioda_free_pe(pe); 3430 3440 } 3431 3441 3432 3442 static void pnv_pci_release_device(struct pci_dev *pdev) ··· 3452 3442 if (!pdn || pdn->pe_number == IODA_INVALID_PE) 3453 3443 return; 3454 3444 3445 + /* 3446 + * PCI hotplug can happen as part of EEH error recovery. The @pdn 3447 + * isn't removed and added afterwards in this scenario. We should 3448 + * set the PE number in @pdn to an invalid one. Otherwise, the PE's 3449 + * device count is decreased on removing devices while failing to 3450 + * be increased on adding devices. It leads to unbalanced PE's device 3451 + * count and eventually make normal PCI hotplug path broken. 3452 + */ 3455 3453 pe = &phb->ioda.pe_array[pdn->pe_number]; 3454 + pdn->pe_number = IODA_INVALID_PE; 3455 + 3456 3456 WARN_ON(--pe->device_count < 0); 3457 3457 if (pe->device_count == 0) 3458 3458 pnv_ioda_release_pe(pe);