Skip to content

Commit

Permalink
powerpc: Move the use of irq_domain_add_nomap() behind a config option
Browse files Browse the repository at this point in the history
Only a handful of old PPC systems are still using the old 'nomap'
variant of the irqdomain library. Move the associated definitions
behind a configuration option, which will allow us to make some
more radical changes.

Signed-off-by: Marc Zyngier <[email protected]>
  • Loading branch information
Marc Zyngier committed Jun 10, 2021
1 parent 1da0273 commit e37af80
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/platforms/cell/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ config PPC_IBM_CELL_BLADE
config AXON_MSI
bool
depends on PPC_IBM_CELL_BLADE && PCI_MSI
select IRQ_DOMAIN_NOMAP
default y

menu "Cell Broadband Engine options"
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/powermac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ config PPC_PMAC32_PSURGE
bool "Support for powersurge upgrade cards" if EXPERT
depends on SMP && PPC32 && PPC_PMAC
select PPC_SMP_MUXED_IPI
select IRQ_DOMAIN_NOMAP
default y
help
The powersurge cpu boards can be used in the generation
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/ps3/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config PPC_PS3
select USB_OHCI_BIG_ENDIAN_MMIO
select USB_EHCI_BIG_ENDIAN_MMIO
select HAVE_PCI
select IRQ_DOMAIN_NOMAP
help
This option enables support for the Sony PS3 game console
and other platforms using the PS3 hypervisor. Enabling this
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/sysdev/xive/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ config PPC_XIVE
bool
select PPC_SMP_MUXED_IPI
select HARDIRQS_SW_RESEND
select IRQ_DOMAIN_NOMAP

config PPC_XIVE_NATIVE
bool
Expand Down
8 changes: 6 additions & 2 deletions include/linux/irqdomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,19 @@ static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_no
{
return __irq_domain_add(of_node_to_fwnode(of_node), size, size, 0, ops, host_data);
}

#ifdef CONFIG_IRQ_DOMAIN_NOMAP
static inline struct irq_domain *irq_domain_add_nomap(struct device_node *of_node,
unsigned int max_irq,
const struct irq_domain_ops *ops,
void *host_data)
{
return __irq_domain_add(of_node_to_fwnode(of_node), 0, max_irq, max_irq, ops, host_data);
}

extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
#endif

static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node,
const struct irq_domain_ops *ops,
void *host_data)
Expand Down Expand Up @@ -408,8 +414,6 @@ static inline unsigned int irq_linear_revmap(struct irq_domain *domain,
return irq_find_mapping(domain, hwirq);
}

extern unsigned int irq_create_direct_mapping(struct irq_domain *host);

extern const struct irq_domain_ops irq_domain_simple_ops;

/* stock xlate functions */
Expand Down
5 changes: 5 additions & 0 deletions kernel/irq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ config IRQ_DOMAIN_HIERARCHY
bool
select IRQ_DOMAIN

# Support for obsolete non-mapping irq domains
config IRQ_DOMAIN_NOMAP
bool
select IRQ_DOMAIN

# Support for hierarchical fasteoi+edge and fasteoi+level handlers
config IRQ_FASTEOI_HIERARCHY_HANDLERS
bool
Expand Down
2 changes: 2 additions & 0 deletions kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ void irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
}
EXPORT_SYMBOL_GPL(irq_domain_associate_many);

#ifdef CONFIG_IRQ_DOMAIN_NOMAP
/**
* irq_create_direct_mapping() - Allocate an irq for direct mapping
* @domain: domain to allocate the irq for or NULL for default domain
Expand Down Expand Up @@ -644,6 +645,7 @@ unsigned int irq_create_direct_mapping(struct irq_domain *domain)
return virq;
}
EXPORT_SYMBOL_GPL(irq_create_direct_mapping);
#endif

/**
* irq_create_mapping_affinity() - Map a hardware interrupt into linux irq space
Expand Down

0 comments on commit e37af80

Please sign in to comment.