Lines Matching refs:pdev
80 static pci_ers_result_t zpci_event_notify_error_detected(struct pci_dev *pdev, in zpci_event_notify_error_detected() argument
85 ers_res = driver->err_handler->error_detected(pdev, pdev->error_state); in zpci_event_notify_error_detected()
87 pr_info("%s: Automatic recovery failed after initial reporting\n", pci_name(pdev)); in zpci_event_notify_error_detected()
89 pr_debug("%s: Driver needs reset to recover\n", pci_name(pdev)); in zpci_event_notify_error_detected()
94 static pci_ers_result_t zpci_event_do_error_state_clear(struct pci_dev *pdev, in zpci_event_do_error_state_clear() argument
98 struct zpci_dev *zdev = to_zpci(pdev); in zpci_event_do_error_state_clear()
101 pr_info("%s: Unblocking device access for examination\n", pci_name(pdev)); in zpci_event_do_error_state_clear()
104 pr_err("%s: Unblocking device access failed\n", pci_name(pdev)); in zpci_event_do_error_state_clear()
110 ers_res = driver->err_handler->mmio_enabled(pdev); in zpci_event_do_error_state_clear()
113 pci_name(pdev)); in zpci_event_do_error_state_clear()
116 pr_debug("%s: Driver needs reset to recover\n", pci_name(pdev)); in zpci_event_do_error_state_clear()
121 pr_debug("%s: Unblocking DMA\n", pci_name(pdev)); in zpci_event_do_error_state_clear()
124 pdev->error_state = pci_channel_io_normal; in zpci_event_do_error_state_clear()
126 pr_err("%s: Unblocking DMA failed\n", pci_name(pdev)); in zpci_event_do_error_state_clear()
134 static pci_ers_result_t zpci_event_do_reset(struct pci_dev *pdev, in zpci_event_do_reset() argument
139 pr_info("%s: Initiating reset\n", pci_name(pdev)); in zpci_event_do_reset()
140 if (zpci_hot_reset_device(to_zpci(pdev))) { in zpci_event_do_reset()
141 pr_err("%s: The reset request failed\n", pci_name(pdev)); in zpci_event_do_reset()
144 pdev->error_state = pci_channel_io_normal; in zpci_event_do_reset()
145 ers_res = driver->err_handler->slot_reset(pdev); in zpci_event_do_reset()
147 pr_info("%s: Automatic recovery failed after slot reset\n", pci_name(pdev)); in zpci_event_do_reset()
162 static pci_ers_result_t zpci_event_attempt_error_recovery(struct pci_dev *pdev) in zpci_event_attempt_error_recovery() argument
172 pci_dev_lock(pdev); in zpci_event_attempt_error_recovery()
173 if (pdev->error_state == pci_channel_io_perm_failure) { in zpci_event_attempt_error_recovery()
177 pdev->error_state = pci_channel_io_frozen; in zpci_event_attempt_error_recovery()
179 if (is_passed_through(to_zpci(pdev))) { in zpci_event_attempt_error_recovery()
181 pci_name(pdev)); in zpci_event_attempt_error_recovery()
185 driver = to_pci_driver(pdev->dev.driver); in zpci_event_attempt_error_recovery()
189 pci_name(pdev)); in zpci_event_attempt_error_recovery()
192 pci_name(pdev), in zpci_event_attempt_error_recovery()
197 ers_res = zpci_event_notify_error_detected(pdev, driver); in zpci_event_attempt_error_recovery()
202 ers_res = zpci_event_do_error_state_clear(pdev, driver); in zpci_event_attempt_error_recovery()
208 ers_res = zpci_event_do_reset(pdev, driver); in zpci_event_attempt_error_recovery()
212 pci_name(pdev)); in zpci_event_attempt_error_recovery()
216 pr_info("%s: The device is ready to resume operations\n", pci_name(pdev)); in zpci_event_attempt_error_recovery()
218 driver->err_handler->resume(pdev); in zpci_event_attempt_error_recovery()
220 pci_dev_unlock(pdev); in zpci_event_attempt_error_recovery()
229 static void zpci_event_io_failure(struct pci_dev *pdev, pci_channel_state_t es) in zpci_event_io_failure() argument
233 pci_dev_lock(pdev); in zpci_event_io_failure()
234 pdev->error_state = es; in zpci_event_io_failure()
242 if (is_passed_through(to_zpci(pdev))) in zpci_event_io_failure()
244 driver = to_pci_driver(pdev->dev.driver); in zpci_event_io_failure()
246 driver->err_handler->error_detected(pdev, pdev->error_state); in zpci_event_io_failure()
248 pci_dev_unlock(pdev); in zpci_event_io_failure()
254 struct pci_dev *pdev = NULL; in __zpci_event_error() local
265 pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); in __zpci_event_error()
269 pdev ? pci_name(pdev) : "n/a", ccdf->pec, ccdf->fid); in __zpci_event_error()
271 if (!pdev) in __zpci_event_error()
276 ers_res = zpci_event_attempt_error_recovery(pdev); in __zpci_event_error()
278 zpci_event_io_failure(pdev, pci_channel_io_perm_failure); in __zpci_event_error()
285 zpci_event_io_failure(pdev, pci_channel_io_frozen); in __zpci_event_error()
288 pci_dev_put(pdev); in __zpci_event_error()