diff options
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 7d4535e989bf..26598941e1b3 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1487,6 +1487,7 @@ static const char *ata_err_string(unsigned int err_mask) | |||
1487 | /** | 1487 | /** |
1488 | * ata_read_log_page - read a specific log page | 1488 | * ata_read_log_page - read a specific log page |
1489 | * @dev: target device | 1489 | * @dev: target device |
1490 | * @log: log to read | ||
1490 | * @page: page to read | 1491 | * @page: page to read |
1491 | * @buf: buffer to store read page | 1492 | * @buf: buffer to store read page |
1492 | * @sectors: number of sectors to read | 1493 | * @sectors: number of sectors to read |
@@ -1499,17 +1500,18 @@ static const char *ata_err_string(unsigned int err_mask) | |||
1499 | * RETURNS: | 1500 | * RETURNS: |
1500 | * 0 on success, AC_ERR_* mask otherwise. | 1501 | * 0 on success, AC_ERR_* mask otherwise. |
1501 | */ | 1502 | */ |
1502 | static unsigned int ata_read_log_page(struct ata_device *dev, | 1503 | unsigned int ata_read_log_page(struct ata_device *dev, u8 log, |
1503 | u8 page, void *buf, unsigned int sectors) | 1504 | u8 page, void *buf, unsigned int sectors) |
1504 | { | 1505 | { |
1505 | struct ata_taskfile tf; | 1506 | struct ata_taskfile tf; |
1506 | unsigned int err_mask; | 1507 | unsigned int err_mask; |
1507 | 1508 | ||
1508 | DPRINTK("read log page - page %d\n", page); | 1509 | DPRINTK("read log page - log 0x%x, page 0x%x\n", log, page); |
1509 | 1510 | ||
1510 | ata_tf_init(dev, &tf); | 1511 | ata_tf_init(dev, &tf); |
1511 | tf.command = ATA_CMD_READ_LOG_EXT; | 1512 | tf.command = ATA_CMD_READ_LOG_EXT; |
1512 | tf.lbal = page; | 1513 | tf.lbal = log; |
1514 | tf.lbam = page; | ||
1513 | tf.nsect = sectors; | 1515 | tf.nsect = sectors; |
1514 | tf.hob_nsect = sectors >> 8; | 1516 | tf.hob_nsect = sectors >> 8; |
1515 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_LBA48 | ATA_TFLAG_DEVICE; | 1517 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_LBA48 | ATA_TFLAG_DEVICE; |
@@ -1545,7 +1547,7 @@ static int ata_eh_read_log_10h(struct ata_device *dev, | |||
1545 | u8 csum; | 1547 | u8 csum; |
1546 | int i; | 1548 | int i; |
1547 | 1549 | ||
1548 | err_mask = ata_read_log_page(dev, ATA_LOG_SATA_NCQ, buf, 1); | 1550 | err_mask = ata_read_log_page(dev, ATA_LOG_SATA_NCQ, 0, buf, 1); |
1549 | if (err_mask) | 1551 | if (err_mask) |
1550 | return -EIO; | 1552 | return -EIO; |
1551 | 1553 | ||