diff options
author | Tejun Heo <tj@kernel.org> | 2015-08-03 11:45:34 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-08-03 12:01:19 -0400 |
commit | 84ded2f8e7dda336fc2fb3570726ceb3b3b3590f (patch) | |
tree | fd3ab53fff8959c6f3373eae756e6314c653baf6 /drivers | |
parent | fe16d4f202c59a560533a223bc6375739ee30944 (diff) |
Revert "libata: Implement support for sense data reporting"
This reverts commit fe7173c206de63fc28475ee6ae42ff95c05692de.
As implemented, ACS-4 sense reporting for ATA devices bypasses error
diagnosis and handling in libata degrading EH behavior significantly.
Revert the related changes for now.
ATA_ID_COMMAND_SET_3/4 constants are not reverted as they're used by
later changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>
Cc: stable@vger.kernel.org #v4.1+
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 20 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 86 |
2 files changed, 4 insertions, 102 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 426bc12459de..19bcb80b2031 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2147,24 +2147,6 @@ static int ata_dev_config_ncq(struct ata_device *dev, | |||
2147 | return 0; | 2147 | return 0; |
2148 | } | 2148 | } |
2149 | 2149 | ||
2150 | static void ata_dev_config_sense_reporting(struct ata_device *dev) | ||
2151 | { | ||
2152 | unsigned int err_mask; | ||
2153 | |||
2154 | if (!ata_id_has_sense_reporting(dev->id)) | ||
2155 | return; | ||
2156 | |||
2157 | if (ata_id_sense_reporting_enabled(dev->id)) | ||
2158 | return; | ||
2159 | |||
2160 | err_mask = ata_dev_set_feature(dev, SETFEATURE_SENSE_DATA, 0x1); | ||
2161 | if (err_mask) { | ||
2162 | ata_dev_dbg(dev, | ||
2163 | "failed to enable Sense Data Reporting, Emask 0x%x\n", | ||
2164 | err_mask); | ||
2165 | } | ||
2166 | } | ||
2167 | |||
2168 | /** | 2150 | /** |
2169 | * ata_dev_configure - Configure the specified ATA/ATAPI device | 2151 | * ata_dev_configure - Configure the specified ATA/ATAPI device |
2170 | * @dev: Target device to configure | 2152 | * @dev: Target device to configure |
@@ -2387,7 +2369,7 @@ int ata_dev_configure(struct ata_device *dev) | |||
2387 | dev->devslp_timing[i] = sata_setting[j]; | 2369 | dev->devslp_timing[i] = sata_setting[j]; |
2388 | } | 2370 | } |
2389 | } | 2371 | } |
2390 | ata_dev_config_sense_reporting(dev); | 2372 | |
2391 | dev->cdb_len = 16; | 2373 | dev->cdb_len = 16; |
2392 | } | 2374 | } |
2393 | 2375 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index af08d32af4e0..16125be34893 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1630,70 +1630,6 @@ unsigned int atapi_eh_tur(struct ata_device *dev, u8 *r_sense_key) | |||
1630 | } | 1630 | } |
1631 | 1631 | ||
1632 | /** | 1632 | /** |
1633 | * ata_eh_request_sense - perform REQUEST_SENSE_DATA_EXT | ||
1634 | * @dev: device to perform REQUEST_SENSE_SENSE_DATA_EXT to | ||
1635 | * @sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long) | ||
1636 | * @dfl_sense_key: default sense key to use | ||
1637 | * | ||
1638 | * Perform REQUEST_SENSE_DATA_EXT after the device reported CHECK | ||
1639 | * SENSE. This function is EH helper. | ||
1640 | * | ||
1641 | * LOCKING: | ||
1642 | * Kernel thread context (may sleep). | ||
1643 | * | ||
1644 | * RETURNS: | ||
1645 | * encoded sense data on success, 0 on failure or if sense data | ||
1646 | * is not available. | ||
1647 | */ | ||
1648 | static u32 ata_eh_request_sense(struct ata_queued_cmd *qc, | ||
1649 | struct scsi_cmnd *cmd) | ||
1650 | { | ||
1651 | struct ata_device *dev = qc->dev; | ||
1652 | struct ata_taskfile tf; | ||
1653 | unsigned int err_mask; | ||
1654 | |||
1655 | if (!cmd) | ||
1656 | return 0; | ||
1657 | |||
1658 | DPRINTK("ATA request sense\n"); | ||
1659 | ata_dev_warn(dev, "request sense\n"); | ||
1660 | if (!ata_id_sense_reporting_enabled(dev->id)) { | ||
1661 | ata_dev_warn(qc->dev, "sense data reporting disabled\n"); | ||
1662 | return 0; | ||
1663 | } | ||
1664 | ata_tf_init(dev, &tf); | ||
1665 | |||
1666 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; | ||
1667 | tf.flags |= ATA_TFLAG_LBA | ATA_TFLAG_LBA48; | ||
1668 | tf.command = ATA_CMD_REQ_SENSE_DATA; | ||
1669 | tf.protocol = ATA_PROT_NODATA; | ||
1670 | |||
1671 | err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); | ||
1672 | /* | ||
1673 | * ACS-4 states: | ||
1674 | * The device may set the SENSE DATA AVAILABLE bit to one in the | ||
1675 | * STATUS field and clear the ERROR bit to zero in the STATUS field | ||
1676 | * to indicate that the command returned completion without an error | ||
1677 | * and the sense data described in table 306 is available. | ||
1678 | * | ||
1679 | * IOW the 'ATA_SENSE' bit might not be set even though valid | ||
1680 | * sense data is available. | ||
1681 | * So check for both. | ||
1682 | */ | ||
1683 | if ((tf.command & ATA_SENSE) || | ||
1684 | tf.lbah != 0 || tf.lbam != 0 || tf.lbal != 0) { | ||
1685 | ata_scsi_set_sense(cmd, tf.lbah, tf.lbam, tf.lbal); | ||
1686 | qc->flags |= ATA_QCFLAG_SENSE_VALID; | ||
1687 | ata_dev_warn(dev, "sense data %02x/%02x/%02x\n", | ||
1688 | tf.lbah, tf.lbam, tf.lbal); | ||
1689 | } else { | ||
1690 | ata_dev_warn(dev, "request sense failed stat %02x emask %x\n", | ||
1691 | tf.command, err_mask); | ||
1692 | } | ||
1693 | return err_mask; | ||
1694 | } | ||
1695 | |||
1696 | /** | ||
1697 | * atapi_eh_request_sense - perform ATAPI REQUEST_SENSE | 1633 | * atapi_eh_request_sense - perform ATAPI REQUEST_SENSE |
1698 | * @dev: device to perform REQUEST_SENSE to | 1634 | * @dev: device to perform REQUEST_SENSE to |
1699 | * @sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long) | 1635 | * @sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long) |
@@ -1896,22 +1832,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, | |||
1896 | return ATA_EH_RESET; | 1832 | return ATA_EH_RESET; |
1897 | } | 1833 | } |
1898 | 1834 | ||
1899 | /* | 1835 | /* Set by NCQ autosense */ |
1900 | * Sense data reporting does not work if the | ||
1901 | * device fault bit is set. | ||
1902 | */ | ||
1903 | if ((stat & ATA_SENSE) && !(stat & ATA_DF) && | ||
1904 | !(qc->flags & ATA_QCFLAG_SENSE_VALID)) { | ||
1905 | if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { | ||
1906 | tmp = ata_eh_request_sense(qc, qc->scsicmd); | ||
1907 | if (tmp) | ||
1908 | qc->err_mask |= tmp; | ||
1909 | } else { | ||
1910 | ata_dev_warn(qc->dev, "sense data available but port frozen\n"); | ||
1911 | } | ||
1912 | } | ||
1913 | |||
1914 | /* Set by NCQ autosense or request sense above */ | ||
1915 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) | 1836 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) |
1916 | return 0; | 1837 | return 0; |
1917 | 1838 | ||
@@ -2658,15 +2579,14 @@ static void ata_eh_link_report(struct ata_link *link) | |||
2658 | 2579 | ||
2659 | #ifdef CONFIG_ATA_VERBOSE_ERROR | 2580 | #ifdef CONFIG_ATA_VERBOSE_ERROR |
2660 | if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | | 2581 | if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | |
2661 | ATA_SENSE | ATA_ERR)) { | 2582 | ATA_ERR)) { |
2662 | if (res->command & ATA_BUSY) | 2583 | if (res->command & ATA_BUSY) |
2663 | ata_dev_err(qc->dev, "status: { Busy }\n"); | 2584 | ata_dev_err(qc->dev, "status: { Busy }\n"); |
2664 | else | 2585 | else |
2665 | ata_dev_err(qc->dev, "status: { %s%s%s%s%s}\n", | 2586 | ata_dev_err(qc->dev, "status: { %s%s%s%s}\n", |
2666 | res->command & ATA_DRDY ? "DRDY " : "", | 2587 | res->command & ATA_DRDY ? "DRDY " : "", |
2667 | res->command & ATA_DF ? "DF " : "", | 2588 | res->command & ATA_DF ? "DF " : "", |
2668 | res->command & ATA_DRQ ? "DRQ " : "", | 2589 | res->command & ATA_DRQ ? "DRQ " : "", |
2669 | res->command & ATA_SENSE ? "SENSE " : "", | ||
2670 | res->command & ATA_ERR ? "ERR " : ""); | 2590 | res->command & ATA_ERR ? "ERR " : ""); |
2671 | } | 2591 | } |
2672 | 2592 | ||