ATA: pata_octeon_cf: Use I/O clock rate for timing calculations.
authorDavid Daney <ddaney@caviumnetworks.com>
Thu, 7 Oct 2010 23:03:51 +0000 (16:03 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 29 Oct 2010 18:08:41 +0000 (19:08 +0100)
The creation of the I/O clock domain requires some adjustments.  Since the
CF bus timing logic is clocked by the I/O clock, use its rate for delay
calculations.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Patchwork: http://patchwork.linux-mips.org/patch/1660/
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
drivers/ata/pata_octeon_cf.c

index 06ddd91ffeda276f0ec5d0c0cfd2696f308a0cc1..74b829817891de507178d868807ed981f8027635 100644 (file)
@@ -60,7 +60,7 @@ static unsigned int ns_to_tim_reg(unsigned int tim_mult, unsigned int nsecs)
         * Compute # of eclock periods to get desired duration in
         * nanoseconds.
         */
-       val = DIV_ROUND_UP(nsecs * (octeon_get_clock_rate() / 1000000),
+       val = DIV_ROUND_UP(nsecs * (octeon_get_io_clock_rate() / 1000000),
                          1000 * tim_mult);
 
        return val;