History

Merge branch 'pci/error'

- Use pci_channel_state_t instead of enum pci_channel_state (Luc Van Oostenryck) - Simplify __aer_print_error() (Bjorn Helgaas) - Log AER correctable errors as warning, not error (Matt Jolly) - Rename pci_aer_clear_device_status() to pcie_clear_device_status() (Bjorn Helgaas) - Clear PCIe Device Status errors only if OS owns AER (Jonathan Cameron) * pci/error: PCI/ERR: Clear PCIe Device Status errors only if OS owns AER PCI/ERR: Rename pci_aer_clear_device_status() to pcie_clear_device_status() PCI/AER: Log correctable errors as warning, not error PCI/AER: Simplify __aer_print_error() PCI: Use 'pci_channel_state_t' instead of 'enum pci_channel_state'

Bjorn Helgaas committed 6 years ago

Commit b0735e82 parents 3f906da 068c29a20 files · +82 −56Browse files

Unified · Split

20 files
  1. Documentation/PCI/pci-error-recovery.rst +4 −4
  2. arch/powerpc/kernel/eeh_driver.c +1 −1
  3. drivers/block/rsxx/core.c +1 −1
  4. drivers/dma/ioat/init.c +1 −1
  5. drivers/media/pci/ngene/ngene-cards.c +1 −1
  6. drivers/misc/genwqe/card_base.c +1 −1
  7. drivers/net/ethernet/intel/i40e/i40e_main.c +1 −1
  8. drivers/net/ethernet/intel/ice/ice_main.c +1 −1
  9. drivers/net/ethernet/intel/ixgb/ixgb_main.c +2 −2
  10. drivers/net/ethernet/sfc/efx.c +1 −1
  11. drivers/net/ethernet/sfc/falcon/efx.c +1 −1
  12. drivers/pci/pci.c +8 −0
  13. drivers/pci/pci.h +2 −3
  14. drivers/pci/pcie/aer.c +47 −29
  15. drivers/pci/pcie/err.c +4 −3
  16. drivers/pci/pcie/portdrv_pci.c +1 −1
  17. drivers/scsi/aacraid/linit.c +1 −1
  18. drivers/scsi/sym53c8xx_2/sym_glue.c +1 −1
  19. drivers/staging/qlge/qlge_main.c +1 −1
  20. include/linux/pci.h +2 −2
