aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:09 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:09 -0400
commit0a70c7f67a24b45e105ad10ac1d7e73fe50ec765 (patch)
tree33c251aa1b4d32919ca2805b809cb453dcf88a89 /drivers/ide
parent2e532d68a2b3e2aa6b19731501222069735c741c (diff)
ide-disk: fix IDE_DFLAG_LBA48 handling on resume
Some code in idedisk_setup() should be in idedisk_capacity() instead. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-disk.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 3853bde8eedc..93ff15e6a9c4 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -403,6 +403,26 @@ static void init_idedisk_capacity(ide_drive_t *drive)
403 if (ata_id_hpa_enabled(id)) 403 if (ata_id_hpa_enabled(id))
404 idedisk_check_hpa(drive); 404 idedisk_check_hpa(drive);
405 } 405 }
406
407 /* limit drive capacity to 137GB if LBA48 cannot be used */
408 if ((drive->dev_flags & IDE_DFLAG_LBA48) == 0 &&
409 drive->capacity64 > 1ULL << 28) {
410 printk(KERN_WARNING "%s: cannot use LBA48 - full capacity "
411 "%llu sectors (%llu MB)\n",
412 drive->name, (unsigned long long)drive->capacity64,
413 sectors_to_MB(drive->capacity64));
414 drive->capacity64 = 1ULL << 28;
415 }
416
417 if ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) &&
418 (drive->dev_flags & IDE_DFLAG_LBA48)) {
419 if (drive->capacity64 > 1ULL << 28) {
420 printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode"
421 " will be used for accessing sectors "
422 "> %u\n", drive->name, 1 << 28);
423 } else
424 drive->dev_flags &= ~IDE_DFLAG_LBA48;
425 }
406} 426}
407 427
408sector_t ide_disk_capacity(ide_drive_t *drive) 428sector_t ide_disk_capacity(ide_drive_t *drive)
@@ -654,26 +674,6 @@ static void idedisk_setup(ide_drive_t *drive)
654 /* calculate drive capacity, and select LBA if possible */ 674 /* calculate drive capacity, and select LBA if possible */
655 init_idedisk_capacity(drive); 675 init_idedisk_capacity(drive);
656 676
657 /* limit drive capacity to 137GB if LBA48 cannot be used */
658 if ((drive->dev_flags & IDE_DFLAG_LBA48) == 0 &&
659 drive->capacity64 > 1ULL << 28) {
660 printk(KERN_WARNING "%s: cannot use LBA48 - full capacity "
661 "%llu sectors (%llu MB)\n",
662 drive->name, (unsigned long long)drive->capacity64,
663 sectors_to_MB(drive->capacity64));
664 drive->capacity64 = 1ULL << 28;
665 }
666
667 if ((hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) &&
668 (drive->dev_flags & IDE_DFLAG_LBA48)) {
669 if (drive->capacity64 > 1ULL << 28) {
670 printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode"
671 " will be used for accessing sectors "
672 "> %u\n", drive->name, 1 << 28);
673 } else
674 drive->dev_flags &= ~IDE_DFLAG_LBA48;
675 }
676
677 /* 677 /*
678 * if possible, give fdisk access to more of the drive, 678 * if possible, give fdisk access to more of the drive,
679 * by correcting bios_cyls: 679 * by correcting bios_cyls: