Despite the name, handle_domain_irq() deals with non-irqdomain handling for the sake of a handful of legacy ARM platforms. Move such handling into ARM's handle_IRQ(), allowing for better code generation for everyone else. This allows us get rid of some complexity, and to rearrange the guards on the various helpers in a more logical way.
Showing the changes to kernel (1 of 3 files). Show all
Unified · Split
| @@ -659,7 +659,7 @@ int generic_handle_irq(unsigned int irq) · 658 unmodified lines | ||
| 659 | 659 | } |
| 660 | 660 | EXPORT_SYMBOL_GPL(generic_handle_irq); |
| 661 | 661 | |
| 662 | −#ifdef CONFIG_HANDLE_DOMAIN_IRQ | |
| 662 | +#ifdef CONFIG_IRQ_DOMAIN | |
| 663 | 663 | /** |
| 664 | 664 | * generic_handle_domain_irq - Invoke the handler for a HW irq belonging |
| 665 | 665 | * to a domain, usually for a non-root interrupt |
| @@ -676,9 +676,10 @@ int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq) · 10 unmodified lines | ||
| 676 | 676 | } |
| 677 | 677 | EXPORT_SYMBOL_GPL(generic_handle_domain_irq); |
| 678 | 678 | |
| 679 | +#ifdef CONFIG_HANDLE_DOMAIN_IRQ | |
| 679 | 680 | /** |
| 680 | − * __handle_domain_irq - Invoke the handler for a HW irq belonging to a domain, | |
| 681 | − * usually for a root interrupt controller | |
| 681 | + * handle_domain_irq - Invoke the handler for a HW irq belonging to a domain, | |
| 682 | + * usually for a root interrupt controller | |
| 682 | 683 | * @domain: The domain where to perform the lookup |
| 683 | 684 | * @hwirq: The HW irq number to convert to a logical one |
| 684 | 685 | * @lookup: Whether to perform the domain lookup or not |
| @@ -686,8 +687,8 @@ EXPORT_SYMBOL_GPL(generic_handle_domain_irq); · 1 unmodified line | ||
| 686 | 687 | * |
| 687 | 688 | * Returns: 0 on success, or -EINVAL if conversion has failed |
| 688 | 689 | */ |
| 689 | −int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, | |
| 690 | − bool lookup, struct pt_regs *regs) | |
| 690 | +int handle_domain_irq(struct irq_domain *domain, | |
| 691 | + unsigned int hwirq, struct pt_regs *regs) | |
| 691 | 692 | { |
| 692 | 693 | struct pt_regs *old_regs = set_irq_regs(regs); |
| 693 | 694 | struct irq_desc *desc; |
| @@ -695,22 +696,8 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, · 1 unmodified line | ||
| 695 | 696 | |
| 696 | 697 | irq_enter(); |
| 697 | 698 | |
| 698 | − if (likely(IS_ENABLED(CONFIG_IRQ_DOMAIN) && lookup)) { | |
| 699 | − /* The irqdomain code provides boundary checks */ | |
| 700 | − desc = irq_resolve_mapping(domain, hwirq); | |
| 701 | − } else { | |
| 702 | − /* | |
| 703 | − * Some hardware gives randomly wrong interrupts. Rather | |
| 704 | − * than crashing, do something sensible. | |
| 705 | − */ | |
| 706 | − if (unlikely(!hwirq || hwirq >= nr_irqs)) { | |
| 707 | − ack_bad_irq(hwirq); | |
| 708 | − desc = NULL; | |
| 709 | − } else { | |
| 710 | − desc = irq_to_desc(hwirq); | |
| 711 | − } | |
| 712 | − } | |
| 713 | − | |
| 699 | + /* The irqdomain code provides boundary checks */ | |
| 700 | + desc = irq_resolve_mapping(domain, hwirq); | |
| 714 | 701 | if (likely(desc)) |
| 715 | 702 | handle_irq_desc(desc); |
| 716 | 703 | else |
| @@ -721,7 +708,6 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, · 4 unmodified lines | ||
| 721 | 708 | return ret; |
| 722 | 709 | } |
| 723 | 710 | |
| 724 | −#ifdef CONFIG_IRQ_DOMAIN | |
| 725 | 711 | /** |
| 726 | 712 | * handle_domain_nmi - Invoke the handler for a HW irq belonging to a domain |
| 727 | 713 | * @domain: The domain where to perform the lookup |