.. | .. |
---|
2442 | 2442 | |
---|
2443 | 2443 | unsigned int arch_dynirq_lower_bound(unsigned int from) |
---|
2444 | 2444 | { |
---|
| 2445 | + unsigned int ret; |
---|
| 2446 | + |
---|
2445 | 2447 | /* |
---|
2446 | 2448 | * dmar_alloc_hwirq() may be called before setup_IO_APIC(), so use |
---|
2447 | 2449 | * gsi_top if ioapic_dynirq_base hasn't been initialized yet. |
---|
2448 | 2450 | */ |
---|
2449 | | - if (!ioapic_initialized) |
---|
2450 | | - return gsi_top; |
---|
| 2451 | + ret = ioapic_dynirq_base ? : gsi_top; |
---|
| 2452 | + |
---|
2451 | 2453 | /* |
---|
2452 | | - * For DT enabled machines ioapic_dynirq_base is irrelevant and not |
---|
2453 | | - * updated. So simply return @from if ioapic_dynirq_base == 0. |
---|
| 2454 | + * For DT enabled machines ioapic_dynirq_base is irrelevant and |
---|
| 2455 | + * always 0. gsi_top can be 0 if there is no IO/APIC registered. |
---|
| 2456 | + * 0 is an invalid interrupt number for dynamic allocations. Return |
---|
| 2457 | + * @from instead. |
---|
2454 | 2458 | */ |
---|
2455 | | - return ioapic_dynirq_base ? : from; |
---|
| 2459 | + return ret ? : from; |
---|
2456 | 2460 | } |
---|
2457 | 2461 | |
---|
2458 | 2462 | #ifdef CONFIG_X86_32 |
---|