Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'powerpc-4.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
- opal-irqchip: Fix double endian conversion from Alistair Popple
- cxl: Set endianess of kernel contexts from Frederic Barrat
- sbc8641: drop bogus PHY IRQ entries from DTS file from Paul Gortmaker
- Revert "powerpc/eeh: Don't unfreeze PHB PE after reset" from Andrew
Donnellan

* tag 'powerpc-4.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
Revert "powerpc/eeh: Don't unfreeze PHB PE after reset"
powerpc/sbc8641: drop bogus PHY IRQ entries from DTS file
cxl: Set endianess of kernel contexts
powerpc/opal-irqchip: Fix double endian conversion

+34 -48
-8
arch/powerpc/boot/dts/sbc8641d.dts
··· 227 227 reg = <0x520 0x20>; 228 228 229 229 phy0: ethernet-phy@1f { 230 - interrupt-parent = <&mpic>; 231 - interrupts = <10 1>; 232 230 reg = <0x1f>; 233 231 }; 234 232 phy1: ethernet-phy@0 { 235 - interrupt-parent = <&mpic>; 236 - interrupts = <10 1>; 237 233 reg = <0>; 238 234 }; 239 235 phy2: ethernet-phy@1 { 240 - interrupt-parent = <&mpic>; 241 - interrupts = <10 1>; 242 236 reg = <1>; 243 237 }; 244 238 phy3: ethernet-phy@2 { 245 - interrupt-parent = <&mpic>; 246 - interrupts = <10 1>; 247 239 reg = <2>; 248 240 }; 249 241 tbi0: tbi-phy@11 {
+4 -10
arch/powerpc/kernel/eeh_driver.c
··· 590 590 eeh_ops->configure_bridge(pe); 591 591 eeh_pe_restore_bars(pe); 592 592 593 - /* 594 - * If it's PHB PE, the frozen state on all available PEs should have 595 - * been cleared by the PHB reset. Otherwise, we unfreeze the PE and its 596 - * child PEs because they might be in frozen state. 597 - */ 598 - if (!(pe->type & EEH_PE_PHB)) { 599 - rc = eeh_clear_pe_frozen_state(pe, false); 600 - if (rc) 601 - return rc; 602 - } 593 + /* Clear frozen state */ 594 + rc = eeh_clear_pe_frozen_state(pe, false); 595 + if (rc) 596 + return rc; 603 597 604 598 /* Give the system 5 seconds to finish running the user-space 605 599 * hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,
+29 -29
arch/powerpc/platforms/powernv/opal-irqchip.c
··· 43 43 static unsigned int *opal_irqs; 44 44 45 45 static void opal_handle_irq_work(struct irq_work *work); 46 - static __be64 last_outstanding_events; 46 + static u64 last_outstanding_events; 47 47 static struct irq_work opal_event_irq_work = { 48 48 .func = opal_handle_irq_work, 49 49 }; 50 + 51 + void opal_handle_events(uint64_t events) 52 + { 53 + int virq, hwirq = 0; 54 + u64 mask = opal_event_irqchip.mask; 55 + 56 + if (!in_irq() && (events & mask)) { 57 + last_outstanding_events = events; 58 + irq_work_queue(&opal_event_irq_work); 59 + return; 60 + } 61 + 62 + while (events & mask) { 63 + hwirq = fls64(events) - 1; 64 + if (BIT_ULL(hwirq) & mask) { 65 + virq = irq_find_mapping(opal_event_irqchip.domain, 66 + hwirq); 67 + if (virq) 68 + generic_handle_irq(virq); 69 + } 70 + events &= ~BIT_ULL(hwirq); 71 + } 72 + } 50 73 51 74 static void opal_event_mask(struct irq_data *d) 52 75 { ··· 78 55 79 56 static void opal_event_unmask(struct irq_data *d) 80 57 { 58 + __be64 events; 59 + 81 60 set_bit(d->hwirq, &opal_event_irqchip.mask); 82 61 83 - opal_poll_events(&last_outstanding_events); 84 - if (last_outstanding_events & opal_event_irqchip.mask) 85 - /* Need to retrigger the interrupt */ 86 - irq_work_queue(&opal_event_irq_work); 62 + opal_poll_events(&events); 63 + opal_handle_events(be64_to_cpu(events)); 87 64 } 88 65 89 66 static int opal_event_set_type(struct irq_data *d, unsigned int flow_type) ··· 119 96 return 0; 120 97 } 121 98 122 - void opal_handle_events(uint64_t events) 123 - { 124 - int virq, hwirq = 0; 125 - u64 mask = opal_event_irqchip.mask; 126 - 127 - if (!in_irq() && (events & mask)) { 128 - last_outstanding_events = events; 129 - irq_work_queue(&opal_event_irq_work); 130 - return; 131 - } 132 - 133 - while (events & mask) { 134 - hwirq = fls64(events) - 1; 135 - if (BIT_ULL(hwirq) & mask) { 136 - virq = irq_find_mapping(opal_event_irqchip.domain, 137 - hwirq); 138 - if (virq) 139 - generic_handle_irq(virq); 140 - } 141 - events &= ~BIT_ULL(hwirq); 142 - } 143 - } 144 - 145 99 static irqreturn_t opal_interrupt(int irq, void *data) 146 100 { 147 101 __be64 events; ··· 131 131 132 132 static void opal_handle_irq_work(struct irq_work *work) 133 133 { 134 - opal_handle_events(be64_to_cpu(last_outstanding_events)); 134 + opal_handle_events(last_outstanding_events); 135 135 } 136 136 137 137 static int opal_event_match(struct irq_domain *h, struct device_node *node,
+1 -1
drivers/misc/cxl/native.c
··· 497 497 { 498 498 u64 sr = 0; 499 499 500 + set_endian(sr); 500 501 if (ctx->master) 501 502 sr |= CXL_PSL_SR_An_MP; 502 503 if (mfspr(SPRN_LPCR) & LPCR_TC) ··· 507 506 sr |= CXL_PSL_SR_An_HV; 508 507 } else { 509 508 sr |= CXL_PSL_SR_An_PR | CXL_PSL_SR_An_R; 510 - set_endian(sr); 511 509 sr &= ~(CXL_PSL_SR_An_HV); 512 510 if (!test_tsk_thread_flag(current, TIF_32BIT)) 513 511 sr |= CXL_PSL_SR_An_SF;