diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-05 20:57:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-05 20:57:34 -0500 |
commit | 926b02d3eb547daa1d56cf9b586f31b270488b77 (patch) | |
tree | 839c5f5ac6ab4f3c50056360da1b8d1af181d6b1 /drivers/pci/controller/dwc/pcie-designware-host.c | |
parent | cf26057a9441173ad552e90cea3344607075c9ad (diff) | |
parent | 72199051af6205049e96ee7ed34f4fc5f44d1baf (diff) |
Merge tag 'pci-v4.21-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
- Remove unused lists from ASPM pcie_link_state (Frederick Lawler)
- Fix Broadcom CNB20LE host bridge unintended sign extension (Colin Ian
King)
- Expand Kconfig "PF" acronyms (Randy Dunlap)
- Update MAINTAINERS for arch/x86/kernel/early-quirks.c (Bjorn Helgaas)
- Add missing include to drivers/pci.h (Alexandru Gagniuc)
- Override Synopsys USB 3.x HAPS device class so dwc3-haps can claim it
instead of xhci (Thinh Nguyen)
- Clean up P2PDMA documentation (Randy Dunlap)
- Allow runtime PM even if driver doesn't supply callbacks (Jarkko
Nikula)
- Remove status check after submitting Switchtec MRPC Firmware Download
commands to avoid Completion Timeouts (Kelvin Cao)
- Set Switchtec coherent DMA mask to allow 64-bit DMA (Boris Glimcher)
- Fix Switchtec SWITCHTEC_IOCTL_EVENT_IDX_ALL flag overwrite issue
(Joey Zhang)
- Enable write combining for Switchtec MRPC Input buffers (Kelvin Cao)
- Add Switchtec MRPC DMA mode support (Wesley Sheng)
- Skip VF scanning on powerpc, which does this in firmware (Sebastian
Ott)
- Add Amlogic Meson PCIe controller driver and DT bindings (Yue Wang)
- Constify histb dw_pcie_host_ops structure (Julia Lawall)
- Support multiple power domains for imx6 (Leonard Crestez)
- Constify layerscape driver data (Stefan Agner)
- Update imx6 Kconfig to allow imx6 PCIe in imx7 kernel (Trent Piepho)
- Support armada8k GPIO reset (Baruch Siach)
- Support suspend/resume support on imx6 (Leonard Crestez)
- Don't hard-code DesignWare DBI/ATU offst (Stephen Warren)
- Skip i.MX6 PHY setup on i.MX7D (Andrey Smirnov)
- Remove Jianguo Sun from HiSilicon STB maintainers (Lorenzo Pieralisi)
- Mask DesignWare interrupts instead of disabling them to avoid lost
interrupts (Marc Zyngier)
- Add locking when acking DesignWare interrupts (Marc Zyngier)
- Ack DesignWare interrupts in the proper callbacks (Marc Zyngier)
- Use devm resource parser in mediatek (Honghui Zhang)
- Remove unused mediatek "num-lanes" DT property (Honghui Zhang)
- Add UniPhier PCIe controller driver and DT bindings (Kunihiko
Hayashi)
- Enable MSI for imx6 downstream components (Richard Zhu)
* tag 'pci-v4.21-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (40 commits)
PCI: imx: Enable MSI from downstream components
s390/pci: skip VF scanning
PCI/IOV: Add flag so platforms can skip VF scanning
PCI/IOV: Factor out sriov_add_vfs()
PCI: uniphier: Add UniPhier PCIe host controller support
dt-bindings: PCI: Add UniPhier PCIe host controller description
PCI: amlogic: Add the Amlogic Meson PCIe controller driver
dt-bindings: PCI: meson: add DT bindings for Amlogic Meson PCIe controller
arm64: dts: mt7622: Remove un-used property for PCIe
arm: dts: mt7623: Remove un-used property for PCIe
dt-bindings: PCI: MediaTek: Remove un-used property
PCI: mediatek: Remove un-used variant in struct mtk_pcie_port
MAINTAINERS: Remove Jianguo Sun from HiSilicon STB DWC entry
PCI: dwc: Don't hard-code DBI/ATU offset
PCI: imx: Add imx6sx suspend/resume support
PCI: armada8k: Add support for gpio controlled reset signal
PCI: dwc: Adjust Kconfig to allow IMX6 PCIe host on IMX7
PCI: dwc: layerscape: Constify driver data
PCI: imx: Add multi-pd support
PCI: Override Synopsys USB 3.x HAPS device class
...
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-designware-host.c')
-rw-r--r-- | drivers/pci/controller/dwc/pcie-designware-host.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 29a05759a294..721d60a5d9e4 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c | |||
@@ -99,9 +99,6 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp) | |||
99 | (i * MAX_MSI_IRQS_PER_CTRL) + | 99 | (i * MAX_MSI_IRQS_PER_CTRL) + |
100 | pos); | 100 | pos); |
101 | generic_handle_irq(irq); | 101 | generic_handle_irq(irq); |
102 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + | ||
103 | (i * MSI_REG_CTRL_BLOCK_SIZE), | ||
104 | 4, 1 << pos); | ||
105 | pos++; | 102 | pos++; |
106 | } | 103 | } |
107 | } | 104 | } |
@@ -168,8 +165,8 @@ static void dw_pci_bottom_mask(struct irq_data *data) | |||
168 | bit = data->hwirq % MAX_MSI_IRQS_PER_CTRL; | 165 | bit = data->hwirq % MAX_MSI_IRQS_PER_CTRL; |
169 | 166 | ||
170 | pp->irq_status[ctrl] &= ~(1 << bit); | 167 | pp->irq_status[ctrl] &= ~(1 << bit); |
171 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, | 168 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK + res, 4, |
172 | pp->irq_status[ctrl]); | 169 | ~pp->irq_status[ctrl]); |
173 | } | 170 | } |
174 | 171 | ||
175 | raw_spin_unlock_irqrestore(&pp->lock, flags); | 172 | raw_spin_unlock_irqrestore(&pp->lock, flags); |
@@ -191,8 +188,8 @@ static void dw_pci_bottom_unmask(struct irq_data *data) | |||
191 | bit = data->hwirq % MAX_MSI_IRQS_PER_CTRL; | 188 | bit = data->hwirq % MAX_MSI_IRQS_PER_CTRL; |
192 | 189 | ||
193 | pp->irq_status[ctrl] |= 1 << bit; | 190 | pp->irq_status[ctrl] |= 1 << bit; |
194 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, | 191 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK + res, 4, |
195 | pp->irq_status[ctrl]); | 192 | ~pp->irq_status[ctrl]); |
196 | } | 193 | } |
197 | 194 | ||
198 | raw_spin_unlock_irqrestore(&pp->lock, flags); | 195 | raw_spin_unlock_irqrestore(&pp->lock, flags); |
@@ -200,13 +197,22 @@ static void dw_pci_bottom_unmask(struct irq_data *data) | |||
200 | 197 | ||
201 | static void dw_pci_bottom_ack(struct irq_data *d) | 198 | static void dw_pci_bottom_ack(struct irq_data *d) |
202 | { | 199 | { |
203 | struct msi_desc *msi = irq_data_get_msi_desc(d); | 200 | struct pcie_port *pp = irq_data_get_irq_chip_data(d); |
204 | struct pcie_port *pp; | 201 | unsigned int res, bit, ctrl; |
202 | unsigned long flags; | ||
203 | |||
204 | ctrl = d->hwirq / MAX_MSI_IRQS_PER_CTRL; | ||
205 | res = ctrl * MSI_REG_CTRL_BLOCK_SIZE; | ||
206 | bit = d->hwirq % MAX_MSI_IRQS_PER_CTRL; | ||
207 | |||
208 | raw_spin_lock_irqsave(&pp->lock, flags); | ||
205 | 209 | ||
206 | pp = msi_desc_to_pci_sysdata(msi); | 210 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + res, 4, 1 << bit); |
207 | 211 | ||
208 | if (pp->ops->msi_irq_ack) | 212 | if (pp->ops->msi_irq_ack) |
209 | pp->ops->msi_irq_ack(d->hwirq, pp); | 213 | pp->ops->msi_irq_ack(d->hwirq, pp); |
214 | |||
215 | raw_spin_unlock_irqrestore(&pp->lock, flags); | ||
210 | } | 216 | } |
211 | 217 | ||
212 | static struct irq_chip dw_pci_msi_bottom_irq_chip = { | 218 | static struct irq_chip dw_pci_msi_bottom_irq_chip = { |
@@ -658,10 +664,15 @@ void dw_pcie_setup_rc(struct pcie_port *pp) | |||
658 | num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL; | 664 | num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL; |
659 | 665 | ||
660 | /* Initialize IRQ Status array */ | 666 | /* Initialize IRQ Status array */ |
661 | for (ctrl = 0; ctrl < num_ctrls; ctrl++) | 667 | for (ctrl = 0; ctrl < num_ctrls; ctrl++) { |
662 | dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_ENABLE + | 668 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK + |
669 | (ctrl * MSI_REG_CTRL_BLOCK_SIZE), | ||
670 | 4, ~0); | ||
671 | dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + | ||
663 | (ctrl * MSI_REG_CTRL_BLOCK_SIZE), | 672 | (ctrl * MSI_REG_CTRL_BLOCK_SIZE), |
664 | 4, &pp->irq_status[ctrl]); | 673 | 4, ~0); |
674 | pp->irq_status[ctrl] = 0; | ||
675 | } | ||
665 | 676 | ||
666 | /* Setup RC BARs */ | 677 | /* Setup RC BARs */ |
667 | dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_0, 0x00000004); | 678 | dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_0, 0x00000004); |
@@ -699,6 +710,9 @@ void dw_pcie_setup_rc(struct pcie_port *pp) | |||
699 | dev_dbg(pci->dev, "iATU unroll: %s\n", | 710 | dev_dbg(pci->dev, "iATU unroll: %s\n", |
700 | pci->iatu_unroll_enabled ? "enabled" : "disabled"); | 711 | pci->iatu_unroll_enabled ? "enabled" : "disabled"); |
701 | 712 | ||
713 | if (pci->iatu_unroll_enabled && !pci->atu_base) | ||
714 | pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET; | ||
715 | |||
702 | dw_pcie_prog_outbound_atu(pci, PCIE_ATU_REGION_INDEX0, | 716 | dw_pcie_prog_outbound_atu(pci, PCIE_ATU_REGION_INDEX0, |
703 | PCIE_ATU_TYPE_MEM, pp->mem_base, | 717 | PCIE_ATU_TYPE_MEM, pp->mem_base, |
704 | pp->mem_bus_addr, pp->mem_size); | 718 | pp->mem_bus_addr, pp->mem_size); |