Skip to content

Commit 26dca6d

Browse files
committed
Merge tag 'pci-v5.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas: "Resource management: - Improve resource assignment for hot-added nested bridges, e.g., Thunderbolt (Nicholas Johnson) Power management: - Optionally print config space of devices before suspend (Chen Yu) - Increase D3 delay for AMD Ryzen5/7 XHCI controllers (Daniel Drake) Virtualization: - Generalize DMA alias quirks (James Sewart) - Add DMA alias quirk for PLX PEX NTB (James Sewart) - Fix IOV memory leak (Navid Emamdoost) AER: - Log which device prevents error recovery (Yicong Yang) Peer-to-peer DMA: - Whitelist Intel SkyLake-E (Armen Baloyan) Broadcom iProc host bridge driver: - Apply PAXC quirk whether driver is built-in or module (Wei Liu) Broadcom STB host bridge driver: - Add Broadcom STB PCIe host controller driver (Jim Quinlan) Intel Gateway SoC host bridge driver: - Add driver for Intel Gateway SoC (Dilip Kota) Intel VMD host bridge driver: - Add support for DMA aliases on other buses (Jon Derrick) - Remove dma_map_ops overrides (Jon Derrick) - Remove now-unused X86_DEV_DMA_OPS (Christoph Hellwig) NVIDIA Tegra host bridge driver: - Fix Tegra30 afi_pex2_ctrl register offset (Marcel Ziswiler) Panasonic UniPhier host bridge driver: - Remove module code since driver can't be built as a module (Masahiro Yamada) Qualcomm host bridge driver: - Add support for SDM845 PCIe controller (Bjorn Andersson) TI Keystone host bridge driver: - Fix "num-viewport" DT property error handling (Kishon Vijay Abraham I) - Fix link training retries initiation (Yurii Monakov) - Fix outbound region mapping (Yurii Monakov) Misc: - Add Switchtec Gen4 support (Kelvin Cao) - Add Switchtec Intercomm Notify and Upstream Error Containment support (Logan Gunthorpe) - Use dma_set_mask_and_coherent() since Switchtec supports 64-bit addressing (Wesley Sheng)" * tag 'pci-v5.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (60 commits) PCI: Allow adjust_bridge_window() to shrink resource if necessary PCI: Set resource size directly in adjust_bridge_window() PCI: Rename extend_bridge_window() to adjust_bridge_window() PCI: Rename extend_bridge_window() parameter PCI: Consider alignment of hot-added bridges when assigning resources PCI: Remove local variable usage in pci_bus_distribute_available_resources() PCI: Pass size + alignment to pci_bus_distribute_available_resources() PCI: Rename variables PCI: vmd: Add two VMD Device IDs PCI: Remove unnecessary braces PCI: brcmstb: Add MSI support PCI: brcmstb: Add Broadcom STB PCIe host controller driver x86/PCI: Remove X86_DEV_DMA_OPS PCI: vmd: Remove dma_map_ops overrides iommu/vt-d: Remove VMD child device sanity check iommu/vt-d: Use pci_real_dma_dev() for mapping PCI: Introduce pci_real_dma_dev() x86/PCI: Expose VMD's pci_dev in struct pci_sysdata x86/PCI: Add to_pci_sysdata() helper PCI/AER: Initialize aer_fifo ...
2 parents 846de71 + 01b810e commit 26dca6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2800
-519
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Andi Shyti <[email protected]> <[email protected]>
2727
Andreas Herrmann <[email protected]>
2828
2929
Andrew Morton <[email protected]>
30+
31+
3032
Andrew Vasquez <[email protected]>
3133
Andy Adamson <[email protected]>
3234
Antoine Tenart <[email protected]>

Documentation/PCI/msi-howto.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,5 +283,5 @@ or disabled (0). If 0 is found in any of the msi_bus files belonging
283283
to bridges between the PCI root and the device, MSIs are disabled.
284284

