]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pata_legacy: correctly mask recovery field for HT6560B
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Thu, 19 Jan 2012 16:09:56 +0000 (19:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 16:52:49 +0000 (09:52 -0700)
commit 9716387311c790de381214c03e7f1b72b91a8189 upstream.

According to the HT6560H datasheet, the recovery timing field is 4-bit wide,
with a value of 0 meaning 16 cycles. Correct obvious thinko in the recovery
field mask.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/pata_legacy.c

index 35aca7d1a3eb13e6d39bb3eb3c8c7a56d2173395..4fe9d2138d48f58f5d094b88ffea6c35416cc935 100644 (file)
@@ -401,8 +401,7 @@ static void ht6560b_set_piomode(struct ata_port *ap, struct ata_device *adev)
        ata_timing_compute(adev, adev->pio_mode, &t, 20000, 1000);
 
        active = clamp_val(t.active, 2, 15);
-       recover = clamp_val(t.recover, 2, 16);
-       recover &= 0x15;
+       recover = clamp_val(t.recover, 2, 16) & 0x0F;
 
        inb(0x3E6);
        inb(0x3E6);