Skip to content

Commit 5c0d0ee

Browse files
sean-jcbjorn-helgaas
authored andcommitted
PCI: Support Immediate Readiness on devices without PM capabilities
Query support for Immediate Readiness irrespective of whether or not the device supports PM capabilities, as nothing in the PCIe spec suggests that Immediate Readiness is in any way dependent on PM functionality. Fixes: d6112f8 ("PCI: Add support for Immediate Readiness") Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: David Matlack <dmatlack@google.com> Cc: Vipin Sharma <vipinsh@google.com> Cc: Aaron Lewis <aaronlewis@google.com> Link: https://patch.msgid.link/20250722155926.352248-1-seanjc@google.com
1 parent 9170304 commit 5c0d0ee

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/pci/pci.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3205,7 +3205,6 @@ void pci_pm_power_up_and_verify_state(struct pci_dev *pci_dev)
32053205
void pci_pm_init(struct pci_dev *dev)
32063206
{
32073207
int pm;
3208-
u16 status;
32093208
u16 pmc;
32103209

32113210
device_enable_async_suspend(&dev->dev);
@@ -3266,9 +3265,6 @@ void pci_pm_init(struct pci_dev *dev)
32663265
pci_pme_active(dev, false);
32673266
}
32683267

3269-
pci_read_config_word(dev, PCI_STATUS, &status);
3270-
if (status & PCI_STATUS_IMM_READY)
3271-
dev->imm_ready = 1;
32723268
pci_pm_power_up_and_verify_state(dev);
32733269
pm_runtime_forbid(&dev->dev);
32743270
pm_runtime_set_active(&dev->dev);

drivers/pci/probe.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,6 +2595,15 @@ void pcie_report_downtraining(struct pci_dev *dev)
25952595
__pcie_print_link_status(dev, false);
25962596
}
25972597

2598+
static void pci_imm_ready_init(struct pci_dev *dev)
2599+
{
2600+
u16 status;
2601+
2602+
pci_read_config_word(dev, PCI_STATUS, &status);
2603+
if (status & PCI_STATUS_IMM_READY)
2604+
dev->imm_ready = 1;
2605+
}
2606+
25982607
static void pci_init_capabilities(struct pci_dev *dev)
25992608
{
26002609
pci_ea_init(dev); /* Enhanced Allocation */
@@ -2604,6 +2613,7 @@ static void pci_init_capabilities(struct pci_dev *dev)
26042613
/* Buffers for saving PCIe and PCI-X capabilities */
26052614
pci_allocate_cap_save_buffers(dev);
26062615

2616+
pci_imm_ready_init(dev); /* Immediate Readiness */
26072617
pci_pm_init(dev); /* Power Management */
26082618
pci_vpd_init(dev); /* Vital Product Data */
26092619
pci_configure_ari(dev); /* Alternative Routing-ID Forwarding */

0 commit comments

Comments
 (0)