diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-09-07 14:57:53 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-10-01 14:21:14 -0400 |
commit | 6b2fd7efeb888fa781c1f767de6c36497ac1596b (patch) | |
tree | 5c0034e0cd1db2e36e54140a6f1477948016bc0f /arch/powerpc | |
parent | 52addcf9d6669fa439387610bc65c92fa0980cef (diff) |
PCI/MSI/PPC: Remove arch_msi_check_device()
Move MSI checks from arch_msi_check_device() to arch_setup_msi_irqs().
This makes the code more compact and allows removing
arch_msi_check_device() from generic MSI code.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/machdep.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/msi.c | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/axon_msi.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.c | 19 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/msi.c | 42 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_msi.c | 12 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic_pasemi_msi.c | 11 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic_u3msi.c | 28 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_hsta_msi.c | 18 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_msi.c | 19 |
10 files changed, 50 insertions, 122 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index b125ceab149c..3af721633618 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -136,8 +136,6 @@ struct machdep_calls { | |||
136 | int (*pci_setup_phb)(struct pci_controller *host); | 136 | int (*pci_setup_phb)(struct pci_controller *host); |
137 | 137 | ||
138 | #ifdef CONFIG_PCI_MSI | 138 | #ifdef CONFIG_PCI_MSI |
139 | int (*msi_check_device)(struct pci_dev* dev, | ||
140 | int nvec, int type); | ||
141 | int (*setup_msi_irqs)(struct pci_dev *dev, | 139 | int (*setup_msi_irqs)(struct pci_dev *dev, |
142 | int nvec, int type); | 140 | int nvec, int type); |
143 | void (*teardown_msi_irqs)(struct pci_dev *dev); | 141 | void (*teardown_msi_irqs)(struct pci_dev *dev); |
diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c index 8bbc12d20f5c..71bd161640cf 100644 --- a/arch/powerpc/kernel/msi.c +++ b/arch/powerpc/kernel/msi.c | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #include <asm/machdep.h> | 14 | #include <asm/machdep.h> |
15 | 15 | ||
16 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type) | 16 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) |
17 | { | 17 | { |
18 | if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) { | 18 | if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) { |
19 | pr_debug("msi: Platform doesn't provide MSI callbacks.\n"); | 19 | pr_debug("msi: Platform doesn't provide MSI callbacks.\n"); |
@@ -24,16 +24,6 @@ int arch_msi_check_device(struct pci_dev* dev, int nvec, int type) | |||
24 | if (type == PCI_CAP_ID_MSI && nvec > 1) | 24 | if (type == PCI_CAP_ID_MSI && nvec > 1) |
25 | return 1; | 25 | return 1; |
26 | 26 | ||
27 | if (ppc_md.msi_check_device) { | ||
28 | pr_debug("msi: Using platform check routine.\n"); | ||
29 | return ppc_md.msi_check_device(dev, nvec, type); | ||
30 | } | ||
31 | |||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | ||
36 | { | ||
37 | return ppc_md.setup_msi_irqs(dev, nvec, type); | 27 | return ppc_md.setup_msi_irqs(dev, nvec, type); |
38 | } | 28 | } |
39 | 29 | ||
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 85825b5401e5..862b32702d29 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c | |||
@@ -199,14 +199,6 @@ out_error: | |||
199 | return msic; | 199 | return msic; |
200 | } | 200 | } |
201 | 201 | ||
202 | static int axon_msi_check_device(struct pci_dev *dev, int nvec, int type) | ||
203 | { | ||
204 | if (!find_msi_translator(dev)) | ||
205 | return -ENODEV; | ||
206 | |||
207 | return 0; | ||
208 | } | ||
209 | |||
210 | static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg) | 202 | static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg) |
211 | { | 203 | { |
212 | struct device_node *dn; | 204 | struct device_node *dn; |
@@ -416,7 +408,6 @@ static int axon_msi_probe(struct platform_device *device) | |||
416 | 408 | ||
417 | ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs; | 409 | ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs; |
418 | ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs; | 410 | ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs; |
419 | ppc_md.msi_check_device = axon_msi_check_device; | ||
420 | 411 | ||
421 | axon_msi_debug_setup(dn, msic); | 412 | axon_msi_debug_setup(dn, msic); |
422 | 413 | ||
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index b854b57ed5e1..b45c49249a5d 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -46,29 +46,21 @@ | |||
46 | //#define cfg_dbg(fmt...) printk(fmt) | 46 | //#define cfg_dbg(fmt...) printk(fmt) |
47 | 47 | ||
48 | #ifdef CONFIG_PCI_MSI | 48 | #ifdef CONFIG_PCI_MSI |
49 | static int pnv_msi_check_device(struct pci_dev* pdev, int nvec, int type) | ||
50 | { | ||
51 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); | ||
52 | struct pnv_phb *phb = hose->private_data; | ||
53 | struct pci_dn *pdn = pci_get_pdn(pdev); | ||
54 | |||
55 | if (pdn && pdn->force_32bit_msi && !phb->msi32_support) | ||
56 | return -ENODEV; | ||
57 | |||
58 | return (phb && phb->msi_bmp.bitmap) ? 0 : -ENODEV; | ||
59 | } | ||
60 | |||
61 | static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | 49 | static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) |
62 | { | 50 | { |
63 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); | 51 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); |
64 | struct pnv_phb *phb = hose->private_data; | 52 | struct pnv_phb *phb = hose->private_data; |
53 | struct pci_dn *pdn = pci_get_pdn(pdev); | ||
65 | struct msi_desc *entry; | 54 | struct msi_desc *entry; |
66 | struct msi_msg msg; | 55 | struct msi_msg msg; |
67 | int hwirq; | 56 | int hwirq; |
68 | unsigned int virq; | 57 | unsigned int virq; |
69 | int rc; | 58 | int rc; |
70 | 59 | ||
71 | if (WARN_ON(!phb)) | 60 | if (WARN_ON(!phb) || !phb->msi_bmp.bitmap) |
61 | return -ENODEV; | ||
62 | |||
63 | if (pdn && pdn->force_32bit_msi && !phb->msi32_support) | ||
72 | return -ENODEV; | 64 | return -ENODEV; |
73 | 65 | ||
74 | list_for_each_entry(entry, &pdev->msi_list, list) { | 66 | list_for_each_entry(entry, &pdev->msi_list, list) { |
@@ -860,7 +852,6 @@ void __init pnv_pci_init(void) | |||
860 | 852 | ||
861 | /* Configure MSIs */ | 853 | /* Configure MSIs */ |
862 | #ifdef CONFIG_PCI_MSI | 854 | #ifdef CONFIG_PCI_MSI |
863 | ppc_md.msi_check_device = pnv_msi_check_device; | ||
864 | ppc_md.setup_msi_irqs = pnv_setup_msi_irqs; | 855 | ppc_md.setup_msi_irqs = pnv_setup_msi_irqs; |
865 | ppc_md.teardown_msi_irqs = pnv_teardown_msi_irqs; | 856 | ppc_md.teardown_msi_irqs = pnv_teardown_msi_irqs; |
866 | #endif | 857 | #endif |
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 18ff4626d74e..e68c196def1a 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c | |||
@@ -336,26 +336,6 @@ out: | |||
336 | return request; | 336 | return request; |
337 | } | 337 | } |
338 | 338 | ||
339 | static int rtas_msi_check_device(struct pci_dev *pdev, int nvec, int type) | ||
340 | { | ||
341 | int quota, rc; | ||
342 | |||
343 | if (type == PCI_CAP_ID_MSIX) | ||
344 | rc = check_req_msix(pdev, nvec); | ||
345 | else | ||
346 | rc = check_req_msi(pdev, nvec); | ||
347 | |||
348 | if (rc) | ||
349 | return rc; | ||
350 | |||
351 | quota = msi_quota_for_device(pdev, nvec); | ||
352 | |||
353 | if (quota && quota < nvec) | ||
354 | return quota; | ||
355 | |||
356 | return 0; | ||
357 | } | ||
358 | |||
359 | static int check_msix_entries(struct pci_dev *pdev) | 339 | static int check_msix_entries(struct pci_dev *pdev) |
360 | { | 340 | { |
361 | struct msi_desc *entry; | 341 | struct msi_desc *entry; |
@@ -397,15 +377,24 @@ static void rtas_hack_32bit_msi_gen2(struct pci_dev *pdev) | |||
397 | static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type) | 377 | static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type) |
398 | { | 378 | { |
399 | struct pci_dn *pdn; | 379 | struct pci_dn *pdn; |
400 | int hwirq, virq, i, rc; | 380 | int hwirq, virq, i, quota, rc; |
401 | struct msi_desc *entry; | 381 | struct msi_desc *entry; |
402 | struct msi_msg msg; | 382 | struct msi_msg msg; |
403 | int nvec = nvec_in; | 383 | int nvec = nvec_in; |
404 | int use_32bit_msi_hack = 0; | 384 | int use_32bit_msi_hack = 0; |
405 | 385 | ||
406 | pdn = pci_get_pdn(pdev); | 386 | if (type == PCI_CAP_ID_MSIX) |
407 | if (!pdn) | 387 | rc = check_req_msix(pdev, nvec); |
408 | return -ENODEV; | 388 | else |
389 | rc = check_req_msi(pdev, nvec); | ||
390 | |||
391 | if (rc) | ||
392 | return rc; | ||
393 | |||
394 | quota = msi_quota_for_device(pdev, nvec); | ||
395 | |||
396 | if (quota && quota < nvec) | ||
397 | return quota; | ||
409 | 398 | ||
410 | if (type == PCI_CAP_ID_MSIX && check_msix_entries(pdev)) | 399 | if (type == PCI_CAP_ID_MSIX && check_msix_entries(pdev)) |
411 | return -EINVAL; | 400 | return -EINVAL; |
@@ -416,12 +405,14 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type) | |||
416 | */ | 405 | */ |
417 | if (type == PCI_CAP_ID_MSIX) { | 406 | if (type == PCI_CAP_ID_MSIX) { |
418 | int m = roundup_pow_of_two(nvec); | 407 | int m = roundup_pow_of_two(nvec); |
419 | int quota = msi_quota_for_device(pdev, m); | 408 | quota = msi_quota_for_device(pdev, m); |
420 | 409 | ||
421 | if (quota >= m) | 410 | if (quota >= m) |
422 | nvec = m; | 411 | nvec = m; |
423 | } | 412 | } |
424 | 413 | ||
414 | pdn = pci_get_pdn(pdev); | ||
415 | |||
425 | /* | 416 | /* |
426 | * Try the new more explicit firmware interface, if that fails fall | 417 | * Try the new more explicit firmware interface, if that fails fall |
427 | * back to the old interface. The old interface is known to never | 418 | * back to the old interface. The old interface is known to never |
@@ -526,7 +517,6 @@ static int rtas_msi_init(void) | |||
526 | WARN_ON(ppc_md.setup_msi_irqs); | 517 | WARN_ON(ppc_md.setup_msi_irqs); |
527 | ppc_md.setup_msi_irqs = rtas_setup_msi_irqs; | 518 | ppc_md.setup_msi_irqs = rtas_setup_msi_irqs; |
528 | ppc_md.teardown_msi_irqs = rtas_teardown_msi_irqs; | 519 | ppc_md.teardown_msi_irqs = rtas_teardown_msi_irqs; |
529 | ppc_md.msi_check_device = rtas_msi_check_device; | ||
530 | 520 | ||
531 | WARN_ON(ppc_md.pci_irq_fixup); | 521 | WARN_ON(ppc_md.pci_irq_fixup); |
532 | ppc_md.pci_irq_fixup = rtas_msi_pci_irq_fixup; | 522 | ppc_md.pci_irq_fixup = rtas_msi_pci_irq_fixup; |
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 77efbaec7b9c..b32e79dbef4f 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
@@ -109,14 +109,6 @@ static int fsl_msi_init_allocator(struct fsl_msi *msi_data) | |||
109 | return 0; | 109 | return 0; |
110 | } | 110 | } |
111 | 111 | ||
112 | static int fsl_msi_check_device(struct pci_dev *pdev, int nvec, int type) | ||
113 | { | ||
114 | if (type == PCI_CAP_ID_MSIX) | ||
115 | pr_debug("fslmsi: MSI-X untested, trying anyway.\n"); | ||
116 | |||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | static void fsl_teardown_msi_irqs(struct pci_dev *pdev) | 112 | static void fsl_teardown_msi_irqs(struct pci_dev *pdev) |
121 | { | 113 | { |
122 | struct msi_desc *entry; | 114 | struct msi_desc *entry; |
@@ -173,6 +165,9 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
173 | struct msi_msg msg; | 165 | struct msi_msg msg; |
174 | struct fsl_msi *msi_data; | 166 | struct fsl_msi *msi_data; |
175 | 167 | ||
168 | if (type == PCI_CAP_ID_MSIX) | ||
169 | pr_debug("fslmsi: MSI-X untested, trying anyway.\n"); | ||
170 | |||
176 | /* | 171 | /* |
177 | * If the PCI node has an fsl,msi property, then we need to use it | 172 | * If the PCI node has an fsl,msi property, then we need to use it |
178 | * to find the specific MSI. | 173 | * to find the specific MSI. |
@@ -527,7 +522,6 @@ static int fsl_of_msi_probe(struct platform_device *dev) | |||
527 | if (!ppc_md.setup_msi_irqs) { | 522 | if (!ppc_md.setup_msi_irqs) { |
528 | ppc_md.setup_msi_irqs = fsl_setup_msi_irqs; | 523 | ppc_md.setup_msi_irqs = fsl_setup_msi_irqs; |
529 | ppc_md.teardown_msi_irqs = fsl_teardown_msi_irqs; | 524 | ppc_md.teardown_msi_irqs = fsl_teardown_msi_irqs; |
530 | ppc_md.msi_check_device = fsl_msi_check_device; | ||
531 | } else if (ppc_md.setup_msi_irqs != fsl_setup_msi_irqs) { | 525 | } else if (ppc_md.setup_msi_irqs != fsl_setup_msi_irqs) { |
532 | dev_err(&dev->dev, "Different MSI driver already installed!\n"); | 526 | dev_err(&dev->dev, "Different MSI driver already installed!\n"); |
533 | err = -ENODEV; | 527 | err = -ENODEV; |
diff --git a/arch/powerpc/sysdev/mpic_pasemi_msi.c b/arch/powerpc/sysdev/mpic_pasemi_msi.c index 38e62382070c..15dccd35fa11 100644 --- a/arch/powerpc/sysdev/mpic_pasemi_msi.c +++ b/arch/powerpc/sysdev/mpic_pasemi_msi.c | |||
@@ -63,14 +63,6 @@ static struct irq_chip mpic_pasemi_msi_chip = { | |||
63 | .name = "PASEMI-MSI", | 63 | .name = "PASEMI-MSI", |
64 | }; | 64 | }; |
65 | 65 | ||
66 | static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type) | ||
67 | { | ||
68 | if (type == PCI_CAP_ID_MSIX) | ||
69 | pr_debug("pasemi_msi: MSI-X untested, trying anyway\n"); | ||
70 | |||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) | 66 | static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) |
75 | { | 67 | { |
76 | struct msi_desc *entry; | 68 | struct msi_desc *entry; |
@@ -97,6 +89,8 @@ static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
97 | struct msi_msg msg; | 89 | struct msi_msg msg; |
98 | int hwirq; | 90 | int hwirq; |
99 | 91 | ||
92 | if (type == PCI_CAP_ID_MSIX) | ||
93 | pr_debug("pasemi_msi: MSI-X untested, trying anyway\n"); | ||
100 | pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n", | 94 | pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n", |
101 | pdev, nvec, type); | 95 | pdev, nvec, type); |
102 | 96 | ||
@@ -169,7 +163,6 @@ int mpic_pasemi_msi_init(struct mpic *mpic) | |||
169 | WARN_ON(ppc_md.setup_msi_irqs); | 163 | WARN_ON(ppc_md.setup_msi_irqs); |
170 | ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs; | 164 | ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs; |
171 | ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs; | 165 | ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs; |
172 | ppc_md.msi_check_device = pasemi_msi_check_device; | ||
173 | 166 | ||
174 | return 0; | 167 | return 0; |
175 | } | 168 | } |
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c index 9a7aa0ed9c1c..623d7fba15b4 100644 --- a/arch/powerpc/sysdev/mpic_u3msi.c +++ b/arch/powerpc/sysdev/mpic_u3msi.c | |||
@@ -105,22 +105,6 @@ static u64 find_u4_magic_addr(struct pci_dev *pdev, unsigned int hwirq) | |||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | static int u3msi_msi_check_device(struct pci_dev *pdev, int nvec, int type) | ||
109 | { | ||
110 | if (type == PCI_CAP_ID_MSIX) | ||
111 | pr_debug("u3msi: MSI-X untested, trying anyway.\n"); | ||
112 | |||
113 | /* If we can't find a magic address then MSI ain't gonna work */ | ||
114 | if (find_ht_magic_addr(pdev, 0) == 0 && | ||
115 | find_u4_magic_addr(pdev, 0) == 0) { | ||
116 | pr_debug("u3msi: no magic address found for %s\n", | ||
117 | pci_name(pdev)); | ||
118 | return -ENXIO; | ||
119 | } | ||
120 | |||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | static void u3msi_teardown_msi_irqs(struct pci_dev *pdev) | 108 | static void u3msi_teardown_msi_irqs(struct pci_dev *pdev) |
125 | { | 109 | { |
126 | struct msi_desc *entry; | 110 | struct msi_desc *entry; |
@@ -146,6 +130,17 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
146 | u64 addr; | 130 | u64 addr; |
147 | int hwirq; | 131 | int hwirq; |
148 | 132 | ||
133 | if (type == PCI_CAP_ID_MSIX) | ||
134 | pr_debug("u3msi: MSI-X untested, trying anyway.\n"); | ||
135 | |||
136 | /* If we can't find a magic address then MSI ain't gonna work */ | ||
137 | if (find_ht_magic_addr(pdev, 0) == 0 && | ||
138 | find_u4_magic_addr(pdev, 0) == 0) { | ||
139 | pr_debug("u3msi: no magic address found for %s\n", | ||
140 | pci_name(pdev)); | ||
141 | return -ENXIO; | ||
142 | } | ||
143 | |||
149 | list_for_each_entry(entry, &pdev->msi_list, list) { | 144 | list_for_each_entry(entry, &pdev->msi_list, list) { |
150 | hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap, 1); | 145 | hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap, 1); |
151 | if (hwirq < 0) { | 146 | if (hwirq < 0) { |
@@ -202,7 +197,6 @@ int mpic_u3msi_init(struct mpic *mpic) | |||
202 | WARN_ON(ppc_md.setup_msi_irqs); | 197 | WARN_ON(ppc_md.setup_msi_irqs); |
203 | ppc_md.setup_msi_irqs = u3msi_setup_msi_irqs; | 198 | ppc_md.setup_msi_irqs = u3msi_setup_msi_irqs; |
204 | ppc_md.teardown_msi_irqs = u3msi_teardown_msi_irqs; | 199 | ppc_md.teardown_msi_irqs = u3msi_teardown_msi_irqs; |
205 | ppc_md.msi_check_device = u3msi_msi_check_device; | ||
206 | 200 | ||
207 | return 0; | 201 | return 0; |
208 | } | 202 | } |
diff --git a/arch/powerpc/sysdev/ppc4xx_hsta_msi.c b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c index 11c888416f0a..a6a4dbda9078 100644 --- a/arch/powerpc/sysdev/ppc4xx_hsta_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c | |||
@@ -44,6 +44,12 @@ static int hsta_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
44 | int irq, hwirq; | 44 | int irq, hwirq; |
45 | u64 addr; | 45 | u64 addr; |
46 | 46 | ||
47 | /* We don't support MSI-X */ | ||
48 | if (type == PCI_CAP_ID_MSIX) { | ||
49 | pr_debug("%s: MSI-X not supported.\n", __func__); | ||
50 | return -EINVAL; | ||
51 | } | ||
52 | |||
47 | list_for_each_entry(entry, &dev->msi_list, list) { | 53 | list_for_each_entry(entry, &dev->msi_list, list) { |
48 | irq = msi_bitmap_alloc_hwirqs(&ppc4xx_hsta_msi.bmp, 1); | 54 | irq = msi_bitmap_alloc_hwirqs(&ppc4xx_hsta_msi.bmp, 1); |
49 | if (irq < 0) { | 55 | if (irq < 0) { |
@@ -117,17 +123,6 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev) | |||
117 | } | 123 | } |
118 | } | 124 | } |
119 | 125 | ||
120 | static int hsta_msi_check_device(struct pci_dev *pdev, int nvec, int type) | ||
121 | { | ||
122 | /* We don't support MSI-X */ | ||
123 | if (type == PCI_CAP_ID_MSIX) { | ||
124 | pr_debug("%s: MSI-X not supported.\n", __func__); | ||
125 | return -EINVAL; | ||
126 | } | ||
127 | |||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | static int hsta_msi_probe(struct platform_device *pdev) | 126 | static int hsta_msi_probe(struct platform_device *pdev) |
132 | { | 127 | { |
133 | struct device *dev = &pdev->dev; | 128 | struct device *dev = &pdev->dev; |
@@ -178,7 +173,6 @@ static int hsta_msi_probe(struct platform_device *pdev) | |||
178 | 173 | ||
179 | ppc_md.setup_msi_irqs = hsta_setup_msi_irqs; | 174 | ppc_md.setup_msi_irqs = hsta_setup_msi_irqs; |
180 | ppc_md.teardown_msi_irqs = hsta_teardown_msi_irqs; | 175 | ppc_md.teardown_msi_irqs = hsta_teardown_msi_irqs; |
181 | ppc_md.msi_check_device = hsta_msi_check_device; | ||
182 | return 0; | 176 | return 0; |
183 | 177 | ||
184 | out2: | 178 | out2: |
diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c index 43948da837a7..22b5200636e7 100644 --- a/arch/powerpc/sysdev/ppc4xx_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_msi.c | |||
@@ -85,8 +85,12 @@ static int ppc4xx_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
85 | struct msi_desc *entry; | 85 | struct msi_desc *entry; |
86 | struct ppc4xx_msi *msi_data = &ppc4xx_msi; | 86 | struct ppc4xx_msi *msi_data = &ppc4xx_msi; |
87 | 87 | ||
88 | msi_data->msi_virqs = kmalloc((msi_irqs) * sizeof(int), | 88 | dev_dbg(&dev->dev, "PCIE-MSI:%s called. vec %x type %d\n", |
89 | GFP_KERNEL); | 89 | __func__, nvec, type); |
90 | if (type == PCI_CAP_ID_MSIX) | ||
91 | pr_debug("ppc4xx msi: MSI-X untested, trying anyway.\n"); | ||
92 | |||
93 | msi_data->msi_virqs = kmalloc((msi_irqs) * sizeof(int), GFP_KERNEL); | ||
90 | if (!msi_data->msi_virqs) | 94 | if (!msi_data->msi_virqs) |
91 | return -ENOMEM; | 95 | return -ENOMEM; |
92 | 96 | ||
@@ -134,16 +138,6 @@ void ppc4xx_teardown_msi_irqs(struct pci_dev *dev) | |||
134 | } | 138 | } |
135 | } | 139 | } |
136 | 140 | ||
137 | static int ppc4xx_msi_check_device(struct pci_dev *pdev, int nvec, int type) | ||
138 | { | ||
139 | dev_dbg(&pdev->dev, "PCIE-MSI:%s called. vec %x type %d\n", | ||
140 | __func__, nvec, type); | ||
141 | if (type == PCI_CAP_ID_MSIX) | ||
142 | pr_debug("ppc4xx msi: MSI-X untested, trying anyway.\n"); | ||
143 | |||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | static int ppc4xx_setup_pcieh_hw(struct platform_device *dev, | 141 | static int ppc4xx_setup_pcieh_hw(struct platform_device *dev, |
148 | struct resource res, struct ppc4xx_msi *msi) | 142 | struct resource res, struct ppc4xx_msi *msi) |
149 | { | 143 | { |
@@ -259,7 +253,6 @@ static int ppc4xx_msi_probe(struct platform_device *dev) | |||
259 | 253 | ||
260 | ppc_md.setup_msi_irqs = ppc4xx_setup_msi_irqs; | 254 | ppc_md.setup_msi_irqs = ppc4xx_setup_msi_irqs; |
261 | ppc_md.teardown_msi_irqs = ppc4xx_teardown_msi_irqs; | 255 | ppc_md.teardown_msi_irqs = ppc4xx_teardown_msi_irqs; |
262 | ppc_md.msi_check_device = ppc4xx_msi_check_device; | ||
263 | return err; | 256 | return err; |
264 | 257 | ||
265 | error_out: | 258 | error_out: |