]> git.karo-electronics.de Git - karo-tx-linux.git/commit
pata_pdc202xx_old: fix UDMA mode for Promise UDMA33 cards
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 13 Feb 2010 13:35:53 +0000 (14:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 27 Sep 2010 00:21:40 +0000 (17:21 -0700)
commit526c2b2bdf2ddbb3ff020ef1d35d531476e3587d
treed932b110bdfec291e95c09fe0853472ff7ff42f9
parent606fa05a76966af96cb3c170e6d09b65194e97c9
pata_pdc202xx_old: fix UDMA mode for Promise UDMA33 cards

commit a75032e8772d13dab5e3501413d7e14a148281b4 upstream.

On Monday 04 January 2010 02:30:24 pm Russell King wrote:

> Found the problem - getting rid of the read of the alt status register
> after the command has been written fixes the UDMA CRC errors on write:
>
> @@ -676,7 +676,8 @@ void ata_sff_exec_command(struct ata_port *ap, const struct
> ata_taskfile *tf)
>         DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
>
>         iowrite8(tf->command, ap->ioaddr.command_addr);
> -       ata_sff_pause(ap);
> +       ndelay(400);
> +//     ata_sff_pause(ap);
>  }
>  EXPORT_SYMBOL_GPL(ata_sff_exec_command);
>
>
> This rather makes sense.  The PDC20247 handles the UDMA part of the
> protocol.  It has no way to tell the PDC20246 to wait while it suspends
> UDMA, so that a normal register access can take place - the 246 ploughs
> on with the register access without any regard to the state of the 247.
>
> If the drive immediately starts the UDMA protocol after a write to the
> command register (as it probably will for the DMA WRITE command), then
> we'll be accessing the taskfile in the middle of the UDMA setup, which
> can't be good.  It's certainly a violation of the ATA specs.

Fix it by adding custom ->sff_exec_command method for UDMA33 chipsets.

Debugged-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ata/pata_pdc202xx_old.c