diff options
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
-rw-r--r-- | drivers/ide/legacy/ht6560b.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 02d12c74764a..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 | } |
@@ -323,7 +332,7 @@ static const struct ide_port_info ht6560b_port_info __initdata = { | |||
323 | IDE_HFLAG_NO_DMA | | 332 | IDE_HFLAG_NO_DMA | |
324 | IDE_HFLAG_NO_AUTOTUNE | | 333 | IDE_HFLAG_NO_AUTOTUNE | |
325 | IDE_HFLAG_ABUSE_PREFETCH, | 334 | IDE_HFLAG_ABUSE_PREFETCH, |
326 | .pio_mask = ATA_PIO5, | 335 | .pio_mask = ATA_PIO4, |
327 | }; | 336 | }; |
328 | 337 | ||
329 | static int __init ht6560b_init(void) | 338 | static int __init ht6560b_init(void) |