]> Git Repo - linux.git/commitdiff
Merge branch 'fixes' into next
authorMichael Ellerman <[email protected]>
Fri, 3 Sep 2021 12:54:12 +0000 (22:54 +1000)
committerMichael Ellerman <[email protected]>
Fri, 3 Sep 2021 12:54:12 +0000 (22:54 +1000)
Merge our fixes branch into next.

That lets us resolve a conflict in arch/powerpc/sysdev/xive/common.c.

Between cbc06f051c52 ("powerpc/xive: Do not skip CPU-less nodes when
creating the IPIs"), which moved request_irq() out of xive_init_ipis(),
and 17df41fec5b8 ("powerpc: use IRQF_NO_DEBUG for IPIs") which added
IRQF_NO_DEBUG to that request_irq() call, which has now moved.

1  2 
arch/powerpc/include/asm/ptrace.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/time.c
arch/powerpc/kernel/traps.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/sysdev/xive/common.c

index f9c235c1d6ce258a96d04b59696dff30c2bbc977,14422e85149461ac3b8a55fae85dce7ce280c6e1..6e560f035614bb06071528182626f572d782ad53
@@@ -22,7 -22,6 +22,7 @@@
  #include <linux/err.h>
  #include <uapi/asm/ptrace.h>
  #include <asm/asm-const.h>
 +#include <asm/reg.h>
  
  #ifndef __ASSEMBLY__
  struct pt_regs
                        unsigned long mq;
  #endif
                        unsigned long trap;
 -                      unsigned long dar;
 -                      unsigned long dsisr;
 +                      union {
 +                              unsigned long dar;
 +                              unsigned long dear;
 +                      };
 +                      union {
 +                              unsigned long dsisr;
 +                              unsigned long esr;
 +                      };
                        unsigned long result;
                };
        };
                unsigned long __pad[4]; /* Maintain 16 byte interrupt stack alignment */
        };
  #endif
+ #if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE)
+       struct { /* Must be a multiple of 16 bytes */
+               unsigned long mas0;
+               unsigned long mas1;
+               unsigned long mas2;
+               unsigned long mas3;
+               unsigned long mas6;
+               unsigned long mas7;
+               unsigned long srr0;
+               unsigned long srr1;
+               unsigned long csrr0;
+               unsigned long csrr1;
+               unsigned long dsrr0;
+               unsigned long dsrr1;
+       };
+ #endif
  };
  #endif
  
@@@ -188,7 -197,11 +204,7 @@@ static inline unsigned long frame_point
        return 0;
  }
  
 -#ifdef __powerpc64__
 -#define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1)
 -#else
  #define user_mode(regs) (((regs)->msr & MSR_PR) != 0)
 -#endif
  
  #define force_successful_syscall_return()   \
        do { \
@@@ -273,28 -286,6 +289,28 @@@ static inline void regs_set_return_valu
        regs->gpr[3] = rc;
  }
  
 +static inline bool cpu_has_msr_ri(void)
 +{
 +      return !IS_ENABLED(CONFIG_BOOKE) && !IS_ENABLED(CONFIG_40x);
 +}
 +
 +static inline bool regs_is_unrecoverable(struct pt_regs *regs)
 +{
 +      return unlikely(cpu_has_msr_ri() && !(regs->msr & MSR_RI));
 +}
 +
 +static inline void regs_set_recoverable(struct pt_regs *regs)
 +{
 +      if (cpu_has_msr_ri())
 +              regs_set_return_msr(regs, regs->msr | MSR_RI);
 +}
 +
 +static inline void regs_set_unrecoverable(struct pt_regs *regs)
 +{
 +      if (cpu_has_msr_ri())
 +              regs_set_return_msr(regs, regs->msr & ~MSR_RI);
 +}
 +
  #define arch_has_single_step()        (1)
  #define arch_has_block_step() (true)
  #define ARCH_HAS_USER_SINGLE_STEP_REPORT
