diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-03-10 02:17:26 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-03-10 02:17:26 -0400 |
commit | e161183ba674f97fce748384f5bb037d07bdc5c9 (patch) | |
tree | 5b3bd4b995f6435ee977b71082244fa1a647f717 /drivers/ata/libata-core.c | |
parent | 2ef7f0dab6b3d171b6aff00a47077385ae3155b5 (diff) | |
parent | 99adcd9d67aaf04e28f5ae96df280f236bde4b66 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 9fbf0595f3d4..060bcd601f57 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1322,14 +1322,16 @@ static u64 ata_id_n_sectors(const u16 *id) | |||
1322 | { | 1322 | { |
1323 | if (ata_id_has_lba(id)) { | 1323 | if (ata_id_has_lba(id)) { |
1324 | if (ata_id_has_lba48(id)) | 1324 | if (ata_id_has_lba48(id)) |
1325 | return ata_id_u64(id, 100); | 1325 | return ata_id_u64(id, ATA_ID_LBA_CAPACITY_2); |
1326 | else | 1326 | else |
1327 | return ata_id_u32(id, 60); | 1327 | return ata_id_u32(id, ATA_ID_LBA_CAPACITY); |
1328 | } else { | 1328 | } else { |
1329 | if (ata_id_current_chs_valid(id)) | 1329 | if (ata_id_current_chs_valid(id)) |
1330 | return ata_id_u32(id, 57); | 1330 | return id[ATA_ID_CUR_CYLS] * id[ATA_ID_CUR_HEADS] * |
1331 | id[ATA_ID_CUR_SECTORS]; | ||
1331 | else | 1332 | else |
1332 | return id[1] * id[3] * id[6]; | 1333 | return id[ATA_ID_CYLS] * id[ATA_ID_HEADS] * |
1334 | id[ATA_ID_SECTORS]; | ||
1333 | } | 1335 | } |
1334 | } | 1336 | } |
1335 | 1337 | ||
@@ -4612,7 +4614,7 @@ void ata_sg_clean(struct ata_queued_cmd *qc) | |||
4612 | VPRINTK("unmapping %u sg elements\n", qc->n_elem); | 4614 | VPRINTK("unmapping %u sg elements\n", qc->n_elem); |
4613 | 4615 | ||
4614 | if (qc->n_elem) | 4616 | if (qc->n_elem) |
4615 | dma_unmap_sg(ap->dev, sg, qc->n_elem, dir); | 4617 | dma_unmap_sg(ap->dev, sg, qc->orig_n_elem, dir); |
4616 | 4618 | ||
4617 | qc->flags &= ~ATA_QCFLAG_DMAMAP; | 4619 | qc->flags &= ~ATA_QCFLAG_DMAMAP; |
4618 | qc->sg = NULL; | 4620 | qc->sg = NULL; |
@@ -4727,7 +4729,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc) | |||
4727 | return -1; | 4729 | return -1; |
4728 | 4730 | ||
4729 | DPRINTK("%d sg elements mapped\n", n_elem); | 4731 | DPRINTK("%d sg elements mapped\n", n_elem); |
4730 | 4732 | qc->orig_n_elem = qc->n_elem; | |
4731 | qc->n_elem = n_elem; | 4733 | qc->n_elem = n_elem; |
4732 | qc->flags |= ATA_QCFLAG_DMAMAP; | 4734 | qc->flags |= ATA_QCFLAG_DMAMAP; |
4733 | 4735 | ||