Commit 565d065
ata: ahci: simplify init function
This patch moves all the IRQ vector allocations into a single
function. Instead of having the allocations spread out over
two separate call sites everything will be handled in ahci_init_irq.
Also a direct call into pci(m)_intx will be removed.
The main part of this change is done by adding a PCI_IRQ_INTX flag into
an already existing pci_alloc_irq_vectors invocation.
In the current implementation of the pci_alloc_irq_vectors is the sequence
of calls msi-x -> msi -> legacy irq and whatever there succeeds stops the
call chain. That makes it impossible to merge all instances into as
a single call to pci_alloc_irq_vectors since the order of calls there is:
multiple msi-x
a single msi
a single msi-x
a legacy irq.
The two last steps can be merged into a single one which are
the msi-x and legacy irq option.
When PCI_IRQ_INTX flag is set the pci_alloc_irq_vectors succeeds in almost
all cases - that makes it possible to convert ahci_init_irq(msi) into
a void function. The exception is when dev->irq is zero then the
pci_alloc_irq_vectors may return with an error code also pci_intx isn't
called from pci_alloc_irq_vectors and thus certain pci calls aren't
performed.
That's just a negligible issue as later in ahci_init_one the (zero)
value of dev->irq is via pci_irq_vector assigned to hpriv->irq.
That value is then later tested in ahci_host_activate->ata_host_activate
where it is welcomed with a WARN_ON message and fails with setting up
irq and then the probe function (ahci_init_one) fails.
The special zero value's meaning is that polling mode is being be set
up which isn't the case.
No functional change.
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Link: https://lore.kernel.org/r/20250319155030.16410-1-thenzl@redhat.com
Signed-off-by: Niklas Cassel <cassel@kernel.org>1 parent 0507c77 commit 565d065
1 file changed
+12
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1676 | 1676 | | |
1677 | 1677 | | |
1678 | 1678 | | |
1679 | | - | |
| 1679 | + | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
1684 | | - | |
1685 | | - | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
1686 | 1688 | | |
1687 | 1689 | | |
1688 | 1690 | | |
| |||
1696 | 1698 | | |
1697 | 1699 | | |
1698 | 1700 | | |
1699 | | - | |
| 1701 | + | |
1700 | 1702 | | |
1701 | 1703 | | |
1702 | 1704 | | |
| |||
1711 | 1713 | | |
1712 | 1714 | | |
1713 | 1715 | | |
1714 | | - | |
| 1716 | + | |
| 1717 | + | |
1715 | 1718 | | |
1716 | 1719 | | |
1717 | 1720 | | |
1718 | | - | |
1719 | | - | |
| 1721 | + | |
| 1722 | + | |
1720 | 1723 | | |
1721 | 1724 | | |
1722 | 1725 | | |
| |||
1996 | 1999 | | |
1997 | 2000 | | |
1998 | 2001 | | |
1999 | | - | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
| 2002 | + | |
| 2003 | + | |
2003 | 2004 | | |
2004 | 2005 | | |
2005 | 2006 | | |
| |||
0 commit comments