Skip to content

Commit b6f6167

Browse files
committed
Merge tag 'pci-v6.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
Pull PCI updates from Bjorn Helgaas: "Enumeration: - Add locking to read/modify/write PCIe Capability Register accessors for Link Control and Root Control - Use pci_dev_id() when possible instead of manually composing ID from dev->bus->number and dev->devfn Resource management: - Move prototypes for __weak sysfs resource files to linux/pci.h to fix 'no previous prototype' warnings - Make more I/O port accesses depend on HAS_IOPORT - Use devm_platform_get_and_ioremap_resource() instead of open-coding platform_get_resource() followed by devm_ioremap_resource() Power management: - Ensure devices are powered up while accessing VPD - If device is powered-up, keep it that way while polling for PME - Only read PCI_PM_CTRL register when available, to avoid reading the wrong register and corrupting dev->current_state Virtualization: - Avoid Secondary Bus Reset on NVIDIA T4 GPUs Error handling: - Remove unused pci_disable_pcie_error_reporting() - Unexport pci_enable_pcie_error_reporting(), used only by aer.c - Unexport pcie_port_bus_type, used only by PCI core VGA: - Simplify and clean up typos in VGA arbiter Apple PCIe controller driver: - Initialize pcie->nvecs (number of available MSIs) before use Broadcom iProc PCIe controller driver: - Use of_property_read_bool() instead of low-level accessors for boolean properties Broadcom STB PCIe controller driver: - Assert PERST# when probing BCM2711 because some bootloaders don't do it Freescale i.MX6 PCIe controller driver: - Add .host_deinit() callback so we can clean up things like regulators on probe failure or driver unload Freescale Layerscape PCIe controller driver: - Add support for link-down notification so the endpoint driver can process LINK_DOWN events - Add suspend/resume support, including manual PME_Turn_off/PME_TO_Ack handshake - Save Link Capabilities during probe so they can be restored when handling a link-up event, since the controller loses the Link Width and Link Speed values during reset Intel VMD host bridge driver: - Fix disable of bridge windows during domain reset; previously we cleared the base/limit registers, which actually left the windows enabled Marvell MVEBU PCIe controller driver: - Remove unused busn member Microchip PolarFlare PCIe controller driver: - Fix interrupt bit definitions so the SEC and DED interrupt handlers work correctly - Make driver buildable as a module - Read FPGA MSI configuration parameters from hardware instead of hard-coding them Microsoft Hyper-V host bridge driver: - To avoid a NULL pointer dereference, skip MSI restore after hibernate if MSI/MSI-X hasn't been enabled NVIDIA Tegra194 PCIe controller driver: - Revert 'PCI: tegra194: Enable support for 256 Byte payload' because Linux doesn't know how to reduce MPS from to 256 to 128 bytes for endpoints below a switch (because other devices below the switch might already be operating), which leads to 'Malformed TLP' errors Qualcomm PCIe controller driver: - Add DT and driver support for interconnect bandwidth voting for 'pcie-mem' and 'cpu-pcie' interconnects - Fix broken SDX65 'compatible' DT property - Configure controller so MHI bus master clock will be switched off while in ASPM L1.x states - Use alignment restriction from EPF core in EPF MHI driver - Add Endpoint eDMA support - Add MHI eDMA support - Add Snapdragon SM8450 support to the EPF MHI driversupport - Add MHI eDMA support - Add Snapdragon SM8450 support to the EPF MHI driversupport - Add MHI eDMA support - Add Snapdragon SM8450 support to the EPF MHI driversupport - Add MHI eDMA support - Add Snapdragon SM8450 support to the EPF MHI driver - Use iATU for EPF MHI transfers smaller than 4K to avoid eDMA setup latency - Add sa8775p DT binding and driver support Rockchip PCIe controller driver: - Use 64-bit mask on MSI 64-bit PCI address to avoid zeroing out the upper 32 bits SiFive FU740 PCIe controller driver: - Set the supported number of MSI vectors so we can use all available MSI interrupts Synopsys DesignWare PCIe controller driver: - Add generic dwc suspend/resume APIs (dw_pcie_suspend_noirq() and dw_pcie_resume_noirq()) to be called by controller driver suspend/resume ops, and a controller callback to send PME_Turn_Off MicroSemi Switchtec management driver: - Add support for PCIe Gen5 devices Miscellaneous: - Reorder and compress to reduce size of struct pci_dev - Fix race in DOE destroy_work_on_stack() - Add stubs to avoid casts between incompatible function types - Explicitly include correct DT includes to untangle headers" * tag 'pci-v6.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: (96 commits) PCI: qcom-ep: Add ICC bandwidth voting support dt-bindings: PCI: qcom: ep: Add interconnects path PCI: qcom-ep: Treat unknown IRQ events as an error dt-bindings: PCI: qcom: Fix SDX65 compatible PCI: endpoint: Add kernel-doc for pci_epc_mem_init() API PCI: epf-mhi: Use iATU for small transfers PCI: epf-mhi: Add support for SM8450 PCI: epf-mhi: Add eDMA support PCI: qcom-ep: Add eDMA support PCI: epf-mhi: Make use of the alignment restriction from EPF core PCI/PM: Only read PCI_PM_CTRL register when available PCI: qcom: Add support for sa8775p SoC dt-bindings: PCI: qcom: Add sa8775p compatible PCI: qcom-ep: Pass alignment restriction to the EPF core PCI: Simplify pcie_capability_clear_and_set_word() control flow PCI: Tidy config space save/restore messages PCI: Fix code formatting inconsistencies PCI: Fix typos in docs and comments PCI: Fix pci_bus_resetable(), pci_slot_resetable() name typos PCI: Simplify pci_dev_driver() ...
2 parents cd99b9e + 43cc31d commit b6f6167

