aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/misc_64.S2
-rw-r--r--arch/powerpc/kernel/process.c12
-rw-r--r--arch/powerpc/mm/hash_native_64.c15
-rw-r--r--drivers/misc/cxl/pci.c12
4 files changed, 33 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index 8ac0bd2bddb0..3280953a82cf 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -623,7 +623,9 @@ BEGIN_FTR_SECTION
623 * NOTE, we rely on r0 being 0 from above. 623 * NOTE, we rely on r0 being 0 from above.
624 */ 624 */
625 mtspr SPRN_IAMR,r0 625 mtspr SPRN_IAMR,r0
626BEGIN_FTR_SECTION_NESTED(42)
626 mtspr SPRN_AMOR,r0 627 mtspr SPRN_AMOR,r0
628END_FTR_SECTION_NESTED_IFSET(CPU_FTR_HVMODE, 42)
627END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) 629END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
628 630
629 /* save regs for local vars on new stack. 631 /* save regs for local vars on new stack.
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index bfdd783e3916..5acb5a176dbe 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1569,16 +1569,22 @@ void arch_release_task_struct(struct task_struct *t)
1569 */ 1569 */
1570int set_thread_tidr(struct task_struct *t) 1570int set_thread_tidr(struct task_struct *t)
1571{ 1571{
1572 int rc;
1573
1572 if (!cpu_has_feature(CPU_FTR_ARCH_300)) 1574 if (!cpu_has_feature(CPU_FTR_ARCH_300))
1573 return -EINVAL; 1575 return -EINVAL;
1574 1576
1575 if (t != current) 1577 if (t != current)
1576 return -EINVAL; 1578 return -EINVAL;
1577 1579
1578 t->thread.tidr = assign_thread_tidr(); 1580 if (t->thread.tidr)
1579 if (t->thread.tidr < 0) 1581 return 0;
1580 return t->thread.tidr; 1582
1583 rc = assign_thread_tidr();
1584 if (rc < 0)
1585 return rc;
1581 1586
1587 t->thread.tidr = rc;
1582 mtspr(SPRN_TIDR, t->thread.tidr); 1588 mtspr(SPRN_TIDR, t->thread.tidr);
1583 1589
1584 return 0; 1590 return 0;
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 3848af167df9..640cf566e986 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -47,7 +47,8 @@
47 47
48DEFINE_RAW_SPINLOCK(native_tlbie_lock); 48DEFINE_RAW_SPINLOCK(native_tlbie_lock);
49 49
50static inline void __tlbie(unsigned long vpn, int psize, int apsize, int ssize) 50static inline unsigned long ___tlbie(unsigned long vpn, int psize,
51 int apsize, int ssize)
51{ 52{
52 unsigned long va; 53 unsigned long va;
53 unsigned int penc; 54 unsigned int penc;
@@ -100,7 +101,15 @@ static inline void __tlbie(unsigned long vpn, int psize, int apsize, int ssize)
100 : "memory"); 101 : "memory");
101 break; 102 break;
102 } 103 }
103 trace_tlbie(0, 0, va, 0, 0, 0, 0); 104 return va;
105}
106
107static inline void __tlbie(unsigned long vpn, int psize, int apsize, int ssize)
108{
109 unsigned long rb;
110
111 rb = ___tlbie(vpn, psize, apsize, ssize);
112 trace_tlbie(0, 0, rb, 0, 0, 0, 0);
104} 113}
105 114
106static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize) 115static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
@@ -652,7 +661,7 @@ static void native_hpte_clear(void)
652 if (hpte_v & HPTE_V_VALID) { 661 if (hpte_v & HPTE_V_VALID) {
653 hpte_decode(hptep, slot, &psize, &apsize, &ssize, &vpn); 662 hpte_decode(hptep, slot, &psize, &apsize, &ssize, &vpn);
654 hptep->v = 0; 663 hptep->v = 0;
655 __tlbie(vpn, psize, apsize, ssize); 664 ___tlbie(vpn, psize, apsize, ssize);
656 } 665 }
657 } 666 }
658 667
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index bb7fd3f4edab..19969ee86d6f 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -2083,6 +2083,9 @@ static pci_ers_result_t cxl_vphb_error_detected(struct cxl_afu *afu,
2083 /* There should only be one entry, but go through the list 2083 /* There should only be one entry, but go through the list
2084 * anyway 2084 * anyway
2085 */ 2085 */
2086 if (afu->phb == NULL)
2087 return result;
2088
2086 list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { 2089 list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) {
2087 if (!afu_dev->driver) 2090 if (!afu_dev->driver)
2088 continue; 2091 continue;
@@ -2124,8 +2127,7 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev,
2124 * Tell the AFU drivers; but we don't care what they 2127 * Tell the AFU drivers; but we don't care what they
2125 * say, we're going away. 2128 * say, we're going away.
2126 */ 2129 */
2127 if (afu->phb != NULL) 2130 cxl_vphb_error_detected(afu, state);
2128 cxl_vphb_error_detected(afu, state);
2129 } 2131 }
2130 return PCI_ERS_RESULT_DISCONNECT; 2132 return PCI_ERS_RESULT_DISCONNECT;
2131 } 2133 }
@@ -2265,6 +2267,9 @@ static pci_ers_result_t cxl_pci_slot_reset(struct pci_dev *pdev)
2265 if (cxl_afu_select_best_mode(afu)) 2267 if (cxl_afu_select_best_mode(afu))
2266 goto err; 2268 goto err;
2267 2269
2270 if (afu->phb == NULL)
2271 continue;
2272
2268 list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { 2273 list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) {
2269 /* Reset the device context. 2274 /* Reset the device context.
2270 * TODO: make this less disruptive 2275 * TODO: make this less disruptive
@@ -2327,6 +2332,9 @@ static void cxl_pci_resume(struct pci_dev *pdev)
2327 for (i = 0; i < adapter->slices; i++) { 2332 for (i = 0; i < adapter->slices; i++) {
2328 afu = adapter->afu[i]; 2333 afu = adapter->afu[i];
2329 2334
2335 if (afu->phb == NULL)
2336 continue;
2337
2330 list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { 2338 list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) {
2331 if (afu_dev->driver && afu_dev->driver->err_handler && 2339 if (afu_dev->driver && afu_dev->driver->err_handler &&
2332 afu_dev->driver->err_handler->resume) 2340 afu_dev->driver->err_handler->resume)