Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ide: actually honor drive's minimum PIO/DMA cycle times

The function ide_timing_compute() fails to *actually* take drive's
specified minimum PIO/DMA cycle times into account -- when doing this, it
calls ide_timing_merge() on the 'struct ide_timing' argument which contains
garbage at the moment, and then ultimately destroys the read cycle time by
quantizing the ide_timing[] entry, instead of copying from that entry to
the argument structure, and only then doing a merge/quantize.

Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Sergei Shtylyov and committed by
Linus Torvalds
17c1033d 178184b6

+7 -1
+7 -1
drivers/ide/ide-timing.h
··· 220 220 return -EINVAL; 221 221 222 222 /* 223 + * Copy the timing from the table. 224 + */ 225 + 226 + *t = *s; 227 + 228 + /* 223 229 * If the drive is an EIDE drive, it can tell us it needs extended 224 230 * PIO/MWDMA cycle timing. 225 231 */ ··· 253 247 * Convert the timing to bus clock counts. 254 248 */ 255 249 256 - ide_timing_quantize(s, t, T, UT); 250 + ide_timing_quantize(t, t, T, UT); 257 251 258 252 /* 259 253 * Even in DMA/UDMA modes we still use PIO access for IDENTIFY, S.M.A.R.T