<div dir="ltr">
<div>
<div class="gmail-post-text">
<p><strong>Register an <em>linux generic interrupt handler</em> using an virtual irq which maps to the actual hwirq of domain to handle interrupts.</strong></p>
<p>I'm having issues in handling interrupts. So far I have registered an
interrupt handler based on the following kernel docuentation <a href="https://www.kernel.org/doc/Documentation/IRQ-domain.txt" rel="nofollow noreferrer">IRQ-domain.txt</a>,
by setting the ops and creating mapping between domain and hwirq. But
unable to receive interrupts on the newly registered virtual interrupt
line. </p>
<p>So my question's are: </p>
<ol><li><p>Am I doing something wrong in the mapping because I am not seeing any interrupts getting handled in cat /proc/interrupts.</p></li><li><p>Should the request_thereaded_irq() consist of the actual hwirq
and later handled in the threaded handler on virq as done in arizona.</p></li></ol><div><b>code:</b><br></div><div><pre><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 = h->host_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;
}</code></pre></div></div></div></div>