Not able to set DMA mode other than default using hdparm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am getting following error when trying to set DMA transfer mode as UDMA2 on latest DaVinci (DM6467) git kernel using hdparm (9.27 or older):

# ./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)

It seems DMA mode setting other than the default mode returns this error. That is, if I use "-Xudma4" in above command it returns success as UDMA4 is the default mode on DM6467.

I made following change which allows hdparm to set any supported DMA mode. Can anyone confirm if this is a hdparm compatibility (incorrect use of ioctl?) or the patch below indeed fixes the issue?

diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index d3440b5..6e7ae2b 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)
        if (tf->command == ATA_CMD_SET_FEATURES &&
            tf->feature == SETFEATURES_XFER &&
            tf->nsect >= XFER_SW_DMA_0) {
-               xfer_rate = ide_find_dma_mode(drive, XFER_UDMA_6);
+               xfer_rate = ide_find_dma_mode(drive, tf->nsect);
                if (xfer_rate != tf->nsect) {
                        err = -EINVAL;
                        goto abort;


Thanks.
-
Hemant
 

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux