ahci: don't expect ATA_CB_STAT_DRQ being clear
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 14 Jul 2011 14:24:03 +0000 (16:24 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 25 Jul 2011 03:28:57 +0000 (23:28 -0400)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/ahci.c

index e2ec07a02215bde6cc05cdd03f92c280dcfbf881..7279199ad427833c847ac20bf9017ca7e9625a39 100644 (file)
@@ -158,7 +158,7 @@ static int ahci_command(struct ahci_port_s *port, int iswrite, int isatapi,
     } while (status & ATA_CB_STAT_BSY);
 
     success = (0x00 == (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_DF |
-                                  ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR)) &&
+                                  ATA_CB_STAT_ERR)) &&
                ATA_CB_STAT_RDY == (status & (ATA_CB_STAT_RDY)));
     if (success) {
         dprintf(2, "AHCI/%d: ... finished, status 0x%x, OK\n", pnr,
@@ -379,8 +379,7 @@ ahci_port_probe(struct ahci_ctrl_s *ctrl, u32 pnr)
     u32 val, count = 0;
 
     val = ahci_port_readl(ctrl, pnr, PORT_TFDATA);
-    while (val & ((1 << 7) /* BSY */ |
-                  (1 << 3) /* DRQ */)) {
+    while (val & ATA_CB_STAT_BSY) {
         ndelay(500);
         val = ahci_port_readl(ctrl, pnr, PORT_TFDATA);
         count++;