aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:31:58 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:31:58 -0500
commit3ab7efe8e2cbcca2d401b43cfcc2fa9a7dac2299 (patch)
tree7ddbb4d5fdae6f61d23ef0ba2a43aaca23bd2195 /include
parente11b9035a47da66fcd4bafd3a5f6b14f51ca667e (diff)
ide: DMA reporting and validity checking fixes (take 3)
* ide_xfer_verbose() fixups: - beautify returned mode names - fix PIO5 reporting - make it return 'const char *' * Change printk() level from KERN_DEBUG to KERN_INFO in ide_find_dma_mode(). * Add ide_id_dma_bug() helper based on ide_dma_verbose() to check for invalid DMA info in identify block. * Use ide_id_dma_bug() in ide_tune_dma() and ide_driveid_update(). As a result DMA won't be tuned or will be disabled after tuning if device reports inconsistent info about enabled DMA mode (ide_dma_verbose() does the same checks while the IDE device is probed by ide-{cd,disk} device driver). * Remove no longer needed ide_dma_verbose(). This patch should fix the following problem with out-of-sync IDE messages reported by Nick Warne: hdd: ATAPI 48X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache<7>hdd: skipping word 93 validity check , UDMA(66) and later debugged by Mark Lord to be caused by: ide_dma_verbose() printk( ... "2048kB Cache"); eighty_ninty_three() printk(KERN_DEBUG "%s: skipping word 93 validity check\n"); ide_dma_verbose() printk(", UDMA(66)" Please note that as a result ide-{cd,disk} device drivers won't report the DMA speed used but this is intended since now DMA mode being used is always reported by IDE core code. v2: * fixes suggested by Randy: - use KERN_CONT for printk()-s in ide-{cd,disk}.c - don't remove argument name from ide_xfer_verbose() declaration v3: * Remove incorrect check for (id->field_valid & 1) from ide_id_dma_bug() (spotted by Sergei). * "XFER SLOW" -> "PIO SLOW" in ide_xfer_verbose() (suggested by Sergei). * Fix ide_find_dma_mode() to report the correct mode ('mode' after being limited by 'req_mode'). Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Nick Warne <nick@ukfsn.org> Cc: Mark Lord <lkml@rtr.ca> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index dc75ccbcf991..9a6a41e7079f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1255,6 +1255,7 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
1255 1255
1256#ifdef CONFIG_BLK_DEV_IDEDMA 1256#ifdef CONFIG_BLK_DEV_IDEDMA
1257int __ide_dma_bad_drive(ide_drive_t *); 1257int __ide_dma_bad_drive(ide_drive_t *);
1258int ide_id_dma_bug(ide_drive_t *);
1258 1259
1259u8 ide_find_dma_mode(ide_drive_t *, u8); 1260u8 ide_find_dma_mode(ide_drive_t *, u8);
1260 1261
@@ -1264,7 +1265,6 @@ static inline u8 ide_max_dma_mode(ide_drive_t *drive)
1264} 1265}
1265 1266
1266void ide_dma_off(ide_drive_t *); 1267void ide_dma_off(ide_drive_t *);
1267void ide_dma_verbose(ide_drive_t *);
1268int ide_set_dma(ide_drive_t *); 1268int ide_set_dma(ide_drive_t *);
1269ide_startstop_t ide_dma_intr(ide_drive_t *); 1269ide_startstop_t ide_dma_intr(ide_drive_t *);
1270 1270
@@ -1287,6 +1287,7 @@ extern void ide_dma_timeout(ide_drive_t *);
1287#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1287#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
1288 1288
1289#else 1289#else
1290static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
1290static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } 1291static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; }
1291static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } 1292static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
1292static inline void ide_dma_off(ide_drive_t *drive) { ; } 1293static inline void ide_dma_off(ide_drive_t *drive) { ; }
@@ -1333,8 +1334,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data)
1333 hwif->hwif_data = data; 1334 hwif->hwif_data = data;
1334} 1335}
1335 1336
1336/* ide-lib.c */ 1337const char *ide_xfer_verbose(u8 mode);
1337extern char *ide_xfer_verbose(u8 xfer_rate);
1338extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1338extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1339extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1339extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
1340 1340