Commit c0215e2
powerpc/pseries: Fix MSI-X allocation failure when quota is exceeded
Nilay reported that since commit daaa574 ("powerpc/pseries/msi: Switch
to msi_create_parent_irq_domain()"), the NVMe driver cannot enable MSI-X
when the device's MSI-X table size is larger than the firmware's MSI quota
for the device.
This is because the commit changes how rtas_prepare_msi_irqs() is called:
- Before, it is called when interrupts are allocated at the global
interrupt domain with nvec_in being the number of allocated interrupts.
rtas_prepare_msi_irqs() can return a positive number and the allocation
will be retried.
- Now, it is called at the creation of per-device interrupt domain with
nvec_in being the number of interrupts that the device supports. If
rtas_prepare_msi_irqs() returns positive, domain creation just fails.
For Nilay's NVMe driver case, rtas_prepare_msi_irqs() returns a positive
number (the quota). This causes per-device interrupt domain creation to
fail and thus the NVMe driver cannot enable MSI-X.
Rework to make this scenario works again:
- pseries_msi_ops_prepare() only prepares as many interrupts as the quota
permit.
- pseries_irq_domain_alloc() fails if the device's quota is exceeded.
Now, if the quota is exceeded, pseries_msi_ops_prepare() will only prepare
as allowed by the quota. If device drivers attempt to allocate more
interrupts than the quota permits, pseries_irq_domain_alloc() will return
an error code and msi_handle_pci_fail() will allow device drivers a retry.
Reported-by: Nilay Shroff <nilay@linux.ibm.com>
Closes: https://lore.kernel.org/linuxppc-dev/6af2c4c2-97f6-4758-be33-256638ef39e5@linux.ibm.com/
Fixes: daaa574 ("powerpc/pseries/msi: Switch to msi_create_parent_irq_domain()")
Signed-off-by: Nam Cao <namcao@linutronix.de>
Cc: stable@vger.kernel.org
Tested-by: Nilay Shroff <nilay@linux.ibm.com>
Acked-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260107100230.1466093-1-namcao@linutronix.de1 parent 1471c51 commit c0215e2
1 file changed
Lines changed: 41 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
433 | 438 | | |
434 | 439 | | |
435 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
436 | 457 | | |
437 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
438 | 463 | | |
439 | 464 | | |
440 | 465 | | |
| |||
443 | 468 | | |
444 | 469 | | |
445 | 470 | | |
| 471 | + | |
446 | 472 | | |
447 | 473 | | |
448 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
449 | 478 | | |
450 | 479 | | |
451 | 480 | | |
| |||
546 | 575 | | |
547 | 576 | | |
548 | 577 | | |
| 578 | + | |
549 | 579 | | |
550 | 580 | | |
551 | 581 | | |
552 | 582 | | |
553 | 583 | | |
554 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
555 | 590 | | |
556 | 591 | | |
557 | 592 | | |
| |||
567 | 602 | | |
568 | 603 | | |
569 | 604 | | |
570 | | - | |
| 605 | + | |
571 | 606 | | |
572 | 607 | | |
| 608 | + | |
573 | 609 | | |
574 | 610 | | |
575 | 611 | | |
| |||
582 | 618 | | |
583 | 619 | | |
584 | 620 | | |
585 | | - | |
| 621 | + | |
| 622 | + | |
586 | 623 | | |
587 | 624 | | |
| 625 | + | |
588 | 626 | | |
589 | 627 | | |
590 | 628 | | |
| |||
0 commit comments