aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-19 19:11:55 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-19 19:11:55 -0400
commit342cdb6d4739cee430efc3eafcacd1605db66036 (patch)
treef09b53028467a2f69ad6f0242f8d3b74b32a5af4 /drivers/ide
parent328dcbb63657ebbb2dd26982fa9e1fa9e04b6fa2 (diff)
ide: make ide_get_best_pio_mode() print info if overriding PIO mode
* Print info about overriding PIO mode in ide_get_best_pio_mode(). * Remove info about overriding PIO mode from cmd64{0,x} host drivers. * Remove no longer needed ide_pio_data_t.overridden field. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-lib.c10
-rw-r--r--drivers/ide/pci/cmd640.c7
-rw-r--r--drivers/ide/pci/cmd64x.c5
3 files changed, 12 insertions, 10 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 074bb32a4a40..d45bbad9ffe7 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -277,7 +277,7 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p
277 } else if (!drive->id) { 277 } else if (!drive->id) {
278 pio_mode = 0; 278 pio_mode = 0;
279 } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { 279 } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
280 overridden = 1; 280 printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name);
281 use_iordy = (pio_mode > 2); 281 use_iordy = (pio_mode > 2);
282 } else { 282 } else {
283 pio_mode = id->tPIO; 283 pio_mode = id->tPIO;
@@ -303,12 +303,17 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p
303 } 303 }
304 } 304 }
305 305
306 if (overridden)
307 printk(KERN_INFO "%s: tPIO > 2, assuming tPIO = 2\n",
308 drive->name);
309
306 /* 310 /*
307 * Conservative "downgrade" for all pre-ATA2 drives 311 * Conservative "downgrade" for all pre-ATA2 drives
308 */ 312 */
309 if (pio_mode && pio_mode < 4) { 313 if (pio_mode && pio_mode < 4) {
310 pio_mode--; 314 pio_mode--;
311 overridden = 1; 315 printk(KERN_INFO "%s: applying conservative "
316 "PIO \"downgrade\"\n", drive->name);
312 if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time) 317 if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time)
313 cycle_time = 0; /* use standard timing */ 318 cycle_time = 0; /* use standard timing */
314 } 319 }
@@ -321,7 +326,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p
321 d->pio_mode = pio_mode; 326 d->pio_mode = pio_mode;
322 d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time; 327 d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
323 d->use_iordy = use_iordy; 328 d->use_iordy = use_iordy;
324 d->overridden = overridden;
325 } 329 }
326 return pio_mode; 330 return pio_mode;
327} 331}
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index dc43f009acab..dff21597e643 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -665,13 +665,12 @@ static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted)
665 (void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d); 665 (void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d);
666 cmd640_set_mode (index, d.pio_mode, d.cycle_time); 666 cmd640_set_mode (index, d.pio_mode, d.cycle_time);
667 667
668 printk ("%s: selected cmd640 PIO mode%d (%dns)%s", 668 printk("%s: selected cmd640 PIO mode%d (%dns)",
669 drive->name, 669 drive->name,
670 d.pio_mode, 670 d.pio_mode,
671 d.cycle_time, 671 d.cycle_time);
672 d.overridden ? " (overriding vendor mode)" : ""); 672
673 display_clocks(index); 673 display_clocks(index);
674 return;
675} 674}
676 675
677#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 676#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 1e89dd6e5bbf..5171e94facdc 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -227,9 +227,8 @@ static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted)
227 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23}; 227 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23};
228 pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &pio); 228 pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &pio);
229 229
230 cmdprintk("%s: PIO mode wanted %d, selected %d (%d ns)%s\n", 230 cmdprintk("%s: PIO mode wanted %d, selected %d (%d ns)\n",
231 drive->name, mode_wanted, pio_mode, pio.cycle_time, 231 drive->name, mode_wanted, pio_mode, pio.cycle_time);
232 pio.overridden ? " (overriding vendor mode)" : "");
233 232
234 program_cycle_times(drive, pio.cycle_time, 233 program_cycle_times(drive, pio.cycle_time,
235 ide_pio_timings[pio_mode].active_time); 234 ide_pio_timings[pio_mode].active_time);