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()
688 struct ata_eh_context *ehc = &link->eh_context; in ata_scsi_port_error_handler() local
698 ehc->saved_xfer_mode[devno] = dev->xfer_mode; in ata_scsi_port_error_handler()
700 ehc->saved_ncq_enabled |= 1 << devno; in ata_scsi_port_error_handler()
1327 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_detach_dev() local
1344 ehc->saved_xfer_mode[dev->devno] = 0; in ata_eh_detach_dev()
1345 ehc->saved_ncq_enabled &= ~(1 << dev->devno); in ata_eh_detach_dev()
1368 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_about_to_do() local
1378 if (!(ehc->i.flags & ATA_EHI_QUIET) && link != ap->slave_link) in ata_eh_about_to_do()
1399 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_done() local
1401 ata_eh_clear_action(link, dev, &ehc->i, action); in ata_eh_done()
1645 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_analyze_serror() local
1646 u32 serror = ehc->i.serror; in ata_eh_analyze_serror()
1676 ata_ehi_hotplugged(&ehc->i); in ata_eh_analyze_serror()
1678 ehc->i.err_mask |= err_mask; in ata_eh_analyze_serror()
1679 ehc->i.action |= action; in ata_eh_analyze_serror()
1697 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_analyze_ncq_error() local
1708 if (!link->sactive || !(ehc->i.err_mask & AC_ERR_DEV)) in ata_eh_analyze_ncq_error()
1752 ehc->i.err_mask &= ~AC_ERR_DEV; in ata_eh_analyze_ncq_error()
2133 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_link_autopsy() local
2143 if (ehc->i.flags & ATA_EHI_NO_AUTOPSY) in ata_eh_link_autopsy()
2149 ehc->i.serror |= serror; in ata_eh_link_autopsy()
2153 ehc->i.probe_mask |= ATA_ALL_DEVICES; in ata_eh_link_autopsy()
2154 ehc->i.action |= ATA_EH_RESET; in ata_eh_link_autopsy()
2155 ehc->i.err_mask |= AC_ERR_OTHER; in ata_eh_link_autopsy()
2162 if (ehc->i.err_mask & ~AC_ERR_OTHER) in ata_eh_link_autopsy()
2163 ehc->i.err_mask &= ~AC_ERR_OTHER; in ata_eh_link_autopsy()
2165 all_err_mask |= ehc->i.err_mask; in ata_eh_link_autopsy()
2173 qc->err_mask |= ehc->i.err_mask; in ata_eh_link_autopsy()
2176 ehc->i.action |= ata_eh_analyze_tf(qc, &qc->result_tf); in ata_eh_link_autopsy()
2200 ehc->i.dev = qc->dev; in ata_eh_link_autopsy()
2214 ehc->i.flags |= ATA_EHI_QUIET; in ata_eh_link_autopsy()
2219 ehc->i.action |= ATA_EH_RESET; in ata_eh_link_autopsy()
2222 ehc->i.action |= ATA_EH_REVALIDATE; in ata_eh_link_autopsy()
2227 if (ehc->i.dev) { in ata_eh_link_autopsy()
2228 ehc->i.dev_action[ehc->i.dev->devno] |= in ata_eh_link_autopsy()
2229 ehc->i.action & ATA_EH_PERDEV_MASK; in ata_eh_link_autopsy()
2230 ehc->i.action &= ~ATA_EH_PERDEV_MASK; in ata_eh_link_autopsy()
2238 dev = ehc->i.dev; in ata_eh_link_autopsy()
2246 ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask); in ata_eh_link_autopsy()
2247 trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask); in ata_eh_link_autopsy()
2432 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_link_report() local
2438 if (ehc->i.flags & ATA_EHI_QUIET) in ata_eh_link_report()
2442 if (ehc->i.desc[0] != '\0') in ata_eh_link_report()
2443 desc = ehc->i.desc; in ata_eh_link_report()
2457 if (!nr_failed && !ehc->i.err_mask) in ata_eh_link_report()
2468 if (ehc->i.dev) { in ata_eh_link_report()
2469 ata_dev_err(ehc->i.dev, "exception Emask 0x%x " in ata_eh_link_report()
2471 ehc->i.err_mask, link->sactive, ehc->i.serror, in ata_eh_link_report()
2472 ehc->i.action, frozen, tries_buf); in ata_eh_link_report()
2474 ata_dev_err(ehc->i.dev, "%s\n", desc); in ata_eh_link_report()
2478 ehc->i.err_mask, link->sactive, ehc->i.serror, in ata_eh_link_report()
2479 ehc->i.action, frozen, tries_buf); in ata_eh_link_report()
2485 if (ehc->i.serror) in ata_eh_link_report()
2488 ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "", in ata_eh_link_report()
2489 ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "", in ata_eh_link_report()
2490 ehc->i.serror & SERR_DATA ? "UnrecovData " : "", in ata_eh_link_report()
2491 ehc->i.serror & SERR_PERSISTENT ? "Persist " : "", in ata_eh_link_report()
2492 ehc->i.serror & SERR_PROTOCOL ? "Proto " : "", in ata_eh_link_report()
2493 ehc->i.serror & SERR_INTERNAL ? "HostInt " : "", in ata_eh_link_report()
2494 ehc->i.serror & SERR_PHYRDY_CHG ? "PHYRdyChg " : "", in ata_eh_link_report()
2495 ehc->i.serror & SERR_PHY_INT_ERR ? "PHYInt " : "", in ata_eh_link_report()
2496 ehc->i.serror & SERR_COMM_WAKE ? "CommWake " : "", in ata_eh_link_report()
2497 ehc->i.serror & SERR_10B_8B_ERR ? "10B8B " : "", in ata_eh_link_report()
2498 ehc->i.serror & SERR_DISPARITY ? "Dispar " : "", in ata_eh_link_report()
2499 ehc->i.serror & SERR_CRC ? "BadCRC " : "", in ata_eh_link_report()
2500 ehc->i.serror & SERR_HANDSHAKE ? "Handshk " : "", in ata_eh_link_report()
2501 ehc->i.serror & SERR_LINK_SEQ_ERR ? "LinkSeq " : "", in ata_eh_link_report()
2502 ehc->i.serror & SERR_TRANS_ST_ERROR ? "TrStaTrns " : "", in ata_eh_link_report()
2503 ehc->i.serror & SERR_UNRECOG_FIS ? "UnrecFIS " : "", in ata_eh_link_report()
2504 ehc->i.serror & SERR_DEV_XCHG ? "DevExch " : ""); in ata_eh_link_report()
2665 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_reset() local
2667 unsigned int *classes = ehc->classes; in ata_eh_reset()
2669 int verbose = !(ehc->i.flags & ATA_EHI_QUIET); in ata_eh_reset()
2692 if (ehc->i.flags & ATA_EHI_DID_RESET) { in ata_eh_reset()
2694 WARN_ON(time_after(ehc->last_reset, now)); in ata_eh_reset()
2695 deadline = ata_deadline(ehc->last_reset, in ata_eh_reset()
2729 ehc->i.action &= ~ATA_EH_RESET; in ata_eh_reset()
2732 ehc->i.action |= ATA_EH_HARDRESET; in ata_eh_reset()
2735 ehc->i.action |= ATA_EH_SOFTRESET; in ata_eh_reset()
2744 sehc->i.action |= ehc->i.action; in ata_eh_reset()
2760 ehc->i.action |= sehc->i.action; in ata_eh_reset()
2766 ehc->i.action &= ~ATA_EH_RESET; in ata_eh_reset()
2782 if (reset && !(ehc->i.action & ATA_EH_RESET)) { in ata_eh_reset()
2808 ehc->last_reset = jiffies; in ata_eh_reset()
2810 ehc->i.flags |= ATA_EHI_DID_HARDRESET; in ata_eh_reset()
2812 ehc->i.flags |= ATA_EHI_DID_SOFTRESET; in ata_eh_reset()
2978 ehc->last_reset = jiffies; /* update to completion time */ in ata_eh_reset()
2979 ehc->i.action |= ATA_EH_REVALIDATE; in ata_eh_reset()
2985 ehc->i.flags &= ~ATA_EHI_HOTPLUGGED; in ata_eh_reset()
3097 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_park_issue_cmd() local
3103 ehc->unloaded_mask |= 1 << dev->devno; in ata_eh_park_issue_cmd()
3110 ehc->unloaded_mask &= ~(1 << dev->devno); in ata_eh_park_issue_cmd()
3119 ehc->unloaded_mask &= ~(1 << dev->devno); in ata_eh_park_issue_cmd()
3127 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_revalidate_and_attach() local
3143 if (ehc->i.flags & ATA_EHI_DID_RESET) in ata_eh_revalidate_and_attach()
3155 rc = ata_dev_revalidate(dev, ehc->classes[dev->devno], in ata_eh_revalidate_and_attach()
3165 ehc->i.flags |= ATA_EHI_SETMODE; in ata_eh_revalidate_and_attach()
3170 ehc->tries[dev->devno] && in ata_eh_revalidate_and_attach()
3171 ata_class_enabled(ehc->classes[dev->devno])) { in ata_eh_revalidate_and_attach()
3178 dev->class = ehc->classes[dev->devno]; in ata_eh_revalidate_and_attach()
3187 ehc->classes[dev->devno] = dev->class; in ata_eh_revalidate_and_attach()
3210 if ((ehc->i.flags & ATA_EHI_DID_RESET) && ata_is_host_link(link)) { in ata_eh_revalidate_and_attach()
3223 dev->class = ehc->classes[dev->devno]; in ata_eh_revalidate_and_attach()
3228 ehc->i.flags |= ATA_EHI_PRINTINFO; in ata_eh_revalidate_and_attach()
3230 ehc->i.flags &= ~ATA_EHI_PRINTINFO; in ata_eh_revalidate_and_attach()
3241 ehc->i.flags |= ATA_EHI_SETMODE; in ata_eh_revalidate_and_attach()
3292 struct ata_eh_context *ehc = &link->eh_context; in ata_set_mode() local
3293 u8 saved_xfer_mode = ehc->saved_xfer_mode[dev->devno]; in ata_set_mode()
3294 u8 saved_ncq = !!(ehc->saved_ncq_enabled & (1 << dev->devno)); in ata_set_mode()
3449 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_set_lpm() local
3552 if (!dev || ehc->tries[dev->devno] <= 2) { in ata_eh_set_lpm()
3585 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_skip_recovery() local
3593 if (ehc->i.flags & ATA_EHI_NO_RECOVERY) in ata_eh_skip_recovery()
3601 if ((ehc->i.action & ATA_EH_RESET) && in ata_eh_skip_recovery()
3602 !(ehc->i.flags & ATA_EHI_DID_RESET)) in ata_eh_skip_recovery()
3608 ehc->classes[dev->devno] != ATA_DEV_NONE) in ata_eh_skip_recovery()
3631 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_schedule_probe() local
3635 if (!(ehc->i.probe_mask & (1 << dev->devno)) || in ata_eh_schedule_probe()
3636 (ehc->did_probe_mask & (1 << dev->devno))) in ata_eh_schedule_probe()
3641 ehc->did_probe_mask |= (1 << dev->devno); in ata_eh_schedule_probe()
3642 ehc->i.action |= ATA_EH_RESET; in ata_eh_schedule_probe()
3643 ehc->saved_xfer_mode[dev->devno] = 0; in ata_eh_schedule_probe()
3644 ehc->saved_ncq_enabled &= ~(1 << dev->devno); in ata_eh_schedule_probe()
3680 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_handle_dev_fail() local
3686 ehc->tries[dev->devno]--; in ata_eh_handle_dev_fail()
3691 ehc->i.probe_mask |= (1 << dev->devno); in ata_eh_handle_dev_fail()
3695 ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1); in ata_eh_handle_dev_fail()
3698 if (ehc->tries[dev->devno] == 1) { in ata_eh_handle_dev_fail()
3708 if (ata_dev_enabled(dev) && !ehc->tries[dev->devno]) { in ata_eh_handle_dev_fail()
3718 ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; in ata_eh_handle_dev_fail()
3719 memset(ehc->cmd_timeout_idx[dev->devno], 0, in ata_eh_handle_dev_fail()
3720 sizeof(ehc->cmd_timeout_idx[dev->devno])); in ata_eh_handle_dev_fail()
3725 ehc->i.action |= ATA_EH_RESET; in ata_eh_handle_dev_fail()
3766 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3769 if (ehc->i.action & ATA_EH_ENABLE_LINK) { in ata_eh_recover()
3779 ehc->tries[dev->devno] = 1; in ata_eh_recover()
3781 ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; in ata_eh_recover()
3784 ehc->i.action |= ehc->i.dev_action[dev->devno] & in ata_eh_recover()
3786 ehc->i.dev_action[dev->devno] &= ATA_EH_PERDEV_MASK; in ata_eh_recover()
3807 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3811 ehc->i.action = 0; in ata_eh_recover()
3814 ehc->classes[dev->devno] = ATA_DEV_UNKNOWN; in ata_eh_recover()
3819 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3821 if (!(ehc->i.action & ATA_EH_RESET)) in ata_eh_recover()
3844 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3850 if (!(ehc->i.dev_action[dev->devno] & in ata_eh_recover()
3858 if (ehc->unloaded_mask & (1 << dev->devno)) in ata_eh_recover()
3888 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3900 ehc->i.action = 0; in ata_eh_recover()
3905 if (ehc->i.flags & ATA_EHI_SETMODE) { in ata_eh_recover()
3909 ehc->i.flags &= ~ATA_EHI_SETMODE; in ata_eh_recover()
3915 if (ehc->i.flags & ATA_EHI_DID_RESET) { in ata_eh_recover()
3946 ehc->i.flags = 0; in ata_eh_recover()