Skip to content

Commit c0ecd63

Browse files
committed
Merge tag 'pci-v6.11-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
Pull PCI fixes from Bjorn Helgaas: - Fix a pci_intx() regression that caused driver reload to fail with "Resources present before probing" (Philipp Stanner) - Fix a pciehp regression that clobbered the upper bits of RAID status LEDs on NVMe devices behind an Intel VMD (Blazej Kucman) * tag 'pci-v6.11-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: PCI: pciehp: Retain Power Indicator bits for userspace indicators PCI: Fix devres regression in pci_intx()
2 parents 183d46f + 5560a61 commit c0ecd63

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

drivers/pci/hotplug/pciehp_hpc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,9 @@ int pciehp_set_raw_indicator_status(struct hotplug_slot *hotplug_slot,
485485
struct pci_dev *pdev = ctrl_dev(ctrl);
486486

487487
pci_config_pm_runtime_get(pdev);
488-
pcie_write_cmd_nowait(ctrl, FIELD_PREP(PCI_EXP_SLTCTL_AIC, status),
488+
489+
/* Attention and Power Indicator Control bits are supported */
490+
pcie_write_cmd_nowait(ctrl, FIELD_PREP(PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC, status),
489491
PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC);
490492
pci_config_pm_runtime_put(pdev);
491493
return 0;

drivers/pci/pci.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4477,21 +4477,22 @@ void pci_intx(struct pci_dev *pdev, int enable)
44774477
{
44784478
u16 pci_command, new;
44794479

4480-
/* Preserve the "hybrid" behavior for backwards compatibility */
4481-
if (pci_is_managed(pdev)) {
4482-
WARN_ON_ONCE(pcim_intx(pdev, enable) != 0);
4483-
return;
4484-
}
4485-
44864480
pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
44874481

44884482
if (enable)
44894483
new = pci_command & ~PCI_COMMAND_INTX_DISABLE;
44904484
else
44914485
new = pci_command | PCI_COMMAND_INTX_DISABLE;
44924486

4493-
if (new != pci_command)
4487+
if (new != pci_command) {
4488+
/* Preserve the "hybrid" behavior for backwards compatibility */
4489+
if (pci_is_managed(pdev)) {
4490+
WARN_ON_ONCE(pcim_intx(pdev, enable) != 0);
4491+
return;
4492+
}
4493+
44944494
pci_write_config_word(pdev, PCI_COMMAND, new);
4495+
}
44954496
}
44964497
EXPORT_SYMBOL_GPL(pci_intx);
44974498

0 commit comments

Comments
 (0)