Some content is hidden

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

91 files changed

+1620
-868
lines changed

Documentation/PCI/pci-error-recovery.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ chipsets are able to deal with these errors; these include PCI-E chipsets,
1717
and the PCI-host bridges found on IBM Power4, Power5 and Power6-based
1818
pSeries boxes. A typical action taken is to disconnect the affected device,
1919
halting all I/O to it. The goal of a disconnection is to avoid system
20-
corruption; for example, to halt system memory corruption due to DMA's
20+
corruption; for example, to halt system memory corruption due to DMAs
2121
to "wild" addresses. Typically, a reconnection mechanism is also
2222
offered, so that the affected PCI device(s) are reset and put back
2323
into working condition. The reset phase requires coordination
@@ -178,9 +178,9 @@ is STEP 6 (Permanent Failure).
178178
complex and not worth implementing.
179179

180180
The current powerpc implementation doesn't much care if the device
181-
attempts I/O at this point, or not. I/O's will fail, returning
181+
attempts I/O at this point, or not. I/Os will fail, returning
182182
a value of 0xff on read, and writes will be dropped. If more than
183-
EEH_MAX_FAILS I/O's are attempted to a frozen adapter, EEH
183+
EEH_MAX_FAILS I/Os are attempted to a frozen adapter, EEH
184184
assumes that the device driver has gone into an infinite loop
185185
and prints an error to syslog. A reboot is then required to
186186
get the device working again.
@@ -204,7 +204,7 @@ instead will have gone directly to STEP 3 (Link Reset) or STEP 4 (Slot Reset)
204204
.. note::
205205

206206
The following is proposed; no platform implements this yet:
207-
Proposal: All I/O's should be done _synchronously_ from within
207+
Proposal: All I/Os should be done _synchronously_ from within
208208
this callback, errors triggered by them will be returned via
209209
the normal pci_check_whatever() API, no new error_detected()
210210
callback will be issued due to an error happening here. However,
@@ -258,7 +258,7 @@ Powerpc platforms implement two levels of slot reset:
258258
soft reset(default) and fundamental(optional) reset.
259259

