aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-02-07 00:03:17 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2017-02-07 00:40:18 -0500
commitab9bad0ead9ab179ace09988a3f1cfca122eb7c2 (patch)
treec66b5330f182f5110969c05ffad9371a9991e360
parent2337d207288f163e10bd8d4d7eeb0c1c75046a0c (diff)
powerpc/powernv: Remove separate entry for OPAL real mode calls
All entry points already read the MSR so they can easily do the right thing. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/opal.h7
-rw-r--r--arch/powerpc/kernel/idle_book3s.S6
-rw-r--r--arch/powerpc/kvm/book3s_hv_builtin.c34
-rw-r--r--arch/powerpc/kvm/book3s_hv_rm_xics.c10
-rw-r--r--arch/powerpc/platforms/powernv/opal-wrappers.S70
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c5
6 files changed, 46 insertions, 86 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 5c7db0f1a708..16efe7406776 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -67,7 +67,6 @@ int64_t opal_pci_config_write_half_word(uint64_t phb_id, uint64_t bus_dev_func,
67int64_t opal_pci_config_write_word(uint64_t phb_id, uint64_t bus_dev_func, 67int64_t opal_pci_config_write_word(uint64_t phb_id, uint64_t bus_dev_func,
68 uint64_t offset, uint32_t data); 68 uint64_t offset, uint32_t data);
69int64_t opal_set_xive(uint32_t isn, uint16_t server, uint8_t priority); 69int64_t opal_set_xive(uint32_t isn, uint16_t server, uint8_t priority);
70int64_t opal_rm_set_xive(uint32_t isn, uint16_t server, uint8_t priority);
71int64_t opal_get_xive(uint32_t isn, __be16 *server, uint8_t *priority); 70int64_t opal_get_xive(uint32_t isn, __be16 *server, uint8_t *priority);
72int64_t opal_register_exception_handler(uint64_t opal_exception, 71int64_t opal_register_exception_handler(uint64_t opal_exception,
73 uint64_t handler_address, 72 uint64_t handler_address,
@@ -220,18 +219,12 @@ int64_t opal_pci_set_power_state(uint64_t async_token, uint64_t id,
220int64_t opal_pci_poll2(uint64_t id, uint64_t data); 219int64_t opal_pci_poll2(uint64_t id, uint64_t data);
221 220
222int64_t opal_int_get_xirr(uint32_t *out_xirr, bool just_poll); 221int64_t opal_int_get_xirr(uint32_t *out_xirr, bool just_poll);
223int64_t opal_rm_int_get_xirr(__be32 *out_xirr, bool just_poll);
224int64_t opal_int_set_cppr(uint8_t cppr); 222int64_t opal_int_set_cppr(uint8_t cppr);
225int64_t opal_int_eoi(uint32_t xirr); 223int64_t opal_int_eoi(uint32_t xirr);
226int64_t opal_rm_int_eoi(uint32_t xirr);
227int64_t opal_int_set_mfrr(uint32_t cpu, uint8_t mfrr); 224int64_t opal_int_set_mfrr(uint32_t cpu, uint8_t mfrr);
228int64_t opal_rm_int_set_mfrr(uint32_t cpu, uint8_t mfrr);
229int64_t opal_pci_tce_kill(uint64_t phb_id, uint32_t kill_type, 225int64_t opal_pci_tce_kill(uint64_t phb_id, uint32_t kill_type,
230 uint32_t pe_num, uint32_t tce_size, 226 uint32_t pe_num, uint32_t tce_size,
231 uint64_t dma_addr, uint32_t npages); 227 uint64_t dma_addr, uint32_t npages);
232int64_t opal_rm_pci_tce_kill(uint64_t phb_id, uint32_t kill_type,
233 uint32_t pe_num, uint32_t tce_size,
234 uint64_t dma_addr, uint32_t npages);
235 228
236/* Internal functions */ 229/* Internal functions */
237extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 230extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index 72dac0b58061..5302e1ad82c2 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -250,7 +250,7 @@ fastsleep_workaround_at_entry:
250 /* Fast sleep workaround */ 250 /* Fast sleep workaround */
251 li r3,1 251 li r3,1
252 li r4,1 252 li r4,1
253 bl opal_rm_config_cpu_idle_state 253 bl opal_config_cpu_idle_state
254 254
255 /* Clear Lock bit */ 255 /* Clear Lock bit */
256 li r0,0 256 li r0,0
@@ -544,7 +544,7 @@ timebase_resync:
544 */ 544 */
545 ble cr3,clear_lock 545 ble cr3,clear_lock
546 /* Time base re-sync */ 546 /* Time base re-sync */
547 bl opal_rm_resync_timebase; 547 bl opal_resync_timebase;
548 /* 548 /*
549 * If waking up from sleep, per core state is not lost, skip to 549 * If waking up from sleep, per core state is not lost, skip to
550 * clear_lock. 550 * clear_lock.
@@ -633,7 +633,7 @@ hypervisor_state_restored:
633fastsleep_workaround_at_exit: 633fastsleep_workaround_at_exit:
634 li r3,1 634 li r3,1
635 li r4,0 635 li r4,0
636 bl opal_rm_config_cpu_idle_state 636 bl opal_config_cpu_idle_state
637 b timebase_resync 637 b timebase_resync
638 638
639/* 639/*
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
index fe08fea54b70..2f69fbc19bb0 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -29,11 +29,6 @@
29#include <asm/opal.h> 29#include <asm/opal.h>
30#include <asm/smp.h> 30#include <asm/smp.h>
31 31
32static bool in_realmode(void)
33{
34 return !(mfmsr() & MSR_IR);
35}
36
37#define KVM_CMA_CHUNK_ORDER 18 32#define KVM_CMA_CHUNK_ORDER 18
38 33
39/* 34/*
@@ -230,13 +225,10 @@ void kvmhv_rm_send_ipi(int cpu)
230 225
231 /* Else poke the target with an IPI */ 226 /* Else poke the target with an IPI */
232 xics_phys = paca[cpu].kvm_hstate.xics_phys; 227 xics_phys = paca[cpu].kvm_hstate.xics_phys;
233 if (!in_realmode()) 228 if (xics_phys)
234 opal_int_set_mfrr(get_hard_smp_processor_id(cpu), IPI_PRIORITY);
235 else if (xics_phys)
236 rm_writeb(xics_phys + XICS_MFRR, IPI_PRIORITY); 229 rm_writeb(xics_phys + XICS_MFRR, IPI_PRIORITY);
237 else 230 else
238 opal_rm_int_set_mfrr(get_hard_smp_processor_id(cpu), 231 opal_int_set_mfrr(get_hard_smp_processor_id(cpu), IPI_PRIORITY);
239 IPI_PRIORITY);
240} 232}
241 233
242/* 234/*
@@ -419,10 +411,8 @@ static long kvmppc_read_one_intr(bool *again)
419 /* Now read the interrupt from the ICP */ 411 /* Now read the interrupt from the ICP */
420 xics_phys = local_paca->kvm_hstate.xics_phys; 412 xics_phys = local_paca->kvm_hstate.xics_phys;
421 rc = 0; 413 rc = 0;
422 if (!in_realmode()) 414 if (!xics_phys)
423 rc = opal_int_get_xirr(&xirr, false); 415 rc = opal_int_get_xirr(&xirr, false);
424 else if (!xics_phys)
425 rc = opal_rm_int_get_xirr(&xirr, false);
426 else 416 else
427 xirr = _lwzcix(xics_phys + XICS_XIRR); 417 xirr = _lwzcix(xics_phys + XICS_XIRR);
428 if (rc < 0) 418 if (rc < 0)
@@ -453,15 +443,12 @@ static long kvmppc_read_one_intr(bool *again)
453 */ 443 */
454 if (xisr == XICS_IPI) { 444 if (xisr == XICS_IPI) {
455 rc = 0; 445 rc = 0;
456 if (!in_realmode()) { 446 if (xics_phys) {
457 opal_int_set_mfrr(hard_smp_processor_id(), 0xff);
458 rc = opal_int_eoi(h_xirr);
459 } else if (xics_phys) {
460 _stbcix(xics_phys + XICS_MFRR, 0xff); 447 _stbcix(xics_phys + XICS_MFRR, 0xff);
461 _stwcix(xics_phys + XICS_XIRR, xirr); 448 _stwcix(xics_phys + XICS_XIRR, xirr);
462 } else { 449 } else {
463 opal_rm_int_set_mfrr(hard_smp_processor_id(), 0xff); 450 opal_int_set_mfrr(hard_smp_processor_id(), 0xff);
464 rc = opal_rm_int_eoi(h_xirr); 451 rc = opal_int_eoi(h_xirr);
465 } 452 }
466 /* If rc > 0, there is another interrupt pending */ 453 /* If rc > 0, there is another interrupt pending */
467 *again = rc > 0; 454 *again = rc > 0;
@@ -482,14 +469,11 @@ static long kvmppc_read_one_intr(bool *again)
482 /* We raced with the host, 469 /* We raced with the host,
483 * we need to resend that IPI, bummer 470 * we need to resend that IPI, bummer
484 */ 471 */
485 if (!in_realmode()) 472 if (xics_phys)
486 opal_int_set_mfrr(hard_smp_processor_id(),
487 IPI_PRIORITY);
488 else if (xics_phys)
489 _stbcix(xics_phys + XICS_MFRR, IPI_PRIORITY); 473 _stbcix(xics_phys + XICS_MFRR, IPI_PRIORITY);
490 else 474 else
491 opal_rm_int_set_mfrr(hard_smp_processor_id(), 475 opal_int_set_mfrr(hard_smp_processor_id(),
492 IPI_PRIORITY); 476 IPI_PRIORITY);
493 /* Let side effects complete */ 477 /* Let side effects complete */
494 smp_mb(); 478 smp_mb();
495 return 1; 479 return 1;
diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c
index 7e2eb3e865b3..29f43ed6d5eb 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_xics.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(kvm_irq_bypass);
36 36
37static void icp_rm_deliver_irq(struct kvmppc_xics *xics, struct kvmppc_icp *icp, 37static void icp_rm_deliver_irq(struct kvmppc_xics *xics, struct kvmppc_icp *icp,
38 u32 new_irq); 38 u32 new_irq);
39static int xics_opal_rm_set_server(unsigned int hw_irq, int server_cpu); 39static int xics_opal_set_server(unsigned int hw_irq, int server_cpu);
40 40
41/* -- ICS routines -- */ 41/* -- ICS routines -- */
42static void ics_rm_check_resend(struct kvmppc_xics *xics, 42static void ics_rm_check_resend(struct kvmppc_xics *xics,
@@ -728,7 +728,7 @@ int kvmppc_rm_h_eoi(struct kvm_vcpu *vcpu, unsigned long xirr)
728 ++vcpu->stat.pthru_host; 728 ++vcpu->stat.pthru_host;
729 if (state->intr_cpu != pcpu) { 729 if (state->intr_cpu != pcpu) {
730 ++vcpu->stat.pthru_bad_aff; 730 ++vcpu->stat.pthru_bad_aff;
731 xics_opal_rm_set_server(state->host_irq, pcpu); 731 xics_opal_set_server(state->host_irq, pcpu);
732 } 732 }
733 state->intr_cpu = -1; 733 state->intr_cpu = -1;
734 } 734 }
@@ -756,16 +756,16 @@ static void icp_eoi(struct irq_chip *c, u32 hwirq, __be32 xirr, bool *again)
756 if (xics_phys) { 756 if (xics_phys) {
757 _stwcix(xics_phys + XICS_XIRR, xirr); 757 _stwcix(xics_phys + XICS_XIRR, xirr);
758 } else { 758 } else {
759 rc = opal_rm_int_eoi(be32_to_cpu(xirr)); 759 rc = opal_int_eoi(be32_to_cpu(xirr));
760 *again = rc > 0; 760 *again = rc > 0;
761 } 761 }
762} 762}
763 763
764static int xics_opal_rm_set_server(unsigned int hw_irq, int server_cpu) 764static int xics_opal_set_server(unsigned int hw_irq, int server_cpu)
765{ 765{
766 unsigned int mangle_cpu = get_hard_smp_processor_id(server_cpu) << 2; 766 unsigned int mangle_cpu = get_hard_smp_processor_id(server_cpu) << 2;
767 767
768 return opal_rm_set_xive(hw_irq, mangle_cpu, DEFAULT_PRIORITY); 768 return opal_set_xive(hw_irq, mangle_cpu, DEFAULT_PRIORITY);
769} 769}
770 770
771/* 771/*
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
index 3aa40f1b20f5..28799e557348 100644
--- a/arch/powerpc/platforms/powernv/opal-wrappers.S
+++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
@@ -58,14 +58,16 @@ END_FTR_SECTION(0, 1); \
58 58
59#define OPAL_CALL(name, token) \ 59#define OPAL_CALL(name, token) \
60 _GLOBAL_TOC(name); \ 60 _GLOBAL_TOC(name); \
61 mfmsr r12; \
61 mflr r0; \ 62 mflr r0; \
63 andi. r11,r12,MSR_IR|MSR_DR; \
62 std r0,PPC_LR_STKOFF(r1); \ 64 std r0,PPC_LR_STKOFF(r1); \
63 li r0,token; \ 65 li r0,token; \
66 beq opal_real_call; \
64 OPAL_BRANCH(opal_tracepoint_entry) \ 67 OPAL_BRANCH(opal_tracepoint_entry) \
65 mfcr r12; \ 68 mfcr r11; \
66 stw r12,8(r1); \ 69 stw r11,8(r1); \
67 li r11,0; \ 70 li r11,0; \
68 mfmsr r12; \
69 ori r11,r11,MSR_EE; \ 71 ori r11,r11,MSR_EE; \
70 std r12,PACASAVEDMSR(r13); \ 72 std r12,PACASAVEDMSR(r13); \
71 andc r12,r12,r11; \ 73 andc r12,r12,r11; \
@@ -98,6 +100,30 @@ opal_return:
98 mtcr r4; 100 mtcr r4;
99 rfid 101 rfid
100 102
103opal_real_call:
104 mfcr r11
105 stw r11,8(r1)
106 /* Set opal return address */
107 LOAD_REG_ADDR(r11, opal_return_realmode)
108 mtlr r11
109 li r11,MSR_LE
110 andc r12,r12,r11
111 mtspr SPRN_HSRR1,r12
112 LOAD_REG_ADDR(r11,opal)
113 ld r12,8(r11)
114 ld r2,0(r11)
115 mtspr SPRN_HSRR0,r12
116 hrfid
117
118opal_return_realmode:
119 FIXUP_ENDIAN
120 ld r2,PACATOC(r13);
121 lwz r11,8(r1);
122 ld r12,PPC_LR_STKOFF(r1)
123 mtcr r11;
124 mtlr r12
125 blr
126
101#ifdef CONFIG_TRACEPOINTS 127#ifdef CONFIG_TRACEPOINTS
102opal_tracepoint_entry: 128opal_tracepoint_entry:
103 stdu r1,-STACKFRAMESIZE(r1) 129 stdu r1,-STACKFRAMESIZE(r1)
@@ -155,36 +181,6 @@ opal_tracepoint_return:
155 blr 181 blr
156#endif 182#endif
157 183
158#define OPAL_CALL_REAL(name, token) \
159 _GLOBAL_TOC(name); \
160 mflr r0; \
161 std r0,PPC_LR_STKOFF(r1); \
162 li r0,token; \
163 mfcr r12; \
164 stw r12,8(r1); \
165 \
166 /* Set opal return address */ \
167 LOAD_REG_ADDR(r11, opal_return_realmode); \
168 mtlr r11; \
169 mfmsr r12; \
170 li r11,MSR_LE; \
171 andc r12,r12,r11; \
172 mtspr SPRN_HSRR1,r12; \
173 LOAD_REG_ADDR(r11,opal); \
174 ld r12,8(r11); \
175 ld r2,0(r11); \
176 mtspr SPRN_HSRR0,r12; \
177 hrfid
178
179opal_return_realmode:
180 FIXUP_ENDIAN
181 ld r2,PACATOC(r13);
182 lwz r11,8(r1);
183 ld r12,PPC_LR_STKOFF(r1)
184 mtcr r11;
185 mtlr r12
186 blr
187
188 184
189OPAL_CALL(opal_invalid_call, OPAL_INVALID_CALL); 185OPAL_CALL(opal_invalid_call, OPAL_INVALID_CALL);
190OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE); 186OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE);
@@ -208,7 +204,6 @@ OPAL_CALL(opal_pci_config_write_byte, OPAL_PCI_CONFIG_WRITE_BYTE);
208OPAL_CALL(opal_pci_config_write_half_word, OPAL_PCI_CONFIG_WRITE_HALF_WORD); 204OPAL_CALL(opal_pci_config_write_half_word, OPAL_PCI_CONFIG_WRITE_HALF_WORD);
209OPAL_CALL(opal_pci_config_write_word, OPAL_PCI_CONFIG_WRITE_WORD); 205OPAL_CALL(opal_pci_config_write_word, OPAL_PCI_CONFIG_WRITE_WORD);
210OPAL_CALL(opal_set_xive, OPAL_SET_XIVE); 206OPAL_CALL(opal_set_xive, OPAL_SET_XIVE);
211OPAL_CALL_REAL(opal_rm_set_xive, OPAL_SET_XIVE);
212OPAL_CALL(opal_get_xive, OPAL_GET_XIVE); 207OPAL_CALL(opal_get_xive, OPAL_GET_XIVE);
213OPAL_CALL(opal_register_exception_handler, OPAL_REGISTER_OPAL_EXCEPTION_HANDLER); 208OPAL_CALL(opal_register_exception_handler, OPAL_REGISTER_OPAL_EXCEPTION_HANDLER);
214OPAL_CALL(opal_pci_eeh_freeze_status, OPAL_PCI_EEH_FREEZE_STATUS); 209OPAL_CALL(opal_pci_eeh_freeze_status, OPAL_PCI_EEH_FREEZE_STATUS);
@@ -264,7 +259,6 @@ OPAL_CALL(opal_validate_flash, OPAL_FLASH_VALIDATE);
264OPAL_CALL(opal_manage_flash, OPAL_FLASH_MANAGE); 259OPAL_CALL(opal_manage_flash, OPAL_FLASH_MANAGE);
265OPAL_CALL(opal_update_flash, OPAL_FLASH_UPDATE); 260OPAL_CALL(opal_update_flash, OPAL_FLASH_UPDATE);
266OPAL_CALL(opal_resync_timebase, OPAL_RESYNC_TIMEBASE); 261OPAL_CALL(opal_resync_timebase, OPAL_RESYNC_TIMEBASE);
267OPAL_CALL_REAL(opal_rm_resync_timebase, OPAL_RESYNC_TIMEBASE);
268OPAL_CALL(opal_check_token, OPAL_CHECK_TOKEN); 262OPAL_CALL(opal_check_token, OPAL_CHECK_TOKEN);
269OPAL_CALL(opal_dump_init, OPAL_DUMP_INIT); 263OPAL_CALL(opal_dump_init, OPAL_DUMP_INIT);
270OPAL_CALL(opal_dump_info, OPAL_DUMP_INFO); 264OPAL_CALL(opal_dump_info, OPAL_DUMP_INFO);
@@ -280,9 +274,7 @@ OPAL_CALL(opal_sensor_read, OPAL_SENSOR_READ);
280OPAL_CALL(opal_get_param, OPAL_GET_PARAM); 274OPAL_CALL(opal_get_param, OPAL_GET_PARAM);
281OPAL_CALL(opal_set_param, OPAL_SET_PARAM); 275OPAL_CALL(opal_set_param, OPAL_SET_PARAM);
282OPAL_CALL(opal_handle_hmi, OPAL_HANDLE_HMI); 276OPAL_CALL(opal_handle_hmi, OPAL_HANDLE_HMI);
283OPAL_CALL_REAL(opal_rm_handle_hmi, OPAL_HANDLE_HMI);
284OPAL_CALL(opal_config_cpu_idle_state, OPAL_CONFIG_CPU_IDLE_STATE); 277OPAL_CALL(opal_config_cpu_idle_state, OPAL_CONFIG_CPU_IDLE_STATE);
285OPAL_CALL_REAL(opal_rm_config_cpu_idle_state, OPAL_CONFIG_CPU_IDLE_STATE);
286OPAL_CALL(opal_slw_set_reg, OPAL_SLW_SET_REG); 278OPAL_CALL(opal_slw_set_reg, OPAL_SLW_SET_REG);
287OPAL_CALL(opal_register_dump_region, OPAL_REGISTER_DUMP_REGION); 279OPAL_CALL(opal_register_dump_region, OPAL_REGISTER_DUMP_REGION);
288OPAL_CALL(opal_unregister_dump_region, OPAL_UNREGISTER_DUMP_REGION); 280OPAL_CALL(opal_unregister_dump_region, OPAL_UNREGISTER_DUMP_REGION);
@@ -304,11 +296,7 @@ OPAL_CALL(opal_pci_get_presence_state, OPAL_PCI_GET_PRESENCE_STATE);
304OPAL_CALL(opal_pci_get_power_state, OPAL_PCI_GET_POWER_STATE); 296OPAL_CALL(opal_pci_get_power_state, OPAL_PCI_GET_POWER_STATE);
305OPAL_CALL(opal_pci_set_power_state, OPAL_PCI_SET_POWER_STATE); 297OPAL_CALL(opal_pci_set_power_state, OPAL_PCI_SET_POWER_STATE);
306OPAL_CALL(opal_int_get_xirr, OPAL_INT_GET_XIRR); 298OPAL_CALL(opal_int_get_xirr, OPAL_INT_GET_XIRR);
307OPAL_CALL_REAL(opal_rm_int_get_xirr, OPAL_INT_GET_XIRR);
308OPAL_CALL(opal_int_set_cppr, OPAL_INT_SET_CPPR); 299OPAL_CALL(opal_int_set_cppr, OPAL_INT_SET_CPPR);
309OPAL_CALL(opal_int_eoi, OPAL_INT_EOI); 300OPAL_CALL(opal_int_eoi, OPAL_INT_EOI);
310OPAL_CALL_REAL(opal_rm_int_eoi, OPAL_INT_EOI);
311OPAL_CALL(opal_int_set_mfrr, OPAL_INT_SET_MFRR); 301OPAL_CALL(opal_int_set_mfrr, OPAL_INT_SET_MFRR);
312OPAL_CALL_REAL(opal_rm_int_set_mfrr, OPAL_INT_SET_MFRR);
313OPAL_CALL(opal_pci_tce_kill, OPAL_PCI_TCE_KILL); 302OPAL_CALL(opal_pci_tce_kill, OPAL_PCI_TCE_KILL);
314OPAL_CALL_REAL(opal_rm_pci_tce_kill, OPAL_PCI_TCE_KILL);
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index b07680cd2518..a897958edb88 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1962,11 +1962,6 @@ static void pnv_pci_ioda2_tce_invalidate(struct iommu_table *tbl,
1962 if (phb->model == PNV_PHB_MODEL_PHB3 && phb->regs) 1962 if (phb->model == PNV_PHB_MODEL_PHB3 && phb->regs)
1963 pnv_pci_phb3_tce_invalidate(pe, rm, shift, 1963 pnv_pci_phb3_tce_invalidate(pe, rm, shift,
1964 index, npages); 1964 index, npages);
1965 else if (rm)
1966 opal_rm_pci_tce_kill(phb->opal_id,
1967 OPAL_PCI_TCE_KILL_PAGES,
1968 pe->pe_number, 1u << shift,
1969 index << shift, npages);
1970 else 1965 else
1971 opal_pci_tce_kill(phb->opal_id, 1966 opal_pci_tce_kill(phb->opal_id,
1972 OPAL_PCI_TCE_KILL_PAGES, 1967 OPAL_PCI_TCE_KILL_PAGES,