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()
1703 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_analyze_serror() local
1704 u32 serror = ehc->i.serror; in ata_eh_analyze_serror()
1734 ata_ehi_hotplugged(&ehc->i); in ata_eh_analyze_serror()
1736 ehc->i.err_mask |= err_mask; in ata_eh_analyze_serror()
1737 ehc->i.action |= action; in ata_eh_analyze_serror()
1755 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_analyze_ncq_error() local
1766 if (!link->sactive || !(ehc->i.err_mask & AC_ERR_DEV)) in ata_eh_analyze_ncq_error()
1800 ehc->i.err_mask &= ~AC_ERR_DEV; in ata_eh_analyze_ncq_error()
2146 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_link_autopsy() local
2155 if (ehc->i.flags & ATA_EHI_NO_AUTOPSY) in ata_eh_link_autopsy()
2161 ehc->i.serror |= serror; in ata_eh_link_autopsy()
2165 ehc->i.probe_mask |= ATA_ALL_DEVICES; in ata_eh_link_autopsy()
2166 ehc->i.action |= ATA_EH_RESET; in ata_eh_link_autopsy()
2167 ehc->i.err_mask |= AC_ERR_OTHER; in ata_eh_link_autopsy()
2174 if (ehc->i.err_mask & ~AC_ERR_OTHER) in ata_eh_link_autopsy()
2175 ehc->i.err_mask &= ~AC_ERR_OTHER; in ata_eh_link_autopsy()
2177 all_err_mask |= ehc->i.err_mask; in ata_eh_link_autopsy()
2187 qc->err_mask |= ehc->i.err_mask; in ata_eh_link_autopsy()
2190 ehc->i.action |= ata_eh_analyze_tf(qc, &qc->result_tf); in ata_eh_link_autopsy()
2210 ehc->i.dev = qc->dev; in ata_eh_link_autopsy()
2220 ehc->i.action |= ATA_EH_RESET; in ata_eh_link_autopsy()
2223 ehc->i.action |= ATA_EH_REVALIDATE; in ata_eh_link_autopsy()
2228 if (ehc->i.dev) { in ata_eh_link_autopsy()
2229 ehc->i.dev_action[ehc->i.dev->devno] |= in ata_eh_link_autopsy()
2230 ehc->i.action & ATA_EH_PERDEV_MASK; in ata_eh_link_autopsy()
2231 ehc->i.action &= ~ATA_EH_PERDEV_MASK; in ata_eh_link_autopsy()
2239 dev = ehc->i.dev; in ata_eh_link_autopsy()
2247 ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask); in ata_eh_link_autopsy()
2249 trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask); in ata_eh_link_autopsy()
2431 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_link_report() local
2436 if (ehc->i.flags & ATA_EHI_QUIET) in ata_eh_link_report()
2440 if (ehc->i.desc[0] != '\0') in ata_eh_link_report()
2441 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()
2643 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_reset() local
2645 unsigned int *classes = ehc->classes; in ata_eh_reset()
2647 int verbose = !(ehc->i.flags & ATA_EHI_QUIET); in ata_eh_reset()
2670 if (ehc->i.flags & ATA_EHI_DID_RESET) { in ata_eh_reset()
2672 WARN_ON(time_after(ehc->last_reset, now)); in ata_eh_reset()
2673 deadline = ata_deadline(ehc->last_reset, in ata_eh_reset()
2707 ehc->i.action &= ~ATA_EH_RESET; in ata_eh_reset()
2710 ehc->i.action |= ATA_EH_HARDRESET; in ata_eh_reset()
2713 ehc->i.action |= ATA_EH_SOFTRESET; in ata_eh_reset()
2722 sehc->i.action |= ehc->i.action; in ata_eh_reset()
2738 ehc->i.action |= sehc->i.action; in ata_eh_reset()
2744 ehc->i.action &= ~ATA_EH_RESET; in ata_eh_reset()
2760 if (reset && !(ehc->i.action & ATA_EH_RESET)) { in ata_eh_reset()
2786 ehc->last_reset = jiffies; in ata_eh_reset()
2788 ehc->i.flags |= ATA_EHI_DID_HARDRESET; in ata_eh_reset()
2790 ehc->i.flags |= ATA_EHI_DID_SOFTRESET; in ata_eh_reset()
2956 ehc->last_reset = jiffies; /* update to completion time */ in ata_eh_reset()
2957 ehc->i.action |= ATA_EH_REVALIDATE; in ata_eh_reset()
2963 ehc->i.flags &= ~ATA_EHI_HOTPLUGGED; in ata_eh_reset()
3075 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_park_issue_cmd() local
3081 ehc->unloaded_mask |= 1 << dev->devno; in ata_eh_park_issue_cmd()
3088 ehc->unloaded_mask &= ~(1 << dev->devno); in ata_eh_park_issue_cmd()
3097 ehc->unloaded_mask &= ~(1 << dev->devno); in ata_eh_park_issue_cmd()
3105 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_revalidate_and_attach() local
3121 if (ehc->i.flags & ATA_EHI_DID_RESET) in ata_eh_revalidate_and_attach()
3133 rc = ata_dev_revalidate(dev, ehc->classes[dev->devno], in ata_eh_revalidate_and_attach()
3143 ehc->i.flags |= ATA_EHI_SETMODE; in ata_eh_revalidate_and_attach()
3148 ehc->tries[dev->devno] && in ata_eh_revalidate_and_attach()
3149 ata_class_enabled(ehc->classes[dev->devno])) { in ata_eh_revalidate_and_attach()
3156 dev->class = ehc->classes[dev->devno]; in ata_eh_revalidate_and_attach()
3165 ehc->classes[dev->devno] = dev->class; in ata_eh_revalidate_and_attach()
3188 if ((ehc->i.flags & ATA_EHI_DID_RESET) && ata_is_host_link(link)) { in ata_eh_revalidate_and_attach()
3201 dev->class = ehc->classes[dev->devno]; in ata_eh_revalidate_and_attach()
3206 ehc->i.flags |= ATA_EHI_PRINTINFO; in ata_eh_revalidate_and_attach()
3208 ehc->i.flags &= ~ATA_EHI_PRINTINFO; in ata_eh_revalidate_and_attach()
3219 ehc->i.flags |= ATA_EHI_SETMODE; in ata_eh_revalidate_and_attach()
3270 struct ata_eh_context *ehc = &link->eh_context; in ata_set_mode() local
3271 u8 saved_xfer_mode = ehc->saved_xfer_mode[dev->devno]; in ata_set_mode()
3272 u8 saved_ncq = !!(ehc->saved_ncq_enabled & (1 << dev->devno)); in ata_set_mode()
3427 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_set_lpm() local
3530 if (!dev || ehc->tries[dev->devno] <= 2) { in ata_eh_set_lpm()
3563 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_skip_recovery() local
3571 if (ehc->i.flags & ATA_EHI_NO_RECOVERY) in ata_eh_skip_recovery()
3579 if ((ehc->i.action & ATA_EH_RESET) && in ata_eh_skip_recovery()
3580 !(ehc->i.flags & ATA_EHI_DID_RESET)) in ata_eh_skip_recovery()
3586 ehc->classes[dev->devno] != ATA_DEV_NONE) in ata_eh_skip_recovery()
3609 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_schedule_probe() local
3613 if (!(ehc->i.probe_mask & (1 << dev->devno)) || in ata_eh_schedule_probe()
3614 (ehc->did_probe_mask & (1 << dev->devno))) in ata_eh_schedule_probe()
3619 ehc->did_probe_mask |= (1 << dev->devno); in ata_eh_schedule_probe()
3620 ehc->i.action |= ATA_EH_RESET; in ata_eh_schedule_probe()
3621 ehc->saved_xfer_mode[dev->devno] = 0; in ata_eh_schedule_probe()
3622 ehc->saved_ncq_enabled &= ~(1 << dev->devno); in ata_eh_schedule_probe()
3658 struct ata_eh_context *ehc = &dev->link->eh_context; in ata_eh_handle_dev_fail() local
3664 ehc->tries[dev->devno]--; in ata_eh_handle_dev_fail()
3669 ehc->i.probe_mask |= (1 << dev->devno); in ata_eh_handle_dev_fail()
3672 ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1); in ata_eh_handle_dev_fail()
3674 if (ehc->tries[dev->devno] == 1) { in ata_eh_handle_dev_fail()
3684 if (ata_dev_enabled(dev) && !ehc->tries[dev->devno]) { in ata_eh_handle_dev_fail()
3694 ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; in ata_eh_handle_dev_fail()
3695 memset(ehc->cmd_timeout_idx[dev->devno], 0, in ata_eh_handle_dev_fail()
3696 sizeof(ehc->cmd_timeout_idx[dev->devno])); in ata_eh_handle_dev_fail()
3701 ehc->i.action |= ATA_EH_RESET; in ata_eh_handle_dev_fail()
3742 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3745 if (ehc->i.action & ATA_EH_ENABLE_LINK) { in ata_eh_recover()
3755 ehc->tries[dev->devno] = 1; in ata_eh_recover()
3757 ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; in ata_eh_recover()
3760 ehc->i.action |= ehc->i.dev_action[dev->devno] & in ata_eh_recover()
3762 ehc->i.dev_action[dev->devno] &= ATA_EH_PERDEV_MASK; in ata_eh_recover()
3783 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3787 ehc->i.action = 0; in ata_eh_recover()
3790 ehc->classes[dev->devno] = ATA_DEV_UNKNOWN; in ata_eh_recover()
3795 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3797 if (!(ehc->i.action & ATA_EH_RESET)) in ata_eh_recover()
3820 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3826 if (!(ehc->i.dev_action[dev->devno] & in ata_eh_recover()
3834 if (ehc->unloaded_mask & (1 << dev->devno)) in ata_eh_recover()
3864 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_recover() local
3876 ehc->i.action = 0; in ata_eh_recover()
3881 if (ehc->i.flags & ATA_EHI_SETMODE) { in ata_eh_recover()
3885 ehc->i.flags &= ~ATA_EHI_SETMODE; in ata_eh_recover()
3891 if (ehc->i.flags & ATA_EHI_DID_RESET) { in ata_eh_recover()
3922 ehc->i.flags = 0; in ata_eh_recover()