260260
Powerpc soft reset consists of asserting the adapter #RST line and then
261-
restoring the PCI BAR's and PCI configuration header to a state
261+
restoring the PCI BARs and PCI configuration header to a state
262262
that is equivalent to what it would be after a fresh system
263263
power-on followed by power-on BIOS/system firmware initialization.
264264
Soft reset is also known as hot-reset.
@@ -362,7 +362,7 @@ permanent failure in some way. If the device is hotplug-capable,
362362
the operator will probably want to remove and replace the device.
363363
Note, however, not all failures are truly "permanent". Some are
364364
caused by over-heating, some by a poorly seated card. Many
365-
PCI error events are caused by software bugs, e.g. DMA's to
365+
PCI error events are caused by software bugs, e.g. DMAs to
366366
wild addresses or bogus split transactions due to programming
367367
errors. See the discussion in Documentation/powerpc/eeh-pci-error-recovery.rst
368368
for additional detail on real-life experience of the causes of

Documentation/PCI/pciebus-howto.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,12 @@ PCI Config Registers
213213
--------------------
214214

215215
Each service driver runs its PCI config operations on its own
216-
capability structure except the PCI Express capability structure, in
217-
which Root Control register and Device Control register are shared
218-
between PME and AER. This patch assumes that all service drivers
219-
will be well behaved and not overwrite other service driver's
220-
configuration settings.
216+
capability structure except the PCI Express capability structure,
217+
that is shared between many drivers including the service drivers.
218+
RMW Capability accessors (pcie_capability_clear_and_set_word(),
219+
pcie_capability_set_word(), and pcie_capability_clear_word()) protect
220+
a selected set of PCI Express Capability Registers (Link Control
221+
Register and Root Control Register). Any change to those registers
222+
should be performed using RMW accessors to avoid problems due to
223+
concurrent updates. For the up-to-date list of protected registers,
224+
see pcie_capability_clear_and_set_word().

Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ maintainers:
1111

1212
properties:
1313
compatible:
14-
enum:
15-
- qcom,sdx55-pcie-ep
16-
- qcom,sdx65-pcie-ep
17-
- qcom,sm8450-pcie-ep
14+
oneOf:
15+
- enum:
16+
- qcom,sdx55-pcie-ep
17+
- qcom,sm8450-pcie-ep
18+
- items:
19+
- const: qcom,sdx65-pcie-ep
20+
- const: qcom,sdx55-pcie-ep
1821

1922
reg:
2023
items:
@@ -71,6 +74,14 @@ properties:
7174
description: GPIO used as WAKE# output signal
7275
maxItems: 1
7376

77+
interconnects:
78+
maxItems: 2
79+
80+
interconnect-names:
81+
items:
82+
- const: pcie-mem
83+
- const: cpu-pcie
84+
7485
resets:
7586
maxItems: 1
7687

