diff options
author | Yijing Wang <wangyijing@huawei.com> | 2014-09-17 05:32:19 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-09-25 13:11:47 -0400 |
commit | 5fc24d8cb9d43e0db335137051092da03a6845dc (patch) | |
tree | c476b207814a1409d74fffe7b0837ef372dc7f9a /drivers/iommu | |
parent | fb3e306515ba6a012364b698b8ca71c337424ed3 (diff) |
iommu/irq_remapping: Fix the regression of hpet irq remapping
Commit 71054d8841b4 ("x86, hpet: Introduce x86_msi_ops.setup_hpet_msi")
introduced x86_msi_ops.setup_hpet_msi to setup hpet MSI irq
when irq remapping enabled. This caused a regression of
hpet MSI irq remapping.
Original code flow before commit 71054d8841b4:
hpet_setup_msi_irq()
arch_setup_hpet_msi()
setup_hpet_msi_remapped()
remap_ops->setup_hpet_msi()
alloc_irte()
msi_compose_msg()
hpet_msi_write()
...
Current code flow after commit 71054d8841b4:
hpet_setup_msi_irq()
x86_msi.setup_hpet_msi()
setup_hpet_msi_remapped()
intel_setup_hpet_msi()
alloc_irte()
Currently, we only call alloc_irte() for hpet MSI, but
do not composed and wrote its msg...
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 4 | ||||
-rw-r--r-- | drivers/iommu/intel_irq_remapping.c | 4 | ||||
-rw-r--r-- | drivers/iommu/irq_remapping.c | 11 | ||||
-rw-r--r-- | drivers/iommu/irq_remapping.h | 2 |
4 files changed, 14 insertions, 7 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 8c5216633987..2f4f45d8dbfd 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -4233,7 +4233,7 @@ static int msi_setup_irq(struct pci_dev *pdev, unsigned int irq, | |||
4233 | return 0; | 4233 | return 0; |
4234 | } | 4234 | } |
4235 | 4235 | ||
4236 | static int setup_hpet_msi(unsigned int irq, unsigned int id) | 4236 | static int alloc_hpet_msi(unsigned int irq, unsigned int id) |
4237 | { | 4237 | { |
4238 | struct irq_2_irte *irte_info; | 4238 | struct irq_2_irte *irte_info; |
4239 | struct irq_cfg *cfg; | 4239 | struct irq_cfg *cfg; |
@@ -4272,6 +4272,6 @@ struct irq_remap_ops amd_iommu_irq_ops = { | |||
4272 | .compose_msi_msg = compose_msi_msg, | 4272 | .compose_msi_msg = compose_msi_msg, |
4273 | .msi_alloc_irq = msi_alloc_irq, | 4273 | .msi_alloc_irq = msi_alloc_irq, |
4274 | .msi_setup_irq = msi_setup_irq, | 4274 | .msi_setup_irq = msi_setup_irq, |
4275 | .setup_hpet_msi = setup_hpet_msi, | 4275 | .alloc_hpet_msi = alloc_hpet_msi, |
4276 | }; | 4276 | }; |
4277 | #endif | 4277 | #endif |
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 0df41f6264f5..ef5e5dd1311d 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c | |||
@@ -1139,7 +1139,7 @@ static int intel_msi_setup_irq(struct pci_dev *pdev, unsigned int irq, | |||
1139 | return ret; | 1139 | return ret; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static int intel_setup_hpet_msi(unsigned int irq, unsigned int id) | 1142 | static int intel_alloc_hpet_msi(unsigned int irq, unsigned int id) |
1143 | { | 1143 | { |
1144 | int ret = -1; | 1144 | int ret = -1; |
1145 | struct intel_iommu *iommu; | 1145 | struct intel_iommu *iommu; |
@@ -1170,5 +1170,5 @@ struct irq_remap_ops intel_irq_remap_ops = { | |||
1170 | .compose_msi_msg = intel_compose_msi_msg, | 1170 | .compose_msi_msg = intel_compose_msi_msg, |
1171 | .msi_alloc_irq = intel_msi_alloc_irq, | 1171 | .msi_alloc_irq = intel_msi_alloc_irq, |
1172 | .msi_setup_irq = intel_msi_setup_irq, | 1172 | .msi_setup_irq = intel_msi_setup_irq, |
1173 | .setup_hpet_msi = intel_setup_hpet_msi, | 1173 | .alloc_hpet_msi = intel_alloc_hpet_msi, |
1174 | }; | 1174 | }; |
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 33c439524080..74a1767c89b5 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/processor.h> | 12 | #include <asm/processor.h> |
13 | #include <asm/x86_init.h> | 13 | #include <asm/x86_init.h> |
14 | #include <asm/apic.h> | 14 | #include <asm/apic.h> |
15 | #include <asm/hpet.h> | ||
15 | 16 | ||
16 | #include "irq_remapping.h" | 17 | #include "irq_remapping.h" |
17 | 18 | ||
@@ -345,10 +346,16 @@ static int msi_setup_remapped_irq(struct pci_dev *pdev, unsigned int irq, | |||
345 | 346 | ||
346 | int setup_hpet_msi_remapped(unsigned int irq, unsigned int id) | 347 | int setup_hpet_msi_remapped(unsigned int irq, unsigned int id) |
347 | { | 348 | { |
348 | if (!remap_ops || !remap_ops->setup_hpet_msi) | 349 | int ret; |
350 | |||
351 | if (!remap_ops || !remap_ops->alloc_hpet_msi) | ||
349 | return -ENODEV; | 352 | return -ENODEV; |
350 | 353 | ||
351 | return remap_ops->setup_hpet_msi(irq, id); | 354 | ret = remap_ops->alloc_hpet_msi(irq, id); |
355 | if (ret) | ||
356 | return -EINVAL; | ||
357 | |||
358 | return default_setup_hpet_msi(irq, id); | ||
352 | } | 359 | } |
353 | 360 | ||
354 | void panic_if_irq_remap(const char *msg) | 361 | void panic_if_irq_remap(const char *msg) |
diff --git a/drivers/iommu/irq_remapping.h b/drivers/iommu/irq_remapping.h index 90c4dae5a46b..fde250f86e60 100644 --- a/drivers/iommu/irq_remapping.h +++ b/drivers/iommu/irq_remapping.h | |||
@@ -80,7 +80,7 @@ struct irq_remap_ops { | |||
80 | int (*msi_setup_irq)(struct pci_dev *, unsigned int, int, int); | 80 | int (*msi_setup_irq)(struct pci_dev *, unsigned int, int, int); |
81 | 81 | ||
82 | /* Setup interrupt remapping for an HPET MSI */ | 82 | /* Setup interrupt remapping for an HPET MSI */ |
83 | int (*setup_hpet_msi)(unsigned int, unsigned int); | 83 | int (*alloc_hpet_msi)(unsigned int, unsigned int); |
84 | }; | 84 | }; |
85 | 85 | ||
86 | extern struct irq_remap_ops intel_irq_remap_ops; | 86 | extern struct irq_remap_ops intel_irq_remap_ops; |