Part Number: TCI6638K2K
Hi,
We are experiencing similar issue per
https://e2e.ti.com/support/processors/f/791/t/869104
Has this issue been resolved? If so, please advice your solution to the problem.
Thanks.
Konny
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TCI6638K2K
Hi,
We are experiencing similar issue per
https://e2e.ti.com/support/processors/f/791/t/869104
Has this issue been resolved? If so, please advice your solution to the problem.
Thanks.
Konny
Hi Rex,
The GPIO interrupt missing issue after kernel upgrade to 4.19.94-rt39 can be resolved by code modification as show below.
The function of interest, irq_create_fwspec_mapping(), is in /kernel/irq/irqdomain.c; and the code changed is toward the end of the function (in red).
I would like to have your comment on the code change; specifically, would like to know is there more proper way of addressing this issue.
unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
{
struct irq_domain *domain;
struct irq_data *irq_data;
irq_hw_number_t hwirq;
unsigned int type = IRQ_TYPE_NONE;
int virq;
if (fwspec->fwnode) {
domain = irq_find_matching_fwspec(fwspec, DOMAIN_BUS_WIRED);
if (!domain)
domain = irq_find_matching_fwspec(fwspec, DOMAIN_BUS_ANY);
} else {
domain = irq_default_domain;
}
if (!domain) {
pr_warn("no irq domain found for %s !\n",
of_node_full_name(to_of_node(fwspec->fwnode)));
return 0;
}
if (irq_domain_translate(domain, fwspec, &hwirq, &type))
return 0;
/*
* WARN if the irqchip returns a type with bits
* outside the sense mask set and clear these bits.
*/
if (WARN_ON(type & ~IRQ_TYPE_SENSE_MASK))
type &= IRQ_TYPE_SENSE_MASK;
/*
* If we've already configured this interrupt,
* don't do it again, or hell will break loose.
*/
virq = irq_find_mapping(domain, hwirq);
if (virq) {
/*
* If the trigger type is not specified or matches the
* current trigger type then we are done so return the
* interrupt number.
*/
if (type == IRQ_TYPE_NONE || type == irq_get_trigger_type(virq))
return virq;
/*
* If the trigger type has not been set yet, then set
* it now and return the interrupt number.
*/
if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) {
irq_data = irq_get_irq_data(virq);
if (!irq_data)
return 0;
irqd_set_trigger_type(irq_data, type);
return virq;
}
pr_warn("type mismatch, failed to map hwirq-%lu for %s!\n",
hwirq, of_node_full_name(to_of_node(fwspec->fwnode)));
return 0;
}
if (irq_domain_is_hierarchy(domain)) {
virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, fwspec);
if (virq <= 0)
return 0;
} else {
/* Create mapping */
virq = irq_create_mapping(domain, hwirq);
if (!virq)
return virq;
}
irq_data = irq_get_irq_data(virq);
if (!irq_data) {
if (irq_domain_is_hierarchy(domain))
irq_domain_free_irqs(virq, 1);
else
irq_dispose_mapping(virq);
return 0;
}
#ifndef CONFIG_GPIO_TARANA_EPLD
/* Store trigger type */
irqd_set_trigger_type(irq_data, type);
#else
/* for Tarana B10, update the GIC config register now */
irq_set_irq_type(virq, type);
#endif
return virq;
}
EXPORT_SYMBOL_GPL(irq_create_fwspec_mapping);
Thanks.
Konny