Linux generic irq handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Register an linux generic interrupt handler using an virtual irq which maps to the actual hwirq of domain to handle interrupts.

I'm having issues in handling interrupts. So far I have registered an interrupt handler based on the following kernel docuentation IRQ-domain.txt, by setting the ops and creating mapping between domain and hwirq. But unable to receive interrupts on the newly registered virtual interrupt line.

So my question's are:

  1. Am I doing something wrong in the mapping because I am not seeing any interrupts getting handled in cat /proc/interrupts.

  2. Should the request_thereaded_irq() consist of the actual hwirq and later handled in the threaded handler on virq as done in arizona.

code:
static struct irq_chip irq_chip = {
    .name                   = "CHIP-IRQ",
    .irq_disable            = noop,
    .irq_enable             = noop,
};


static int irq_map(struct irq_domain *h, unsigned int virq,
                             irq_hw_number_t hw)
{
       struct chipdata *data = ""

       irq_set_chip_and_handler(virq, &irq_chip, handle_simple_irq);
       irq_set_chip_data(virq, data);
       irq_set_noprobe(virq);

       return 0;
}

static const struct irq_domain_ops irq_domain_ops = {
       .map    = irq_map,
       .xlate  = irq_domain_xlate_twocell,
};

/* Register an interrupt domain */    `
chipdata.irq_domain = irq_domain_create_linear( fwn, 20, &irq_domain_ops, ebus);
if (!chipdata.irq_domain) {
         dev_err(ebus->bus.dev, "Failed to add core IRQ domain\n");
}

/* Create mapping between domain and hwirq*/    
virq = irq_create_mapping( chipdata.irq_domain, hwirq);

ret = request_threaded_irq( virq, interrupt, threaded_interrupt, IRQF_SHARED, KBUILD_MODNAME, ebus);
if (ret) {
         dev_err(bus->dev, "unable to grab IRQ %d, disabling device\n", virq);
         return ret;
}
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux