aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/legacy/ht6560b.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 2701e7d6caff..78ca68e60f97 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -21,18 +21,21 @@
21 * "Prefetch" mode bit OFF for ide disks and 21 * "Prefetch" mode bit OFF for ide disks and
22 * ON for anything else. 22 * ON for anything else.
23 * 23 *
24 * Version 0.08 Need to force prefetch for CDs and other non-disk
25 * devices. (not sure which devices exactly need
26 * prefetch)
24 * 27 *
25 * HT-6560B EIDE-controller support 28 * HT-6560B EIDE-controller support
26 * To activate controller support use kernel parameter "ide0=ht6560b". 29 * To activate controller support use kernel parameter "ide0=ht6560b".
27 * Use hdparm utility to enable PIO mode support. 30 * Use hdparm utility to enable PIO mode support.
28 * 31 *
29 * Author: Mikko Ala-Fossi <maf@iki.fi> 32 * Author: Mikko Ala-Fossi <maf@iki.fi>
30 * Jan Evert van Grootheest <janevert@iae.nl> 33 * Jan Evert van Grootheest <janevert@caiway.nl>
31 * 34 *
32 * Try: http://www.maf.iki.fi/~maf/ht6560b/ 35 * Try: http://www.maf.iki.fi/~maf/ht6560b/
33 */ 36 */
34 37
35#define HT6560B_VERSION "v0.07" 38#define HT6560B_VERSION "v0.08"
36 39
37#include <linux/module.h> 40#include <linux/module.h>
38#include <linux/types.h> 41#include <linux/types.h>
@@ -130,15 +133,20 @@ static void ht6560b_selectproc (ide_drive_t *drive)
130 u8 select, timing; 133 u8 select, timing;
131 134
132 local_irq_save(flags); 135 local_irq_save(flags);
133 136
134 select = HT_CONFIG(drive); 137 select = HT_CONFIG(drive);
135 timing = HT_TIMING(drive); 138 timing = HT_TIMING(drive);
136 139
140 /*
141 * Need to enforce prefetch sometimes because otherwise
142 * it'll hang (hard).
143 */
144 if (drive->media != ide_disk || !drive->present)
145 select |= HT_PREFETCH_MODE;
146
137 if (select != current_select || timing != current_timing) { 147 if (select != current_select || timing != current_timing) {
138 current_select = select; 148 current_select = select;
139 current_timing = timing; 149 current_timing = timing;
140 if (drive->media != ide_disk || !drive->present)
141 select |= HT_PREFETCH_MODE;
142 (void)inb(HT_CONFIG_PORT); 150 (void)inb(HT_CONFIG_PORT);
143 (void)inb(HT_CONFIG_PORT); 151 (void)inb(HT_CONFIG_PORT);
144 (void)inb(HT_CONFIG_PORT); 152 (void)inb(HT_CONFIG_PORT);
@@ -188,11 +196,12 @@ static int __init try_to_init_ht6560b(void)
188 outb(HT_TIMING_DEFAULT, 0x1f6); /* IDE_SELECT_REG */ 196 outb(HT_TIMING_DEFAULT, 0x1f6); /* IDE_SELECT_REG */
189 (void) inb(0x1f7); /* IDE_STATUS_REG */ 197 (void) inb(0x1f7); /* IDE_STATUS_REG */
190 198
191 printk("\nht6560b " HT6560B_VERSION 199 printk("ht6560b " HT6560B_VERSION
192 ": chipset detected and initialized" 200 ": chipset detected and initialized"
193#ifdef DEBUG 201#ifdef DEBUG
194 " with debug enabled" 202 " with debug enabled"
195#endif 203#endif
204 "\n"
196 ); 205 );
197 return 1; 206 return 1;
198} 207}