]> git.hungrycats.org Git - linux/commit
ide: fix ioctl to pass requested transfer mode to ide_find_dma_mode instead of UDMA6
authorHemant Pedanekar <hemantp@ti.com>
Wed, 25 Nov 2009 23:04:54 +0000 (15:04 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:43:49 +0000 (13:43 -0800)
commite7019386657e13cb3d82a5633a391c9af8a922a9
treeba78f96c989375a5b4084f365bcfd8c9f4e2a4bd
parent006e58040fd635e02d3edbbb85504e4231256390
ide: fix ioctl to pass requested transfer mode to ide_find_dma_mode instead of UDMA6

[ Upstream commit 28c1969ff887bc2a7df39272850dece01de03285 ]

Currently, ide_cmd_ioctl when invoked for setting DMA transfer mode calls
ide_find_dma_mode with requested mode as XFER_UDMA_6. This prevents setting DMA
mode to any other value than the default (maximum) supported by the device (or
UDMA6, if supported) irrespective of the actual requested transfer mode and
returns error.

For example, setting mode to UDMA2 using hdparm, where UDMA4 is the default
transfer mode gives following error:
# ./hdparm -d1 -Xudma2  /dev/hda
 /dev/hda:hda: UDMA/66 mode selected
 setting using_dma to 1 (on)
 hda: UDMA/66 mode selected
 setting xfermode to 66 (UltraDMA mode2)
 HDIO_DRIVE_CMD(setxfermode) failed: Invalid argument
 using_dma     =  1 (on)

This patch fixes the issue.

Signed-off-by: Hemant Pedanekar <hemantp@ti.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ide/ide-ioctls.c