Lines Matching refs:ehc

341 	struct ata_eh_context *ehc = &dev->link->eh_context;  in ata_internal_cmd_timeout()  local
348 idx = ehc->cmd_timeout_idx[dev->devno][ent]; in ata_internal_cmd_timeout()
366 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_internal_cmd_timed_out() local
373 idx = ehc->cmd_timeout_idx[dev->devno][ent]; in ata_internal_cmd_timed_out()
375 ehc->cmd_timeout_idx[dev->devno][ent]++; in ata_internal_cmd_timed_out()
437 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_dev_action() local
439 return ehc->i.action | ehc->i.dev_action[dev->devno]; in ata_eh_dev_action()
741 struct ata_eh_context *ehc = &link->eh_context; in ata_scsi_port_error_handler() local
751 ehc->saved_xfer_mode[devno] = dev->xfer_mode; in ata_scsi_port_error_handler()
753 ehc->saved_ncq_enabled |= 1 << devno; in ata_scsi_port_error_handler()
1377 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_detach_dev() local
1394 ehc->saved_xfer_mode[dev->devno] = 0; in ata_eh_detach_dev()
1395 ehc->saved_ncq_enabled &= ~(1 << dev->devno); in ata_eh_detach_dev()
1418 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_about_to_do() local
1428 if (!(ehc->i.flags & ATA_EHI_QUIET) && link != ap->slave_link) in ata_eh_about_to_do()
1449 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_done() local
1451 ata_eh_clear_action(link, dev, &ehc->i, action); in ata_eh_done()
1695 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_analyze_serror() local
1696 u32 serror = ehc->i.serror; in ata_eh_analyze_serror()
1726 ata_ehi_hotplugged(&ehc->i); in ata_eh_analyze_serror()
1728 ehc->i.err_mask |= err_mask; in ata_eh_analyze_serror()
1729 ehc->i.action |= action; in ata_eh_analyze_serror()
1747 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_analyze_ncq_error() local
1758 if (!link->sactive || !(ehc->i.err_mask & AC_ERR_DEV)) in ata_eh_analyze_ncq_error()
1792 ehc->i.err_mask &= ~AC_ERR_DEV; in ata_eh_analyze_ncq_error()
2138 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_link_autopsy() local
2147 if (ehc->i.flags & ATA_EHI_NO_AUTOPSY) in ata_eh_link_autopsy()
2153 ehc->i.serror |= serror; in ata_eh_link_autopsy()
2157 ehc->i.probe_mask |= ATA_ALL_DEVICES; in ata_eh_link_autopsy()
2158 ehc->i.action |= ATA_EH_RESET; in ata_eh_link_autopsy()
2159 ehc->i.err_mask |= AC_ERR_OTHER; in ata_eh_link_autopsy()
2166 if (ehc->i.err_mask & ~AC_ERR_OTHER) in ata_eh_link_autopsy()
2167 ehc->i.err_mask &= ~AC_ERR_OTHER; in ata_eh_link_autopsy()
2169 all_err_mask |= ehc->i.err_mask; in ata_eh_link_autopsy()
2179 qc->err_mask |= ehc->i.err_mask; in ata_eh_link_autopsy()
2182 ehc->i.action |= ata_eh_analyze_tf(qc, &qc->result_tf); in ata_eh_link_autopsy()
2202 ehc->i.dev = qc->dev; in ata_eh_link_autopsy()
2212 ehc->i.action |= ATA_EH_RESET; in ata_eh_link_autopsy()
2215 ehc->i.action |= ATA_EH_REVALIDATE; in ata_eh_link_autopsy()
2220 if (ehc->i.dev) { in ata_eh_link_autopsy()
2221 ehc->i.dev_action[ehc->i.dev->devno] |= in ata_eh_link_autopsy()
2222 ehc->i.action & ATA_EH_PERDEV_MASK; in ata_eh_link_autopsy()
2223 ehc->i.action &= ~ATA_EH_PERDEV_MASK; in ata_eh_link_autopsy()
2231 dev = ehc->i.dev; in ata_eh_link_autopsy()
2239 ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask); in ata_eh_link_autopsy()
2241 trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask); in ata_eh_link_autopsy()
2423 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_link_report() local
2428 if (ehc->i.flags & ATA_EHI_QUIET) in ata_eh_link_report()
2432 if (ehc->i.desc[0] != '\0') in ata_eh_link_report()
2433 desc = ehc->i.desc; in ata_eh_link_report()
2449 if (!nr_failed && !ehc->i.err_mask) in ata_eh_link_report()
2460 if (ehc->i.dev) { in ata_eh_link_report()
2461 ata_dev_err(ehc->i.dev, "exception Emask 0x%x " in ata_eh_link_report()
2463 ehc->i.err_mask, link->sactive, ehc->i.serror, in ata_eh_link_report()
2464 ehc->i.action, frozen, tries_buf); in ata_eh_link_report()
2466 ata_dev_err(ehc->i.dev, "%s\n", desc); in ata_eh_link_report()
2470 ehc->i.err_mask, link->sactive, ehc->i.serror, in ata_eh_link_report()
2471 ehc->i.action, frozen, tries_buf); in ata_eh_link_report()
2477 if (ehc->i.serror) in ata_eh_link_report()
2480 ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "", in ata_eh_link_report()
2481 ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "", in ata_eh_link_report()
2482 ehc->i.serror & SERR_DATA ? "UnrecovData " : "", in ata_eh_link_report()
2483 ehc->i.serror & SERR_PERSISTENT ? "Persist " : "", in ata_eh_link_report()
2484 ehc->i.serror & SERR_PROTOCOL ? "Proto " : "", in ata_eh_link_report()
2485 ehc->i.serror & SERR_INTERNAL ? "HostInt " : "", in ata_eh_link_report()
2486 ehc->i.serror & SERR_PHYRDY_CHG ? "PHYRdyChg " : "", in ata_eh_link_report()
2487 ehc->i.serror & SERR_PHY_INT_ERR ? "PHYInt " : "", in ata_eh_link_report()
2488 ehc->i.serror & SERR_COMM_WAKE ? "CommWake " : "", in ata_eh_link_report()
2489 ehc->i.serror & SERR_10B_8B_ERR ? "10B8B " : "", in ata_eh_link_report()
2490 ehc->i.serror & SERR_DISPARITY ? "Dispar " : "", in ata_eh_link_report()
2491 ehc->i.serror & SERR_CRC ? "BadCRC " : "", in ata_eh_link_report()
2492 ehc->i.serror & SERR_HANDSHAKE ? "Handshk " : "", in ata_eh_link_report()
2493 ehc->i.serror & SERR_LINK_SEQ_ERR ? "LinkSeq " : "", in ata_eh_link_report()
2494 ehc->i.serror & SERR_TRANS_ST_ERROR ? "TrStaTrns " : "", in ata_eh_link_report()
2495 ehc->i.serror & SERR_UNRECOG_FIS ? "UnrecFIS " : "", in ata_eh_link_report()
2496 ehc->i.serror & SERR_DEV_XCHG ? "DevExch " : ""); in ata_eh_link_report()
2635 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_reset() local
2637 unsigned int *classes = ehc->classes; in ata_eh_reset()
2639 int verbose = !(ehc->i.flags & ATA_EHI_QUIET); in ata_eh_reset()
2662 if (ehc->i.flags & ATA_EHI_DID_RESET) { in ata_eh_reset()
2664 WARN_ON(time_after(ehc->last_reset, now)); in ata_eh_reset()
2665 deadline = ata_deadline(ehc->last_reset, in ata_eh_reset()
2699 ehc->i.action &= ~ATA_EH_RESET; in ata_eh_reset()
2702 ehc->i.action |= ATA_EH_HARDRESET; in ata_eh_reset()
2705 ehc->i.action |= ATA_EH_SOFTRESET; in ata_eh_reset()
2714 sehc->i.action |= ehc->i.action; in ata_eh_reset()
2730 ehc->i.action |= sehc->i.action; in ata_eh_reset()
2736 ehc->i.action &= ~ATA_EH_RESET; in ata_eh_reset()
2752 if (reset && !(ehc->i.action & ATA_EH_RESET)) { in ata_eh_reset()
2778 ehc->last_reset = jiffies; in ata_eh_reset()
2780 ehc->i.flags |= ATA_EHI_DID_HARDRESET; in ata_eh_reset()
2782 ehc->i.flags |= ATA_EHI_DID_SOFTRESET; in ata_eh_reset()
2948 ehc->last_reset = jiffies; /* update to completion time */ in ata_eh_reset()
2949 ehc->i.action |= ATA_EH_REVALIDATE; in ata_eh_reset()
2955 ehc->i.flags &= ~ATA_EHI_HOTPLUGGED; in ata_eh_reset()
3067 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_park_issue_cmd() local
3073 ehc->unloaded_mask |= 1 << dev->devno; in ata_eh_park_issue_cmd()
3080 ehc->unloaded_mask &= ~(1 << dev->devno); in ata_eh_park_issue_cmd()
3089 ehc->unloaded_mask &= ~(1 << dev->devno); in ata_eh_park_issue_cmd()
3097 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_revalidate_and_attach() local
3113 if (ehc->i.flags & ATA_EHI_DID_RESET) in ata_eh_revalidate_and_attach()
3125 rc = ata_dev_revalidate(dev, ehc->classes[dev->devno], in ata_eh_revalidate_and_attach()
3135 ehc->i.flags |= ATA_EHI_SETMODE; in ata_eh_revalidate_and_attach()
3140 ehc->tries[dev->devno] && in ata_eh_revalidate_and_attach()
3141 ata_class_enabled(ehc->classes[dev->devno])) { in ata_eh_revalidate_and_attach()
3148 dev->class = ehc->classes[dev->devno]; in ata_eh_revalidate_and_attach()
3157 ehc->classes[dev->devno] = dev->class; in ata_eh_revalidate_and_attach()
3180 if ((ehc->i.flags & ATA_EHI_DID_RESET) && ata_is_host_link(link)) { in ata_eh_revalidate_and_attach()
3193 dev->class = ehc->classes[dev->devno]; in ata_eh_revalidate_and_attach()
3198 ehc->i.flags |= ATA_EHI_PRINTINFO; in ata_eh_revalidate_and_attach()
3200 ehc->i.flags &= ~ATA_EHI_PRINTINFO; in ata_eh_revalidate_and_attach()
3211 ehc->i.flags |= ATA_EHI_SETMODE; in ata_eh_revalidate_and_attach()
3262 struct ata_eh_context *ehc = &link->eh_context; in ata_set_mode() local
3263 u8 saved_xfer_mode = ehc->saved_xfer_mode[dev->devno]; in ata_set_mode()
3264 u8 saved_ncq = !!(ehc->saved_ncq_enabled & (1 << dev->devno)); in ata_set_mode()
3419 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_set_lpm() local
3522 if (!dev || ehc->tries[dev->devno] <= 2) { in ata_eh_set_lpm()
3555 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_skip_recovery() local
3563 if (ehc->i.flags & ATA_EHI_NO_RECOVERY) in ata_eh_skip_recovery()
3571 if ((ehc->i.action & ATA_EH_RESET) && in ata_eh_skip_recovery()
3572 !(ehc->i.flags & ATA_EHI_DID_RESET)) in ata_eh_skip_recovery()
3578 ehc->classes[dev->devno] != ATA_DEV_NONE) in ata_eh_skip_recovery()
3601 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_schedule_probe() local
3605 if (!(ehc->i.probe_mask & (1 << dev->devno)) || in ata_eh_schedule_probe()
3606 (ehc->did_probe_mask & (1 << dev->devno))) in ata_eh_schedule_probe()
3611 ehc->did_probe_mask |= (1 << dev->devno); in ata_eh_schedule_probe()
3612 ehc->i.action |= ATA_EH_RESET; in ata_eh_schedule_probe()
3613 ehc->saved_xfer_mode[dev->devno] = 0; in ata_eh_schedule_probe()
3614 ehc->saved_ncq_enabled &= ~(1 << dev->devno); in ata_eh_schedule_probe()
3650 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_handle_dev_fail() local
3656 ehc->tries[dev->devno]--; in ata_eh_handle_dev_fail()
3661 ehc->i.probe_mask |= (1 << dev->devno); in ata_eh_handle_dev_fail()
3664 ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1); in ata_eh_handle_dev_fail()
3666 if (ehc->tries[dev->devno] == 1) { in ata_eh_handle_dev_fail()
3676 if (ata_dev_enabled(dev) && !ehc->tries[dev->devno]) { in ata_eh_handle_dev_fail()
3686 ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; in ata_eh_handle_dev_fail()
3687 memset(ehc->cmd_timeout_idx[dev->devno], 0, in ata_eh_handle_dev_fail()
3688 sizeof(ehc->cmd_timeout_idx[dev->devno])); in ata_eh_handle_dev_fail()
3693 ehc->i.action |= ATA_EH_RESET; in ata_eh_handle_dev_fail()
3734 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3737 if (ehc->i.action & ATA_EH_ENABLE_LINK) { in ata_eh_recover()
3747 ehc->tries[dev->devno] = 1; in ata_eh_recover()
3749 ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; in ata_eh_recover()
3752 ehc->i.action |= ehc->i.dev_action[dev->devno] & in ata_eh_recover()
3754 ehc->i.dev_action[dev->devno] &= ATA_EH_PERDEV_MASK; in ata_eh_recover()
3775 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3779 ehc->i.action = 0; in ata_eh_recover()
3782 ehc->classes[dev->devno] = ATA_DEV_UNKNOWN; in ata_eh_recover()
3787 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3789 if (!(ehc->i.action & ATA_EH_RESET)) in ata_eh_recover()
3812 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3818 if (!(ehc->i.dev_action[dev->devno] & in ata_eh_recover()
3826 if (ehc->unloaded_mask & (1 << dev->devno)) in ata_eh_recover()
3856 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3868 ehc->i.action = 0; in ata_eh_recover()
3873 if (ehc->i.flags & ATA_EHI_SETMODE) { in ata_eh_recover()
3877 ehc->i.flags &= ~ATA_EHI_SETMODE; in ata_eh_recover()
3883 if (ehc->i.flags & ATA_EHI_DID_RESET) { in ata_eh_recover()
3914 ehc->i.flags = 0; in ata_eh_recover()