• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/ata/

Lines Matching refs:link

258 	if (ap->link.eh_info.desc_len)
259 __ata_ehi_push_desc(&ap->link.eh_info, " ");
262 __ata_ehi_pushv_desc(&ap->link.eh_info, fmt, args);
337 struct ata_eh_context *ehc = &dev->link->eh_context;
362 struct ata_eh_context *ehc = &dev->link->eh_context;
427 struct ata_eh_context *ehc = &dev->link->eh_context;
432 static void ata_eh_clear_action(struct ata_link *link, struct ata_device *dev,
439 ata_for_each_dev(tdev, link, ALL)
447 ata_for_each_dev(tdev, link, ALL)
494 qc = ata_qc_from_tag(ap, ap->link.active_tag);
510 struct ata_link *link;
517 ata_for_each_link(link, ap, PMP_FIRST) {
518 sata_scr_write(link, SCR_CONTROL, link->saved_scontrol & 0xff0);
519 ata_for_each_dev(dev, link, ALL)
638 struct ata_link *link;
649 ata_for_each_link(link, ap, HOST_FIRST) {
650 struct ata_eh_context *ehc = &link->eh_context;
653 memset(&link->eh_context, 0, sizeof(link->eh_context));
654 link->eh_context.i = link->eh_info;
655 memset(&link->eh_info, 0, sizeof(link->eh_info));
657 ata_for_each_dev(dev, link, ENABLED) {
703 ata_for_each_link(link, ap, HOST_FIRST)
704 memset(&link->eh_info, 0, sizeof(link->eh_info));
715 WARN_ON(ata_qc_from_tag(ap, ap->link.active_tag) == NULL);
923 static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link)
935 if (qc && (!link || qc->dev->link == link)) {
949 * ata_link_abort - abort all qc's on the link
950 * @link: ATA link to abort qc's for
952 * Abort all active qc's active on @link and schedule EH.
960 int ata_link_abort(struct ata_link *link)
962 return ata_do_link_abort(link->ap, link);
1059 rc = sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf);
1061 sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf);
1070 struct ata_device *dev = ap->link.device;
1087 struct ata_link *link;
1090 ata_for_each_link(link, ap, EDGE) {
1091 if (!(sntf & (1 << link->pmp)))
1094 if ((link->device->class == ATA_DEV_ATAPI) &&
1095 (link->device->flags & ATA_DFLAG_AN))
1096 ata_scsi_media_change_notify(link->device);
1227 if (ata_msg_drv(dev->link->ap))
1250 struct ata_link *link = dev->link;
1251 struct ata_port *ap = link->ap;
1252 struct ata_eh_context *ehc = &link->eh_context;
1267 ata_eh_clear_action(link, dev, &link->eh_info, ATA_EH_PERDEV_MASK);
1268 ata_eh_clear_action(link, dev, &link->eh_context.i, ATA_EH_PERDEV_MASK);
1277 * @link: target ATA link
1282 * in @link->eh_info such that eh actions are not unnecessarily
1288 void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev,
1291 struct ata_port *ap = link->ap;
1292 struct ata_eh_info *ehi = &link->eh_info;
1293 struct ata_eh_context *ehc = &link->eh_context;
1298 ata_eh_clear_action(link, dev, ehi, action);
1303 if (!(ehc->i.flags & ATA_EHI_QUIET) && link != ap->slave_link)
1316 * in @link->eh_context.
1321 void ata_eh_done(struct ata_link *link, struct ata_device *dev,
1324 struct ata_eh_context *ehc = &link->eh_context;
1326 ata_eh_clear_action(link, dev, &ehc->i, action);
1420 u8 *buf = dev->link->ap->sector_buf;
1507 struct ata_port *ap = dev->link->ap;
1542 * @link: ATA link to analyze SError for
1550 static void ata_eh_analyze_serror(struct ata_link *link)
1552 struct ata_eh_context *ehc = &link->eh_context;
1573 * considered as X bit is left at 1 for link plugging.
1577 if (!(link->flags & ATA_LFLAG_DISABLED) || ata_is_host_link(link))
1591 * @link: ATA link to analyze NCQ error for
1601 void ata_eh_analyze_ncq_error(struct ata_link *link)
1603 struct ata_port *ap = link->ap;
1604 struct ata_eh_context *ehc = &link->eh_context;
1605 struct ata_device *dev = link->device;
1615 if (!link->sactive || !(ehc->i.err_mask & AC_ERR_DEV))
1633 ata_link_printk(link, KERN_ERR, "failed to read log page 10h "
1638 if (!(link->sactive & (1 << tag))) {
1639 ata_link_printk(link, KERN_ERR, "log page 10h reported "
1887 struct ata_link *link = ata_dev_phys_link(dev);
1912 /* speed down SATA link speed if possible */
1913 if (sata_down_spd_limit(link, 0) == 0) {
1944 (link->ap->cbl != ATA_CBL_SATA || dev->class == ATA_DEV_ATAPI) &&
1963 * @link: host link to perform autopsy on
1965 * Analyze why @link failed and determine which recovery actions
1972 static void ata_eh_link_autopsy(struct ata_link *link)
1974 struct ata_port *ap = link->ap;
1975 struct ata_eh_context *ehc = &link->eh_context;
1988 rc = sata_scr_read(link, SCR_ERROR, &serror);
1991 ata_eh_analyze_serror(link);
2000 ata_eh_analyze_ncq_error(link);
2012 ata_dev_phys_link(qc->dev) != link)
2064 /* propagate timeout to host link */
2065 if ((all_err_mask & AC_ERR_TIMEOUT) && !ata_is_host_link(link))
2066 ap->link.eh_context.i.err_mask |= AC_ERR_TIMEOUT;
2070 if (!dev && ((ata_link_max_devices(link) == 1 &&
2071 ata_dev_enabled(link->device))))
2072 dev = link->device;
2095 struct ata_link *link;
2097 ata_for_each_link(link, ap, EDGE)
2098 ata_eh_link_autopsy(link);
2100 /* Handle the frigging slave link. Autopsy is done similarly
2102 * link and handled from there.
2105 struct ata_eh_context *mehc = &ap->link.eh_context;
2111 /* perform autopsy on the slave link */
2122 /* Autopsy of fanout ports can affect host link autopsy.
2123 * Perform host link autopsy last.
2126 ata_eh_link_autopsy(&ap->link);
2242 * @link: ATA link EH is going on
2249 static void ata_eh_link_report(struct ata_link *link)
2251 struct ata_port *ap = link->ap;
2252 struct ata_eh_context *ehc = &link->eh_context;
2268 ata_dev_phys_link(qc->dev) != link ||
2293 ehc->i.err_mask, link->sactive, ehc->i.serror,
2298 ata_link_printk(link, KERN_ERR, "exception Emask 0x%x "
2300 ehc->i.err_mask, link->sactive, ehc->i.serror,
2303 ata_link_printk(link, KERN_ERR, "%s\n", desc);
2308 ata_link_printk(link, KERN_ERR,
2337 ata_dev_phys_link(qc->dev) != link || !qc->err_mask)
2433 struct ata_link *link;
2435 ata_for_each_link(link, ap, HOST_FIRST)
2436 ata_eh_link_report(link);
2439 static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset,
2446 ata_for_each_dev(dev, link, ALL)
2449 return reset(link, classes, deadline);
2452 static int ata_eh_followup_srst_needed(struct ata_link *link,
2455 if ((link->flags & ATA_LFLAG_NO_SRST) || ata_link_offline(link))
2459 if (sata_pmp_supported(link->ap) && ata_is_host_link(link))
2464 int ata_eh_reset(struct ata_link *link, int classify,
2468 struct ata_port *ap = link->ap;
2470 struct ata_eh_context *ehc = &link->eh_context;
2473 unsigned int lflags = link->flags;
2489 if (link->flags & ATA_LFLAG_NO_HRST)
2491 if (link->flags & ATA_LFLAG_NO_SRST)
2508 ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
2510 ata_for_each_dev(dev, link, ALL) {
2549 rc = prereset(link, deadline);
2551 /* If present, do prereset on slave link too. Reset
2567 ata_link_printk(link, KERN_DEBUG,
2571 ata_for_each_dev(dev, link, ALL)
2576 ata_link_printk(link, KERN_ERR,
2585 ata_for_each_dev(dev, link, ALL)
2588 ata_is_host_link(link))
2599 if (ata_is_host_link(link))
2606 ata_link_printk(link, KERN_INFO, "%s resetting link\n",
2616 rc = ata_do_reset(link, reset, classes, deadline, true);
2618 failed_link = link;
2622 /* hardreset slave link if existent */
2628 "hard resetting link\n");
2647 ata_eh_followup_srst_needed(link, rc, classes)) {
2651 ata_link_printk(link, KERN_ERR,
2654 failed_link = link;
2659 ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
2660 rc = ata_do_reset(link, reset, classes, deadline, true);
2662 failed_link = link;
2668 ata_link_printk(link, KERN_INFO, "no reset method "
2677 ata_for_each_dev(dev, link, ALL) {
2695 /* record current link speed */
2696 if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0)
2697 link->sata_spd = (sstatus >> 4) & 0xf;
2702 if (ata_is_host_link(link))
2706 * is cleared during link resume, clearing SError here is
2710 * link onlineness and classification result later.
2713 postreset(link, classes);
2724 spin_lock_irqsave(link->ap->lock, flags);
2725 memset(&link->eh_info, 0, sizeof(link->eh_info));
2727 memset(&slave->eh_info, 0, sizeof(link->eh_info));
2729 spin_unlock_irqrestore(link->ap->lock, flags);
2736 * link on/offlineness and classification result, those
2740 ata_for_each_dev(dev, link, ALL) {
2743 ata_dev_printk(dev, KERN_DEBUG, "link online "
2750 ata_dev_printk(dev, KERN_DEBUG, "link offline, "
2755 ata_dev_printk(dev, KERN_DEBUG, "link status unknown, "
2763 ata_link_printk(link, KERN_WARNING, "link online but "
2766 failed_link = link;
2770 ata_link_printk(link, KERN_WARNING,
2771 "link online but %d devices misclassified, "
2776 ata_eh_done(link, NULL, ATA_EH_RESET);
2797 if (!ata_is_host_link(link) &&
2798 sata_scr_read(link, SCR_STATUS, &sstatus))
2817 sata_down_spd_limit(link, 0);
2830 struct ata_link *link;
2862 ata_for_each_link(link, ap, EDGE) {
2863 ata_for_each_dev(dev, link, ALL) {
2864 struct ata_eh_info *ehi = &link->eh_info;
2866 link->eh_context.i.dev_action[dev->devno] |=
2868 ata_eh_clear_action(link, dev, ehi, ATA_EH_PARK);
2876 struct ata_eh_context *ehc = &dev->link->eh_context;
2902 static int ata_eh_revalidate_and_attach(struct ata_link *link,
2905 struct ata_port *ap = link->ap;
2906 struct ata_eh_context *ehc = &link->eh_context;
2918 ata_for_each_dev(dev, link, ALL_REVERSE) {
2933 ata_eh_about_to_do(link, dev, ATA_EH_REVALIDATE);
2939 ata_eh_done(link, dev, ATA_EH_REVALIDATE);
2989 if ((ehc->i.flags & ATA_EHI_DID_RESET) && ata_is_host_link(link)) {
2998 ata_for_each_dev(dev, link, ALL) {
3033 * @link: link on which timings will be programmed
3046 int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
3048 struct ata_port *ap = link->ap;
3053 ata_for_each_dev(dev, link, ENABLED) {
3065 rc = ap->ops->set_mode(link, r_failed_dev);
3067 rc = ata_do_set_mode(link, r_failed_dev);
3070 ata_for_each_dev(dev, link, ENABLED) {
3071 struct ata_eh_context *ehc = &link->eh_context;
3102 u8 *sense_buffer = dev->link->ap->sector_buf;
3149 struct ata_link *link = dev->link;
3150 struct ata_port *ap = link->ap;
3157 if (!ata_tag_valid(link->active_tag))
3160 qc = __ata_qc_from_tag(ap, link->active_tag);
3206 static int ata_link_nr_enabled(struct ata_link *link)
3211 ata_for_each_dev(dev, link, ENABLED)
3216 static int ata_link_nr_vacant(struct ata_link *link)
3221 ata_for_each_dev(dev, link, ALL)
3227 static int ata_eh_skip_recovery(struct ata_link *link)
3229 struct ata_port *ap = link->ap;
3230 struct ata_eh_context *ehc = &link->eh_context;
3234 if (link->flags & ATA_LFLAG_DISABLED)
3242 if ((ap->pflags & ATA_PFLAG_FROZEN) || ata_link_nr_enabled(link))
3251 ata_for_each_dev(dev, link, ALL) {
3275 struct ata_eh_context *ehc = &dev->link->eh_context;
3276 struct ata_link *link = ata_dev_phys_link(dev);
3294 sata_down_spd_limit(link, 1);
3301 struct ata_eh_context *ehc = &dev->link->eh_context;
3356 * @r_failed_link: out parameter for failed link
3360 * recover each link and hotplug requests are recorded in the
3361 * link's eh_context. This function executes all the operations
3376 struct ata_link *link;
3385 ata_for_each_link(link, ap, EDGE) {
3386 struct ata_eh_context *ehc = &link->eh_context;
3388 /* re-enable link? */
3390 ata_eh_about_to_do(link, NULL, ATA_EH_ENABLE_LINK);
3392 link->flags &= ~ATA_LFLAG_DISABLED;
3394 ata_eh_done(link, NULL, ATA_EH_ENABLE_LINK);
3397 ata_for_each_dev(dev, link, ALL) {
3398 if (link->flags & ATA_LFLAG_NO_RETRY)
3427 ata_for_each_link(link, ap, EDGE) {
3428 struct ata_eh_context *ehc = &link->eh_context;
3431 if (ata_eh_skip_recovery(link))
3434 ata_for_each_dev(dev, link, ALL)
3439 ata_for_each_link(link, ap, EDGE) {
3440 struct ata_eh_context *ehc = &link->eh_context;
3445 rc = ata_eh_reset(link, ata_link_nr_vacant(link),
3448 ata_link_printk(link, KERN_ERR,
3464 ata_for_each_link(link, ap, EDGE) {
3465 ata_for_each_dev(dev, link, ALL) {
3466 struct ata_eh_context *ehc = &link->eh_context;
3493 ata_for_each_link(link, ap, EDGE) {
3494 ata_for_each_dev(dev, link, ALL) {
3495 if (!(link->eh_context.unloaded_mask &
3500 ata_eh_done(link, dev, ATA_EH_PARK);
3505 ata_for_each_link(link, ap, EDGE) {
3506 struct ata_eh_context *ehc = &link->eh_context;
3509 rc = ata_eh_revalidate_and_attach(link, &dev);
3514 if (link->device->class == ATA_DEV_PMP) {
3521 rc = ata_set_mode(link, &dev);
3531 ata_for_each_dev(dev, link, ALL) {
3541 ata_for_each_dev(dev, link, ALL) {
3549 /* configure link power saving */
3551 ata_for_each_dev(dev, link, ALL)
3554 /* this link is okay now */
3577 *r_failed_link = link;
3652 ata_for_each_dev(dev, &ap->link, ALL)
3674 if (hardreset == sata_std_hardreset && !sata_scr_valid(&ap->link))
3749 struct ata_link *link;
3772 ata_for_each_link(link, ap, HOST_FIRST)
3773 ata_for_each_dev(dev, link, ALL)