diff options
Diffstat (limited to 'drivers/ide/legacy/ide-cs.c')
-rw-r--r-- | drivers/ide/legacy/ide-cs.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index aa2ea3deac85..3381424d70a1 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
@@ -135,13 +135,17 @@ static void ide_detach(struct pcmcia_device *link) | |||
135 | { | 135 | { |
136 | ide_info_t *info = link->priv; | 136 | ide_info_t *info = link->priv; |
137 | ide_hwif_t *hwif = info->hwif; | 137 | ide_hwif_t *hwif = info->hwif; |
138 | unsigned long data_addr, ctl_addr; | ||
138 | 139 | ||
139 | DEBUG(0, "ide_detach(0x%p)\n", link); | 140 | DEBUG(0, "ide_detach(0x%p)\n", link); |
140 | 141 | ||
142 | data_addr = hwif->io_ports.data_addr; | ||
143 | ctl_addr = hwif->io_ports.ctl_addr; | ||
144 | |||
141 | ide_release(link); | 145 | ide_release(link); |
142 | 146 | ||
143 | release_region(hwif->io_ports.ctl_addr, 1); | 147 | release_region(ctl_addr, 1); |
144 | release_region(hwif->io_ports.data_addr, 8); | 148 | release_region(data_addr, 8); |
145 | 149 | ||
146 | kfree(info); | 150 | kfree(info); |
147 | } /* ide_detach */ | 151 | } /* ide_detach */ |
@@ -194,6 +198,16 @@ static ide_hwif_t *idecs_register(unsigned long io, unsigned long ctl, | |||
194 | if (hwif->present) | 198 | if (hwif->present) |
195 | return hwif; | 199 | return hwif; |
196 | 200 | ||
201 | /* retry registration in case device is still spinning up */ | ||
202 | for (i = 0; i < 10; i++) { | ||
203 | msleep(100); | ||
204 | ide_port_scan(hwif); | ||
205 | if (hwif->present) | ||
206 | return hwif; | ||
207 | } | ||
208 | |||
209 | return hwif; | ||
210 | |||
197 | out_release: | 211 | out_release: |
198 | release_region(ctl, 1); | 212 | release_region(ctl, 1); |
199 | release_region(io, 8); | 213 | release_region(io, 8); |
@@ -222,7 +236,7 @@ static int ide_config(struct pcmcia_device *link) | |||
222 | cistpl_cftable_entry_t dflt; | 236 | cistpl_cftable_entry_t dflt; |
223 | } *stk = NULL; | 237 | } *stk = NULL; |
224 | cistpl_cftable_entry_t *cfg; | 238 | cistpl_cftable_entry_t *cfg; |
225 | int i, pass, last_ret = 0, last_fn = 0, is_kme = 0; | 239 | int pass, last_ret = 0, last_fn = 0, is_kme = 0; |
226 | unsigned long io_base, ctl_base; | 240 | unsigned long io_base, ctl_base; |
227 | ide_hwif_t *hwif; | 241 | ide_hwif_t *hwif; |
228 | 242 | ||
@@ -319,30 +333,15 @@ static int ide_config(struct pcmcia_device *link) | |||
319 | if (is_kme) | 333 | if (is_kme) |
320 | outb(0x81, ctl_base+1); | 334 | outb(0x81, ctl_base+1); |
321 | 335 | ||
322 | /* retry registration in case device is still spinning up */ | 336 | hwif = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); |
323 | for (i = 0; i < 10; i++) { | 337 | if (hwif == NULL && link->io.NumPorts1 == 0x20) { |
324 | hwif = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); | ||
325 | if (hwif) | ||
326 | break; | ||
327 | if (link->io.NumPorts1 == 0x20) { | ||
328 | outb(0x02, ctl_base + 0x10); | 338 | outb(0x02, ctl_base + 0x10); |
329 | hwif = idecs_register(io_base + 0x10, ctl_base + 0x10, | 339 | hwif = idecs_register(io_base + 0x10, ctl_base + 0x10, |
330 | link->irq.AssignedIRQ, link); | 340 | link->irq.AssignedIRQ, link); |
331 | if (hwif) { | ||
332 | io_base += 0x10; | ||
333 | ctl_base += 0x10; | ||
334 | break; | ||
335 | } | ||
336 | } | ||
337 | msleep(100); | ||
338 | } | 341 | } |
339 | 342 | ||
340 | if (hwif == NULL) { | 343 | if (hwif == NULL) |
341 | printk(KERN_NOTICE "ide-cs: ide_register() at 0x%3lx & 0x%3lx" | ||
342 | ", irq %u failed\n", io_base, ctl_base, | ||
343 | link->irq.AssignedIRQ); | ||
344 | goto failed; | 344 | goto failed; |
345 | } | ||
346 | 345 | ||
347 | info->ndev = 1; | 346 | info->ndev = 1; |
348 | sprintf(info->node.dev_name, "hd%c", 'a' + hwif->index * 2); | 347 | sprintf(info->node.dev_name, "hd%c", 'a' + hwif->index * 2); |
@@ -411,6 +410,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
411 | PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ | 410 | PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ |
412 | PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), | 411 | PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), |
413 | PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ | 412 | PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ |
413 | PCMCIA_DEVICE_MANF_CARD(0x004f, 0x0000), /* Kingston */ | ||
414 | PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ | 414 | PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ |
415 | PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), | 415 | PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), |
416 | PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ | 416 | PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ |
@@ -440,6 +440,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
440 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), | 440 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), |
441 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), | 441 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), |
442 | PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), | 442 | PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), |
443 | PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF300", 0x7ed2ad87, 0x7e9e78ee), | ||
443 | PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), | 444 | PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), |
444 | PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), | 445 | PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), |
445 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), | 446 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), |
@@ -450,6 +451,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
450 | PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), | 451 | PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), |
451 | PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), | 452 | PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), |
452 | PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), | 453 | PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), |
454 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF45", 0x709b1bf1, 0xf68b6f32), | ||
453 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), | 455 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), |
454 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), | 456 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), |
455 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), | 457 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), |