libata-eh.c (cb6e73aaadff73751bb1c01349e58f2c6428e0a8) libata-eh.c (b46c760e11c8ce59166d2f9038d237dee409f37d)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * libata-eh.c - libata error handling
4 *
5 * Copyright 2006 Tejun Heo <htejun@gmail.com>
6 *
7 * libata documentation is available via 'make {ps|pdf}docs',
8 * as Documentation/driver-api/libata.rst

--- 1376 unchanged lines hidden (view full) ---

1385 if (err_mask == AC_ERR_DEV)
1386 *r_sense_key = tf.error >> 4;
1387 return err_mask;
1388}
1389
1390/**
1391 * ata_eh_request_sense - perform REQUEST_SENSE_DATA_EXT
1392 * @qc: qc to perform REQUEST_SENSE_SENSE_DATA_EXT to
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * libata-eh.c - libata error handling
4 *
5 * Copyright 2006 Tejun Heo <htejun@gmail.com>
6 *
7 * libata documentation is available via 'make {ps|pdf}docs',
8 * as Documentation/driver-api/libata.rst

--- 1376 unchanged lines hidden (view full) ---

1385 if (err_mask == AC_ERR_DEV)
1386 *r_sense_key = tf.error >> 4;
1387 return err_mask;
1388}
1389
1390/**
1391 * ata_eh_request_sense - perform REQUEST_SENSE_DATA_EXT
1392 * @qc: qc to perform REQUEST_SENSE_SENSE_DATA_EXT to
1393 * @cmd: scsi command for which the sense code should be set
1394 *
1395 * Perform REQUEST_SENSE_DATA_EXT after the device reported CHECK
1396 * SENSE. This function is an EH helper.
1397 *
1398 * LOCKING:
1399 * Kernel thread context (may sleep).
1400 */
1393 *
1394 * Perform REQUEST_SENSE_DATA_EXT after the device reported CHECK
1395 * SENSE. This function is an EH helper.
1396 *
1397 * LOCKING:
1398 * Kernel thread context (may sleep).
1399 */
1401static void ata_eh_request_sense(struct ata_queued_cmd *qc,
1402 struct scsi_cmnd *cmd)
1400static void ata_eh_request_sense(struct ata_queued_cmd *qc)
1403{
1401{
1402 struct scsi_cmnd *cmd = qc->scsicmd;
1404 struct ata_device *dev = qc->dev;
1405 struct ata_taskfile tf;
1406 unsigned int err_mask;
1407
1408 if (qc->ap->pflags & ATA_PFLAG_FROZEN) {
1409 ata_dev_warn(dev, "sense data available but port frozen\n");
1410 return;
1411 }

--- 159 unchanged lines hidden (view full) ---

1571 stat &= ~ATA_SENSE;
1572 } else {
1573 return 0;
1574 }
1575
1576 switch (qc->dev->class) {
1577 case ATA_DEV_ZAC:
1578 if (stat & ATA_SENSE)
1403 struct ata_device *dev = qc->dev;
1404 struct ata_taskfile tf;
1405 unsigned int err_mask;
1406
1407 if (qc->ap->pflags & ATA_PFLAG_FROZEN) {
1408 ata_dev_warn(dev, "sense data available but port frozen\n");
1409 return;
1410 }

--- 159 unchanged lines hidden (view full) ---

1570 stat &= ~ATA_SENSE;
1571 } else {
1572 return 0;
1573 }
1574
1575 switch (qc->dev->class) {
1576 case ATA_DEV_ZAC:
1577 if (stat & ATA_SENSE)
1579 ata_eh_request_sense(qc, qc->scsicmd);
1578 ata_eh_request_sense(qc);
1580 fallthrough;
1581 case ATA_DEV_ATA:
1582 if (err & ATA_ICRC)
1583 qc->err_mask |= AC_ERR_ATA_BUS;
1584 if (err & (ATA_UNC | ATA_AMNF))
1585 qc->err_mask |= AC_ERR_MEDIA;
1586 if (err & ATA_IDNF)
1587 qc->err_mask |= AC_ERR_INVALID;

--- 2387 unchanged lines hidden ---
1579 fallthrough;
1580 case ATA_DEV_ATA:
1581 if (err & ATA_ICRC)
1582 qc->err_mask |= AC_ERR_ATA_BUS;
1583 if (err & (ATA_UNC | ATA_AMNF))
1584 qc->err_mask |= AC_ERR_MEDIA;
1585 if (err & ATA_IDNF)
1586 qc->err_mask |= AC_ERR_INVALID;

--- 2387 unchanged lines hidden ---