aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d94b8a02c340..090abe443820 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1224,7 +1224,7 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev)
1224 * ata_dev_read_id - Read ID data from the specified device 1224 * ata_dev_read_id - Read ID data from the specified device
1225 * @dev: target device 1225 * @dev: target device
1226 * @p_class: pointer to class of the target device (may be changed) 1226 * @p_class: pointer to class of the target device (may be changed)
1227 * @post_reset: is this read ID post-reset? 1227 * @flags: ATA_READID_* flags
1228 * @id: buffer to read IDENTIFY data into 1228 * @id: buffer to read IDENTIFY data into
1229 * 1229 *
1230 * Read ID data from the specified device. ATA_CMD_ID_ATA is 1230 * Read ID data from the specified device. ATA_CMD_ID_ATA is
@@ -1239,7 +1239,7 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev)
1239 * 0 on success, -errno otherwise. 1239 * 0 on success, -errno otherwise.
1240 */ 1240 */
1241int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, 1241int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
1242 int post_reset, u16 *id) 1242 unsigned int flags, u16 *id)
1243{ 1243{
1244 struct ata_port *ap = dev->ap; 1244 struct ata_port *ap = dev->ap;
1245 unsigned int class = *p_class; 1245 unsigned int class = *p_class;
@@ -1294,7 +1294,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
1294 goto err_out; 1294 goto err_out;
1295 } 1295 }
1296 1296
1297 if (post_reset && class == ATA_DEV_ATA) { 1297 if ((flags & ATA_READID_POSTRESET) && class == ATA_DEV_ATA) {
1298 /* 1298 /*
1299 * The exact sequence expected by certain pre-ATA4 drives is: 1299 * The exact sequence expected by certain pre-ATA4 drives is:
1300 * SRST RESET 1300 * SRST RESET
@@ -1314,7 +1314,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
1314 /* current CHS translation info (id[53-58]) might be 1314 /* current CHS translation info (id[53-58]) might be
1315 * changed. reread the identify device info. 1315 * changed. reread the identify device info.
1316 */ 1316 */
1317 post_reset = 0; 1317 flags &= ~ATA_READID_POSTRESET;
1318 goto retry; 1318 goto retry;
1319 } 1319 }
1320 } 1320 }
@@ -1643,7 +1643,8 @@ int ata_bus_probe(struct ata_port *ap)
1643 if (!ata_dev_enabled(dev)) 1643 if (!ata_dev_enabled(dev))
1644 continue; 1644 continue;
1645 1645
1646 rc = ata_dev_read_id(dev, &dev->class, 1, dev->id); 1646 rc = ata_dev_read_id(dev, &dev->class, ATA_READID_POSTRESET,
1647 dev->id);
1647 if (rc) 1648 if (rc)
1648 goto fail; 1649 goto fail;
1649 1650
@@ -3023,7 +3024,7 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3023/** 3024/**
3024 * ata_dev_revalidate - Revalidate ATA device 3025 * ata_dev_revalidate - Revalidate ATA device
3025 * @dev: device to revalidate 3026 * @dev: device to revalidate
3026 * @post_reset: is this revalidation after reset? 3027 * @readid_flags: read ID flags
3027 * 3028 *
3028 * Re-read IDENTIFY page and make sure @dev is still attached to 3029 * Re-read IDENTIFY page and make sure @dev is still attached to
3029 * the port. 3030 * the port.
@@ -3034,7 +3035,7 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3034 * RETURNS: 3035 * RETURNS:
3035 * 0 on success, negative errno otherwise 3036 * 0 on success, negative errno otherwise
3036 */ 3037 */
3037int ata_dev_revalidate(struct ata_device *dev, int post_reset) 3038int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags)
3038{ 3039{
3039 unsigned int class = dev->class; 3040 unsigned int class = dev->class;
3040 u16 *id = (void *)dev->ap->sector_buf; 3041 u16 *id = (void *)dev->ap->sector_buf;
@@ -3046,7 +3047,7 @@ int ata_dev_revalidate(struct ata_device *dev, int post_reset)
3046 } 3047 }
3047 3048
3048 /* read ID data */ 3049 /* read ID data */
3049 rc = ata_dev_read_id(dev, &class, post_reset, id); 3050 rc = ata_dev_read_id(dev, &class, readid_flags, id);
3050 if (rc) 3051 if (rc)
3051 goto fail; 3052 goto fail;
3052 3053