285285
It is also worth checking the device driver to see whether it supports MSIs.
286-
For example, it may contain calls to pci_irq_alloc_vectors() with the
286+
For example, it may contain calls to pci_alloc_irq_vectors() with the
287287
PCI_IRQ_MSI or PCI_IRQ_MSIX flags.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pci/brcm,stb-pcie.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Brcmstb PCIe Host Controller Device Tree Bindings
8+
9+
maintainers:
10+
- Nicolas Saenz Julienne <[email protected]>
11+
12+
allOf:
13+
- $ref: /schemas/pci/pci-bus.yaml#
14+
15+
properties:
16+
compatible:
17+
const: brcm,bcm2711-pcie # The Raspberry Pi 4
18+
19+
reg:
20+
maxItems: 1
21+
22+
interrupts:
23+
minItems: 1
24+
maxItems: 2
25+
items:
26+
- description: PCIe host controller
27+
- description: builtin MSI controller
28+
29+
interrupt-names:
30+
minItems: 1
31+
maxItems: 2
32+
items:
33+
- const: pcie
34+
- const: msi
35+
36+
ranges:
37+
maxItems: 1
38+
39+
dma-ranges:
40+
maxItems: 1
41+
42+
clocks:
43+
maxItems: 1
44+
45+
clock-names:
46+
items:
47+
- const: sw_pcie
48+
49+
msi-controller:
50+
description: Identifies the node as an MSI controller.
51+
52+
msi-parent:
53+
description: MSI controller the device is capable of using.
54+
55+
brcm,enable-ssc:
56+
description: Indicates usage of spread-spectrum clocking.
57+
type: boolean
58+
59+
required:
60+
- reg
61+
- dma-ranges
62+
- "#interrupt-cells"
63+
- interrupts
64+
- interrupt-names
65+
- interrupt-map-mask
66+
- interrupt-map
67+
- msi-controller
68+
69+
unevaluatedProperties: false
70+
71+
examples:
72+
- |
73+
#include <dt-bindings/interrupt-controller/irq.h>
74+
#include <dt-bindings/interrupt-controller/arm-gic.h>
75+
76+
scb {
77+
#address-cells = <2>;
78+
#size-cells = <1>;
79+
pcie0: pcie@7d500000 {
80+
compatible = "brcm,bcm2711-pcie";
81+
reg = <0x0 0x7d500000 0x9310>;
82+
device_type = "pci";
83+
#address-cells = <3>;
84+
#size-cells = <2>;
85+
#interrupt-cells = <1>;
86+
interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
87+
<GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
88+
interrupt-names = "pcie", "msi";
89+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
90+
interrupt-map = <0 0 0 1 &gicv2 GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
91+
msi-parent = <&pcie0>;
92+
msi-controller;
93+
ranges = <0x02000000 0x0 0xf8000000 0x6 0x00000000 0x0 0x04000000>;
94+
dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;
95+
brcm,enable-ssc;
96+
};
97+
};
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pci/intel-gw-pcie.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: PCIe RC controller on Intel Gateway SoCs
8+
9+
maintainers:
10+
- Dilip Kota <[email protected]>
11+
12+
properties:
13+
compatible:
14+
items:
15+
- const: intel,lgm-pcie
16+
- const: snps,dw-pcie
17+
18+
device_type:
19+
const: pci
20+
21+
"#address-cells":
22+
const: 3
23+
24+
"#size-cells":
25+
const: 2
26+
27+
reg:
28+
items:
29+
- description: Controller control and status registers.
30+
- description: PCIe configuration registers.
31+
- description: Controller application registers.
32+
33+
reg-names:
34+
items:
35+
- const: dbi
36+
- const: config
37+
- const: app
38+
39+
ranges:
40+
maxItems: 1
41+
42+
resets:
43+
maxItems: 1
44+
45+
clocks:
46+
maxItems: 1
47+
48+
phys:
49+
maxItems: 1
50+
51+
phy-names:
52+
const: pcie
53+
54+
reset-gpios:
55+
maxItems: 1
56+
57+
linux,pci-domain: true
58+
59+
num-lanes:
60+
maximum: 2
61+
description: Number of lanes to use for this port.
62+
63+
'#interrupt-cells':
64+
const: 1
65+
66+
interrupt-map-mask:
67+
description: Standard PCI IRQ mapping properties.
68+
69+
interrupt-map:
70+
description: Standard PCI IRQ mapping properties.
71+
72+
max-link-speed:
73+
description: Specify PCI Gen for link capability.
74+
allOf:
75+
- $ref: /schemas/types.yaml#/definitions/uint32
76+
- enum: [ 1, 2, 3, 4 ]
77+
- default: 1
78+
79+
bus-range:
80+
description: Range of bus numbers associated with this controller.
81+
82+
reset-assert-ms:
83+
description: |
84+
Delay after asserting reset to the PCIe device.
85+
maximum: 500
86+
default: 100
87+
88+
required:
89+
- compatible
90+
- device_type
91+
- "#address-cells"
92+
- "#size-cells"
93+
- reg
94+
- reg-names
95+
- ranges
96+
- resets
97+
- clocks
98+
- phys
99+
- phy-names
100+
- reset-gpios
101+
- '#interrupt-cells'
102+
- interrupt-map
103+
- interrupt-map-mask
104+
105+
additionalProperties: false
106+
107+
examples:
108+
- |
109+
#include <dt-bindings/gpio/gpio.h>
110+
#include <dt-bindings/clock/intel,lgm-clk.h>
111+
pcie10: pcie@d0e00000 {
112+
compatible = "intel,lgm-pcie", "snps,dw-pcie";
113+
device_type = "pci";
114+
#address-cells = <3>;
115+
#size-cells = <2>;
116+
reg = <0xd0e00000 0x1000>,
117+
<0xd2000000 0x800000>,
118+
<0xd0a41000 0x1000>;
119+
reg-names = "dbi", "config", "app";
120+
linux,pci-domain = <0>;
121+
max-link-speed = <4>;
122+
bus-range = <0x00 0x08>;
123+
interrupt-parent = <&ioapic1>;
124+
#interrupt-cells = <1>;
125+
interrupt-map-mask = <0 0 0 0x7>;
126+
interrupt-map = <0 0 0 1 &ioapic1 27 1>,
127+
<0 0 0 2 &ioapic1 28 1>,
128+
<0 0 0 3 &ioapic1 29 1>,
129+
<0 0 0 4 &ioapic1 30 1>;
130+
ranges = <0x02000000 0 0xd4000000 0xd4000000 0 0x04000000>;
131+
resets = <&rcu0 0x50 0>;
132+
clocks = <&cgu0 LGM_GCLK_PCIE10>;
133+
phys = <&cb0phy0>;
134+
phy-names = "pcie";
135+
reset-assert-ms = <500>;
136+
reset-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
137+
num-lanes = <2>;
138+
};

