libata: add deadline support to prereset and reset methods
[powerpc.git] / drivers / ata / pata_hpt37x.c
index fe1b482..1614e8c 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_hpt37x"
-#define DRV_VERSION    "0.6.4"
+#define DRV_VERSION    "0.6.5"
 
 struct hpt_clock {
        u8      xfer_speed;
@@ -130,7 +130,7 @@ static const struct hpt_chip hpt370 = {
                hpt37x_timings_33,
                NULL,
                NULL,
-               hpt37x_timings_66
+               NULL
        }
 };
 
@@ -141,7 +141,7 @@ static const struct hpt_chip hpt370a = {
                hpt37x_timings_33,
                NULL,
                hpt37x_timings_50,
-               hpt37x_timings_66
+               NULL
        }
 };
 
@@ -307,11 +307,12 @@ static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
 /**
  *     hpt37x_pre_reset        -       reset the hpt37x bus
  *     @ap: ATA port to reset
+ *     @deadline: deadline jiffies for the operation
  *
  *     Perform the initial reset handling for the 370/372 and 374 func 0
  */
 
-static int hpt37x_pre_reset(struct ata_port *ap)
+static int hpt37x_pre_reset(struct ata_port *ap, unsigned long deadline)
 {
        u8 scr2, ata66;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -338,7 +339,7 @@ static int hpt37x_pre_reset(struct ata_port *ap)
        pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
        udelay(100);
 
-       return ata_std_prereset(ap);
+       return ata_std_prereset(ap, deadline);
 }
 
 /**
@@ -353,7 +354,7 @@ static void hpt37x_error_handler(struct ata_port *ap)
        ata_bmdma_drive_eh(ap, hpt37x_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
 }
 
-static int hpt374_pre_reset(struct ata_port *ap)
+static int hpt374_pre_reset(struct ata_port *ap, unsigned long deadline)
 {
        static const struct pci_bits hpt37x_enable_bits[] = {
                { 0x50, 1, 0x04, 0x04 },
@@ -388,7 +389,7 @@ static int hpt374_pre_reset(struct ata_port *ap)
        pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
        udelay(100);
 
-       return ata_std_prereset(ap);
+       return ata_std_prereset(ap, deadline);
 }
 
 /**
@@ -1018,8 +1019,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                                        return -ENODEV;
                                port = &info_hpt372;
                                chip_table = &hpt371;
-                               /* Single channel device, paster is not present
-                                  but the NIOS (or us for non x86) must mark it
+                               /* Single channel device, master is not present
+                                  but the BIOS (or us for non x86) must mark it
                                   absent */
                                pci_read_config_byte(dev, 0x50, &mcr1);
                                mcr1 &= ~0x04;
@@ -1131,16 +1132,11 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        } else {
                port->private_data = (void *)chip_table->clocks[clock_slot];
                /*
-                *      Perform a final fixup. The 371 and 372 clock determines
-                *      if UDMA133 is available. (FIXME: should we use DPLL then ?)
-                */
+                *      Perform a final fixup. Note that we will have used the
+                *      DPLL on the HPT372 which means we don't have to worry
+                *      about lack of UDMA133 support on lower clocks
+                */
 
-               if (clock_slot == 2 && chip_table == &hpt372) { /* 50Mhz */
-                       printk(KERN_WARNING "pata_hpt37x: No UDMA133 support available with 50MHz bus clock.\n");
-                       if (port == &info_hpt372)
-                               port = &info_hpt372_50;
-                       else BUG();
-               }
                if (clock_slot < 2 && port == &info_hpt370)
                        port = &info_hpt370_33;
                if (clock_slot < 2 && port == &info_hpt370a)