diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2023-08-29 18:03:49 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-08-29 18:03:49 +0200 |
commit | 8b524514e49670d3ab81c7dca18fdc55d82631d4 (patch) | |
tree | 681257fbda0657d2fee37fbcc3999ce419515786 /drivers/pci/hotplug | |
parent | Merge branch 'pci/ioport' (diff) | |
parent | PCI: Simplify pcie_capability_clear_and_set_word() control flow (diff) | |
download | linux-8b524514e49670d3ab81c7dca18fdc55d82631d4.tar.xz linux-8b524514e49670d3ab81c7dca18fdc55d82631d4.zip |
Merge branch 'pci/pcie-rmw'
- Add locking for read/modify/write PCIe Capability Register accessors for
Link Control and Root Control (Ilpo Järvinen)
- Use PCIe RMW accessors for Link Control updates in PCI core, pciehp,
amdgpu, radeon, mlx5, ath10k, ath11k, ath12k (Ilpo Järvinen)
- Convert PCIBIOS error values in mlx5 to generic errnos (Ilpo Järvinen)
- Simplify pcie_capability_clear_and_set_word() control flow (Bjorn
Helgaas)
* pci/pcie-rmw:
PCI: Simplify pcie_capability_clear_and_set_word() control flow
net/mlx5: Convert PCI error values to generic errnos
PCI: Document the Capability accessor RMW improvements
wifi: ath10k: Use RMW accessors for changing LNKCTL
wifi: ath12k: Use RMW accessors for changing LNKCTL
wifi: ath11k: Use RMW accessors for changing LNKCTL
net/mlx5: Use RMW accessors for changing LNKCTL
drm/radeon: Use RMW accessors for changing LNKCTL
drm/amdgpu: Use RMW accessors for changing LNKCTL
PCI/ASPM: Use RMW accessors for changing LNKCTL
PCI: pciehp: Use RMW accessors for changing LNKCTL
PCI: Make link retraining use RMW accessors for changing LNKCTL
PCI: Add locking to RMW PCI Express Capability Register accessors
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 8711325605f0..fd713abdfb9f 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -332,17 +332,11 @@ int pciehp_check_link_status(struct controller *ctrl) static int __pciehp_link_set(struct controller *ctrl, bool enable) { struct pci_dev *pdev = ctrl_dev(ctrl); - u16 lnk_ctrl; - pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &lnk_ctrl); + pcie_capability_clear_and_set_word(pdev, PCI_EXP_LNKCTL, + PCI_EXP_LNKCTL_LD, + enable ? 0 : PCI_EXP_LNKCTL_LD); - if (enable) - lnk_ctrl &= ~PCI_EXP_LNKCTL_LD; - else - lnk_ctrl |= PCI_EXP_LNKCTL_LD; - - pcie_capability_write_word(pdev, PCI_EXP_LNKCTL, lnk_ctrl); - ctrl_dbg(ctrl, "%s: lnk_ctrl = %x\n", __func__, lnk_ctrl); return 0; } |