Skip to content

Commit

Permalink
[PATCH] ide: actually honor drive's minimum PIO/DMA cycle times
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergei Shtylyov authored and Linus Torvalds committed Jun 26, 2006
1 parent 178184b commit 17c1033
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/ide/ide-timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ static int ide_timing_compute(ide_drive_t *drive, short speed, struct ide_timing
if (!(s = ide_timing_find_mode(speed)))
return -EINVAL;

/*
* Copy the timing from the table.
*/

*t = *s;

/*
* If the drive is an EIDE drive, it can tell us it needs extended
* PIO/MWDMA cycle timing.
Expand Down Expand Up @@ -247,7 +253,7 @@ static int ide_timing_compute(ide_drive_t *drive, short speed, struct ide_timing
* Convert the timing to bus clock counts.
*/

ide_timing_quantize(s, t, T, UT);
ide_timing_quantize(t, t, T, UT);

/*
* Even in DMA/UDMA modes we still use PIO access for IDENTIFY, S.M.A.R.T
Expand Down

0 comments on commit 17c1033

Please sign in to comment.