@@ -98,6 +109,8 @@ required:
98109
- interrupts
99110
- interrupt-names
100111
- reset-gpios
112+
- interconnects
113+
- interconnect-names
101114
- resets
102115
- reset-names
103116
- power-domains
@@ -110,7 +123,6 @@ allOf:
110123
contains:
111124
enum:
112125
- qcom,sdx55-pcie-ep
113-
- qcom,sdx65-pcie-ep
114126
then:
115127
properties:
116128
clocks:
@@ -167,7 +179,9 @@ examples:
167179
- |
168180
#include <dt-bindings/clock/qcom,gcc-sdx55.h>
169181
#include <dt-bindings/gpio/gpio.h>
182+
#include <dt-bindings/interconnect/qcom,sdx55.h>
170183
#include <dt-bindings/interrupt-controller/arm-gic.h>
184+
171185
pcie_ep: pcie-ep@1c00000 {
172186
compatible = "qcom,sdx55-pcie-ep";
173187
reg = <0x01c00000 0x3000>,
@@ -194,6 +208,9 @@ examples:
194208
interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
195209
<GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
196210
interrupt-names = "global", "doorbell";
211+
interconnects = <&system_noc MASTER_PCIE &mc_virt SLAVE_EBI_CH0>,
212+
<&mem_noc MASTER_AMPSS_M0 &system_noc SLAVE_PCIE_0>;
213+
interconnect-names = "pcie-mem", "cpu-pcie";
197214
reset-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
198215
wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>;
199216
resets = <&gcc GCC_PCIE_BCR>;

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ properties:
2929
- qcom,pcie-msm8996
3030
- qcom,pcie-qcs404
3131
- qcom,pcie-sa8540p
32+
- qcom,pcie-sa8775p
3233
- qcom,pcie-sc7280
3334
- qcom,pcie-sc8180x
3435
- qcom,pcie-sc8280xp
@@ -211,6 +212,7 @@ allOf:
211212
compatible:
212213
contains:
213214
enum:
215+
- qcom,pcie-sa8775p
214216
- qcom,pcie-sc7280
215217
- qcom,pcie-sc8180x
216218
- qcom,pcie-sc8280xp
@@ -743,12 +745,37 @@ allOf:
743745
items:
744746
- const: pci # PCIe core reset
745747

748+
- if:
749+
properties:
750+
compatible:
751+
contains:
752+
enum:
753+
- qcom,pcie-sa8775p
754+
then:
755+
properties:
756+
clocks:
757+
minItems: 5
758+
maxItems: 5
759+
clock-names:
760+
items:
761+
- const: aux # Auxiliary clock
762+
- const: cfg # Configuration clock
763+
- const: bus_master # Master AXI clock
764+
- const: bus_slave # Slave AXI clock
765+
- const: slave_q2a # Slave Q2A clock
766+
resets:
767+
maxItems: 1
768+
reset-names:
769+
items:
770+
- const: pci # PCIe core reset
771+
746772
- if:
747773
properties:
748774
compatible:
749775
contains:
750776
enum:
751777
- qcom,pcie-sa8540p
778+
- qcom,pcie-sa8775p
752779
- qcom,pcie-sc8280xp
753780
then:
754781
required:
@@ -790,6 +817,7 @@ allOf:
790817
contains:
791818
enum:
792819
- qcom,pcie-msm8996
820+
- qcom,pcie-sa8775p
793821
- qcom,pcie-sc7280
794822
- qcom,pcie-sc8180x
795823
- qcom,pcie-sdm845

arch/alpha/include/asm/pci.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,4 @@ extern void pci_adjust_legacy_attr(struct pci_bus *bus,
8888
enum pci_mmap_state mmap_type);
8989
#define HAVE_PCI_LEGACY 1
9090

91-
extern int pci_create_resource_files(struct pci_dev *dev);
92-
extern void pci_remove_resource_files(struct pci_dev *dev);
93-
9491
#endif /* __ALPHA_PCI_H */

arch/x86/pci/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ static inline struct irq_routing_table *pirq_convert_irt_table(u8 *addr,
136136
if (ir->signature != IRT_SIGNATURE || !ir->used || ir->size < ir->used)
137137
return NULL;
138138

139-
size = sizeof(*ir) + ir->used * sizeof(ir->slots[0]);
139+
size = struct_size(ir, slots, ir->used);
140140
if (size > limit - addr)
141141
return NULL;
142142

143143
DBG(KERN_DEBUG "PCI: $IRT Interrupt Routing Table found at 0x%lx\n",
144144
__pa(ir));
145145

146-
size = sizeof(*rt) + ir->used * sizeof(rt->slots[0]);
146+
size = struct_size(rt, slots, ir->used);
147147
rt = kzalloc(size, GFP_KERNEL);
148148
if (!rt)
149149
return NULL;

drivers/gpu/drm/amd/amdgpu/cik.c

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,17 +1574,8 @@ static void cik_pcie_gen3_enable(struct amdgpu_device *adev)
15741574
u16 bridge_cfg2, gpu_cfg2;
15751575
u32 max_lw, current_lw, tmp;
15761576

1577-
pcie_capability_read_word(root, PCI_EXP_LNKCTL,
1578-
&bridge_cfg);
1579-
pcie_capability_read_word(adev->pdev, PCI_EXP_LNKCTL,
1580-
&gpu_cfg);
1581-
1582-
tmp16 = bridge_cfg | PCI_EXP_LNKCTL_HAWD;
1583-
pcie_capability_write_word(root, PCI_EXP_LNKCTL, tmp16);
1584-
1585-
tmp16 = gpu_cfg | PCI_EXP_LNKCTL_HAWD;
1586-
pcie_capability_write_word(adev->pdev, PCI_EXP_LNKCTL,
1587-
tmp16);
1577+
pcie_capability_set_word(root, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_HAWD);
1578+
pcie_capability_set_word(adev->pdev, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_HAWD);
15881579

15891580
tmp = RREG32_PCIE(ixPCIE_LC_STATUS1);
15901581
max_lw = (tmp & PCIE_LC_STATUS1__LC_DETECTED_LINK_WIDTH_MASK) >>
@@ -1637,21 +1628,14 @@ static void cik_pcie_gen3_enable(struct amdgpu_device *adev)
16371628
msleep(100);
16381629

16391630
/* linkctl */
1640-
pcie_capability_read_word(root, PCI_EXP_LNKCTL,
1641-
&tmp16);
1642-
tmp16 &= ~PCI_EXP_LNKCTL_HAWD;
1643-
tmp16 |= (bridge_cfg & PCI_EXP_LNKCTL_HAWD);
1644-
pcie_capability_write_word(root, PCI_EXP_LNKCTL,
1645-
tmp16);
1646-
1647-
pcie_capability_read_word(adev->pdev,
1648-
PCI_EXP_LNKCTL,
1649-
&tmp16);
1650-
tmp16 &= ~PCI_EXP_LNKCTL_HAWD;
1651-
tmp16 |= (gpu_cfg & PCI_EXP_LNKCTL_HAWD);
1652-
pcie_capability_write_word(adev->pdev,
1653-
PCI_EXP_LNKCTL,
1654-
tmp16);
1631+
pcie_capability_clear_and_set_word(root, PCI_EXP_LNKCTL,
1632+
PCI_EXP_LNKCTL_HAWD,
1633+
bridge_cfg &
1634+
PCI_EXP_LNKCTL_HAWD);
1635+
pcie_capability_clear_and_set_word(adev->pdev, PCI_EXP_LNKCTL,
1636+
PCI_EXP_LNKCTL_HAWD,
1637+
gpu_cfg &
1638+
PCI_EXP_LNKCTL_HAWD);
16551639

16561640
/* linkctl2 */
16571641
pcie_capability_read_word(root, PCI_EXP_LNKCTL2,

drivers/gpu/drm/amd/amdgpu/si.c

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,17 +2276,8 @@ static void si_pcie_gen3_enable(struct amdgpu_device *adev)
22762276
u16 bridge_cfg2, gpu_cfg2;
22772277
u32 max_lw, current_lw, tmp;
22782278

2279-
pcie_capability_read_word(root, PCI_EXP_LNKCTL,
2280-
&bridge_cfg);
2281-
pcie_capability_read_word(adev->pdev, PCI_EXP_LNKCTL,
2282-
&gpu_cfg);
2283-
2284-
tmp16 = bridge_cfg | PCI_EXP_LNKCTL_HAWD;
2285-
pcie_capability_write_word(root, PCI_EXP_LNKCTL, tmp16);
2286-
2287-
tmp16 = gpu_cfg | PCI_EXP_LNKCTL_HAWD;
2288-
pcie_capability_write_word(adev->pdev, PCI_EXP_LNKCTL,
2289-
tmp16);
2279+
pcie_capability_set_word(root, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_HAWD);
2280+
pcie_capability_set_word(adev->pdev, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_HAWD);
22902281

22912282
tmp = RREG32_PCIE(PCIE_LC_STATUS1);
22922283
max_lw = (tmp & LC_DETECTED_LINK_WIDTH_MASK) >> LC_DETECTED_LINK_WIDTH_SHIFT;
@@ -2331,21 +2322,14 @@ static void si_pcie_gen3_enable(struct amdgpu_device *adev)
23312322

23322323
mdelay(100);
23332324

2334-
pcie_capability_read_word(root, PCI_EXP_LNKCTL,
2335-
&tmp16);
2336-
tmp16 &= ~PCI_EXP_LNKCTL_HAWD;
2337-
tmp16 |= (bridge_cfg & PCI_EXP_LNKCTL_HAWD);
2338-
pcie_capability_write_word(root, PCI_EXP_LNKCTL,
2339-
tmp16);
2340-
2341-
pcie_capability_read_word(adev->pdev,
2342-
PCI_EXP_LNKCTL,
2343-
&tmp16);
2344-
tmp16 &= ~PCI_EXP_LNKCTL_HAWD;
2345-
tmp16 |= (gpu_cfg & PCI_EXP_LNKCTL_HAWD);
2346-
pcie_capability_write_word(adev->pdev,
2347-
PCI_EXP_LNKCTL,
2348-
tmp16);
2325+
pcie_capability_clear_and_set_word(root, PCI_EXP_LNKCTL,
2326+
PCI_EXP_LNKCTL_HAWD,
2327+
bridge_cfg &
2328+
PCI_EXP_LNKCTL_HAWD);
2329+
pcie_capability_clear_and_set_word(adev->pdev, PCI_EXP_LNKCTL,
2330+
PCI_EXP_LNKCTL_HAWD,
2331+
gpu_cfg &
2332+
PCI_EXP_LNKCTL_HAWD);
23492333

23502334
pcie_capability_read_word(root, PCI_EXP_LNKCTL2,
23512335
&tmp16);

drivers/gpu/drm/radeon/cik.c

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9534,17 +9534,8 @@ static void cik_pcie_gen3_enable(struct radeon_device *rdev)
95349534
u16 bridge_cfg2, gpu_cfg2;
95359535
u32 max_lw, current_lw, tmp;
95369536

9537-
pcie_capability_read_word(root, PCI_EXP_LNKCTL,
9538-
&bridge_cfg);
9539-
pcie_capability_read_word(rdev->pdev, PCI_EXP_LNKCTL,
9540-
&gpu_cfg);
9541-
9542-
tmp16 = bridge_cfg | PCI_EXP_LNKCTL_HAWD;
9543-
pcie_capability_write_word(root, PCI_EXP_LNKCTL, tmp16);
9544-
9545-
tmp16 = gpu_cfg | PCI_EXP_LNKCTL_HAWD;
9546-
pcie_capability_write_word(rdev->pdev, PCI_EXP_LNKCTL,
9547-
tmp16);
9537+
pcie_capability_set_word(root, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_HAWD);
9538+
pcie_capability_set_word(rdev->pdev, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_HAWD);
95489539

95499540
tmp = RREG32_PCIE_PORT(PCIE_LC_STATUS1);
95509541
max_lw = (tmp & LC_DETECTED_LINK_WIDTH_MASK) >> LC_DETECTED_LINK_WIDTH_SHIFT;
@@ -9591,21 +9582,14 @@ static void cik_pcie_gen3_enable(struct radeon_device *rdev)
95919582
msleep(100);
95929583

95939584
/* linkctl */
9594-
pcie_capability_read_word(root, PCI_EXP_LNKCTL,
9595-
&tmp16);
9596-
tmp16 &= ~PCI_EXP_LNKCTL_HAWD;
9597-
tmp16 |= (bridge_cfg & PCI_EXP_LNKCTL_HAWD);
9598-
pcie_capability_write_word(root, PCI_EXP_LNKCTL,
9599-
tmp16);
9600-
9601-
pcie_capability_read_word(rdev->pdev,
9602-
PCI_EXP_LNKCTL,
9603-
&tmp16);
9604-
tmp16 &= ~PCI_EXP_LNKCTL_HAWD;
9605-
tmp16 |= (gpu_cfg & PCI_EXP_LNKCTL_HAWD);
9606-
pcie_capability_write_word(rdev->pdev,
9607-
PCI_EXP_LNKCTL,
9608-
tmp16);
9585+
pcie_capability_clear_and_set_word(root, PCI_EXP_LNKCTL,
9586+
PCI_EXP_LNKCTL_HAWD,
9587+
bridge_cfg &
9588+
PCI_EXP_LNKCTL_HAWD);
9589+
pcie_capability_clear_and_set_word(rdev->pdev, PCI_EXP_LNKCTL,
9590+
PCI_EXP_LNKCTL_HAWD,
9591+
gpu_cfg &
9592+
PCI_EXP_LNKCTL_HAWD);
96099593

96109594
/* linkctl2 */
96119595
pcie_capability_read_word(root, PCI_EXP_LNKCTL2,

0 commit comments

Comments
 (0)