diff options
author | Brice Goglin <brice@myri.com> | 2006-05-23 03:05:27 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 15:00:00 -0400 |
commit | 1edab4a164b229807853682f7ff7858c11dd3481 (patch) | |
tree | b2b65bb914850270f5e22f9b4c49ef371c0f20b6 /drivers/pci/msi.c | |
parent | 74d0a988d3aa359b6b8a8536c8cb92cce02ca5d5 (diff) |
[PATCH] PCI: AMD 8131 MSI quirk called too late, bus_flags not inherited ?
The PCI_BUS_FLAGS_NO_MSI bus flags does not appear do be inherited
correctly from the amd8131 MSI quirk to its parent busses. It makes
devices behind a bridge behind amd8131 try to enable MSI while the
amd8131 does not support it.
We fix this by looking at flags of all parent busses in
pci_enable_msi() and pci_enable_msix().
By the way, also add the missing dev->no_msi check in pci_enable_msix()
Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r-- | drivers/pci/msi.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index f8105783da2f..4aea563bda60 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -916,6 +916,7 @@ static int msix_capability_init(struct pci_dev *dev, | |||
916 | **/ | 916 | **/ |
917 | int pci_enable_msi(struct pci_dev* dev) | 917 | int pci_enable_msi(struct pci_dev* dev) |
918 | { | 918 | { |
919 | struct pci_bus *bus; | ||
919 | int pos, temp, status = -EINVAL; | 920 | int pos, temp, status = -EINVAL; |
920 | u16 control; | 921 | u16 control; |
921 | 922 | ||
@@ -925,8 +926,9 @@ int pci_enable_msi(struct pci_dev* dev) | |||
925 | if (dev->no_msi) | 926 | if (dev->no_msi) |
926 | return status; | 927 | return status; |
927 | 928 | ||
928 | if (dev->bus->bus_flags & PCI_BUS_FLAGS_NO_MSI) | 929 | for (bus = dev->bus; bus; bus = bus->parent) |
929 | return -EINVAL; | 930 | if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI) |
931 | return -EINVAL; | ||
930 | 932 | ||
931 | temp = dev->irq; | 933 | temp = dev->irq; |
932 | 934 | ||
@@ -1162,6 +1164,7 @@ static int reroute_msix_table(int head, struct msix_entry *entries, int *nvec) | |||
1162 | **/ | 1164 | **/ |
1163 | int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec) | 1165 | int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec) |
1164 | { | 1166 | { |
1167 | struct pci_bus *bus; | ||
1165 | int status, pos, nr_entries, free_vectors; | 1168 | int status, pos, nr_entries, free_vectors; |
1166 | int i, j, temp; | 1169 | int i, j, temp; |
1167 | u16 control; | 1170 | u16 control; |
@@ -1170,6 +1173,13 @@ int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec) | |||
1170 | if (!pci_msi_enable || !dev || !entries) | 1173 | if (!pci_msi_enable || !dev || !entries) |
1171 | return -EINVAL; | 1174 | return -EINVAL; |
1172 | 1175 | ||
1176 | if (dev->no_msi) | ||
1177 | return -EINVAL; | ||
1178 | |||
1179 | for (bus = dev->bus; bus; bus = bus->parent) | ||
1180 | if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI) | ||
1181 | return -EINVAL; | ||
1182 | |||
1173 | status = msi_init(); | 1183 | status = msi_init(); |
1174 | if (status < 0) | 1184 | if (status < 0) |
1175 | return status; | 1185 | return status; |