[PATCH v4 2/4] irqchip/ast2700-intc: Add AST2700-A2 support

Ryan Chen ryan_chen at aspeedtech.com
Tue Mar 31 23:49:07 PDT 2026


> Subject: Re: [PATCH v4 2/4] irqchip/ast2700-intc: Add AST2700-A2 support
> 
> On Mon, Mar 30 2026 at 14:32, Ryan Chen wrote:
> > +static int resolve_parent_range_for_output(const struct aspeed_intc0
> *intc0,
> > +					   const struct fwnode_handle *parent,
> > +					   u32 output,
> > +					   struct aspeed_intc_interrupt_range *resolved)
> 
> Please reduce the number of line breaks. You still have 100 characters.
Will update
static int resolve_parent_range_for_output(const struct aspeed_intc0 *intc0,
					   const struct fwnode_handle *parent, u32 output,
					   struct aspeed_intc_interrupt_range *resolved)
> 
> > +{
> > +	for (size_t i = 0; i < intc0->ranges.nranges; i++) {
> > +		struct aspeed_intc_interrupt_range range =
> > +			intc0->ranges.ranges[i];
> 
> No line break required.
Will update
struct aspeed_intc_interrupt_range range = intc0->ranges.ranges[i];
> 
> > +static int aspeed_intc1_irq_domain_activate(struct irq_domain *domain,
> > +					    struct irq_data *data, bool reserve) {
> > +	struct aspeed_intc1 *intc1 = irq_data_get_irq_chip_data(data);
> > +	struct aspeed_intc_interrupt_range resolved;
> > +	int rc, bank, bit;
> > +	u32 mask;
> > +
> > +	if (WARN_ON_ONCE((data->hwirq >> INTC1_ROUTE_SHIFT) >=
> ARRAY_SIZE(aspeed_intc1_routes)))
> > +		return -EINVAL;
> > +
> > +	/*
> > +	 * outpin may be an error if the upstream is the BootMCU APLIC node, or
> > +	 * anything except a valid intc0 driver instance
> > +	 */
> > +	rc = aspeed_intc0_resolve_route(intc1->upstream, INTC1_ROUTE_NUM,
> > +					aspeed_intc1_routes[data->hwirq >>
> INTC1_ROUTE_SHIFT],
> > +					intc1->ranges.nranges,
> > +					intc1->ranges.ranges, &resolved);
> 
> Please test your code with CONFIG_PROVE_LOCKING=y, which is mandatory
> for submission according to documentation.
> 
> This is invoked with the interrupt descriptor lock held and interrupts disabled.
> 
>        aspeed_intc0_resolve_route()
>                 ....
>                 irq_find_matching_fwspec()
>                 	mutex_lock(&irq_domain_mutex); <---- FAIL
> 
Thank you point out the issue.

I plan to cache the irq_domain pointer in each aspeed_intc_interrupt_range 
entry at populate time. 

Add a domain field to struct aspeed_intc_interrupt_range in irq-ast2700.h
In aspeed_intc_populate_ranges() (irq-ast2700.c), call irq_find_matching_fwspec() 
once per range entry and store the result in r->domain. 
This runs in probe context, so taking irq_domain_mutex is safe.

In aspeed_intc0_resolve_route() (irq-ast2700-intc0.c), replace the 
irq_find_matching_fwspec() call with a direct comparison against c1r.domain.

In aspeed_intc1_request_interrupts() (irq-ast2700-intc1.c), 
likewise replace irq_find_matching_fwspec() with a comparison against r->domain.




More information about the linux-riscv mailing list