index 8357d5fcd09edadf1cdc84bd7a6262de18f598a1,5bee245d832b10f50718fa0e5a9e4fb2a81a7fd0..e563d3222d695c3a5928ecc86bc8430de33fe878
@@@ -286,40 -286,44 +286,37 @@@ int main(void
        STACK_PT_REGS_OFFSET(_CCR, ccr);
        STACK_PT_REGS_OFFSET(_XER, xer);
        STACK_PT_REGS_OFFSET(_DAR, dar);
 +      STACK_PT_REGS_OFFSET(_DEAR, dear);
        STACK_PT_REGS_OFFSET(_DSISR, dsisr);
 +      STACK_PT_REGS_OFFSET(_ESR, esr);
        STACK_PT_REGS_OFFSET(ORIG_GPR3, orig_gpr3);
        STACK_PT_REGS_OFFSET(RESULT, result);
        STACK_PT_REGS_OFFSET(_TRAP, trap);
 -#ifndef CONFIG_PPC64
 -      /*
 -       * The PowerPC 400-class & Book-E processors have neither the DAR
 -       * nor the DSISR SPRs. Hence, we overload them to hold the similar
 -       * DEAR and ESR SPRs for such processors.  For critical interrupts
 -       * we use them to hold SRR0 and SRR1.
 -       */
 -      STACK_PT_REGS_OFFSET(_DEAR, dar);
 -      STACK_PT_REGS_OFFSET(_ESR, dsisr);
 -#else /* CONFIG_PPC64 */
 +#ifdef CONFIG_PPC64
        STACK_PT_REGS_OFFSET(SOFTE, softe);
        STACK_PT_REGS_OFFSET(_PPR, ppr);
 -#endif /* CONFIG_PPC64 */
 +#endif
  
  #ifdef CONFIG_PPC_PKEY
        STACK_PT_REGS_OFFSET(STACK_REGS_AMR, amr);
        STACK_PT_REGS_OFFSET(STACK_REGS_IAMR, iamr);
  #endif
  
- #if defined(CONFIG_PPC32)
- #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
-       DEFINE(EXC_LVL_SIZE, STACK_EXC_LVL_FRAME_SIZE);
-       DEFINE(MAS0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas0));
+ #if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE)
+       STACK_PT_REGS_OFFSET(MAS0, mas0);
        /* we overload MMUCR for 44x on MAS0 since they are mutually exclusive */
-       DEFINE(MMUCR, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas0));
-       DEFINE(MAS1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas1));
-       DEFINE(MAS2, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas2));
-       DEFINE(MAS3, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas3));
-       DEFINE(MAS6, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas6));
-       DEFINE(MAS7, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas7));
-       DEFINE(_SRR0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, srr0));
-       DEFINE(_SRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, srr1));
-       DEFINE(_CSRR0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, csrr0));
-       DEFINE(_CSRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, csrr1));
-       DEFINE(_DSRR0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, dsrr0));
-       DEFINE(_DSRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, dsrr1));
- #endif
+       STACK_PT_REGS_OFFSET(MMUCR, mas0);
+       STACK_PT_REGS_OFFSET(MAS1, mas1);
+       STACK_PT_REGS_OFFSET(MAS2, mas2);
+       STACK_PT_REGS_OFFSET(MAS3, mas3);
+       STACK_PT_REGS_OFFSET(MAS6, mas6);
+       STACK_PT_REGS_OFFSET(MAS7, mas7);
+       STACK_PT_REGS_OFFSET(_SRR0, srr0);
+       STACK_PT_REGS_OFFSET(_SRR1, srr1);
+       STACK_PT_REGS_OFFSET(_CSRR0, csrr0);
+       STACK_PT_REGS_OFFSET(_CSRR1, csrr1);
+       STACK_PT_REGS_OFFSET(_DSRR0, dsrr0);
+       STACK_PT_REGS_OFFSET(_DSRR1, dsrr1);
  #endif
  
        /* About the CPU features table */
index 77bae85e2fae9e27e231edf13de59a923e3b409a,c487ba5a6e11c386f4e7fc755e679bf1776b47d1..934d8ae66cc63b12e599a49cb1c2d04920b7a4ad
@@@ -31,7 -31,6 +31,7 @@@
  #include <linux/export.h>
  #include <linux/sched.h>
  #include <linux/sched/clock.h>
 +#include <linux/sched/cputime.h>
  #include <linux/kernel.h>
  #include <linux/param.h>
  #include <linux/string.h>
@@@ -53,6 -52,8 +53,6 @@@
  #include <linux/irq_work.h>
  #include <linux/of_clk.h>
  #include <linux/suspend.h>
 -#include <linux/sched/cputime.h>
 -#include <linux/sched/clock.h>
  #include <linux/processor.h>
  #include <asm/trace.h>
  
