aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/Kconfig1
-rw-r--r--drivers/ide/ide-disk.c2
-rw-r--r--drivers/ide/ide-dma.c2
-rw-r--r--drivers/ide/ide-iops.c2
-rw-r--r--drivers/ide/ide.c5
-rw-r--r--drivers/ide/legacy/ide-cs.c81
-rw-r--r--drivers/ide/pci/generic.c8
-rw-r--r--drivers/ide/pci/it821x.c11
8 files changed, 35 insertions, 77 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 53bba41f29bc..b6fb167e20f6 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -682,6 +682,7 @@ config BLK_DEV_SVWKS
682config BLK_DEV_SGIIOC4 682config BLK_DEV_SGIIOC4
683 tristate "Silicon Graphics IOC4 chipset ATA/ATAPI support" 683 tristate "Silicon Graphics IOC4 chipset ATA/ATAPI support"
684 depends on (IA64_SGI_SN2 || IA64_GENERIC) && SGI_IOC4 684 depends on (IA64_SGI_SN2 || IA64_GENERIC) && SGI_IOC4
685 select IDEPCI_SHARE_IRQ
685 help 686 help
686 This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4 687 This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
687 chipset, which has one channel and can support two devices. 688 chipset, which has one channel and can support two devices.
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index f712e4cfd9dc..7cf3eb023521 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -776,7 +776,7 @@ static void update_ordered(ide_drive_t *drive)
776 * not available so we don't need to recheck that. 776 * not available so we don't need to recheck that.
777 */ 777 */
778 capacity = idedisk_capacity(drive); 778 capacity = idedisk_capacity(drive);
779 barrier = ide_id_has_flush_cache(id) && 779 barrier = ide_id_has_flush_cache(id) && !drive->noflush &&
780 (drive->addressing == 0 || capacity <= (1ULL << 28) || 780 (drive->addressing == 0 || capacity <= (1ULL << 28) ||
781 ide_id_has_flush_cache_ext(id)); 781 ide_id_has_flush_cache_ext(id));
782 782
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 98918fb6b2ce..7c3a13e1cf64 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -750,7 +750,7 @@ void ide_dma_verbose(ide_drive_t *drive)
750 goto bug_dma_off; 750 goto bug_dma_off;
751 printk(", DMA"); 751 printk(", DMA");
752 } else if (id->field_valid & 1) { 752 } else if (id->field_valid & 1) {
753 printk(", BUG"); 753 goto bug_dma_off;
754 } 754 }
755 return; 755 return;
756bug_dma_off: 756bug_dma_off:
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 657165297dc7..77703acaec17 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -23,6 +23,7 @@
23#include <linux/hdreg.h> 23#include <linux/hdreg.h>
24#include <linux/ide.h> 24#include <linux/ide.h>
25#include <linux/bitops.h> 25#include <linux/bitops.h>
26#include <linux/nmi.h>
26 27
27#include <asm/byteorder.h> 28#include <asm/byteorder.h>
28#include <asm/irq.h> 29#include <asm/irq.h>
@@ -1243,6 +1244,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
1243 if (stat == 0xff) 1244 if (stat == 0xff)
1244 return -ENODEV; 1245 return -ENODEV;
1245 touch_softlockup_watchdog(); 1246 touch_softlockup_watchdog();
1247 touch_nmi_watchdog();
1246 } 1248 }
1247 return -EBUSY; 1249 return -EBUSY;
1248} 1250}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 05fbd9298db7..defd4b4bd374 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1539,7 +1539,7 @@ static int __init ide_setup(char *s)
1539 const char *hd_words[] = { 1539 const char *hd_words[] = {
1540 "none", "noprobe", "nowerr", "cdrom", "serialize", 1540 "none", "noprobe", "nowerr", "cdrom", "serialize",
1541 "autotune", "noautotune", "minus8", "swapdata", "bswap", 1541 "autotune", "noautotune", "minus8", "swapdata", "bswap",
1542 "minus11", "remap", "remap63", "scsi", NULL }; 1542 "noflush", "remap", "remap63", "scsi", NULL };
1543 unit = s[2] - 'a'; 1543 unit = s[2] - 'a';
1544 hw = unit / MAX_DRIVES; 1544 hw = unit / MAX_DRIVES;
1545 unit = unit % MAX_DRIVES; 1545 unit = unit % MAX_DRIVES;
@@ -1578,6 +1578,9 @@ static int __init ide_setup(char *s)
1578 case -10: /* "bswap" */ 1578 case -10: /* "bswap" */
1579 drive->bswap = 1; 1579 drive->bswap = 1;
1580 goto done; 1580 goto done;
1581 case -11: /* noflush */
1582 drive->noflush = 1;
1583 goto done;
1581 case -12: /* "remap" */ 1584 case -12: /* "remap" */
1582 drive->remap_0_to_1 = 1; 1585 drive->remap_0_to_1 = 1;
1583 goto done; 1586 goto done;
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index b7e459e4f284..602797a44208 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -146,16 +146,7 @@ static void ide_detach(struct pcmcia_device *link)
146 kfree(link->priv); 146 kfree(link->priv);
147} /* ide_detach */ 147} /* ide_detach */
148 148
149static void idecs_mmio_fixup(ide_hwif_t *hwif) 149static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
150{
151 default_hwif_mmiops(hwif);
152 hwif->mmio = 2;
153
154 ide_undecoded_slave(hwif);
155}
156
157static int idecs_register(unsigned long io, unsigned long ctl,
158 unsigned long irq, struct pcmcia_device *handle, int is_mmio)
159{ 150{
160 hw_regs_t hw; 151 hw_regs_t hw;
161 memset(&hw, 0, sizeof(hw)); 152 memset(&hw, 0, sizeof(hw));
@@ -163,19 +154,7 @@ static int idecs_register(unsigned long io, unsigned long ctl,
163 hw.irq = irq; 154 hw.irq = irq;
164 hw.chipset = ide_pci; 155 hw.chipset = ide_pci;
165 hw.dev = &handle->dev; 156 hw.dev = &handle->dev;
166 157 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
167 if(is_mmio)
168 return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
169 else
170 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
171}
172
173void outb_io(unsigned char value, unsigned long port) {
174 outb(value, port);
175}
176
177void outb_mem(unsigned char value, unsigned long port) {
178 writeb(value, (void __iomem *) port);
179} 158}
180 159
181/*====================================================================== 160/*======================================================================
@@ -201,8 +180,7 @@ static int ide_config(struct pcmcia_device *link)
201 } *stk = NULL; 180 } *stk = NULL;
202 cistpl_cftable_entry_t *cfg; 181 cistpl_cftable_entry_t *cfg;
203 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; 182 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
204 unsigned long io_base, ctl_base, is_mmio, try_slave; 183 unsigned long io_base, ctl_base;
205 void (*my_outb)(unsigned char, unsigned long);
206 184
207 DEBUG(0, "ide_config(0x%p)\n", link); 185 DEBUG(0, "ide_config(0x%p)\n", link);
208 186
@@ -232,7 +210,7 @@ static int ide_config(struct pcmcia_device *link)
232 /* Not sure if this is right... look up the current Vcc */ 210 /* Not sure if this is right... look up the current Vcc */
233 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); 211 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
234 212
235 pass = io_base = ctl_base = is_mmio = try_slave = 0; 213 pass = io_base = ctl_base = 0;
236 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 214 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
237 tuple.Attributes = 0; 215 tuple.Attributes = 0;
238 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 216 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -280,45 +258,11 @@ static int ide_config(struct pcmcia_device *link)
280 goto next_entry; 258 goto next_entry;
281 io_base = link->io.BasePort1; 259 io_base = link->io.BasePort1;
282 ctl_base = link->io.BasePort1 + 0x0e; 260 ctl_base = link->io.BasePort1 + 0x0e;
283
284 if (io->win[0].len >= 0x20)
285 try_slave = 1;
286
287 } else goto next_entry; 261 } else goto next_entry;
288 /* If we've got this far, we're done */ 262 /* If we've got this far, we're done */
289 break; 263 break;
290 } 264 }
291 265
292 if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
293 win_req_t req;
294 memreq_t map;
295 cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
296
297 if (mem->win[0].len < 16)
298 goto next_entry;
299
300 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
301 req.Attributes |= WIN_ENABLE;
302 req.Base = mem->win[0].host_addr;
303 req.Size = 0;
304
305 req.AccessSpeed = 0;
306 if (pcmcia_request_window(&link, &req, &link->win) != 0)
307 goto next_entry;
308 map.Page = 0; map.CardOffset = mem->win[0].card_addr;
309 if (pcmcia_map_mem_page(link->win, &map) != 0)
310 goto next_entry;
311
312 io_base = (unsigned long) ioremap(req.Base, req.Size);
313 ctl_base = io_base + 0x0e;
314 is_mmio = 1;
315
316 if (mem->win[0].len >= 0x20)
317 try_slave = 1;
318
319 break;
320 }
321
322 next_entry: 266 next_entry:
323 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 267 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
324 memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); 268 memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -334,26 +278,21 @@ static int ide_config(struct pcmcia_device *link)
334 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 278 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
335 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 279 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
336 280
337 if(is_mmio)
338 my_outb = outb_mem;
339 else
340 my_outb = outb_io;
341
342 /* disable drive interrupts during IDE probe */ 281 /* disable drive interrupts during IDE probe */
343 my_outb(0x02, ctl_base); 282 outb(0x02, ctl_base);
344 283
345 /* special setup for KXLC005 card */ 284 /* special setup for KXLC005 card */
346 if (is_kme) 285 if (is_kme)
347 my_outb(0x81, ctl_base+1); 286 outb(0x81, ctl_base+1);
348 287
349 /* retry registration in case device is still spinning up */ 288 /* retry registration in case device is still spinning up */
350 for (hd = -1, i = 0; i < 10; i++) { 289 for (hd = -1, i = 0; i < 10; i++) {
351 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio); 290 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
352 if (hd >= 0) break; 291 if (hd >= 0) break;
353 if (try_slave) { 292 if (link->io.NumPorts1 == 0x20) {
354 my_outb(0x02, ctl_base + 0x10); 293 outb(0x02, ctl_base + 0x10);
355 hd = idecs_register(io_base + 0x10, ctl_base + 0x10, 294 hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
356 link->irq.AssignedIRQ, link, is_mmio); 295 link->irq.AssignedIRQ, link);
357 if (hd >= 0) { 296 if (hd >= 0) {
358 io_base += 0x10; 297 io_base += 0x10;
359 ctl_base += 0x10; 298 ctl_base += 0x10;
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index f82e82109728..2f962cfa3f7f 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -212,6 +212,9 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
212 (!(PCI_FUNC(dev->devfn) & 1))) 212 (!(PCI_FUNC(dev->devfn) & 1)))
213 goto out; 213 goto out;
214 214
215 if (dev->vendor == PCI_VENDOR_ID_JMICRON && PCI_FUNC(dev->devfn) != 1)
216 goto out;
217
215 pci_read_config_word(dev, PCI_COMMAND, &command); 218 pci_read_config_word(dev, PCI_COMMAND, &command);
216 if (!(command & PCI_COMMAND_IO)) { 219 if (!(command & PCI_COMMAND_IO)) {
217 printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name); 220 printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
@@ -239,6 +242,11 @@ static struct pci_device_id generic_pci_tbl[] = {
239 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, 242 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
240 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, 243 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
241 { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, 244 { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
245 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
246 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16},
247 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17},
248 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
249 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19},
242 /* Must come last. If you add entries adjust this table appropriately and the init_one code */ 250 /* Must come last. If you add entries adjust this table appropriately and the init_one code */
243 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, 251 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0},
244 { 0, }, 252 { 0, },
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 3cb04424d351..e9bad185968a 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -498,9 +498,14 @@ static int config_chipset_for_dma (ide_drive_t *drive)
498{ 498{
499 u8 speed = ide_dma_speed(drive, it821x_ratemask(drive)); 499 u8 speed = ide_dma_speed(drive, it821x_ratemask(drive));
500 500
501 config_it821x_chipset_for_pio(drive, !speed); 501 if (speed) {
502 it821x_tune_chipset(drive, speed); 502 config_it821x_chipset_for_pio(drive, 0);
503 return ide_dma_enable(drive); 503 it821x_tune_chipset(drive, speed);
504
505 return ide_dma_enable(drive);
506 }
507
508 return 0;
504} 509}
505 510
506/** 511/**