libata: set dma_mode to 0xff in reset
authorAaron Lu <aaron.lu@intel.com>
Mon, 3 Dec 2012 03:35:02 +0000 (11:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:43:54 +0000 (08:43 -0800)
commit 5416912af75de9cba5d1c75b99a7888b0bbbd2fb upstream.

ata_device->dma_mode's initial value is zero, which is not a valid dma
mode, but ata_dma_enabled will return true for this value. This patch
sets dma_mode to 0xff in reset function, so that ata_dma_enabled will
not return true for this case, or it will cause problem for pata_acpi.

The corrsponding bugzilla page is at:
https://bugzilla.kernel.org/show_bug.cgi?id=49151

Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Tested-by: Szymon Janc <szymon@janc.net.pl>
Tested-by: Dutra Julio <dutra.julio@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/libata-core.c
drivers/ata/libata-eh.c

index 600ede0c0720d223785e25b2f9690443fe0e2490..5a72e36a3147dc47f6533b74d16b22fa478a82bb 100644 (file)
@@ -2543,6 +2543,7 @@ int ata_bus_probe(struct ata_port *ap)
                 * bus as we may be talking too fast.
                 */
                dev->pio_mode = XFER_PIO_0;
+               dev->dma_mode = 0xff;
 
                /* If the controller has a pio mode setup function
                 * then use it to set the chipset to rights. Don't
index 311c92d1db251e08a44a2587e90bda9a49bcd770..1cbb0043638d460f1a02f0c4d52ef25ce0b99bc2 100644 (file)
@@ -2602,6 +2602,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
                 * bus as we may be talking too fast.
                 */
                dev->pio_mode = XFER_PIO_0;
+               dev->dma_mode = 0xff;
 
                /* If the controller has a pio mode setup function
                 * then use it to set the chipset to rights. Don't