diff --git a/ChangeLog b/ChangeLog index f5bc28b..4dec14d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-18 Vladimir Serbinenko + + Fix a false negative for ata disks + + * disk/ata.c (grub_ata_device_initialize): check for status after + identify + 2009-05-17 Vladimir Serbinenko Not fail if unable to retrieve C/H/S on LBA disks diff --git a/disk/ata.c b/disk/ata.c index ea42d59..32a314b 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -334,16 +334,6 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); grub_ata_wait (); - /* If status is 0x00, it is safe to assume that there - is no device (or only a !READY) device connected. */ - grub_int8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); - grub_dprintf ("ata", "status=0x%x\n", sts); - if (sts == 0x00) - { - grub_free(dev); - return 0; - } - /* Try to detect if the port is in use by writing to it, waiting for a while and reading it again. If the value was preserved, there is a device connected. @@ -365,6 +355,17 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) if (grub_ata_identify (dev)) { grub_free (dev); + grub_errno = GRUB_ERR_NONE; + return 0; + } + + /* If status is 0x00, it is safe to assume that there + is no device (or only a !READY) device connected. */ + grub_int8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + grub_dprintf ("ata", "status=0x%x\n", sts); + if (sts == 0x00) + { + grub_free(dev); return 0; }