Documentation/devicetree/bindings/pci/qcom,pcie.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- "qcom,pcie-ipq4019" for ipq4019
1212
- "qcom,pcie-ipq8074" for ipq8074
1313
- "qcom,pcie-qcs404" for qcs404
14+
- "qcom,pcie-sdm845" for sdm845
1415

1516
- reg:
1617
Usage: required
@@ -126,6 +127,18 @@
126127
- "master_bus" AXI Master clock
127128
- "slave_bus" AXI Slave clock
128129

130+
-clock-names:
131+
Usage: required for sdm845
132+
Value type: <stringlist>
133+
Definition: Should contain the following entries
134+
- "aux" Auxiliary clock
135+
- "cfg" Configuration clock
136+
- "bus_master" Master AXI clock
137+
- "bus_slave" Slave AXI clock
138+
- "slave_q2a" Slave Q2A clock
139+
- "tbu" PCIe TBU clock
140+
- "pipe" PIPE clock
141+
129142
- resets:
130143
Usage: required
131144
Value type: <prop-encoded-array>
@@ -188,6 +201,12 @@
188201
- "pwr" PWR reset
189202
- "ahb" AHB reset
190203

204+
- reset-names:
205+
Usage: required for sdm845
206+
Value type: <stringlist>
207+
Definition: Should contain the following entries
208+
- "pci" PCIe core reset
209+
191210
- power-domains:
192211
Usage: required for apq8084 and msm8996/apq8096
193212
Value type: <prop-encoded-array>

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12914,7 +12914,7 @@ F: arch/x86/kernel/early-quirks.c
1291412914

1291512915
PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
1291612916
M: Lorenzo Pieralisi <[email protected]>
12917-
R: Andrew Murray <[email protected]>
12917+
R: Andrew Murray <[email protected]>
1291812918
1291912919
Q: http://patchwork.ozlabs.org/project/linux-pci/list/
1292012920
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/

arch/x86/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,9 +2931,6 @@ config HAVE_ATOMIC_IOMAP
29312931
def_bool y
29322932
depends on X86_32
29332933

2934-
config X86_DEV_DMA_OPS
2935-
bool
2936-
29372934
source "drivers/firmware/Kconfig"
29382935

29392936
source "arch/x86/kvm/Kconfig"

arch/x86/include/asm/device.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ struct dev_archdata {
88
#endif
99
};
1010

11-
#if defined(CONFIG_X86_DEV_DMA_OPS) && defined(CONFIG_PCI_DOMAINS)
12-
struct dma_domain {
13-
struct list_head node;
14-
const struct dma_map_ops *dma_ops;
15-
int domain_nr;
16-
};
17-
void add_dma_domain(struct dma_domain *domain);
18-
void del_dma_domain(struct dma_domain *domain);
19-
#endif
20-
2111
struct pdev_archdata {
2212
};
2313

arch/x86/include/asm/pci.h

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct pci_sysdata {
2525
void *fwnode; /* IRQ domain for MSI assignment */
2626
#endif
2727
#if IS_ENABLED(CONFIG_VMD)
28-
bool vmd_domain; /* True if in Intel VMD domain */
28+
struct pci_dev *vmd_dev; /* VMD Device if in Intel VMD domain */
2929
#endif
3030
};
3131

@@ -35,12 +35,15 @@ extern int noioapicreroute;
3535

3636
#ifdef CONFIG_PCI
3737

38+
static inline struct pci_sysdata *to_pci_sysdata(const struct pci_bus *bus)
39+
{
40+
return bus->sysdata;
41+
}
42+
3843
#ifdef CONFIG_PCI_DOMAINS
3944
static inline int pci_domain_nr(struct pci_bus *bus)
4045
{
41-
struct pci_sysdata *sd = bus->sysdata;
42-
43-
return sd->domain;
46+
return to_pci_sysdata(bus)->domain;
4447
}
4548

4649
static inline int pci_proc_domain(struct pci_bus *bus)
@@ -52,24 +55,20 @@ static inline int pci_proc_domain(struct pci_bus *bus)
5255
#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
5356
static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
5457
{
55-
struct pci_sysdata *sd = bus->sysdata;
56-
57-
return sd->fwnode;
58+
return to_pci_sysdata(bus)->fwnode;
5859
}
5960

6061
#define pci_root_bus_fwnode _pci_root_bus_fwnode
6162
#endif
6263

64+
#if IS_ENABLED(CONFIG_VMD)
6365
static inline bool is_vmd(struct pci_bus *bus)
6466
{
65-
#if IS_ENABLED(CONFIG_VMD)
66-
struct pci_sysdata *sd = bus->sysdata;
67-
68-
return sd->vmd_domain;
69-
#else
70-
return false;
71-
#endif
67+
return to_pci_sysdata(bus)->vmd_dev != NULL;
7268
}
69+
#else
70+
#define is_vmd(bus) false
71+
#endif /* CONFIG_VMD */
7372

7473
/* Can be used to override the logic in pci_scan_bus for skipping
7574
already-configured bus numbers - to be used for buggy BIOSes
@@ -124,9 +123,7 @@ void native_restore_msi_irqs(struct pci_dev *dev);
124123
/* Returns the node based on pci bus */
125124
static inline int __pcibus_to_node(const struct pci_bus *bus)
126125
{
127-
const struct pci_sysdata *sd = bus->sysdata;
128-
129-
return sd->node;
126+
return to_pci_sysdata(bus)->node;
130127
}
131128

132129
static inline const struct cpumask *

0 commit comments

Comments
 (0)