Documentation/PCI/pci-error-recovery.rst+4−4
@@ -79,7 +79,7 @@ This structure has the form:: · 78 unmodified lines
79 79
80 struct pci_error_handlers80 struct pci_error_handlers
81 {81 {
82 int (*error_detected)(struct pci_dev *dev, enum pci_channel_state);82 int (*error_detected)(struct pci_dev *dev, pci_channel_state_t);
83 int (*mmio_enabled)(struct pci_dev *dev);83 int (*mmio_enabled)(struct pci_dev *dev);
84 int (*slot_reset)(struct pci_dev *dev);84 int (*slot_reset)(struct pci_dev *dev);
85 void (*resume)(struct pci_dev *dev);85 void (*resume)(struct pci_dev *dev);
@@ -87,11 +87,11 @@ This structure has the form:: · 1 unmodified line
87 87
88The possible channel states are::88The possible channel states are::
89 89
90 enum pci_channel_state {90 typedef enum {
91 pci_channel_io_normal, /* I/O channel is in normal state */91 pci_channel_io_normal, /* I/O channel is in normal state */
92 pci_channel_io_frozen, /* I/O to channel is blocked */92 pci_channel_io_frozen, /* I/O to channel is blocked */
93 pci_channel_io_perm_failure, /* PCI card is dead */93 pci_channel_io_perm_failure, /* PCI card is dead */
94 };94 } pci_channel_state_t;
95 95
96Possible return values are::96Possible return values are::
97 97
@@ -348,7 +348,7 @@ STEP 6: Permanent Failure · 250 unmodified lines
348-------------------------348-------------------------
349A "permanent failure" has occurred, and the platform cannot recover349A "permanent failure" has occurred, and the platform cannot recover
350the device. The platform will call error_detected() with a350the device. The platform will call error_detected() with a
351pci_channel_state value of pci_channel_io_perm_failure.351pci_channel_state_t value of pci_channel_io_perm_failure.
352 352
353The device driver should, at this point, assume the worst. It should353The device driver should, at this point, assume the worst. It should
354cancel all pending I/O, refuse all new I/O, returning -EIO to354cancel all pending I/O, refuse all new I/O, returning -EIO to
arch/powerpc/kernel/eeh_driver.c+1−1
@@ -214,7 +214,7 @@ static void eeh_dev_save_state(struct eeh_dev *edev, void *userdata) · 213 unmodified lines
214 pci_save_state(pdev);214 pci_save_state(pdev);
215}215}
216 216
217static void eeh_set_channel_state(struct eeh_pe *root, enum pci_channel_state s)217static void eeh_set_channel_state(struct eeh_pe *root, pci_channel_state_t s)
218{218{
219 struct eeh_pe *pe;219 struct eeh_pe *pe;
220 struct eeh_dev *edev, *tmp;220 struct eeh_dev *edev, *tmp;
drivers/block/rsxx/core.c+1−1
@@ -625,7 +625,7 @@ static int rsxx_eeh_fifo_flush_poll(struct rsxx_cardinfo *card) · 624 unmodified lines
625}625}
626 626
627static pci_ers_result_t rsxx_error_detected(struct pci_dev *dev,627static pci_ers_result_t rsxx_error_detected(struct pci_dev *dev,
628 enum pci_channel_state error)628 pci_channel_state_t error)
629{629{
630 int st;630 int st;
631 631
drivers/dma/ioat/init.c+1−1
@@ -1267,7 +1267,7 @@ static void ioat_resume(struct ioatdma_device *ioat_dma) · 1266 unmodified lines
1267#define DRV_NAME "ioatdma"1267#define DRV_NAME "ioatdma"
1268 1268
1269static pci_ers_result_t ioat_pcie_error_detected(struct pci_dev *pdev,1269static pci_ers_result_t ioat_pcie_error_detected(struct pci_dev *pdev,
1270 enum pci_channel_state error)1270 pci_channel_state_t error)
1271{1271{
1272 dev_dbg(&pdev->dev, "%s: PCIe AER error %d\n", DRV_NAME, error);1272 dev_dbg(&pdev->dev, "%s: PCIe AER error %d\n", DRV_NAME, error);
1273 1273
drivers/media/pci/ngene/ngene-cards.c+1−1
@@ -1186,7 +1186,7 @@ MODULE_DEVICE_TABLE(pci, ngene_id_tbl); · 1185 unmodified lines
1186/****************************************************************************/1186/****************************************************************************/
1187 1187
1188static pci_ers_result_t ngene_error_detected(struct pci_dev *dev,1188static pci_ers_result_t ngene_error_detected(struct pci_dev *dev,
1189 enum pci_channel_state state)1189 pci_channel_state_t state)
1190{1190{
1191 dev_err(&dev->dev, "PCI error\n");1191 dev_err(&dev->dev, "PCI error\n");
1192 if (state == pci_channel_io_perm_failure)1192 if (state == pci_channel_io_perm_failure)
drivers/misc/genwqe/card_base.c+1−1
@@ -1240,7 +1240,7 @@ static void genwqe_remove(struct pci_dev *pci_dev) · 1239 unmodified lines
1240 * error is detected.1240 * error is detected.
1241 */1241 */
1242static pci_ers_result_t genwqe_err_error_detected(struct pci_dev *pci_dev,1242static pci_ers_result_t genwqe_err_error_detected(struct pci_dev *pci_dev,
1243 enum pci_channel_state state)1243 pci_channel_state_t state)
1244{1244{
1245 struct genwqe_dev *cd;1245 struct genwqe_dev *cd;
1246 1246
drivers/net/ethernet/intel/i40e/i40e_main.c+1−1
@@ -15465,7 +15465,7 @@ unmap: · 15464 unmodified lines
15465 * remediation.15465 * remediation.
15466 **/15466 **/
15467static pci_ers_result_t i40e_pci_error_detected(struct pci_dev *pdev,15467static pci_ers_result_t i40e_pci_error_detected(struct pci_dev *pdev,
15468 enum pci_channel_state error)15468 pci_channel_state_t error)
15469{15469{
15470 struct i40e_pf *pf = pci_get_drvdata(pdev);15470 struct i40e_pf *pf = pci_get_drvdata(pdev);
15471 15471
drivers/net/ethernet/intel/ice/ice_main.c+1−1
@@ -3586,7 +3586,7 @@ static void ice_remove(struct pci_dev *pdev) · 3585 unmodified lines
3586 * is in progress. Allows the driver to gracefully prepare/handle PCI errors.3586 * is in progress. Allows the driver to gracefully prepare/handle PCI errors.
3587 */3587 */
3588static pci_ers_result_t3588static pci_ers_result_t
3589ice_pci_err_detected(struct pci_dev *pdev, enum pci_channel_state err)3589ice_pci_err_detected(struct pci_dev *pdev, pci_channel_state_t err)
3590{3590{
3591 struct ice_pf *pf = pci_get_drvdata(pdev);3591 struct ice_pf *pf = pci_get_drvdata(pdev);
3592 3592
drivers/net/ethernet/intel/ixgb/ixgb_main.c+2−2
@@ -82,7 +82,7 @@ static int ixgb_vlan_rx_kill_vid(struct net_device *netdev, · 81 unmodified lines
82static void ixgb_restore_vlan(struct ixgb_adapter *adapter);82static void ixgb_restore_vlan(struct ixgb_adapter *adapter);
83 83
84static pci_ers_result_t ixgb_io_error_detected (struct pci_dev *pdev,84static pci_ers_result_t ixgb_io_error_detected (struct pci_dev *pdev,
85 enum pci_channel_state state);85 pci_channel_state_t state);
86static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);86static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);
87static void ixgb_io_resume (struct pci_dev *pdev);87static void ixgb_io_resume (struct pci_dev *pdev);
88 88
@@ -2194,7 +2194,7 @@ ixgb_restore_vlan(struct ixgb_adapter *adapter) · 2105 unmodified lines
2194 * a PCI bus error is detected.2194 * a PCI bus error is detected.
2195 */2195 */
2196static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev,2196static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev,
2197 enum pci_channel_state state)2197 pci_channel_state_t state)
2198{2198{
2199 struct net_device *netdev = pci_get_drvdata(pdev);2199 struct net_device *netdev = pci_get_drvdata(pdev);
2200 struct ixgb_adapter *adapter = netdev_priv(netdev);2200 struct ixgb_adapter *adapter = netdev_priv(netdev);
drivers/net/ethernet/sfc/efx.c+1−1
@@ -1519,7 +1519,7 @@ static const struct dev_pm_ops efx_pm_ops = { · 1518 unmodified lines
1519 * Stop the software path and request a slot reset.1519 * Stop the software path and request a slot reset.
1520 */1520 */
1521static pci_ers_result_t efx_io_error_detected(struct pci_dev *pdev,1521static pci_ers_result_t efx_io_error_detected(struct pci_dev *pdev,
1522 enum pci_channel_state state)1522 pci_channel_state_t state)
1523{1523{
1524 pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED;1524 pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED;
1525 struct efx_nic *efx = pci_get_drvdata(pdev);1525 struct efx_nic *efx = pci_get_drvdata(pdev);
drivers/net/ethernet/sfc/falcon/efx.c+1−1
@@ -3118,7 +3118,7 @@ static const struct dev_pm_ops ef4_pm_ops = { · 3117 unmodified lines
3118 * Stop the software path and request a slot reset.3118 * Stop the software path and request a slot reset.
3119 */3119 */
3120static pci_ers_result_t ef4_io_error_detected(struct pci_dev *pdev,3120static pci_ers_result_t ef4_io_error_detected(struct pci_dev *pdev,
3121 enum pci_channel_state state)3121 pci_channel_state_t state)
3122{3122{
3123 pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED;3123 pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED;
3124 struct ef4_nic *efx = pci_get_drvdata(pdev);3124 struct ef4_nic *efx = pci_get_drvdata(pdev);
drivers/pci/pci.c+8−0
@@ -2173,6 +2173,14 @@ int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state) · 2172 unmodified lines
2173}2173}
2174EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state);2174EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state);
2175 2175
2176void pcie_clear_device_status(struct pci_dev *dev)
2177{
2178 u16 sta;
2179
2180 pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta);
2181 pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta);
2182}
2183
2176/**2184/**
2177 * pcie_clear_root_pme_status - Clear root port PME interrupt status.2185 * pcie_clear_root_pme_status - Clear root port PME interrupt status.
2178 * @dev: PCIe root port or event collector.2186 * @dev: PCIe root port or event collector.
drivers/pci/pci.h+2−3
@@ -92,6 +92,7 @@ void pci_refresh_power_state(struct pci_dev *dev); · 91 unmodified lines
92int pci_power_up(struct pci_dev *dev);92int pci_power_up(struct pci_dev *dev);
93void pci_disable_enabled_device(struct pci_dev *dev);93void pci_disable_enabled_device(struct pci_dev *dev);
94int pci_finish_runtime_suspend(struct pci_dev *dev);94int pci_finish_runtime_suspend(struct pci_dev *dev);
95void pcie_clear_device_status(struct pci_dev *dev);
95void pcie_clear_root_pme_status(struct pci_dev *dev);96void pcie_clear_root_pme_status(struct pci_dev *dev);
96bool pci_check_pme_status(struct pci_dev *dev);97bool pci_check_pme_status(struct pci_dev *dev);
97void pci_pme_wakeup_bus(struct pci_bus *bus);98void pci_pme_wakeup_bus(struct pci_bus *bus);
@@ -555,7 +556,7 @@ static inline int pci_dev_specific_disable_acs_redir(struct pci_dev *dev) · 457 unmodified lines
555 556
556/* PCI error reporting and recovery */557/* PCI error reporting and recovery */
557pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,558pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
558 enum pci_channel_state state,559 pci_channel_state_t state,
559 pci_ers_result_t (*reset_link)(struct pci_dev *pdev));560 pci_ers_result_t (*reset_link)(struct pci_dev *pdev));
560 561
561bool pcie_wait_for_link(struct pci_dev *pdev, bool active);562bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
@@ -658,7 +659,6 @@ void pci_aer_init(struct pci_dev *dev); · 96 unmodified lines
658void pci_aer_exit(struct pci_dev *dev);659void pci_aer_exit(struct pci_dev *dev);
659extern const struct attribute_group aer_stats_attr_group;660extern const struct attribute_group aer_stats_attr_group;
660void pci_aer_clear_fatal_status(struct pci_dev *dev);661void pci_aer_clear_fatal_status(struct pci_dev *dev);
661void pci_aer_clear_device_status(struct pci_dev *dev);
662int pci_aer_clear_status(struct pci_dev *dev);662int pci_aer_clear_status(struct pci_dev *dev);
663int pci_aer_raw_clear_status(struct pci_dev *dev);663int pci_aer_raw_clear_status(struct pci_dev *dev);
664#else664#else
@@ -666,7 +666,6 @@ static inline void pci_no_aer(void) { } · 1 unmodified line
666static inline void pci_aer_init(struct pci_dev *d) { }666static inline void pci_aer_init(struct pci_dev *d) { }
667static inline void pci_aer_exit(struct pci_dev *d) { }667static inline void pci_aer_exit(struct pci_dev *d) { }
668static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { }668static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { }
669static inline void pci_aer_clear_device_status(struct pci_dev *dev) { }
670static inline int pci_aer_clear_status(struct pci_dev *dev) { return -EINVAL; }669static inline int pci_aer_clear_status(struct pci_dev *dev) { return -EINVAL; }
671static inline int pci_aer_raw_clear_status(struct pci_dev *dev) { return -EINVAL; }670static inline int pci_aer_raw_clear_status(struct pci_dev *dev) { return -EINVAL; }
672#endif671#endif
drivers/pci/pcie/aer.c+47−29
@@ -241,14 +241,6 @@ int pci_disable_pcie_error_reporting(struct pci_dev *dev) · 240 unmodified lines
241}241}
242EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);242EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
243 243
244void pci_aer_clear_device_status(struct pci_dev *dev)
245{
246 u16 sta;
247
248 pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta);
249 pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta);
250}
251
252int pci_aer_clear_nonfatal_status(struct pci_dev *dev)244int pci_aer_clear_nonfatal_status(struct pci_dev *dev)
253{245{
254 int aer = dev->aer_cap;246 int aer = dev->aer_cap;
@@ -447,7 +439,7 @@ static const char *aer_error_layer[] = { · 192 unmodified lines
447 "Transaction Layer"439 "Transaction Layer"
448};440};
449 441
450static const char *aer_correctable_error_string[AER_MAX_TYPEOF_COR_ERRS] = {442static const char *aer_correctable_error_string[] = {
451 "RxErr", /* Bit Position 0 */443 "RxErr", /* Bit Position 0 */
452 NULL,444 NULL,
453 NULL,445 NULL,
@@ -464,9 +456,25 @@ static const char *aer_correctable_error_string[AER_MAX_TYPEOF_COR_ERRS] = { · 10 unmodified lines
464 "NonFatalErr", /* Bit Position 13 */456 "NonFatalErr", /* Bit Position 13 */
465 "CorrIntErr", /* Bit Position 14 */457 "CorrIntErr", /* Bit Position 14 */
466 "HeaderOF", /* Bit Position 15 */458 "HeaderOF", /* Bit Position 15 */
459 NULL, /* Bit Position 16 */
460 NULL, /* Bit Position 17 */
461 NULL, /* Bit Position 18 */
462 NULL, /* Bit Position 19 */
463 NULL, /* Bit Position 20 */
464 NULL, /* Bit Position 21 */
465 NULL, /* Bit Position 22 */
466 NULL, /* Bit Position 23 */
467 NULL, /* Bit Position 24 */
468 NULL, /* Bit Position 25 */
469 NULL, /* Bit Position 26 */
470 NULL, /* Bit Position 27 */
471 NULL, /* Bit Position 28 */
472 NULL, /* Bit Position 29 */
473 NULL, /* Bit Position 30 */
474 NULL, /* Bit Position 31 */
467};475};
468 476
469static const char *aer_uncorrectable_error_string[AER_MAX_TYPEOF_UNCOR_ERRS] = {477static const char *aer_uncorrectable_error_string[] = {
470 "Undefined", /* Bit Position 0 */478 "Undefined", /* Bit Position 0 */
471 NULL,479 NULL,
472 NULL,480 NULL,
@@ -494,6 +502,11 @@ static const char *aer_uncorrectable_error_string[AER_MAX_TYPEOF_UNCOR_ERRS] = { · 21 unmodified lines
494 "AtomicOpBlocked", /* Bit Position 24 */502 "AtomicOpBlocked", /* Bit Position 24 */
495 "TLPBlockedErr", /* Bit Position 25 */503 "TLPBlockedErr", /* Bit Position 25 */
496 "PoisonTLPBlocked", /* Bit Position 26 */504 "PoisonTLPBlocked", /* Bit Position 26 */
505 NULL, /* Bit Position 27 */
506 NULL, /* Bit Position 28 */
507 NULL, /* Bit Position 29 */
508 NULL, /* Bit Position 30 */
509 NULL, /* Bit Position 31 */
497};510};
498 511
499static const char *aer_agent_string[] = {512static const char *aer_agent_string[] = {
@@ -650,24 +663,26 @@ static void __print_tlp_header(struct pci_dev *dev, · 150 unmodified lines
650static void __aer_print_error(struct pci_dev *dev,663static void __aer_print_error(struct pci_dev *dev,
651 struct aer_err_info *info)664 struct aer_err_info *info)
652{665{
666 const char **strings;
653 unsigned long status = info->status & ~info->mask;667 unsigned long status = info->status & ~info->mask;
654 const char *errmsg = NULL;668 const char *level, *errmsg;
655 int i;669 int i;
656 670
671 if (info->severity == AER_CORRECTABLE) {
672 strings = aer_correctable_error_string;
673 level = KERN_WARNING;
674 } else {
675 strings = aer_uncorrectable_error_string;
676 level = KERN_ERR;
677 }
678
657 for_each_set_bit(i, &status, 32) {679 for_each_set_bit(i, &status, 32) {
658 if (info->severity == AER_CORRECTABLE)680 errmsg = strings[i];
659 errmsg = i < ARRAY_SIZE(aer_correctable_error_string) ?681 if (!errmsg)
660 aer_correctable_error_string[i] : NULL;682 errmsg = "Unknown Error Bit";
661 else
662 errmsg = i < ARRAY_SIZE(aer_uncorrectable_error_string) ?
663 aer_uncorrectable_error_string[i] : NULL;
664 683
665 if (errmsg)684 pci_printk(level, dev, " [%2d] %-22s%s\n", i, errmsg,
666 pci_err(dev, " [%2d] %-22s%s\n", i, errmsg,
667 info->first_error == i ? " (First)" : "");685 info->first_error == i ? " (First)" : "");
668 else
669 pci_err(dev, " [%2d] Unknown Error Bit%s\n",
670 i, info->first_error == i ? " (First)" : "");
671 }686 }
672 pci_dev_aer_stats_incr(dev, info);687 pci_dev_aer_stats_incr(dev, info);
673}688}
@@ -676,6 +691,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) · 2 unmodified lines
676{691{
677 int layer, agent;692 int layer, agent;
678 int id = ((dev->bus->number << 8) | dev->devfn);693 int id = ((dev->bus->number << 8) | dev->devfn);
694 const char *level;
679 695
680 if (!info->status) {696 if (!info->status) {
681 pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n",697 pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n",
@@ -686,13 +702,14 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) · 4 unmodified lines
686 layer = AER_GET_LAYER_ERROR(info->severity, info->status);702 layer = AER_GET_LAYER_ERROR(info->severity, info->status);
687 agent = AER_GET_AGENT(info->severity, info->status);703 agent = AER_GET_AGENT(info->severity, info->status);
688 704
689 pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",705 level = (info->severity == AER_CORRECTABLE) ? KERN_WARNING : KERN_ERR;
690 aer_error_severity_string[info->severity],706
691 aer_error_layer[layer], aer_agent_string[agent]);707 pci_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
708 aer_error_severity_string[info->severity],
709 aer_error_layer[layer], aer_agent_string[agent]);
692 710
693 pci_err(dev, " device [%04x:%04x] error status/mask=%08x/%08x\n",711 pci_printk(level, dev, " device [%04x:%04x] error status/mask=%08x/%08x\n",
694 dev->vendor, dev->device,712 dev->vendor, dev->device, info->status, info->mask);
695 info->status, info->mask);
696 713
697 __aer_print_error(dev, info);714 __aer_print_error(dev, info);
698 715
@@ -922,7 +939,8 @@ static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info) · 223 unmodified lines
922 if (aer)939 if (aer)
923 pci_write_config_dword(dev, aer + PCI_ERR_COR_STATUS,940 pci_write_config_dword(dev, aer + PCI_ERR_COR_STATUS,
924 info->status);941 info->status);
925 pci_aer_clear_device_status(dev);942 if (pcie_aer_is_native(dev))
943 pcie_clear_device_status(dev);
926 } else if (info->severity == AER_NONFATAL)944 } else if (info->severity == AER_NONFATAL)
927 pcie_do_recovery(dev, pci_channel_io_normal, aer_root_reset);945 pcie_do_recovery(dev, pci_channel_io_normal, aer_root_reset);
928 else if (info->severity == AER_FATAL)946 else if (info->severity == AER_FATAL)
drivers/pci/pcie/err.c+4−3
@@ -46,7 +46,7 @@ static pci_ers_result_t merge_result(enum pci_ers_result orig, · 45 unmodified lines
46}46}
47 47
48static int report_error_detected(struct pci_dev *dev,48static int report_error_detected(struct pci_dev *dev,
49 enum pci_channel_state state,49 pci_channel_state_t state,
50 enum pci_ers_result *result)50 enum pci_ers_result *result)
51{51{
52 pci_ers_result_t vote;52 pci_ers_result_t vote;
@@ -147,7 +147,7 @@ out: · 94 unmodified lines
147}147}
148 148
149pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,149pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
150 enum pci_channel_state state,150 pci_channel_state_t state,
151 pci_ers_result_t (*reset_link)(struct pci_dev *pdev))151 pci_ers_result_t (*reset_link)(struct pci_dev *pdev))
152{152{
153 pci_ers_result_t status = PCI_ERS_RESULT_CAN_RECOVER;153 pci_ers_result_t status = PCI_ERS_RESULT_CAN_RECOVER;
@@ -197,7 +197,8 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, · 43 unmodified lines
197 pci_dbg(dev, "broadcast resume message\n");197 pci_dbg(dev, "broadcast resume message\n");
198 pci_walk_bus(bus, report_resume, &status);198 pci_walk_bus(bus, report_resume, &status);
199 199
200 pci_aer_clear_device_status(dev);200 if (pcie_aer_is_native(dev))
201 pcie_clear_device_status(dev);
201 pci_aer_clear_nonfatal_status(dev);202 pci_aer_clear_nonfatal_status(dev);
202 pci_info(dev, "device recovery successful\n");203 pci_info(dev, "device recovery successful\n");
203 return status;204 return status;
drivers/pci/pcie/portdrv_pci.c+1−1
@@ -146,7 +146,7 @@ static void pcie_portdrv_remove(struct pci_dev *dev) · 145 unmodified lines
146}146}
147 147
148static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev,148static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev,
149 enum pci_channel_state error)149 pci_channel_state_t error)
150{150{
151 /* Root Port has no impact. Always recovers. */151 /* Root Port has no impact. Always recovers. */
152 return PCI_ERS_RESULT_CAN_RECOVER;152 return PCI_ERS_RESULT_CAN_RECOVER;
drivers/scsi/aacraid/linit.c+1−1
@@ -2002,7 +2002,7 @@ static void aac_remove_one(struct pci_dev *pdev) · 2001 unmodified lines
2002}2002}
2003 2003
2004static pci_ers_result_t aac_pci_error_detected(struct pci_dev *pdev,2004static pci_ers_result_t aac_pci_error_detected(struct pci_dev *pdev,
2005 enum pci_channel_state error)2005 pci_channel_state_t error)
2006{2006{
2007 struct Scsi_Host *shost = pci_get_drvdata(pdev);2007 struct Scsi_Host *shost = pci_get_drvdata(pdev);
2008 struct aac_dev *aac = shost_priv(shost);2008 struct aac_dev *aac = shost_priv(shost);
drivers/scsi/sym53c8xx_2/sym_glue.c+1−1
@@ -1743,7 +1743,7 @@ static void sym2_remove(struct pci_dev *pdev) · 1742 unmodified lines
1743 * @state: current state of the PCI slot1743 * @state: current state of the PCI slot
1744 */1744 */
1745static pci_ers_result_t sym2_io_error_detected(struct pci_dev *pdev,1745static pci_ers_result_t sym2_io_error_detected(struct pci_dev *pdev,
1746 enum pci_channel_state state)1746 pci_channel_state_t state)
1747{1747{
1748 /* If slot is permanently frozen, turn everything off */1748 /* If slot is permanently frozen, turn everything off */
1749 if (state == pci_channel_io_perm_failure) {1749 if (state == pci_channel_io_perm_failure) {
drivers/staging/qlge/qlge_main.c+1−1
@@ -4678,7 +4678,7 @@ static void ql_eeh_close(struct net_device *ndev) · 4677 unmodified lines
4678 * a PCI bus error is detected.4678 * a PCI bus error is detected.
4679 */4679 */
4680static pci_ers_result_t qlge_io_error_detected(struct pci_dev *pdev,4680static pci_ers_result_t qlge_io_error_detected(struct pci_dev *pdev,
4681 enum pci_channel_state state)4681 pci_channel_state_t state)
4682{4682{
4683 struct net_device *ndev = pci_get_drvdata(pdev);4683 struct net_device *ndev = pci_get_drvdata(pdev);
4684 struct ql_adapter *qdev = netdev_priv(ndev);4684 struct ql_adapter *qdev = netdev_priv(ndev);
include/linux/pci.h+2−2
@@ -179,7 +179,7 @@ static inline const char *pci_power_name(pci_power_t state) · 178 unmodified lines
179 */179 */
180typedef unsigned int __bitwise pci_channel_state_t;180typedef unsigned int __bitwise pci_channel_state_t;
181 181
182enum pci_channel_state {182enum {
183 /* I/O channel is in normal state */183 /* I/O channel is in normal state */
184 pci_channel_io_normal = (__force pci_channel_state_t) 1,184 pci_channel_io_normal = (__force pci_channel_state_t) 1,
185 185
@@ -792,7 +792,7 @@ enum pci_ers_result { · 606 unmodified lines
792struct pci_error_handlers {792struct pci_error_handlers {
793 /* PCI bus error detected on this device */793 /* PCI bus error detected on this device */
794 pci_ers_result_t (*error_detected)(struct pci_dev *dev,794 pci_ers_result_t (*error_detected)(struct pci_dev *dev,
795 enum pci_channel_state error);795 pci_channel_state_t error);
796 796
797 /* MMIO has been re-enabled, but not DMA */797 /* MMIO has been re-enabled, but not DMA */
798 pci_ers_result_t (*mmio_enabled)(struct pci_dev *dev);798 pci_ers_result_t (*mmio_enabled)(struct pci_dev *dev);