diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-29 13:58:21 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-29 13:58:21 -0400 |
commit | ac19bff25b6834d858274406a686f2227dd8489d (patch) | |
tree | d77670070abc662b6b14b5a9f9d6c08a56a476a9 /drivers/scsi/libata-core.c | |
parent | 9dfb7808fb05643b0d06df7411b94d9546696bf1 (diff) |
[libata] ensure ->tf_read() hook reads Status and Error registers
We want ->tf_read() to get a complete snapshot of all taskfile
registers, without requiring the callers to manually call
ata_chk_status() and ata_chk_err() themselves.
This also fixes a minor bug in sata_vsc where the lower bits of the
feature register were incorrectly placed in the HOB (high order bits)
portion of struct ata_taskfile.
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index f53d7b8ac33f..56c81f0aa1d9 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -370,6 +370,8 @@ static void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf) | |||
370 | { | 370 | { |
371 | struct ata_ioports *ioaddr = &ap->ioaddr; | 371 | struct ata_ioports *ioaddr = &ap->ioaddr; |
372 | 372 | ||
373 | tf->command = ata_check_status(ap); | ||
374 | tf->feature = ata_chk_err(ap); | ||
373 | tf->nsect = inb(ioaddr->nsect_addr); | 375 | tf->nsect = inb(ioaddr->nsect_addr); |
374 | tf->lbal = inb(ioaddr->lbal_addr); | 376 | tf->lbal = inb(ioaddr->lbal_addr); |
375 | tf->lbam = inb(ioaddr->lbam_addr); | 377 | tf->lbam = inb(ioaddr->lbam_addr); |
@@ -402,6 +404,8 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf) | |||
402 | { | 404 | { |
403 | struct ata_ioports *ioaddr = &ap->ioaddr; | 405 | struct ata_ioports *ioaddr = &ap->ioaddr; |
404 | 406 | ||
407 | tf->command = ata_check_status(ap); | ||
408 | tf->feature = ata_chk_err(ap); | ||
405 | tf->nsect = readb((void __iomem *)ioaddr->nsect_addr); | 409 | tf->nsect = readb((void __iomem *)ioaddr->nsect_addr); |
406 | tf->lbal = readb((void __iomem *)ioaddr->lbal_addr); | 410 | tf->lbal = readb((void __iomem *)ioaddr->lbal_addr); |
407 | tf->lbam = readb((void __iomem *)ioaddr->lbam_addr); | 411 | tf->lbam = readb((void __iomem *)ioaddr->lbam_addr); |