Lines Matching +full:tf +full:- +full:a

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright 2003-2004 Red Hat, Inc. All rights reserved.
6 * Copyright 2003-2004 Jeff Garzik
19 #include "libata-transport.h"
30 * sata_scr_valid - test whether SCRs are accessible
43 struct ata_port *ap = link->ap; in sata_scr_valid()
45 return (ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read; in sata_scr_valid()
50 * sata_scr_read - read SCR register of the specified port
56 * guaranteed to succeed if @link is ap->link, the cable type of
57 * the port is SATA and the port implements ->scr_read.
60 * None if @link is ap->link. Kernel thread context otherwise.
69 return link->ap->ops->scr_read(link, reg, val); in sata_scr_read()
70 return -EOPNOTSUPP; in sata_scr_read()
78 * sata_scr_write - write SCR register of the specified port
84 * guaranteed to succeed if @link is ap->link, the cable type of
85 * the port is SATA and the port implements ->scr_read.
88 * None if @link is ap->link. Kernel thread context otherwise.
97 return link->ap->ops->scr_write(link, reg, val); in sata_scr_write()
98 return -EOPNOTSUPP; in sata_scr_write()
106 * sata_scr_write_flush - write SCR register of the specified port and flush
115 * None if @link is ap->link. Kernel thread context otherwise.
126 rc = link->ap->ops->scr_write(link, reg, val); in sata_scr_write_flush()
128 rc = link->ap->ops->scr_read(link, reg, &val); in sata_scr_write_flush()
131 return -EOPNOTSUPP; in sata_scr_write_flush()
139 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
140 * @tf: Taskfile to convert
145 * Converts a standard ATA taskfile to a Serial ATA
146 * FIS structure (Register - Host to Device).
151 void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) in ata_tf_to_fis() argument
153 fis[0] = 0x27; /* Register - Host to Device FIS */ in ata_tf_to_fis()
158 fis[2] = tf->command; in ata_tf_to_fis()
159 fis[3] = tf->feature; in ata_tf_to_fis()
161 fis[4] = tf->lbal; in ata_tf_to_fis()
162 fis[5] = tf->lbam; in ata_tf_to_fis()
163 fis[6] = tf->lbah; in ata_tf_to_fis()
164 fis[7] = tf->device; in ata_tf_to_fis()
166 fis[8] = tf->hob_lbal; in ata_tf_to_fis()
167 fis[9] = tf->hob_lbam; in ata_tf_to_fis()
168 fis[10] = tf->hob_lbah; in ata_tf_to_fis()
169 fis[11] = tf->hob_feature; in ata_tf_to_fis()
171 fis[12] = tf->nsect; in ata_tf_to_fis()
172 fis[13] = tf->hob_nsect; in ata_tf_to_fis()
174 fis[15] = tf->ctl; in ata_tf_to_fis()
176 fis[16] = tf->auxiliary & 0xff; in ata_tf_to_fis()
177 fis[17] = (tf->auxiliary >> 8) & 0xff; in ata_tf_to_fis()
178 fis[18] = (tf->auxiliary >> 16) & 0xff; in ata_tf_to_fis()
179 fis[19] = (tf->auxiliary >> 24) & 0xff; in ata_tf_to_fis()
184 * ata_tf_from_fis - Convert SATA FIS to ATA taskfile
186 * @tf: Taskfile to output
188 * Converts a serial ATA FIS structure to a standard ATA taskfile.
194 void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf) in ata_tf_from_fis() argument
196 tf->status = fis[2]; in ata_tf_from_fis()
197 tf->error = fis[3]; in ata_tf_from_fis()
199 tf->lbal = fis[4]; in ata_tf_from_fis()
200 tf->lbam = fis[5]; in ata_tf_from_fis()
201 tf->lbah = fis[6]; in ata_tf_from_fis()
202 tf->device = fis[7]; in ata_tf_from_fis()
204 tf->hob_lbal = fis[8]; in ata_tf_from_fis()
205 tf->hob_lbam = fis[9]; in ata_tf_from_fis()
206 tf->hob_lbah = fis[10]; in ata_tf_from_fis()
208 tf->nsect = fis[12]; in ata_tf_from_fis()
209 tf->hob_nsect = fis[13]; in ata_tf_from_fis()
214 * sata_link_debounce - debounce SATA phy status
233 * 0 on success, -errno on failure.
256 ata_msleep(link->ap, interval); in sata_link_debounce()
276 * -EPIPE to tell upper layer to lower link speed. in sata_link_debounce()
279 return -EPIPE; in sata_link_debounce()
285 * sata_link_resume - resume SATA link
296 * 0 on success, -errno on failure.
322 if (!(link->flags & ATA_LFLAG_NO_DEBOUNCE_DELAY)) in sata_link_resume()
323 ata_msleep(link->ap, 200); in sata_link_resume()
328 } while ((scontrol & 0xf0f) != 0x300 && --tries); in sata_link_resume()
338 ATA_LINK_RESUME_TRIES - tries); in sata_link_resume()
347 return rc != -EINVAL ? rc : 0; in sata_link_resume()
352 * sata_link_scr_lpm - manipulate SControl IPM and SPM fields
367 * 0 on success, -errno otherwise.
372 struct ata_eh_context *ehc = &link->eh_context; in sata_link_scr_lpm()
407 if (link->ap->host->flags & ATA_HOST_NO_PART) in sata_link_scr_lpm()
410 if (link->ap->host->flags & ATA_HOST_NO_SSC) in sata_link_scr_lpm()
413 if (link->ap->host->flags & ATA_HOST_NO_DEVSLP) in sata_link_scr_lpm()
434 ehc->i.serror &= ~SERR_PHYRDY_CHG; in sata_link_scr_lpm()
441 struct ata_link *host_link = &link->ap->link; in __sata_set_spd_needed()
444 limit = link->sata_spd_limit; in __sata_set_spd_needed()
450 if (!ata_is_host_link(link) && host_link->sata_spd) in __sata_set_spd_needed()
451 limit &= (1 << host_link->sata_spd) - 1; in __sata_set_spd_needed()
465 * sata_set_spd_needed - is SATA spd configuration needed
469 * @link->sata_spd_limit. This function is used to determine
490 * sata_set_spd - set SATA spd according to spd limit
521 * sata_link_hardreset - reset link via SATA phy reset
528 * SATA phy-reset @link using DET bits of SControl register.
542 * 0 on success, -errno otherwise.
580 /* Couldn't find anything in SATA I/II specs, but AHCI-1.1 in sata_link_hardreset()
583 ata_msleep(link->ap, 1); in sata_link_hardreset()
593 /* Link is online. From this point, -ENODEV too is an error. */ in sata_link_hardreset()
597 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) { in sata_link_hardreset()
598 /* If PMP is supported, we have to do follow-up SRST. in sata_link_hardreset()
612 rc = -EAGAIN; in sata_link_hardreset()
620 if (rc && rc != -EAGAIN) { in sata_link_hardreset()
630 * ata_qc_complete_multiple - Complete multiple qcs successfully
634 * Complete in-flight commands. This functions is meant to be
635 * called from low-level driver's interrupt routine to complete
636 * requests normally. ap->qc_active and @qc_active is compared
647 * Number of completed commands on success, -errno otherwise.
651 u64 done_mask, ap_qc_active = ap->qc_active; in ata_qc_complete_multiple()
655 * If the internal tag is set on ap->qc_active, then we care about in ata_qc_complete_multiple()
667 ata_port_err(ap, "illegal qc_active transition (%08llx->%08llx)\n", in ata_qc_complete_multiple()
668 ap->qc_active, qc_active); in ata_qc_complete_multiple()
669 return -EINVAL; in ata_qc_complete_multiple()
672 if (ap->ops->qc_ncq_fill_rtf) in ata_qc_complete_multiple()
673 ap->ops->qc_ncq_fill_rtf(ap, done_mask); in ata_qc_complete_multiple()
692 * ata_slave_link_init - initialize slave link
698 * In libata, a port contains links and a link contains devices.
699 * There is single host link but if a PMP is attached to it,
700 * there can be multiple fan-out links. On SATA, there's usually
701 * a single device connected to a link but PATA and SATA
702 * controllers emulating TF based interface can have two - master
705 * However, there are a few controllers which don't fit into this
706 * abstraction too well - SATA controllers which emulate TF
710 * (e.g. onlineness, link speed) but should be treated like a
718 * handling, separate @ap->slave_link is used. All dirty details
724 * prereset(M) -> prereset(S) -> hardreset(M) -> hardreset(S) ->
725 * softreset(M) -> postreset(M) -> postreset(S)
735 * 0 on success, -errno on failure.
741 WARN_ON(ap->slave_link); in ata_slave_link_init()
742 WARN_ON(ap->flags & ATA_FLAG_PMP); in ata_slave_link_init()
746 return -ENOMEM; in ata_slave_link_init()
749 ap->slave_link = link; in ata_slave_link_init()
755 * sata_lpm_ignore_phy_events - test if PHY event should be ignored
768 unsigned long lpm_timeout = link->last_lpm_change + in sata_lpm_ignore_phy_events()
772 if (link->lpm_policy > ATA_LPM_MAX_POWER) in sata_lpm_ignore_phy_events()
778 if ((link->flags & ATA_LFLAG_CHANGED) && in sata_lpm_ignore_phy_events()
815 return -EINVAL; in ata_scsi_lpm_store()
817 spin_lock_irqsave(ap->lock, flags); in ata_scsi_lpm_store()
820 ata_for_each_dev(dev, &ap->link, ENABLED) { in ata_scsi_lpm_store()
821 if (dev->horkage & ATA_HORKAGE_NOLPM) { in ata_scsi_lpm_store()
822 count = -EOPNOTSUPP; in ata_scsi_lpm_store()
828 ap->target_lpm_policy = policy; in ata_scsi_lpm_store()
831 spin_unlock_irqrestore(ap->lock, flags); in ata_scsi_lpm_store()
841 if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names)) in ata_scsi_lpm_show()
842 return -EINVAL; in ata_scsi_lpm_show()
845 ata_lpm_policy_names[ap->target_lpm_policy]); in ata_scsi_lpm_show()
856 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_supported_show()
861 spin_lock_irq(ap->lock); in ata_ncq_prio_supported_show()
864 rc = -ENODEV; in ata_ncq_prio_supported_show()
866 ncq_prio_supported = dev->flags & ATA_DFLAG_NCQ_PRIO; in ata_ncq_prio_supported_show()
867 spin_unlock_irq(ap->lock); in ata_ncq_prio_supported_show()
880 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_enable_show()
885 spin_lock_irq(ap->lock); in ata_ncq_prio_enable_show()
888 rc = -ENODEV; in ata_ncq_prio_enable_show()
890 ncq_prio_enable = dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED; in ata_ncq_prio_enable_show()
891 spin_unlock_irq(ap->lock); in ata_ncq_prio_enable_show()
910 return -EINVAL; in ata_ncq_prio_enable_store()
912 ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_enable_store()
915 return -ENODEV; in ata_ncq_prio_enable_store()
917 spin_lock_irq(ap->lock); in ata_ncq_prio_enable_store()
919 if (!(dev->flags & ATA_DFLAG_NCQ_PRIO)) { in ata_ncq_prio_enable_store()
920 rc = -EINVAL; in ata_ncq_prio_enable_store()
925 if (dev->flags & ATA_DFLAG_CDL_ENABLED) { in ata_ncq_prio_enable_store()
928 rc = -EINVAL; in ata_ncq_prio_enable_store()
931 dev->flags |= ATA_DFLAG_NCQ_PRIO_ENABLED; in ata_ncq_prio_enable_store()
933 dev->flags &= ~ATA_DFLAG_NCQ_PRIO_ENABLED; in ata_ncq_prio_enable_store()
937 spin_unlock_irq(ap->lock); in ata_ncq_prio_enable_store()
969 if (ap->ops->em_store && (ap->flags & ATA_FLAG_EM)) in ata_scsi_em_message_store()
970 return ap->ops->em_store(ap, buf, count); in ata_scsi_em_message_store()
971 return -EINVAL; in ata_scsi_em_message_store()
981 if (ap->ops->em_show && (ap->flags & ATA_FLAG_EM)) in ata_scsi_em_message_show()
982 return ap->ops->em_show(ap, buf); in ata_scsi_em_message_show()
983 return -EINVAL; in ata_scsi_em_message_show()
996 return sysfs_emit(buf, "%d\n", ap->em_message_type); in ata_scsi_em_message_type_show()
1007 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_show()
1010 if (atadev && ap->ops->sw_activity_show && in ata_scsi_activity_show()
1011 (ap->flags & ATA_FLAG_SW_ACTIVITY)) in ata_scsi_activity_show()
1012 return ap->ops->sw_activity_show(atadev, buf); in ata_scsi_activity_show()
1013 return -EINVAL; in ata_scsi_activity_show()
1021 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_store()
1026 if (atadev && ap->ops->sw_activity_store && in ata_scsi_activity_store()
1027 (ap->flags & ATA_FLAG_SW_ACTIVITY)) { in ata_scsi_activity_store()
1031 rc = ap->ops->sw_activity_store(atadev, val); in ata_scsi_activity_store()
1038 return -EINVAL; in ata_scsi_activity_store()
1045 * ata_change_queue_depth - Set a device maximum queue depth
1050 * Helper to set a device maximum queue depth, usable with both libsas
1061 spin_lock_irqsave(ap->lock, flags); in ata_change_queue_depth()
1064 if (!dev || queue_depth < 1 || queue_depth == sdev->queue_depth) { in ata_change_queue_depth()
1065 spin_unlock_irqrestore(ap->lock, flags); in ata_change_queue_depth()
1066 return sdev->queue_depth; in ata_change_queue_depth()
1073 max_queue_depth = min(ATA_MAX_QUEUE, sdev->host->can_queue); in ata_change_queue_depth()
1074 max_queue_depth = min(max_queue_depth, ata_id_queue_depth(dev->id)); in ata_change_queue_depth()
1076 spin_unlock_irqrestore(ap->lock, flags); in ata_change_queue_depth()
1077 return -EINVAL; in ata_change_queue_depth()
1085 dev->flags |= ATA_DFLAG_NCQ_OFF; in ata_change_queue_depth()
1088 dev->flags &= ~ATA_DFLAG_NCQ_OFF; in ata_change_queue_depth()
1091 spin_unlock_irqrestore(ap->lock, flags); in ata_change_queue_depth()
1093 if (queue_depth == sdev->queue_depth) in ata_change_queue_depth()
1094 return sdev->queue_depth; in ata_change_queue_depth()
1101 * ata_scsi_change_queue_depth - SCSI callback for queue depth config
1105 * This is libata standard hostt->change_queue_depth callback.
1117 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_change_queue_depth()
1124 * ata_sas_port_alloc - Allocate port for a SAS attached SATA device
1126 * @port_info: Information from low-level host driver
1146 ap->port_no = 0; in ata_sas_port_alloc()
1147 ap->lock = &host->lock; in ata_sas_port_alloc()
1148 ap->pio_mask = port_info->pio_mask; in ata_sas_port_alloc()
1149 ap->mwdma_mask = port_info->mwdma_mask; in ata_sas_port_alloc()
1150 ap->udma_mask = port_info->udma_mask; in ata_sas_port_alloc()
1151 ap->flags |= port_info->flags; in ata_sas_port_alloc()
1152 ap->ops = port_info->port_ops; in ata_sas_port_alloc()
1153 ap->cbl = ATA_CBL_SATA; in ata_sas_port_alloc()
1154 ap->print_id = atomic_inc_return(&ata_print_id); in ata_sas_port_alloc()
1173 * ata_sas_slave_configure - Default slave_config routine for libata devices
1185 return ata_scsi_dev_config(sdev, ap->link.device); in ata_sas_slave_configure()
1190 * ata_sas_queuecmd - Issue SCSI cdb to libata-managed device
1203 if (likely(ata_dev_enabled(ap->link.device))) in ata_sas_queuecmd()
1204 rc = __ata_scsi_queuecmd(cmd, ap->link.device); in ata_sas_queuecmd()
1206 cmd->result = (DID_BAD_TARGET << 16); in ata_sas_queuecmd()
1214 * sata_async_notification - SATA async notification handler
1231 if (!(ap->flags & ATA_FLAG_AN)) in sata_async_notification()
1234 rc = sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf); in sata_async_notification()
1236 sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf); in sata_async_notification()
1245 struct ata_device *dev = ap->link.device; in sata_async_notification()
1247 if ((dev->class == ATA_DEV_ATAPI) && in sata_async_notification()
1248 (dev->flags & ATA_DFLAG_AN)) in sata_async_notification()
1266 if (!(sntf & (1 << link->pmp))) in sata_async_notification()
1269 if ((link->device->class == ATA_DEV_ATAPI) && in sata_async_notification()
1270 (link->device->flags & ATA_DFLAG_AN)) in sata_async_notification()
1271 ata_scsi_media_change_notify(link->device); in sata_async_notification()
1288 * ata_eh_read_log_10h - Read log page 10h for NCQ error details
1291 * @tf: Resulting taskfile registers of the failed command
1300 * 0 on success, -errno otherwise.
1303 int *tag, struct ata_taskfile *tf) in ata_eh_read_log_10h() argument
1305 u8 *buf = dev->link->ap->sector_buf; in ata_eh_read_log_10h()
1312 return -EIO; in ata_eh_read_log_10h()
1322 return -ENOENT; in ata_eh_read_log_10h()
1326 tf->status = buf[2]; in ata_eh_read_log_10h()
1327 tf->error = buf[3]; in ata_eh_read_log_10h()
1328 tf->lbal = buf[4]; in ata_eh_read_log_10h()
1329 tf->lbam = buf[5]; in ata_eh_read_log_10h()
1330 tf->lbah = buf[6]; in ata_eh_read_log_10h()
1331 tf->device = buf[7]; in ata_eh_read_log_10h()
1332 tf->hob_lbal = buf[8]; in ata_eh_read_log_10h()
1333 tf->hob_lbam = buf[9]; in ata_eh_read_log_10h()
1334 tf->hob_lbah = buf[10]; in ata_eh_read_log_10h()
1335 tf->nsect = buf[12]; in ata_eh_read_log_10h()
1336 tf->hob_nsect = buf[13]; in ata_eh_read_log_10h()
1337 if (ata_id_has_ncq_autosense(dev->id) && (tf->status & ATA_SENSE)) in ata_eh_read_log_10h()
1338 tf->auxiliary = buf[14] << 16 | buf[15] << 8 | buf[16]; in ata_eh_read_log_10h()
1344 * ata_eh_read_sense_success_ncq_log - Read the sense data for successful
1356 * 0 on success, -errno otherwise.
1360 struct ata_device *dev = link->device; in ata_eh_read_sense_success_ncq_log()
1361 struct ata_port *ap = dev->link->ap; in ata_eh_read_sense_success_ncq_log()
1362 u8 *buf = ap->ncq_sense_buf; in ata_eh_read_sense_success_ncq_log()
1373 return -EIO; in ata_eh_read_sense_success_ncq_log()
1381 return -EIO; in ata_eh_read_sense_success_ncq_log()
1388 if (!(qc->flags & ATA_QCFLAG_EH) || in ata_eh_read_sense_success_ncq_log()
1389 !(qc->flags & ATA_QCFLAG_EH_SUCCESS_CMD) || in ata_eh_read_sense_success_ncq_log()
1390 qc->err_mask || in ata_eh_read_sense_success_ncq_log()
1391 ata_dev_phys_link(qc->dev) != link) in ata_eh_read_sense_success_ncq_log()
1399 qc->result_tf.status &= ~ATA_SENSE; in ata_eh_read_sense_success_ncq_log()
1409 ret = -EIO; in ata_eh_read_sense_success_ncq_log()
1413 /* Set sense without also setting scsicmd->result */ in ata_eh_read_sense_success_ncq_log()
1414 scsi_build_sense_buffer(dev->flags & ATA_DFLAG_D_SENSE, in ata_eh_read_sense_success_ncq_log()
1415 qc->scsicmd->sense_buffer, sk, in ata_eh_read_sense_success_ncq_log()
1417 qc->flags |= ATA_QCFLAG_SENSE_VALID; in ata_eh_read_sense_success_ncq_log()
1425 scsi_check_sense(qc->scsicmd); in ata_eh_read_sense_success_ncq_log()
1433 * ata_eh_analyze_ncq_error - analyze NCQ error
1437 * error status TF. For NCQ device errors, all LLDDs have to do
1438 * is setting AC_ERR_DEV in ehi->err_mask. This function takes
1446 struct ata_port *ap = link->ap; in ata_eh_analyze_ncq_error()
1447 struct ata_eh_context *ehc = &link->eh_context; in ata_eh_analyze_ncq_error()
1448 struct ata_device *dev = link->device; in ata_eh_analyze_ncq_error()
1450 struct ata_taskfile tf; in ata_eh_analyze_ncq_error() local
1458 if (!link->sactive || !(ehc->i.err_mask & AC_ERR_DEV)) in ata_eh_analyze_ncq_error()
1463 if (!(qc->flags & ATA_QCFLAG_EH)) in ata_eh_analyze_ncq_error()
1466 if (qc->err_mask) in ata_eh_analyze_ncq_error()
1471 memset(&tf, 0, sizeof(tf)); in ata_eh_analyze_ncq_error()
1472 rc = ata_eh_read_log_10h(dev, &tag, &tf); in ata_eh_analyze_ncq_error()
1479 if (!(link->sactive & (1 << tag))) { in ata_eh_analyze_ncq_error()
1487 memcpy(&qc->result_tf, &tf, sizeof(tf)); in ata_eh_analyze_ncq_error()
1488 qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48; in ata_eh_analyze_ncq_error()
1489 qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ; in ata_eh_analyze_ncq_error()
1493 * stored the sense data in qc->result_tf.auxiliary. in ata_eh_analyze_ncq_error()
1495 if (qc->result_tf.auxiliary) { in ata_eh_analyze_ncq_error()
1498 sense_key = (qc->result_tf.auxiliary >> 16) & 0xff; in ata_eh_analyze_ncq_error()
1499 asc = (qc->result_tf.auxiliary >> 8) & 0xff; in ata_eh_analyze_ncq_error()
1500 ascq = qc->result_tf.auxiliary & 0xff; in ata_eh_analyze_ncq_error()
1502 ata_scsi_set_sense(dev, qc->scsicmd, sense_key, asc, in ata_eh_analyze_ncq_error()
1504 ata_scsi_set_sense_information(dev, qc->scsicmd, in ata_eh_analyze_ncq_error()
1505 &qc->result_tf); in ata_eh_analyze_ncq_error()
1506 qc->flags |= ATA_QCFLAG_SENSE_VALID; in ata_eh_analyze_ncq_error()
1511 if (!(qc->flags & ATA_QCFLAG_EH) || in ata_eh_analyze_ncq_error()
1512 qc->flags & ATA_QCFLAG_EH_SUCCESS_CMD || in ata_eh_analyze_ncq_error()
1513 ata_dev_phys_link(qc->dev) != link) in ata_eh_analyze_ncq_error()
1517 if (qc->err_mask) in ata_eh_analyze_ncq_error()
1526 qc->result_tf.status &= ~ATA_ERR; in ata_eh_analyze_ncq_error()
1527 qc->result_tf.error = 0; in ata_eh_analyze_ncq_error()
1530 * If we get a NCQ error, that means that a single command was in ata_eh_analyze_ncq_error()
1535 qc->flags |= ATA_QCFLAG_RETRY; in ata_eh_analyze_ncq_error()
1538 ehc->i.err_mask &= ~AC_ERR_DEV; in ata_eh_analyze_ncq_error()