diff options
author | Hemant Pedanekar <hemantp@ti.com> | 2009-11-25 18:04:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-25 18:04:54 -0500 |
commit | 28c1969ff887bc2a7df39272850dece01de03285 (patch) | |
tree | 2ae8dd368f7372093a1116aa85049dda3af202d9 /drivers/ide | |
parent | 0fb18c4777ff424c1db694af98443a201fa4fc30 (diff) |
ide: fix ioctl to pass requested transfer mode to ide_find_dma_mode instead of UDMA6
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>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-ioctls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c index d3440b5010a5..6e7ae2b6cfc6 100644 --- a/drivers/ide/ide-ioctls.c +++ b/drivers/ide/ide-ioctls.c | |||
@@ -162,7 +162,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg) | |||
162 | if (tf->command == ATA_CMD_SET_FEATURES && | 162 | if (tf->command == ATA_CMD_SET_FEATURES && |
163 | tf->feature == SETFEATURES_XFER && | 163 | tf->feature == SETFEATURES_XFER && |
164 | tf->nsect >= XFER_SW_DMA_0) { | 164 | tf->nsect >= XFER_SW_DMA_0) { |
165 | xfer_rate = ide_find_dma_mode(drive, XFER_UDMA_6); | 165 | xfer_rate = ide_find_dma_mode(drive, tf->nsect); |
166 | if (xfer_rate != tf->nsect) { | 166 | if (xfer_rate != tf->nsect) { |
167 | err = -EINVAL; | 167 | err = -EINVAL; |
168 | goto abort; | 168 | goto abort; |