@@@ -585,7 -586,7 +585,7 @@@ DEFINE_INTERRUPT_HANDLER_ASYNC(timer_in
  
  #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC)
        if (atomic_read(&ppc_n_lost_interrupts) != 0)
-               do_IRQ(regs);
+               __do_IRQ(regs);
  #endif
  
        old_regs = set_irq_regs(regs);
index 3a344f5265c220c0317ebf671a85ddfebb502785,d56254f05e174be819e9b746260481c55ec8f1ef..96bec6349876af6c5c71d13c5dcbb6109f5fc3e3
  #include <linux/smp.h>
  #include <linux/console.h>
  #include <linux/kmsg_dump.h>
 +#include <linux/debugfs.h>
  
  #include <asm/emulated_ops.h>
  #include <linux/uaccess.h>
 -#include <asm/debugfs.h>
  #include <asm/interrupt.h>
  #include <asm/io.h>
  #include <asm/machdep.h>
@@@ -428,7 -428,7 +428,7 @@@ void hv_nmi_check_nonrecoverable(struc
        return;
  
  nonrecoverable:
 -      regs_set_return_msr(regs, regs->msr & ~MSR_RI);
 +      regs_set_unrecoverable(regs);
  #endif
  }
  DEFINE_INTERRUPT_HANDLER_NMI(system_reset_exception)
@@@ -498,7 -498,7 +498,7 @@@ out
                die("Unrecoverable nested System Reset", regs, SIGABRT);
  #endif
        /* Must die if the interrupt is not recoverable */
 -      if (!(regs->msr & MSR_RI)) {
 +      if (regs_is_unrecoverable(regs)) {
                /* For the reason explained in die_mce, nmi_exit before die */
                nmi_exit();
                die("Unrecoverable System Reset", regs, SIGABRT);
@@@ -550,7 -550,7 +550,7 @@@ static inline int check_io_access(struc
                        printk(KERN_DEBUG "%s bad port %lx at %p\n",
                               (*nip & 0x100)? "OUT to": "IN from",
                               regs->gpr[rb] - _IO_BASE, nip);
 -                      regs_set_return_msr(regs, regs->msr | MSR_RI);
 +                      regs_set_recoverable(regs);
                        regs_set_return_ip(regs, extable_fixup(entry));
                        return 1;
                }
  #ifdef CONFIG_PPC_ADV_DEBUG_REGS
  /* On 4xx, the reason for the machine check or program exception
     is in the ESR. */
 -#define get_reason(regs)      ((regs)->dsisr)
 +#define get_reason(regs)      ((regs)->esr)
  #define REASON_FP             ESR_FP
  #define REASON_ILLEGAL                (ESR_PIL | ESR_PUO)
  #define REASON_PRIVILEGED     ESR_PPR
@@@ -840,7 -840,7 +840,7 @@@ DEFINE_INTERRUPT_HANDLER_NMI(machine_ch
  
  bail:
        /* Must die if the interrupt is not recoverable */
 -      if (!(regs->msr & MSR_RI))
 +      if (regs_is_unrecoverable(regs))
                die_mce("Unrecoverable Machine check", regs, SIGBUS);
  
  #ifdef CONFIG_PPC_BOOK3S_64
@@@ -1104,7 -1104,7 +1104,7 @@@ DEFINE_INTERRUPT_HANDLER(RunModeExcepti
        _exception(SIGTRAP, regs, TRAP_UNK, 0);
  }
  
DEFINE_INTERRUPT_HANDLER(single_step_exception)
static void __single_step_exception(struct pt_regs *regs)
  {
        clear_single_step(regs);
        clear_br_trace(regs);
        _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
  }
  
+ DEFINE_INTERRUPT_HANDLER(single_step_exception)
+ {
+       __single_step_exception(regs);
+ }
  /*
   * After we have successfully emulated an instruction, we have to
   * check if the instruction was being single-stepped, and if so,
  static void emulate_single_step(struct pt_regs *regs)
  {
        if (single_stepping(regs))
-               single_step_exception(regs);
+               __single_step_exception(regs);
  }
  
  static inline int __parse_fpscr(unsigned long fpscr)
@@@ -1477,13 -1482,8 +1482,13 @@@ static void do_program_check(struct pt_
  
                if (!(regs->msr & MSR_PR) &&  /* not user-mode */
                    report_bug(bugaddr, regs) == BUG_TRAP_TYPE_WARN) {
 -                      regs_add_return_ip(regs, 4);
 -                      return;
 +                      const struct exception_table_entry *entry;
 +
 +                      entry = search_exception_tables(bugaddr);
 +                      if (entry) {
 +                              regs_set_return_ip(regs, extable_fixup(entry) + regs->nip - bugaddr);
 +                              return;
 +                      }
                }
                _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
                return;
@@@ -2272,7 -2272,7 +2277,7 @@@ static int __init ppc_warn_emulated_ini
        struct ppc_emulated_entry *entries = (void *)&ppc_emulated;
  
        dir = debugfs_create_dir("emulated_instructions",
 -                               powerpc_debugfs_root);
 +                               arch_debugfs_dir);
  
        debugfs_create_u32("do_warn", 0644, dir, &ppc_warn_emulated);
  
index 35724caf8a835875f80556022dbb18ff96926f95,0dfaa6ab44cc51294c137653143497ab308756a5..f79126f16258a502ccbb0a23ca7ceb4984327817
@@@ -77,7 -77,7 +77,7 @@@
  #include "../../../../drivers/pci/pci.h"
  
  DEFINE_STATIC_KEY_FALSE(shared_processor);
- EXPORT_SYMBOL_GPL(shared_processor);
+ EXPORT_SYMBOL(shared_processor);
  
  int CMO_PrPSP = -1;
  int CMO_SecPSP = -1;
@@@ -486,8 -486,6 +486,8 @@@ static void __init pSeries_discover_phb
  
                /* create pci_dn's for DT nodes under this PHB */
                pci_devs_phb_init_dynamic(phb);
 +
 +              pseries_msi_allocate_domains(phb);
        }
  
        of_node_put(root);
@@@ -541,9 -539,10 +541,10 @@@ static void init_cpu_char_feature_flags
         * H_CPU_BEHAV_FAVOUR_SECURITY_H could be set only if
         * H_CPU_BEHAV_FAVOUR_SECURITY is.
         */
-       if (!(result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY))
+       if (!(result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY)) {
                security_ftr_clear(SEC_FTR_FAVOUR_SECURITY);
-       else if (result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY_H)
+               pseries_security_flavor = 0;
+       } else if (result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY_H)
                pseries_security_flavor = 1;
        else
                pseries_security_flavor = 2;
index 458645c7a72bf3f8f5ad010e0da2e510fa69e1f5,8183ca343675a4c3c90ca806fddd6d3fc5d2c6dd..c732ce5a3e1a500746feb41649d78b8a164ae354
@@@ -21,6 -21,7 +21,6 @@@
  #include <linux/msi.h>
  #include <linux/vmalloc.h>
  
 -#include <asm/debugfs.h>
  #include <asm/prom.h>
  #include <asm/io.h>
  #include <asm/smp.h>
@@@ -66,6 -67,7 +66,7 @@@ static struct irq_domain *xive_irq_doma
  static struct xive_ipi_desc {
        unsigned int irq;
        char name[16];
+       atomic_t started;
  } *xive_ipis;
  
  /*
@@@ -311,10 -313,11 +312,10 @@@ void xmon_xive_get_irq_all(void
        struct irq_desc *desc;
  
        for_each_irq_desc(i, desc) {
 -              struct irq_data *d = irq_desc_get_irq_data(desc);
 -              unsigned int hwirq = (unsigned int)irqd_to_hwirq(d);
 +              struct irq_data *d = irq_domain_get_irq_data(xive_irq_domain, i);
  
 -              if (d->domain == xive_irq_domain)
 -                      xmon_xive_get_irq_config(hwirq, d);
 +              if (d)
 +                      xmon_xive_get_irq_config(irqd_to_hwirq(d), d);
        }
  }
  
@@@ -614,6 -617,16 +615,6 @@@ static unsigned int xive_irq_startup(st
        pr_devel("xive_irq_startup: irq %d [0x%x] data @%p\n",
                 d->irq, hw_irq, d);
  
 -#ifdef CONFIG_PCI_MSI
 -      /*
 -       * The generic MSI code returns with the interrupt disabled on the
 -       * card, using the MSI mask bits. Firmware doesn't appear to unmask
 -       * at that level, so we do it here by hand.
 -       */
 -      if (irq_data_get_msi_desc(d))
 -              pci_msi_unmask_irq(d);
 -#endif
 -
        /* Pick a target */
        target = xive_pick_irq_target(d, irq_data_get_affinity_mask(d));
        if (target == XIVE_INVALID_TARGET) {
@@@ -701,12 -714,16 +702,12 @@@ static int xive_irq_set_affinity(struc
        u32 target, old_target;
        int rc = 0;
  
 -      pr_devel("xive_irq_set_affinity: irq %d\n", d->irq);
 +      pr_debug("%s: irq %d/%x\n", __func__, d->irq, hw_irq);
  
        /* Is this valid ? */
        if (cpumask_any_and(cpumask, cpu_online_mask) >= nr_cpu_ids)
                return -EINVAL;
  
 -      /* Don't do anything if the interrupt isn't started */
 -      if (!irqd_is_started(d))
 -              return IRQ_SET_MASK_OK;
 -
        /*
         * If existing target is already in the new mask, and is
         * online then do nothing.
                return rc;
        }
  
 -      pr_devel("  target: 0x%x\n", target);
 +      pr_debug("  target: 0x%x\n", target);
        xd->target = target;
  
        /* Give up previous target */
@@@ -973,8 -990,6 +974,8 @@@ EXPORT_SYMBOL_GPL(is_xive_irq)
  
  void xive_cleanup_irq_data(struct xive_irq_data *xd)
  {
 +      pr_debug("%s for HW %x\n", __func__, xd->hw_irq);
 +
        if (xd->eoi_mmio) {
                iounmap(xd->eoi_mmio);
                if (xd->eoi_mmio == xd->trig_mmio)
@@@ -1016,7 -1031,7 +1017,7 @@@ static int xive_irq_alloc_data(unsigne
        return 0;
  }
  
 -static void xive_irq_free_data(unsigned int virq)
 +void xive_irq_free_data(unsigned int virq)
  {
        struct xive_irq_data *xd = irq_get_handler_data(virq);
  
        xive_cleanup_irq_data(xd);
        kfree(xd);
  }
 +EXPORT_SYMBOL_GPL(xive_irq_free_data);
  
  #ifdef CONFIG_SMP
  
@@@ -1107,7 -1121,7 +1108,7 @@@ static const struct irq_domain_ops xive
        .alloc  = xive_ipi_irq_domain_alloc,
  };
  
- static int __init xive_request_ipi(void)
+ static int __init xive_init_ipis(void)
  {
        struct fwnode_handle *fwnode;
        struct irq_domain *ipi_domain;
                struct xive_ipi_desc *xid = &xive_ipis[node];
                struct xive_ipi_alloc_info info = { node };
  
-               /* Skip nodes without CPUs */
-               if (cpumask_empty(cpumask_of_node(node)))
-                       continue;
                /*
                 * Map one IPI interrupt per node for all cpus of that node.
                 * Since the HW interrupt number doesn't have any meaning,
                xid->irq = ret;
  
                snprintf(xid->name, sizeof(xid->name), "IPI-%d", node);
-               ret = request_irq(xid->irq, xive_muxed_ipi_action,
-                                 IRQF_NO_DEBUG | IRQF_PERCPU | IRQF_NO_THREAD,
-                                 xid->name, NULL);
-               WARN(ret < 0, "Failed to request IPI %d: %d\n", xid->irq, ret);
        }
  
        return ret;
        return ret;
  }
  
 -                        IRQF_PERCPU | IRQF_NO_THREAD,
+ static int xive_request_ipi(unsigned int cpu)
+ {
+       struct xive_ipi_desc *xid = &xive_ipis[early_cpu_to_node(cpu)];
+       int ret;
+       if (atomic_inc_return(&xid->started) > 1)
+               return 0;
+       ret = request_irq(xid->irq, xive_muxed_ipi_action,
++                        IRQF_NO_DEBUG | IRQF_PERCPU | IRQF_NO_THREAD,
+                         xid->name, NULL);
+       WARN(ret < 0, "Failed to request IPI %d: %d\n", xid->irq, ret);
+       return ret;
+ }
  static int xive_setup_cpu_ipi(unsigned int cpu)
  {
        unsigned int xive_ipi_irq = xive_ipi_cpu_to_irq(cpu);
        if (xc->hw_ipi != XIVE_BAD_IRQ)
                return 0;
  
+       /* Register the IPI */
+       xive_request_ipi(cpu);
        /* Grab an IPI from the backend, this will populate xc->hw_ipi */
        if (xive_ops->get_ipi(cpu, xc))
                return -EIO;
@@@ -1219,6 -1242,8 +1229,8 @@@ static void xive_cleanup_cpu_ipi(unsign
        if (xc->hw_ipi == XIVE_BAD_IRQ)
                return;
  
+       /* TODO: clear IPI mapping */
        /* Mask the IPI */
        xive_do_source_set_mask(&xc->ipi_data, true);
  
@@@ -1241,7 -1266,7 +1253,7 @@@ void __init xive_smp_probe(void
        smp_ops->cause_ipi = xive_cause_ipi;
  
        /* Register the IPI */
-       xive_request_ipi();
+       xive_init_ipis();
  
        /* Allocate and setup IPI for the boot CPU */
        xive_setup_cpu_ipi(smp_processor_id());
@@@ -1354,71 -1379,7 +1366,71 @@@ static void xive_irq_domain_debug_show(
  }
  #endif
  
 +#ifdef        CONFIG_IRQ_DOMAIN_HIERARCHY
 +static int xive_irq_domain_translate(struct irq_domain *d,
 +                                   struct irq_fwspec *fwspec,
 +                                   unsigned long *hwirq,
 +                                   unsigned int *type)
 +{
 +      return xive_irq_domain_xlate(d, to_of_node(fwspec->fwnode),
 +                                   fwspec->param, fwspec->param_count,
 +                                   hwirq, type);
 +}
 +
 +static int xive_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
 +                               unsigned int nr_irqs, void *arg)
 +{
 +      struct irq_fwspec *fwspec = arg;
 +      irq_hw_number_t hwirq;
 +      unsigned int type = IRQ_TYPE_NONE;
 +      int i, rc;
 +
 +      rc = xive_irq_domain_translate(domain, fwspec, &hwirq, &type);
 +      if (rc)
 +              return rc;
 +
 +      pr_debug("%s %d/%lx #%d\n", __func__, virq, hwirq, nr_irqs);
 +
 +      for (i = 0; i < nr_irqs; i++) {
 +              /* TODO: call xive_irq_domain_map() */
 +
 +              /*
 +               * Mark interrupts as edge sensitive by default so that resend
 +               * actually works. Will fix that up below if needed.
 +               */
 +              irq_clear_status_flags(virq, IRQ_LEVEL);
 +
 +              /* allocates and sets handler data */
 +              rc = xive_irq_alloc_data(virq + i, hwirq + i);
 +              if (rc)
 +                      return rc;
 +
 +              irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
 +                                            &xive_irq_chip, domain->host_data);
 +              irq_set_handler(virq + i, handle_fasteoi_irq);
 +      }
 +
 +      return 0;
 +}
 +
 +static void xive_irq_domain_free(struct irq_domain *domain,
 +                               unsigned int virq, unsigned int nr_irqs)
 +{
 +      int i;
 +
 +      pr_debug("%s %d #%d\n", __func__, virq, nr_irqs);
 +
 +      for (i = 0; i < nr_irqs; i++)
 +              xive_irq_free_data(virq + i);
 +}
 +#endif
 +
  static const struct irq_domain_ops xive_irq_domain_ops = {
 +#ifdef        CONFIG_IRQ_DOMAIN_HIERARCHY
 +      .alloc  = xive_irq_domain_alloc,
 +      .free   = xive_irq_domain_free,
 +      .translate = xive_irq_domain_translate,
 +#endif
        .match = xive_irq_domain_match,
        .map = xive_irq_domain_map,
        .unmap = xive_irq_domain_unmap,
@@@ -1756,9 -1717,9 +1768,9 @@@ static int xive_core_debug_show(struct 
                xive_debug_show_cpu(m, cpu);
  
        for_each_irq_desc(i, desc) {
 -              struct irq_data *d = irq_desc_get_irq_data(desc);
 +              struct irq_data *d = irq_domain_get_irq_data(xive_irq_domain, i);
  
 -              if (d->domain == xive_irq_domain)
 +              if (d)
                        xive_debug_show_irq(m, d);
        }
        return 0;
@@@ -1768,7 -1729,7 +1780,7 @@@ DEFINE_SHOW_ATTRIBUTE(xive_core_debug)
  int xive_core_debug_init(void)
  {
        if (xive_enabled())
 -              debugfs_create_file("xive", 0400, powerpc_debugfs_root,
 +              debugfs_create_file("xive", 0400, arch_debugfs_dir,
                                    NULL, &xive_core_debug_fops);
        return 0;
  }
This page took 0.153613 seconds and 4 git commands to generate.