diff options
Diffstat (limited to 'drivers/pci/dwc/pcie-designware-host.c')
-rw-r--r-- | drivers/pci/dwc/pcie-designware-host.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c index 5ba334938b52..28ed32ba4f1b 100644 --- a/drivers/pci/dwc/pcie-designware-host.c +++ b/drivers/pci/dwc/pcie-designware-host.c | |||
@@ -56,24 +56,25 @@ static struct irq_chip dw_msi_irq_chip = { | |||
56 | /* MSI int handler */ | 56 | /* MSI int handler */ |
57 | irqreturn_t dw_handle_msi_irq(struct pcie_port *pp) | 57 | irqreturn_t dw_handle_msi_irq(struct pcie_port *pp) |
58 | { | 58 | { |
59 | unsigned long val; | 59 | u32 val; |
60 | int i, pos, irq; | 60 | int i, pos, irq; |
61 | irqreturn_t ret = IRQ_NONE; | 61 | irqreturn_t ret = IRQ_NONE; |
62 | 62 | ||
63 | for (i = 0; i < MAX_MSI_CTRLS; i++) { | 63 | for (i = 0; i < MAX_MSI_CTRLS; i++) { |
64 | dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12, 4, | 64 | dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12, 4, |
65 | (u32 *)&val); | 65 | &val); |
66 | if (val) { | 66 | if (!val) |
67 | ret = IRQ_HANDLED; | 67 | continue; |
68 | pos = 0; | 68 | |
69 | while ((pos = find_next_bit(&val, 32, pos)) != 32) { | 69 | ret = IRQ_HANDLED; |
70 | irq = irq_find_mapping(pp->irq_domain, | 70 | pos = 0; |
71 | i * 32 + pos); | 71 | while ((pos = find_next_bit((unsigned long *) &val, 32, |
72 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + | 72 | pos)) != 32) { |
73 | i * 12, 4, 1 << pos); | 73 | irq = irq_find_mapping(pp->irq_domain, i * 32 + pos); |
74 | generic_handle_irq(irq); | 74 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12, |
75 | pos++; | 75 | 4, 1 << pos); |
76 | } | 76 | generic_handle_irq(irq); |
77 | pos++; | ||
77 | } | 78 | } |
78 | } | 79 | } |
79 | 80 | ||
@@ -338,8 +339,9 @@ int dw_pcie_host_init(struct pcie_port *pp) | |||
338 | } | 339 | } |
339 | 340 | ||
340 | if (!pci->dbi_base) { | 341 | if (!pci->dbi_base) { |
341 | pci->dbi_base = devm_ioremap(dev, pp->cfg->start, | 342 | pci->dbi_base = devm_pci_remap_cfgspace(dev, |
342 | resource_size(pp->cfg)); | 343 | pp->cfg->start, |
344 | resource_size(pp->cfg)); | ||
343 | if (!pci->dbi_base) { | 345 | if (!pci->dbi_base) { |
344 | dev_err(dev, "error with ioremap\n"); | 346 | dev_err(dev, "error with ioremap\n"); |
345 | ret = -ENOMEM; | 347 | ret = -ENOMEM; |
@@ -350,8 +352,8 @@ int dw_pcie_host_init(struct pcie_port *pp) | |||
350 | pp->mem_base = pp->mem->start; | 352 | pp->mem_base = pp->mem->start; |
351 | 353 | ||
352 | if (!pp->va_cfg0_base) { | 354 | if (!pp->va_cfg0_base) { |
353 | pp->va_cfg0_base = devm_ioremap(dev, pp->cfg0_base, | 355 | pp->va_cfg0_base = devm_pci_remap_cfgspace(dev, |
354 | pp->cfg0_size); | 356 | pp->cfg0_base, pp->cfg0_size); |
355 | if (!pp->va_cfg0_base) { | 357 | if (!pp->va_cfg0_base) { |
356 | dev_err(dev, "error with ioremap in function\n"); | 358 | dev_err(dev, "error with ioremap in function\n"); |
357 | ret = -ENOMEM; | 359 | ret = -ENOMEM; |
@@ -360,7 +362,8 @@ int dw_pcie_host_init(struct pcie_port *pp) | |||
360 | } | 362 | } |
361 | 363 | ||
362 | if (!pp->va_cfg1_base) { | 364 | if (!pp->va_cfg1_base) { |
363 | pp->va_cfg1_base = devm_ioremap(dev, pp->cfg1_base, | 365 | pp->va_cfg1_base = devm_pci_remap_cfgspace(dev, |
366 | pp->cfg1_base, | ||
364 | pp->cfg1_size); | 367 | pp->cfg1_size); |
365 | if (!pp->va_cfg1_base) { | 368 | if (!pp->va_cfg1_base) { |
366 | dev_err(dev, "error with ioremap\n"); | 369 | dev_err(dev, "error with ioremap\n"); |