Lines Matching +full:async +full:- +full:prefix

1 // SPDX-License-Identifier: GPL-2.0
58 cap = (u16 *)&save_state->cap.data[0]; in pci_save_dpc_state()
59 pci_read_config_word(dev, dev->dpc_cap + PCI_EXP_DPC_CTL, cap); in pci_save_dpc_state()
74 cap = (u16 *)&save_state->cap.data[0]; in pci_restore_dpc_state()
75 pci_write_config_word(dev, dev->dpc_cap + PCI_EXP_DPC_CTL, *cap); in pci_restore_dpc_state()
85 pci_read_config_word(pdev, pdev->dpc_cap + PCI_EXP_DPC_STATUS, &status); in dpc_completed()
89 if (test_bit(PCI_DPC_RECOVERING, &pdev->priv_flags)) in dpc_completed()
96 * pci_dpc_recovered - whether DPC triggered and has recovered successfully
107 if (!pdev->dpc_cap) in pci_dpc_recovered()
114 host = pci_find_host_bridge(pdev->bus); in pci_dpc_recovered()
115 if (!host->native_dpc && !IS_ENABLED(CONFIG_PCIE_EDR)) in pci_dpc_recovered()
126 return test_and_clear_bit(PCI_DPC_RECOVERED, &pdev->priv_flags); in pci_dpc_recovered()
133 u16 cap = pdev->dpc_cap, status; in dpc_wait_rp_inactive()
143 return -EBUSY; in dpc_wait_rp_inactive()
153 set_bit(PCI_DPC_RECOVERING, &pdev->priv_flags); in dpc_reset_link()
159 cap = pdev->dpc_cap; in dpc_reset_link()
168 if (pdev->dpc_rp_extensions && dpc_wait_rp_inactive(pdev)) { in dpc_reset_link()
169 clear_bit(PCI_DPC_RECOVERED, &pdev->priv_flags); in dpc_reset_link()
178 clear_bit(PCI_DPC_RECOVERED, &pdev->priv_flags); in dpc_reset_link()
181 set_bit(PCI_DPC_RECOVERED, &pdev->priv_flags); in dpc_reset_link()
185 clear_bit(PCI_DPC_RECOVERING, &pdev->priv_flags); in dpc_reset_link()
192 u16 cap = pdev->dpc_cap, dpc_status, first_error; in dpc_process_rp_pio_error()
193 u32 status, mask, sev, syserr, exc, log, prefix; in dpc_process_rp_pio_error() local
218 if (pdev->dpc_rp_log_size < 4) in dpc_process_rp_pio_error()
224 if (pdev->dpc_rp_log_size < 5) in dpc_process_rp_pio_error()
229 for (i = 0; i < pdev->dpc_rp_log_size - 5; i++) { in dpc_process_rp_pio_error()
231 cap + PCI_EXP_DPC_RP_PIO_TLPPREFIX_LOG + i * 4, &prefix); in dpc_process_rp_pio_error()
232 pci_err(pdev, "TLP Prefix Header: dw%d, %#010x\n", i, prefix); in dpc_process_rp_pio_error()
241 int pos = dev->aer_cap; in dpc_get_aer_uncorrect_severity()
253 info->severity = AER_FATAL; in dpc_get_aer_uncorrect_severity()
255 info->severity = AER_NONFATAL; in dpc_get_aer_uncorrect_severity()
262 u16 cap = pdev->dpc_cap, status, source, reason, ext_reason; in dpc_process_error()
287 if (pdev->dpc_rp_extensions && in dpc_process_error()
302 if (pdev->dpc_rp_extensions) in pci_clear_surpdn_errors()
303 pci_write_config_dword(pdev, pdev->dpc_cap + in pci_clear_surpdn_errors()
323 if (pdev->dpc_rp_extensions && dpc_wait_rp_inactive(pdev)) in dpc_handle_surprise_removal()
329 pci_write_config_word(pdev, pdev->dpc_cap + PCI_EXP_DPC_STATUS, in dpc_handle_surprise_removal()
333 clear_bit(PCI_DPC_RECOVERED, &pdev->priv_flags); in dpc_handle_surprise_removal()
341 if (!pdev->is_hotplug_bridge) in dpc_is_surprise_removal()
344 if (pci_read_config_word(pdev, pdev->aer_cap + PCI_ERR_UNCOR_STATUS, in dpc_is_surprise_removal()
357 * of async removal and should be ignored by software. in dpc_handler()
375 u16 cap = pdev->dpc_cap, status; in dpc_irq()
393 pdev->dpc_cap = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_DPC); in pci_dpc_init()
394 if (!pdev->dpc_cap) in pci_dpc_init()
397 pci_read_config_word(pdev, pdev->dpc_cap + PCI_EXP_DPC_CAP, &cap); in pci_dpc_init()
401 pdev->dpc_rp_extensions = true; in pci_dpc_init()
404 if (!pdev->dpc_rp_log_size) { in pci_dpc_init()
405 pdev->dpc_rp_log_size = in pci_dpc_init()
407 if (pdev->dpc_rp_log_size < 4 || pdev->dpc_rp_log_size > 9) { in pci_dpc_init()
409 pdev->dpc_rp_log_size); in pci_dpc_init()
410 pdev->dpc_rp_log_size = 0; in pci_dpc_init()
417 struct pci_dev *pdev = dev->port; in dpc_enable()
418 int dpc = pdev->dpc_cap; in dpc_enable()
436 struct pci_dev *pdev = dev->port; in dpc_disable()
437 int dpc = pdev->dpc_cap; in dpc_disable()
446 #define FLAG(x, y) (((x) & (y)) ? '+' : '-')
449 struct pci_dev *pdev = dev->port; in dpc_probe()
450 struct device *device = &dev->device; in dpc_probe()
455 return -ENOTSUPP; in dpc_probe()
457 status = devm_request_threaded_irq(device, dev->irq, dpc_irq, in dpc_probe()
459 "pcie-dpc", pdev); in dpc_probe()
461 pci_warn(pdev, "request IRQ%d failed: %d\n", dev->irq, in dpc_probe()
466 pci_read_config_word(pdev, pdev->dpc_cap + PCI_EXP_DPC_CAP, &cap); in dpc_probe()
469 pci_info(pdev, "enabled with IRQ %d\n", dev->irq); in dpc_probe()
473 FLAG(cap, PCI_EXP_DPC_CAP_SW_TRIGGER), pdev->dpc_rp_log_size, in dpc_probe()