Re: [PATCH 14/18] ide: add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag

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

 



Hi,

On Thursday 15 November 2007, Sergei Shtylyov wrote:
> Hello, I wrote:
> 
> >    It's tome that I go and make a patch which deals with 0x00 (default 
> 
>     s/tome/time/
> 
> > PIO mode)...
> 
>     But I'm unsure how this value could reach us form userspace because of the 
> argument check present everywhere that filters out 0 value form being passed 
> -- look at set_xfer_rate() and ide_cmd_ioctl(). So, such fix doesn't seem to 
> be applicable... :-|

You are right, I was mislead by "if (arg < 0 || arg > 70)":

static int set_xfer_rate (ide_drive_t *drive, int arg)
{
	int err;

	if (arg < 0 || arg > 70)
		return -EINVAL;

	err = ide_wait_cmd(drive,
			WIN_SETFEATURES, (u8) arg,
			SETFEATURES_XFER, 0, NULL);

	if (!err && arg) {
		ide_set_xfer_rate(drive, (u8) arg);
		ide_driveid_update(drive);
	}
	return err;
}

but value "1" is still theoretically possible. ;)

Anyway fixing 0x00 is a desirable thing as it is needed for cleanly
handling many older CF cards (they don't support IORDY).

Thanks,
Bart
-
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