aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-11 12:19:22 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-11 12:19:22 -0500
commiteedcdefb1ad75de9cc0889b247524be64cc244ef (patch)
tree763c742fe2ef0f109af364fca266f022739ef8bc
parent9585ca02f8f9e844b64e7ff4d167ccc1390a99ab (diff)
parent467390a2a50493332ddc21eb806094b1829c1161 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: ide: remove stale comment from ide-lib.c ide: fix comment in init_irq() ide: ide_init_port() bugfix ide-disk: fix flush requests (take 2) ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option bast-ide: build fix ide-tape: remove never executed code ide: fix ide/legacy/gayle.c compilation ide-cd: replace ntohs with generic byteorder macro be16_to_cpu ide: remove stale version number pdc202xx_old: always enable burst mode palm_bk3710: use struct ide_port_info palm_bk3710: port initialization/probing bugfix palm_bk3710: fix ide_unregister() usage palm_bk3710: ide_register_hw() -> ide_device_add() ide: insert BUG_ON() into __ide_set_handler() (take 2) cs5520: remove stale comment ide: another possible ide panic fix for blk-end-request
-rw-r--r--drivers/ide/Kconfig26
-rw-r--r--drivers/ide/arm/bast-ide.c12
-rw-r--r--drivers/ide/arm/palm_bk3710.c74
-rw-r--r--drivers/ide/ide-cd.c2
-rw-r--r--drivers/ide/ide-disk.c18
-rw-r--r--drivers/ide/ide-dma.c14
-rw-r--r--drivers/ide/ide-io.c19
-rw-r--r--drivers/ide/ide-iops.c10
-rw-r--r--drivers/ide/ide-lib.c9
-rw-r--r--drivers/ide/ide-probe.c4
-rw-r--r--drivers/ide/ide-tape.c34
-rw-r--r--drivers/ide/ide.c4
-rw-r--r--drivers/ide/legacy/gayle.c2
-rw-r--r--drivers/ide/pci/cs5520.c5
-rw-r--r--drivers/ide/pci/pdc202xx_old.c22
-rw-r--r--include/linux/ide.h11
16 files changed, 107 insertions, 159 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 043c34ad0a05..df752e690e47 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -378,6 +378,9 @@ config BLK_DEV_IDEPNP
378 would like the kernel to automatically detect and activate 378 would like the kernel to automatically detect and activate
379 it, say Y here. 379 it, say Y here.
380 380
381config BLK_DEV_IDEDMA_SFF
382 bool
383
381if PCI 384if PCI
382 385
383comment "PCI IDE chipsets support" 386comment "PCI IDE chipsets support"
@@ -459,6 +462,7 @@ config BLK_DEV_RZ1000
459config BLK_DEV_IDEDMA_PCI 462config BLK_DEV_IDEDMA_PCI
460 bool 463 bool
461 select BLK_DEV_IDEPCI 464 select BLK_DEV_IDEPCI
465 select BLK_DEV_IDEDMA_SFF
462 466
463config BLK_DEV_AEC62XX 467config BLK_DEV_AEC62XX
464 tristate "AEC62XX chipset support" 468 tristate "AEC62XX chipset support"
@@ -688,23 +692,6 @@ config BLK_DEV_PDC202XX_OLD
688 692
689 If unsure, say N. 693 If unsure, say N.
690 694
691config PDC202XX_BURST
692 bool "Special UDMA Feature"
693 depends on BLK_DEV_PDC202XX_OLD
694 help
695 This option causes the pdc202xx driver to enable UDMA modes on the
696 PDC202xx even when the PDC202xx BIOS has not done so.
697
698 It was originally designed for the PDC20246/Ultra33, whose BIOS will
699 only setup UDMA on the first two PDC20246 cards. It has also been
700 used successfully on a PDC20265/Ultra100, allowing use of UDMA modes
701 when the PDC20265 BIOS has been disabled (for faster boot up).
702
703 Please read the comments at the top of
704 <file:drivers/ide/pci/pdc202xx_old.c>.
705
706 If unsure, say N.
707
708config BLK_DEV_PDC202XX_NEW 695config BLK_DEV_PDC202XX_NEW
709 tristate "PROMISE PDC202{68|69|70|71|75|76|77} support" 696 tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
710 select BLK_DEV_IDEDMA_PCI 697 select BLK_DEV_IDEDMA_PCI
@@ -1016,7 +1003,7 @@ config BLK_DEV_Q40IDE
1016config BLK_DEV_PALMCHIP_BK3710 1003config BLK_DEV_PALMCHIP_BK3710
1017 tristate "Palmchip bk3710 IDE controller support" 1004 tristate "Palmchip bk3710 IDE controller support"
1018 depends on ARCH_DAVINCI 1005 depends on ARCH_DAVINCI
1019 select BLK_DEV_IDEDMA_PCI 1006 select BLK_DEV_IDEDMA_SFF
1020 help 1007 help
1021 Say Y here if you want to support the onchip IDE controller on the 1008 Say Y here if you want to support the onchip IDE controller on the
1022 TI DaVinci SoC 1009 TI DaVinci SoC
@@ -1124,7 +1111,8 @@ config BLK_DEV_UMC8672
1124endif 1111endif
1125 1112
1126config BLK_DEV_IDEDMA 1113config BLK_DEV_IDEDMA
1127 def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 1114 def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
1115 BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
1128 1116
1129config IDE_ARCH_OBSOLETE_INIT 1117config IDE_ARCH_OBSOLETE_INIT
1130 def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC 1118 def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index 0e7574c0ee60..161d30c8481e 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -21,12 +21,7 @@
21#include <asm/arch/bast-map.h> 21#include <asm/arch/bast-map.h>
22#include <asm/arch/bast-irq.h> 22#include <asm/arch/bast-irq.h>
23 23
24/* list of registered interfaces */ 24static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
25static ide_hwif_t *ifs[2];
26
27static int __init
28bastide_register(unsigned int base, unsigned int aux, int irq,
29 ide_hwif_t **hwif)
30{ 25{
31 ide_hwif_t *hwif; 26 ide_hwif_t *hwif;
32 hw_regs_t hw; 27 hw_regs_t hw;
@@ -76,8 +71,9 @@ static int __init bastide_init(void)
76 71
77 printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n"); 72 printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
78 73
79 bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]); 74 bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
80 bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]); 75 bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);
76
81 return 0; 77 return 0;
82} 78}
83 79
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index c3069970a012..8e1f6bd33887 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -311,15 +311,37 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
311 palm_bk3710_setpiomode(base, NULL, 0, 600, 0); 311 palm_bk3710_setpiomode(base, NULL, 0, 600, 0);
312 palm_bk3710_setpiomode(base, NULL, 1, 600, 0); 312 palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
313} 313}
314
315static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
316{
317 return ATA_CBL_PATA80;
318}
319
320static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif)
321{
322 hwif->set_pio_mode = palm_bk3710_set_pio_mode;
323 hwif->set_dma_mode = palm_bk3710_set_dma_mode;
324
325 hwif->cable_detect = palm_bk3710_cable_detect;
326}
327
328static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
329 .init_hwif = palm_bk3710_init_hwif,
330 .host_flags = IDE_HFLAG_NO_DMA, /* hack (no PCI) */
331 .pio_mask = ATA_PIO4,
332 .udma_mask = ATA_UDMA4, /* (input clk 99MHz) */
333 .mwdma_mask = ATA_MWDMA2,
334};
335
314static int __devinit palm_bk3710_probe(struct platform_device *pdev) 336static int __devinit palm_bk3710_probe(struct platform_device *pdev)
315{ 337{
316 hw_regs_t ide_ctlr_info;
317 int index = 0;
318 int pribase;
319 struct clk *clkp; 338 struct clk *clkp;
320 struct resource *mem, *irq; 339 struct resource *mem, *irq;
321 ide_hwif_t *hwif; 340 ide_hwif_t *hwif;
322 void __iomem *base; 341 void __iomem *base;
342 int pribase, i;
343 hw_regs_t hw;
344 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
323 345
324 clkp = clk_get(NULL, "IDECLK"); 346 clkp = clk_get(NULL, "IDECLK");
325 if (IS_ERR(clkp)) 347 if (IS_ERR(clkp))
@@ -330,7 +352,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
330 ide_palm_clk = clk_get_rate(ideclkp)/100000; 352 ide_palm_clk = clk_get_rate(ideclkp)/100000;
331 ide_palm_clk = (10000/ide_palm_clk) + 1; 353 ide_palm_clk = (10000/ide_palm_clk) + 1;
332 /* Register the IDE interface with Linux ATA Interface */ 354 /* Register the IDE interface with Linux ATA Interface */
333 memset(&ide_ctlr_info, 0, sizeof(ide_ctlr_info)); 355 memset(&hw, 0, sizeof(hw));
334 356
335 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 357 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
336 if (mem == NULL) { 358 if (mem == NULL) {
@@ -349,32 +371,42 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
349 palm_bk3710_chipinit(base); 371 palm_bk3710_chipinit(base);
350 372
351 pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET; 373 pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET;
352 for (index = 0; index < IDE_NR_PORTS - 2; index++) 374 for (i = 0; i < IDE_NR_PORTS - 2; i++)
353 ide_ctlr_info.io_ports[index] = pribase + index; 375 hw.io_ports[i] = pribase + i;
354 ide_ctlr_info.io_ports[IDE_CONTROL_OFFSET] = mem->start + 376 hw.io_ports[IDE_CONTROL_OFFSET] = mem->start +
355 IDE_PALM_ATA_PRI_CTL_OFFSET; 377 IDE_PALM_ATA_PRI_CTL_OFFSET;
356 ide_ctlr_info.irq = irq->start; 378 hw.irq = irq->start;
357 ide_ctlr_info.chipset = ide_palm3710; 379 hw.chipset = ide_palm3710;
358 380
359 if (ide_register_hw(&ide_ctlr_info, NULL, &hwif) < 0) { 381 hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
360 printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n"); 382 if (hwif == NULL)
361 return -ENODEV; 383 goto out;
362 } 384
385 i = hwif->index;
386
387 if (hwif->present)
388 ide_unregister(i, 0, 0);
389 else if (!hwif->hold)
390 ide_init_port_data(hwif, i);
391
392 ide_init_port_hw(hwif, &hw);
363 393
364 hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
365 hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
366 hwif->mmio = 1; 394 hwif->mmio = 1;
367 default_hwif_mmiops(hwif); 395 default_hwif_mmiops(hwif);
368 hwif->cbl = ATA_CBL_PATA80;
369 hwif->ultra_mask = 0x1f; /* Ultra DMA Mode 4 Max
370 (input clk 99MHz) */
371 hwif->mwdma_mask = 0x7;
372 hwif->drives[0].autotune = 1;
373 hwif->drives[1].autotune = 1;
374 396
375 ide_setup_dma(hwif, mem->start); 397 ide_setup_dma(hwif, mem->start);
376 398
399 idx[0] = i;
400
401 ide_device_add(idx, &palm_bk3710_port_info);
402
403 if (!hwif->present)
404 goto out;
405
377 return 0; 406 return 0;
407out:
408 printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
409 return -ENODEV;
378} 410}
379 411
380static struct platform_driver platform_bk_driver = { 412static struct platform_driver platform_bk_driver = {
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 5e42c19a03e3..354c91d06a6d 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1555,7 +1555,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
1555 if (stat) 1555 if (stat)
1556 return stat; 1556 return stat;
1557 1557
1558 toc->hdr.toc_length = ntohs (toc->hdr.toc_length); 1558 toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length);
1559 1559
1560 if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { 1560 if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) {
1561 toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); 1561 toc->hdr.first_track = BCD2BIN(toc->hdr.first_track);
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 3c69822507e2..aed8b31ca561 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -590,20 +590,24 @@ static ide_proc_entry_t idedisk_proc[] = {
590static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) 590static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
591{ 591{
592 ide_drive_t *drive = q->queuedata; 592 ide_drive_t *drive = q->queuedata;
593 ide_task_t task; 593 ide_task_t *task = kmalloc(sizeof(*task), GFP_ATOMIC);
594 594
595 memset(&task, 0, sizeof(task)); 595 /* FIXME: map struct ide_taskfile on rq->cmd[] */
596 BUG_ON(task == NULL);
597
598 memset(task, 0, sizeof(*task));
596 if (ide_id_has_flush_cache_ext(drive->id) && 599 if (ide_id_has_flush_cache_ext(drive->id) &&
597 (drive->capacity64 >= (1UL << 28))) 600 (drive->capacity64 >= (1UL << 28)))
598 task.tf.command = WIN_FLUSH_CACHE_EXT; 601 task->tf.command = WIN_FLUSH_CACHE_EXT;
599 else 602 else
600 task.tf.command = WIN_FLUSH_CACHE; 603 task->tf.command = WIN_FLUSH_CACHE;
601 task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 604 task->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
602 task.data_phase = TASKFILE_NO_DATA; 605 IDE_TFLAG_DYN;
606 task->data_phase = TASKFILE_NO_DATA;
603 607
604 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 608 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
605 rq->cmd_flags |= REQ_SOFTBARRIER; 609 rq->cmd_flags |= REQ_SOFTBARRIER;
606 rq->special = &task; 610 rq->special = task;
607} 611}
608 612
609/* 613/*
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index a4bb32883c6b..d0e7b537353e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -198,7 +198,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
198 198
199EXPORT_SYMBOL_GPL(ide_build_sglist); 199EXPORT_SYMBOL_GPL(ide_build_sglist);
200 200
201#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 201#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
202/** 202/**
203 * ide_build_dmatable - build IDE DMA table 203 * ide_build_dmatable - build IDE DMA table
204 * 204 *
@@ -316,7 +316,7 @@ void ide_destroy_dmatable (ide_drive_t *drive)
316 316
317EXPORT_SYMBOL_GPL(ide_destroy_dmatable); 317EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
318 318
319#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 319#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
320/** 320/**
321 * config_drive_for_dma - attempt to activate IDE DMA 321 * config_drive_for_dma - attempt to activate IDE DMA
322 * @drive: the drive to place in DMA mode 322 * @drive: the drive to place in DMA mode
@@ -424,7 +424,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on)
424} 424}
425 425
426EXPORT_SYMBOL_GPL(ide_dma_host_set); 426EXPORT_SYMBOL_GPL(ide_dma_host_set);
427#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 427#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
428 428
429/** 429/**
430 * ide_dma_off_quietly - Generic DMA kill 430 * ide_dma_off_quietly - Generic DMA kill
@@ -474,7 +474,7 @@ void ide_dma_on(ide_drive_t *drive)
474 drive->hwif->dma_host_set(drive, 1); 474 drive->hwif->dma_host_set(drive, 1);
475} 475}
476 476
477#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 477#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
478/** 478/**
479 * ide_dma_setup - begin a DMA phase 479 * ide_dma_setup - begin a DMA phase
480 * @drive: target device 480 * @drive: target device
@@ -591,7 +591,7 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
591} 591}
592#else 592#else
593static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } 593static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
594#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 594#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
595 595
596int __ide_dma_bad_drive (ide_drive_t *drive) 596int __ide_dma_bad_drive (ide_drive_t *drive)
597{ 597{
@@ -840,7 +840,7 @@ void ide_check_dma_crc(ide_drive_t *drive)
840 ide_dma_on(drive); 840 ide_dma_on(drive);
841} 841}
842 842
843#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 843#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
844void ide_dma_lost_irq (ide_drive_t *drive) 844void ide_dma_lost_irq (ide_drive_t *drive)
845{ 845{
846 printk("%s: DMA interrupt recovery\n", drive->name); 846 printk("%s: DMA interrupt recovery\n", drive->name);
@@ -1002,4 +1002,4 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
1002} 1002}
1003 1003
1004EXPORT_SYMBOL_GPL(ide_setup_dma); 1004EXPORT_SYMBOL_GPL(ide_setup_dma);
1005#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1005#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 3addbe478d26..715379605a7b 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -361,17 +361,21 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
361 spin_unlock_irqrestore(&ide_lock, flags); 361 spin_unlock_irqrestore(&ide_lock, flags);
362 362
363 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { 363 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
364 ide_task_t *args = (ide_task_t *) rq->special; 364 ide_task_t *task = (ide_task_t *)rq->special;
365
365 if (rq->errors == 0) 366 if (rq->errors == 0)
366 rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); 367 rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
367 368
368 if (args) { 369 if (task) {
369 struct ide_taskfile *tf = &args->tf; 370 struct ide_taskfile *tf = &task->tf;
370 371
371 tf->error = err; 372 tf->error = err;
372 tf->status = stat; 373 tf->status = stat;
373 374
374 ide_tf_read(drive, args); 375 ide_tf_read(drive, task);
376
377 if (task->tf_flags & IDE_TFLAG_DYN)
378 kfree(task);
375 } 379 }
376 } else if (blk_pm_request(rq)) { 380 } else if (blk_pm_request(rq)) {
377 struct request_pm_state *pm = rq->data; 381 struct request_pm_state *pm = rq->data;
@@ -388,7 +392,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
388 spin_lock_irqsave(&ide_lock, flags); 392 spin_lock_irqsave(&ide_lock, flags);
389 HWGROUP(drive)->rq = NULL; 393 HWGROUP(drive)->rq = NULL;
390 rq->errors = err; 394 rq->errors = err;
391 if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0)) 395 if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
396 blk_rq_bytes(rq))))
392 BUG(); 397 BUG();
393 spin_unlock_irqrestore(&ide_lock, flags); 398 spin_unlock_irqrestore(&ide_lock, flags);
394} 399}
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index c32e759df208..c419266234a7 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
786{ 786{
787 ide_hwgroup_t *hwgroup = HWGROUP(drive); 787 ide_hwgroup_t *hwgroup = HWGROUP(drive);
788 788
789 if (hwgroup->handler != NULL) { 789 BUG_ON(hwgroup->handler);
790 printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
791 "old=%p, new=%p\n",
792 drive->name, hwgroup->handler, handler);
793 }
794 hwgroup->handler = handler; 790 hwgroup->handler = handler;
795 hwgroup->expiry = expiry; 791 hwgroup->expiry = expiry;
796 hwgroup->timer.expires = jiffies + timeout; 792 hwgroup->timer.expires = jiffies + timeout;
797 hwgroup->req_gen_timer = hwgroup->req_gen; 793 hwgroup->req_gen_timer = hwgroup->req_gen;
798 add_timer(&hwgroup->timer); 794 add_timer(&hwgroup->timer);
799} 795}
800 796
@@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
827 unsigned timeout, ide_expiry_t *expiry) 823 unsigned timeout, ide_expiry_t *expiry)
828{ 824{
829 unsigned long flags; 825 unsigned long flags;
830 ide_hwgroup_t *hwgroup = HWGROUP(drive);
831 ide_hwif_t *hwif = HWIF(drive); 826 ide_hwif_t *hwif = HWIF(drive);
832 827
833 spin_lock_irqsave(&ide_lock, flags); 828 spin_lock_irqsave(&ide_lock, flags);
834 BUG_ON(hwgroup->handler);
835 __ide_set_handler(drive, handler, timeout, expiry); 829 __ide_set_handler(drive, handler, timeout, expiry);
836 hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); 830 hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG);
837 /* 831 /*
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 1ff676cc6473..29e2c9719c30 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -21,15 +21,6 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/io.h> 22#include <asm/io.h>
23 23
24/*
25 * IDE library routines. These are plug in code that most
26 * drivers can use but occasionally may be weird enough
27 * to want to do their own thing with
28 *
29 * Add common non I/O op stuff here. Make sure it has proper
30 * kernel-doc function headers or your patch will be rejected
31 */
32
33static const char *udma_str[] = 24static const char *udma_str[] =
34 { "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44", 25 { "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44",
35 "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" }; 26 "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 6daea896c5db..4a2cb2868226 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1051,7 +1051,7 @@ static int init_irq (ide_hwif_t *hwif)
1051 int sa = 0; 1051 int sa = 0;
1052#if defined(__mc68000__) 1052#if defined(__mc68000__)
1053 sa = IRQF_SHARED; 1053 sa = IRQF_SHARED;
1054#endif /* __mc68000__ || CONFIG_APUS */ 1054#endif /* __mc68000__ */
1055 1055
1056 if (IDE_CHIPSET_IS_PCI(hwif->chipset)) 1056 if (IDE_CHIPSET_IS_PCI(hwif->chipset))
1057 sa = IRQF_SHARED; 1057 sa = IRQF_SHARED;
@@ -1355,7 +1355,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
1355 hwif->ultra_mask = d->udma_mask; 1355 hwif->ultra_mask = d->udma_mask;
1356 1356
1357 /* reset DMA masks only for SFF-style DMA controllers */ 1357 /* reset DMA masks only for SFF-style DMA controllers */
1358 if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0) 1358 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
1359 hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0; 1359 hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
1360 1360
1361 if (d->host_flags & IDE_HFLAG_RQSIZE_256) 1361 if (d->host_flags & IDE_HFLAG_RQSIZE_256)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 49dd2e7bae7a..0598ecfd5f37 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -466,9 +466,6 @@ static void ide_tape_put(struct ide_tape_obj *tape)
466/* 0 = no tape is loaded, so we don't rewind after ejecting */ 466/* 0 = no tape is loaded, so we don't rewind after ejecting */
467#define IDETAPE_MEDIUM_PRESENT 9 467#define IDETAPE_MEDIUM_PRESENT 9
468 468
469/* A define for the READ BUFFER command */
470#define IDETAPE_RETRIEVE_FAULTY_BLOCK 6
471
472/* Some defines for the SPACE command */ 469/* Some defines for the SPACE command */
473#define IDETAPE_SPACE_OVER_FILEMARK 1 470#define IDETAPE_SPACE_OVER_FILEMARK 1
474#define IDETAPE_SPACE_TO_EOD 3 471#define IDETAPE_SPACE_TO_EOD 3
@@ -490,7 +487,6 @@ enum {
490 REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */ 487 REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */
491 REQ_IDETAPE_READ = (1 << 2), 488 REQ_IDETAPE_READ = (1 << 2),
492 REQ_IDETAPE_WRITE = (1 << 3), 489 REQ_IDETAPE_WRITE = (1 << 3),
493 REQ_IDETAPE_READ_BUFFER = (1 << 4),
494}; 490};
495 491
496/* Error codes returned in rq->errors to the higher part of the driver. */ 492/* Error codes returned in rq->errors to the higher part of the driver. */
@@ -1523,29 +1519,6 @@ static void idetape_create_read_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
1523 set_bit(PC_DMA_RECOMMENDED, &pc->flags); 1519 set_bit(PC_DMA_RECOMMENDED, &pc->flags);
1524} 1520}
1525 1521
1526static void idetape_create_read_buffer_cmd(idetape_tape_t *tape,
1527 idetape_pc_t *pc, struct idetape_bh *bh)
1528{
1529 int size = 32768;
1530 struct idetape_bh *p = bh;
1531
1532 idetape_init_pc(pc);
1533 pc->c[0] = READ_BUFFER;
1534 pc->c[1] = IDETAPE_RETRIEVE_FAULTY_BLOCK;
1535 pc->c[7] = size >> 8;
1536 pc->c[8] = size & 0xff;
1537 pc->callback = &idetape_pc_callback;
1538 pc->bh = bh;
1539 atomic_set(&bh->b_count, 0);
1540 pc->buffer = NULL;
1541 while (p) {
1542 atomic_set(&p->b_count, 0);
1543 p = p->b_reqnext;
1544 }
1545 pc->request_transfer = size;
1546 pc->buffer_size = size;
1547}
1548
1549static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc, 1522static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
1550 unsigned int length, struct idetape_bh *bh) 1523 unsigned int length, struct idetape_bh *bh)
1551{ 1524{
@@ -1655,13 +1628,6 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
1655 (struct idetape_bh *)rq->special); 1628 (struct idetape_bh *)rq->special);
1656 goto out; 1629 goto out;
1657 } 1630 }
1658 if (rq->cmd[0] & REQ_IDETAPE_READ_BUFFER) {
1659 tape->postpone_cnt = 0;
1660 pc = idetape_next_pc_storage(drive);
1661 idetape_create_read_buffer_cmd(tape, pc,
1662 (struct idetape_bh *)rq->special);
1663 goto out;
1664 }
1665 if (rq->cmd[0] & REQ_IDETAPE_PC1) { 1631 if (rq->cmd[0] & REQ_IDETAPE_PC1) {
1666 pc = (idetape_pc_t *) rq->buffer; 1632 pc = (idetape_pc_t *) rq->buffer;
1667 rq->cmd[0] &= ~(REQ_IDETAPE_PC1); 1633 rq->cmd[0] &= ~(REQ_IDETAPE_PC1);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index ad0e9955f73c..4a8952a6c3da 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -44,8 +44,6 @@
44 * inspiration from lots of linux users, esp. hamish@zot.apana.org.au 44 * inspiration from lots of linux users, esp. hamish@zot.apana.org.au
45 */ 45 */
46 46
47#define REVISION "Revision: 7.00alpha2"
48
49#define _IDE_C /* Tell ide.h it's really us */ 47#define _IDE_C /* Tell ide.h it's really us */
50 48
51#include <linux/module.h> 49#include <linux/module.h>
@@ -1618,7 +1616,7 @@ static int __init ide_init(void)
1618{ 1616{
1619 int ret; 1617 int ret;
1620 1618
1621 printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n"); 1619 printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
1622 system_bus_speed = ide_system_bus_speed(); 1620 system_bus_speed = ide_system_bus_speed();
1623 1621
1624 printk(KERN_INFO "ide: Assuming %dMHz system bus speed " 1622 printk(KERN_INFO "ide: Assuming %dMHz system bus speed "
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 9d3851d27677..b7d81090d5da 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -94,7 +94,7 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif)
94 94
95static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base, 95static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
96 unsigned long ctl, unsigned long irq_port, 96 unsigned long ctl, unsigned long irq_port,
97 ide_ack_intr_t *ack_intr); 97 ide_ack_intr_t *ack_intr)
98{ 98{
99 int i; 99 int i;
100 100
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index 0be1a824102b..1c163e4ef03f 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -147,11 +147,6 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
147 147
148 /* We must not grab the entire device, it has 'ISA' space in its 148 /* We must not grab the entire device, it has 'ISA' space in its
149 * BARS too and we will freak out other bits of the kernel 149 * BARS too and we will freak out other bits of the kernel
150 *
151 * pci_enable_device_bars() is going away. I replaced it with
152 * IO only enable for now but I'll need confirmation this is
153 * allright for that device. If not, it will need some kind of
154 * quirk. --BenH.
155 */ 150 */
156 if (pci_enable_device_io(dev)) { 151 if (pci_enable_device_io(dev)) {
157 printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name); 152 printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name);
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index da4329790387..150422ec3cfa 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -3,26 +3,6 @@
3 * Copyright (C) 2006-2007 MontaVista Software, Inc. 3 * Copyright (C) 2006-2007 MontaVista Software, Inc.
4 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 4 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz
5 * 5 *
6 * Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
7 * compiled into the kernel if you have more than one card installed.
8 * Note that BIOS v1.29 is reported to fix the problem. Since this is
9 * safe chipset tuning, including this support is harmless
10 *
11 * Promise Ultra66 cards with BIOS v1.11 this
12 * compiled into the kernel if you have more than one card installed.
13 *
14 * Promise Ultra100 cards.
15 *
16 * The latest chipset code will support the following ::
17 * Three Ultra33 controllers and 12 drives.
18 * 8 are UDMA supported and 4 are limited to DMA mode 2 multi-word.
19 * The 8/4 ratio is a BIOS code limit by promise.
20 *
21 * UNLESS you enable "CONFIG_PDC202XX_BURST"
22 *
23 */
24
25/*
26 * Portions Copyright (C) 1999 Promise Technology, Inc. 6 * Portions Copyright (C) 1999 Promise Technology, Inc.
27 * Author: Frank Tiernan (frankt@promise.com) 7 * Author: Frank Tiernan (frankt@promise.com)
28 * Released under terms of General Public License 8 * Released under terms of General Public License
@@ -344,7 +324,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
344 (primary_mode & 1) ? "MASTER" : "PCI", 324 (primary_mode & 1) ? "MASTER" : "PCI",
345 (secondary_mode & 1) ? "MASTER" : "PCI" ); 325 (secondary_mode & 1) ? "MASTER" : "PCI" );
346 326
347#ifdef CONFIG_PDC202XX_BURST
348 if (!(udma_speed_flag & 1)) { 327 if (!(udma_speed_flag & 1)) {
349 printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ", 328 printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ",
350 hwif->cds->name, udma_speed_flag, 329 hwif->cds->name, udma_speed_flag,
@@ -352,7 +331,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
352 outb(udma_speed_flag | 1, dmabase | 0x1f); 331 outb(udma_speed_flag | 1, dmabase | 0x1f);
353 printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN"); 332 printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN");
354 } 333 }
355#endif /* CONFIG_PDC202XX_BURST */
356 334
357 ide_setup_dma(hwif, dmabase); 335 ide_setup_dma(hwif, dmabase);
358} 336}
diff --git a/include/linux/ide.h b/include/linux/ide.h
index acec99da832d..23fad89292df 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -906,6 +906,8 @@ enum {
906 IDE_TFLAG_IN_DEVICE, 906 IDE_TFLAG_IN_DEVICE,
907 /* force 16-bit I/O operations */ 907 /* force 16-bit I/O operations */
908 IDE_TFLAG_IO_16BIT = (1 << 30), 908 IDE_TFLAG_IO_16BIT = (1 << 30),
909 /* ide_task_t was allocated using kmalloc() */
910 IDE_TFLAG_DYN = (1 << 31),
909}; 911};
910 912
911struct ide_taskfile { 913struct ide_taskfile {
@@ -998,8 +1000,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
998void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); 1000void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *);
999void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1001void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
1000 1002
1001/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */ 1003#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
1002#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI)
1003void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); 1004void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
1004#else 1005#else
1005static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, 1006static inline void ide_hwif_setup_dma(ide_hwif_t *hwif,
@@ -1146,7 +1147,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *);
1146int ide_build_sglist(ide_drive_t *, struct request *); 1147int ide_build_sglist(ide_drive_t *, struct request *);
1147void ide_destroy_dmatable(ide_drive_t *); 1148void ide_destroy_dmatable(ide_drive_t *);
1148 1149
1149#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 1150#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
1150extern int ide_build_dmatable(ide_drive_t *, struct request *); 1151extern int ide_build_dmatable(ide_drive_t *, struct request *);
1151extern int ide_release_dma(ide_hwif_t *); 1152extern int ide_release_dma(ide_hwif_t *);
1152extern void ide_setup_dma(ide_hwif_t *, unsigned long); 1153extern void ide_setup_dma(ide_hwif_t *, unsigned long);
@@ -1157,7 +1158,7 @@ extern void ide_dma_start(ide_drive_t *);
1157extern int __ide_dma_end(ide_drive_t *); 1158extern int __ide_dma_end(ide_drive_t *);
1158extern void ide_dma_lost_irq(ide_drive_t *); 1159extern void ide_dma_lost_irq(ide_drive_t *);
1159extern void ide_dma_timeout(ide_drive_t *); 1160extern void ide_dma_timeout(ide_drive_t *);
1160#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1161#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
1161 1162
1162#else 1163#else
1163static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } 1164static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
@@ -1171,7 +1172,7 @@ static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1171static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } 1172static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1172#endif /* CONFIG_BLK_DEV_IDEDMA */ 1173#endif /* CONFIG_BLK_DEV_IDEDMA */
1173 1174
1174#ifndef CONFIG_BLK_DEV_IDEDMA_PCI 1175#ifndef CONFIG_BLK_DEV_IDEDMA_SFF
1175static inline void ide_release_dma(ide_hwif_t *drive) {;} 1176static inline void ide_release_dma(ide_hwif_t *drive) {;}
1176#endif 1177#endif
1177 1178