aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/Kconfig30
-rw-r--r--drivers/ide/ide-cd.c30
-rw-r--r--drivers/ide/ide-cd_ioctl.c4
-rw-r--r--drivers/ide/ide-disk.c5
-rw-r--r--drivers/ide/ide-dma.c54
-rw-r--r--drivers/ide/ide-probe.c3
-rw-r--r--drivers/ide/ide-tape.c5
-rw-r--r--drivers/ide/ide.c24
-rw-r--r--drivers/ide/legacy/qd65xx.c43
-rw-r--r--drivers/ide/pci/cmd640.c3
-rw-r--r--drivers/ide/pci/hpt366.c12
11 files changed, 66 insertions, 147 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index df752e690e47..eed6d8e1b5c7 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -50,7 +50,7 @@ menuconfig IDE
50 To compile this driver as a module, choose M here: the 50 To compile this driver as a module, choose M here: the
51 module will be called ide. 51 module will be called ide.
52 52
53 For further information, please read <file:Documentation/ide.txt>. 53 For further information, please read <file:Documentation/ide/ide.txt>.
54 54
55 If unsure, say Y. 55 If unsure, say Y.
56 56
@@ -77,7 +77,7 @@ config BLK_DEV_IDE
77 Useful information about large (>540 MB) IDE disks, multiple 77 Useful information about large (>540 MB) IDE disks, multiple
78 interfaces, what to do if ATA/IDE devices are not automatically 78 interfaces, what to do if ATA/IDE devices are not automatically
79 detected, sound card ATA/IDE ports, module support, and other 79 detected, sound card ATA/IDE ports, module support, and other
80 topics, is contained in <file:Documentation/ide.txt>. For detailed 80 topics, is contained in <file:Documentation/ide/ide.txt>. For detailed
81 information about hard drives, consult the Disk-HOWTO and the 81 information about hard drives, consult the Disk-HOWTO and the
82 Multi-Disk-HOWTO, available from 82 Multi-Disk-HOWTO, available from
83 <http://www.tldp.org/docs.html#howto>. 83 <http://www.tldp.org/docs.html#howto>.
@@ -87,7 +87,7 @@ config BLK_DEV_IDE
87 <ftp://ibiblio.org/pub/Linux/system/hardware/>. 87 <ftp://ibiblio.org/pub/Linux/system/hardware/>.
88 88
89 To compile this driver as a module, choose M here and read 89 To compile this driver as a module, choose M here and read
90 <file:Documentation/ide.txt>. The module will be called ide-mod. 90 <file:Documentation/ide/ide.txt>. The module will be called ide-mod.
91 Do not compile this driver as a module if your root file system (the 91 Do not compile this driver as a module if your root file system (the
92 one containing the directory /) is located on an IDE device. 92 one containing the directory /) is located on an IDE device.
93 93
@@ -98,7 +98,7 @@ config BLK_DEV_IDE
98 98
99if BLK_DEV_IDE 99if BLK_DEV_IDE
100 100
101comment "Please see Documentation/ide.txt for help/info on IDE drives" 101comment "Please see Documentation/ide/ide.txt for help/info on IDE drives"
102 102
103config BLK_DEV_IDE_SATA 103config BLK_DEV_IDE_SATA
104 bool "Support for SATA (deprecated; conflicts with libata SATA driver)" 104 bool "Support for SATA (deprecated; conflicts with libata SATA driver)"
@@ -235,8 +235,8 @@ config BLK_DEV_IDETAPE
235 along with other IDE devices, as "hdb" or "hdc", or something 235 along with other IDE devices, as "hdb" or "hdc", or something
236 similar, and will be mapped to a character device such as "ht0" 236 similar, and will be mapped to a character device such as "ht0"
237 (check the boot messages with dmesg). Be sure to consult the 237 (check the boot messages with dmesg). Be sure to consult the
238 <file:drivers/ide/ide-tape.c> and <file:Documentation/ide.txt> files 238 <file:drivers/ide/ide-tape.c> and <file:Documentation/ide/ide.txt>
239 for usage information. 239 files for usage information.
240 240
241 To compile this driver as a module, choose M here: the 241 To compile this driver as a module, choose M here: the
242 module will be called ide-tape. 242 module will be called ide-tape.
@@ -358,7 +358,7 @@ config BLK_DEV_CMD640
358 358
359 The CMD640 chip is also used on add-in cards by Acculogic, and on 359 The CMD640 chip is also used on add-in cards by Acculogic, and on
360 the "CSA-6400E PCI to IDE controller" that some people have. For 360 the "CSA-6400E PCI to IDE controller" that some people have. For
361 details, read <file:Documentation/ide.txt>. 361 details, read <file:Documentation/ide/ide.txt>.
362 362
363config BLK_DEV_CMD640_ENHANCED 363config BLK_DEV_CMD640_ENHANCED
364 bool "CMD640 enhanced support" 364 bool "CMD640 enhanced support"
@@ -366,7 +366,7 @@ config BLK_DEV_CMD640_ENHANCED
366 help 366 help
367 This option includes support for setting/autotuning PIO modes and 367 This option includes support for setting/autotuning PIO modes and
368 prefetch on CMD640 IDE interfaces. For details, read 368 prefetch on CMD640 IDE interfaces. For details, read
369 <file:Documentation/ide.txt>. If you have a CMD640 IDE interface 369 <file:Documentation/ide/ide.txt>. If you have a CMD640 IDE interface
370 and your BIOS does not already do this for you, then say Y here. 370 and your BIOS does not already do this for you, then say Y here.
371 Otherwise say N. 371 Otherwise say N.
372 372
@@ -1069,9 +1069,9 @@ config BLK_DEV_ALI14XX
1069 This driver is enabled at runtime using the "ali14xx.probe" kernel 1069 This driver is enabled at runtime using the "ali14xx.probe" kernel
1070 boot parameter. It enables support for the secondary IDE interface 1070 boot parameter. It enables support for the secondary IDE interface
1071 of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster 1071 of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster
1072 I/O speeds to be set as well. See the files 1072 I/O speeds to be set as well.
1073 <file:Documentation/ide.txt> and <file:drivers/ide/legacy/ali14xx.c> 1073 See the files <file:Documentation/ide/ide.txt> and
1074 for more info. 1074 <file:drivers/ide/legacy/ali14xx.c> for more info.
1075 1075
1076config BLK_DEV_DTC2278 1076config BLK_DEV_DTC2278
1077 tristate "DTC-2278 support" 1077 tristate "DTC-2278 support"
@@ -1079,7 +1079,7 @@ config BLK_DEV_DTC2278
1079 This driver is enabled at runtime using the "dtc2278.probe" kernel 1079 This driver is enabled at runtime using the "dtc2278.probe" kernel
1080 boot parameter. It enables support for the secondary IDE interface 1080 boot parameter. It enables support for the secondary IDE interface
1081 of the DTC-2278 card, and permits faster I/O speeds to be set as 1081 of the DTC-2278 card, and permits faster I/O speeds to be set as
1082 well. See the <file:Documentation/ide.txt> and 1082 well. See the <file:Documentation/ide/ide.txt> and
1083 <file:drivers/ide/legacy/dtc2278.c> files for more info. 1083 <file:drivers/ide/legacy/dtc2278.c> files for more info.
1084 1084
1085config BLK_DEV_HT6560B 1085config BLK_DEV_HT6560B
@@ -1088,7 +1088,7 @@ config BLK_DEV_HT6560B
1088 This driver is enabled at runtime using the "ht6560b.probe" kernel 1088 This driver is enabled at runtime using the "ht6560b.probe" kernel
1089 boot parameter. It enables support for the secondary IDE interface 1089 boot parameter. It enables support for the secondary IDE interface
1090 of the Holtek card, and permits faster I/O speeds to be set as well. 1090 of the Holtek card, and permits faster I/O speeds to be set as well.
1091 See the <file:Documentation/ide.txt> and 1091 See the <file:Documentation/ide/ide.txt> and
1092 <file:drivers/ide/legacy/ht6560b.c> files for more info. 1092 <file:drivers/ide/legacy/ht6560b.c> files for more info.
1093 1093
1094config BLK_DEV_QD65XX 1094config BLK_DEV_QD65XX
@@ -1096,7 +1096,7 @@ config BLK_DEV_QD65XX
1096 help 1096 help
1097 This driver is enabled at runtime using the "qd65xx.probe" kernel 1097 This driver is enabled at runtime using the "qd65xx.probe" kernel
1098 boot parameter. It permits faster I/O speeds to be set. See the 1098 boot parameter. It permits faster I/O speeds to be set. See the
1099 <file:Documentation/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> 1099 <file:Documentation/ide/ide.txt> and <file:drivers/ide/legacy/qd65xx.c>
1100 for more info. 1100 for more info.
1101 1101
1102config BLK_DEV_UMC8672 1102config BLK_DEV_UMC8672
@@ -1105,7 +1105,7 @@ config BLK_DEV_UMC8672
1105 This driver is enabled at runtime using the "umc8672.probe" kernel 1105 This driver is enabled at runtime using the "umc8672.probe" kernel
1106 boot parameter. It enables support for the secondary IDE interface 1106 boot parameter. It enables support for the secondary IDE interface
1107 of the UMC-8672, and permits faster I/O speeds to be set as well. 1107 of the UMC-8672, and permits faster I/O speeds to be set as well.
1108 See the files <file:Documentation/ide.txt> and 1108 See the files <file:Documentation/ide/ide.txt> and
1109 <file:drivers/ide/legacy/umc8672.c> for more info. 1109 <file:drivers/ide/legacy/umc8672.c> for more info.
1110 1110
1111endif 1111endif
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 310e497b5838..c8d0e8715997 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -670,8 +670,8 @@ static void cdrom_buffer_sectors (ide_drive_t *drive, unsigned long sector,
670 * and attempt to recover if there are problems. Returns 0 if everything's 670 * and attempt to recover if there are problems. Returns 0 if everything's
671 * ok; nonzero if the request has been terminated. 671 * ok; nonzero if the request has been terminated.
672 */ 672 */
673static 673static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
674int ide_cd_check_ireason(ide_drive_t *drive, int len, int ireason, int rw) 674 int len, int ireason, int rw)
675{ 675{
676 /* 676 /*
677 * ireason == 0: the drive wants to receive data from us 677 * ireason == 0: the drive wants to receive data from us
@@ -701,6 +701,9 @@ int ide_cd_check_ireason(ide_drive_t *drive, int len, int ireason, int rw)
701 drive->name, __FUNCTION__, ireason); 701 drive->name, __FUNCTION__, ireason);
702 } 702 }
703 703
704 if (rq->cmd_type == REQ_TYPE_ATA_PC)
705 rq->cmd_flags |= REQ_FAILED;
706
704 cdrom_end_request(drive, 0); 707 cdrom_end_request(drive, 0);
705 return -1; 708 return -1;
706} 709}
@@ -1071,11 +1074,11 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1071 /* 1074 /*
1072 * check which way to transfer data 1075 * check which way to transfer data
1073 */ 1076 */
1074 if (blk_fs_request(rq) || blk_pc_request(rq)) { 1077 if (ide_cd_check_ireason(drive, rq, len, ireason, write))
1075 if (ide_cd_check_ireason(drive, len, ireason, write)) 1078 return ide_stopped;
1076 return ide_stopped;
1077 1079
1078 if (blk_fs_request(rq) && write == 0) { 1080 if (blk_fs_request(rq)) {
1081 if (write == 0) {
1079 int nskip; 1082 int nskip;
1080 1083
1081 if (ide_cd_check_transfer_size(drive, len)) { 1084 if (ide_cd_check_transfer_size(drive, len)) {
@@ -1101,16 +1104,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1101 if (ireason == 0) { 1104 if (ireason == 0) {
1102 write = 1; 1105 write = 1;
1103 xferfunc = HWIF(drive)->atapi_output_bytes; 1106 xferfunc = HWIF(drive)->atapi_output_bytes;
1104 } else if (ireason == 2 || (ireason == 1 && 1107 } else {
1105 (blk_fs_request(rq) || blk_pc_request(rq)))) {
1106 write = 0; 1108 write = 0;
1107 xferfunc = HWIF(drive)->atapi_input_bytes; 1109 xferfunc = HWIF(drive)->atapi_input_bytes;
1108 } else {
1109 printk(KERN_ERR "%s: %s: The drive "
1110 "appears confused (ireason = 0x%02x). "
1111 "Trying to recover by ending request.\n",
1112 drive->name, __FUNCTION__, ireason);
1113 goto end_request;
1114 } 1110 }
1115 1111
1116 /* 1112 /*
@@ -1182,11 +1178,10 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1182 else 1178 else
1183 rq->data += blen; 1179 rq->data += blen;
1184 } 1180 }
1181 if (!write && blk_sense_request(rq))
1182 rq->sense_len += blen;
1185 } 1183 }
1186 1184
1187 if (write && blk_sense_request(rq))
1188 rq->sense_len += thislen;
1189
1190 /* 1185 /*
1191 * pad, if necessary 1186 * pad, if necessary
1192 */ 1187 */
@@ -1931,6 +1926,7 @@ static const struct cd_list_entry ide_cd_quirks_list[] = {
1931 { "MATSHITADVD-ROM SR-8186", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, 1926 { "MATSHITADVD-ROM SR-8186", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK },
1932 { "MATSHITADVD-ROM SR-8176", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, 1927 { "MATSHITADVD-ROM SR-8176", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK },
1933 { "MATSHITADVD-ROM SR-8174", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, 1928 { "MATSHITADVD-ROM SR-8174", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK },
1929 { "Optiarc DVD RW AD-5200A", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK },
1934 { NULL, NULL, 0 } 1930 { NULL, NULL, 0 }
1935}; 1931};
1936 1932
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c
index b68284de4e85..6d147ce6782f 100644
--- a/drivers/ide/ide-cd_ioctl.c
+++ b/drivers/ide/ide-cd_ioctl.c
@@ -457,6 +457,10 @@ int ide_cdrom_packet(struct cdrom_device_info *cdi,
457 layer. the packet must be complete, as we do not 457 layer. the packet must be complete, as we do not
458 touch it at all. */ 458 touch it at all. */
459 ide_cd_init_rq(drive, &req); 459 ide_cd_init_rq(drive, &req);
460
461 if (cgc->data_direction == CGC_DATA_WRITE)
462 req.cmd_flags |= REQ_RW;
463
460 memcpy(req.cmd, cgc->cmd, CDROM_PACKET_SIZE); 464 memcpy(req.cmd, cgc->cmd, CDROM_PACKET_SIZE);
461 if (cgc->sense) 465 if (cgc->sense)
462 memset(cgc->sense, 0, sizeof(struct request_sense)); 466 memset(cgc->sense, 0, sizeof(struct request_sense));
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 8f5bed471050..39501d130256 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -867,7 +867,7 @@ static void idedisk_setup (ide_drive_t *drive)
867 867
868 /* Only print cache size when it was specified */ 868 /* Only print cache size when it was specified */
869 if (id->buf_size) 869 if (id->buf_size)
870 printk (" w/%dKiB Cache", id->buf_size/2); 870 printk(KERN_CONT " w/%dKiB Cache", id->buf_size / 2);
871 871
872 printk(KERN_CONT ", CHS=%d/%d/%d\n", 872 printk(KERN_CONT ", CHS=%d/%d/%d\n",
873 drive->bios_cyl, drive->bios_head, drive->bios_sect); 873 drive->bios_cyl, drive->bios_head, drive->bios_sect);
@@ -949,7 +949,8 @@ static void ide_device_shutdown(ide_drive_t *drive)
949 return; 949 return;
950 } 950 }
951 951
952 printk("Shutdown: %s\n", drive->name); 952 printk(KERN_INFO "Shutdown: %s\n", drive->name);
953
953 drive->gendev.bus->suspend(&drive->gendev, PMSG_SUSPEND); 954 drive->gendev.bus->suspend(&drive->gendev, PMSG_SUSPEND);
954} 955}
955 956
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index d0e7b537353e..d61e5788d310 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -1,9 +1,13 @@
1/* 1/*
2 * IDE DMA support (including IDE PCI BM-DMA).
3 *
2 * Copyright (C) 1995-1998 Mark Lord 4 * Copyright (C) 1995-1998 Mark Lord
3 * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> 5 * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
4 * Copyright (C) 2004, 2007 Bartlomiej Zolnierkiewicz 6 * Copyright (C) 2004, 2007 Bartlomiej Zolnierkiewicz
5 * 7 *
6 * May be copied or modified under the terms of the GNU General Public License 8 * May be copied or modified under the terms of the GNU General Public License
9 *
10 * DMA is supported for all IDE devices (disk drives, cdroms, tapes, floppies).
7 */ 11 */
8 12
9/* 13/*
@@ -11,49 +15,6 @@
11 */ 15 */
12 16
13/* 17/*
14 * This module provides support for the bus-master IDE DMA functions
15 * of various PCI chipsets, including the Intel PIIX (i82371FB for
16 * the 430 FX chipset), the PIIX3 (i82371SB for the 430 HX/VX and
17 * 440 chipsets), and the PIIX4 (i82371AB for the 430 TX chipset)
18 * ("PIIX" stands for "PCI ISA IDE Xcellerator").
19 *
20 * Pretty much the same code works for other IDE PCI bus-mastering chipsets.
21 *
22 * DMA is supported for all IDE devices (disk drives, cdroms, tapes, floppies).
23 *
24 * By default, DMA support is prepared for use, but is currently enabled only
25 * for drives which already have DMA enabled (UltraDMA or mode 2 multi/single),
26 * or which are recognized as "good" (see table below). Drives with only mode0
27 * or mode1 (multi/single) DMA should also work with this chipset/driver
28 * (eg. MC2112A) but are not enabled by default.
29 *
30 * Use "hdparm -i" to view modes supported by a given drive.
31 *
32 * The hdparm-3.5 (or later) utility can be used for manually enabling/disabling
33 * DMA support, but must be (re-)compiled against this kernel version or later.
34 *
35 * To enable DMA, use "hdparm -d1 /dev/hd?" on a per-drive basis after booting.
36 * If problems arise, ide.c will disable DMA operation after a few retries.
37 * This error recovery mechanism works and has been extremely well exercised.
38 *
39 * IDE drives, depending on their vintage, may support several different modes
40 * of DMA operation. The boot-time modes are indicated with a "*" in
41 * the "hdparm -i" listing, and can be changed with *knowledgeable* use of
42 * the "hdparm -X" feature. There is seldom a need to do this, as drives
43 * normally power-up with their "best" PIO/DMA modes enabled.
44 *
45 * Testing has been done with a rather extensive number of drives,
46 * with Quantum & Western Digital models generally outperforming the pack,
47 * and Fujitsu & Conner (and some Seagate which are really Conner) drives
48 * showing more lackluster throughput.
49 *
50 * Keep an eye on /var/adm/messages for "DMA disabled" messages.
51 *
52 * Some people have reported trouble with Intel Zappa motherboards.
53 * This can be fixed by upgrading the AMI BIOS to version 1.00.04.BS0,
54 * available from ftp://ftp.intel.com/pub/bios/10004bs0.exe
55 * (thanks to Glen Morrell <glen@spin.Stanford.edu> for researching this).
56 *
57 * Thanks to "Christopher J. Reimer" <reimer@doe.carleton.ca> for 18 * Thanks to "Christopher J. Reimer" <reimer@doe.carleton.ca> for
58 * fixing the problem with the BIOS on some Acer motherboards. 19 * fixing the problem with the BIOS on some Acer motherboards.
59 * 20 *
@@ -65,11 +26,6 @@
65 * 26 *
66 * Most importantly, thanks to Robert Bringman <rob@mars.trion.com> 27 * Most importantly, thanks to Robert Bringman <rob@mars.trion.com>
67 * for supplying a Promise UDMA board & WD UDMA drive for this work! 28 * for supplying a Promise UDMA board & WD UDMA drive for this work!
68 *
69 * And, yes, Intel Zappa boards really *do* use both PIIX IDE ports.
70 *
71 * ATA-66/100 and recovery functions, I forgot the rest......
72 *
73 */ 29 */
74 30
75#include <linux/module.h> 31#include <linux/module.h>
@@ -757,7 +713,7 @@ static int ide_tune_dma(ide_drive_t *drive)
757 } 713 }
758 714
759 if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE) 715 if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
760 return 0; 716 return 1;
761 717
762 if (ide_set_dma_mode(drive, speed)) 718 if (ide_set_dma_mode(drive, speed))
763 return 0; 719 return 0;
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 4a2cb2868226..194ecb0049eb 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -756,7 +756,8 @@ static int ide_probe_port(ide_hwif_t *hwif)
756 756
757 BUG_ON(hwif->present); 757 BUG_ON(hwif->present);
758 758
759 if (hwif->noprobe) 759 if (hwif->noprobe ||
760 (hwif->drives[0].noprobe && hwif->drives[1].noprobe))
760 return -EACCES; 761 return -EACCES;
761 762
762 /* 763 /*
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 0598ecfd5f37..43e0e0557776 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -3765,6 +3765,11 @@ static int ide_tape_probe(ide_drive_t *drive)
3765 g->fops = &idetape_block_ops; 3765 g->fops = &idetape_block_ops;
3766 ide_register_region(g); 3766 ide_register_region(g);
3767 3767
3768 printk(KERN_WARNING "It is possible that this driver does not have any"
3769 " users anymore and, as a result, it will be REMOVED soon."
3770 " Please notify Bart <bzolnier@gmail.com> or Boris"
3771 " <petkovbb@gmail.com> in case you still need it.\n");
3772
3768 return 0; 3773 return 0;
3769 3774
3770out_free_tape: 3775out_free_tape:
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 477833f0daf5..9976f9d627d4 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -590,11 +590,6 @@ void ide_unregister(unsigned int index, int init_default, int restore)
590 hwif->extra_ports = 0; 590 hwif->extra_ports = 0;
591 } 591 }
592 592
593 /*
594 * Note that we only release the standard ports,
595 * and do not even try to handle any extra ports
596 * allocated for weird IDE interface chipsets.
597 */
598 ide_hwif_release_regions(hwif); 593 ide_hwif_release_regions(hwif);
599 594
600 /* copy original settings */ 595 /* copy original settings */
@@ -672,7 +667,6 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
672 667
673 do { 668 do {
674 hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]); 669 hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]);
675 index = hwif->index;
676 if (hwif) 670 if (hwif)
677 goto found; 671 goto found;
678 for (index = 0; index < MAX_HWIFS; index++) 672 for (index = 0; index < MAX_HWIFS; index++)
@@ -680,6 +674,7 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
680 } while (retry--); 674 } while (retry--);
681 return -1; 675 return -1;
682found: 676found:
677 index = hwif->index;
683 if (hwif->present) 678 if (hwif->present)
684 ide_unregister(index, 0, 1); 679 ide_unregister(index, 0, 1);
685 else if (!hwif->hold) 680 else if (!hwif->hold)
@@ -1036,10 +1031,9 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1036 drive->nice1 = (arg >> IDE_NICE_1) & 1; 1031 drive->nice1 = (arg >> IDE_NICE_1) & 1;
1037 return 0; 1032 return 0;
1038 case HDIO_DRIVE_RESET: 1033 case HDIO_DRIVE_RESET:
1039 { 1034 if (!capable(CAP_SYS_ADMIN))
1040 unsigned long flags; 1035 return -EACCES;
1041 if (!capable(CAP_SYS_ADMIN)) return -EACCES; 1036
1042
1043 /* 1037 /*
1044 * Abort the current command on the 1038 * Abort the current command on the
1045 * group if there is one, taking 1039 * group if there is one, taking
@@ -1058,17 +1052,15 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1058 ide_abort(drive, "drive reset"); 1052 ide_abort(drive, "drive reset");
1059 1053
1060 BUG_ON(HWGROUP(drive)->handler); 1054 BUG_ON(HWGROUP(drive)->handler);
1061 1055
1062 /* Ensure nothing gets queued after we 1056 /* Ensure nothing gets queued after we
1063 drop the lock. Reset will clear the busy */ 1057 drop the lock. Reset will clear the busy */
1064 1058
1065 HWGROUP(drive)->busy = 1; 1059 HWGROUP(drive)->busy = 1;
1066 spin_unlock_irqrestore(&ide_lock, flags); 1060 spin_unlock_irqrestore(&ide_lock, flags);
1067 (void) ide_do_reset(drive); 1061 (void) ide_do_reset(drive);
1068 1062
1069 return 0; 1063 return 0;
1070 }
1071
1072 case HDIO_GET_BUSSTATE: 1064 case HDIO_GET_BUSSTATE:
1073 if (!capable(CAP_SYS_ADMIN)) 1065 if (!capable(CAP_SYS_ADMIN))
1074 return -EACCES; 1066 return -EACCES;
@@ -1188,7 +1180,7 @@ static int __initdata is_chipset_set[MAX_HWIFS];
1188 * ide_setup() gets called VERY EARLY during initialization, 1180 * ide_setup() gets called VERY EARLY during initialization,
1189 * to handle kernel "command line" strings beginning with "hdx=" or "ide". 1181 * to handle kernel "command line" strings beginning with "hdx=" or "ide".
1190 * 1182 *
1191 * Remember to update Documentation/ide.txt if you change something here. 1183 * Remember to update Documentation/ide/ide.txt if you change something here.
1192 */ 1184 */
1193static int __init ide_setup(char *s) 1185static int __init ide_setup(char *s)
1194{ 1186{
@@ -1449,7 +1441,7 @@ static int __init ide_setup(char *s)
1449 1441
1450 case -1: /* "noprobe" */ 1442 case -1: /* "noprobe" */
1451 hwif->noprobe = 1; 1443 hwif->noprobe = 1;
1452 goto done; 1444 goto obsolete_option;
1453 1445
1454 case 1: /* base */ 1446 case 1: /* base */
1455 vals[1] = vals[0] + 0x206; /* default ctl */ 1447 vals[1] = vals[0] + 0x206; /* default ctl */
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index bba29df5f21d..2f4f47ad602f 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -334,43 +334,6 @@ static void __init qd6580_port_init_devs(ide_hwif_t *hwif)
334 hwif->drives[1].drive_data = t2; 334 hwif->drives[1].drive_data = t2;
335} 335}
336 336
337/*
338 * qd_unsetup:
339 *
340 * called to unsetup an ata channel : back to default values, unlinks tuning
341 */
342/*
343static void __exit qd_unsetup(ide_hwif_t *hwif)
344{
345 u8 config = hwif->config_data;
346 int base = hwif->select_data;
347 void *set_pio_mode = (void *)hwif->set_pio_mode;
348
349 if (hwif->chipset != ide_qd65xx)
350 return;
351
352 printk(KERN_NOTICE "%s: back to defaults\n", hwif->name);
353
354 hwif->selectproc = NULL;
355 hwif->set_pio_mode = NULL;
356
357 if (set_pio_mode == (void *)qd6500_set_pio_mode) {
358 // will do it for both
359 outb(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
360 } else if (set_pio_mode == (void *)qd6580_set_pio_mode) {
361 if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) {
362 outb(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
363 outb(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1]));
364 } else {
365 outb(hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
366 }
367 } else {
368 printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n");
369 printk(KERN_WARNING "keeping settings !\n");
370 }
371}
372*/
373
374static const struct ide_port_info qd65xx_port_info __initdata = { 337static const struct ide_port_info qd65xx_port_info __initdata = {
375 .chipset = ide_qd65xx, 338 .chipset = ide_qd65xx,
376 .host_flags = IDE_HFLAG_IO_32BIT | 339 .host_flags = IDE_HFLAG_IO_32BIT |
@@ -444,6 +407,8 @@ static int __init qd_probe(int base)
444 printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n", 407 printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n",
445 config, control, QD_ID3); 408 config, control, QD_ID3);
446 409
410 outb(QD_DEF_CONTR, QD_CONTROL_PORT);
411
447 if (control & QD_CONTR_SEC_DISABLED) { 412 if (control & QD_CONTR_SEC_DISABLED) {
448 /* secondary disabled */ 413 /* secondary disabled */
449 414
@@ -460,8 +425,6 @@ static int __init qd_probe(int base)
460 425
461 ide_device_add(idx, &qd65xx_port_info); 426 ide_device_add(idx, &qd65xx_port_info);
462 427
463 outb(QD_DEF_CONTR, QD_CONTROL_PORT);
464
465 return 1; 428 return 1;
466 } else { 429 } else {
467 ide_hwif_t *mate; 430 ide_hwif_t *mate;
@@ -487,8 +450,6 @@ static int __init qd_probe(int base)
487 450
488 ide_device_add(idx, &qd65xx_port_info); 451 ide_device_add(idx, &qd65xx_port_info);
489 452
490 outb(QD_DEF_CONTR, QD_CONTROL_PORT);
491
492 return 0; /* no other qd65xx possible */ 453 return 0; /* no other qd65xx possible */
493 } 454 }
494 } 455 }
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index bd24dad3cfc6..ec667982809c 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -787,7 +787,8 @@ static int __init cmd640x_init(void)
787 /* 787 /*
788 * Try to enable the secondary interface, if not already enabled 788 * Try to enable the secondary interface, if not already enabled
789 */ 789 */
790 if (cmd_hwif1->noprobe) { 790 if (cmd_hwif1->noprobe ||
791 (cmd_hwif1->drives[0].noprobe && cmd_hwif1->drives[1].noprobe)) {
791 port2 = "not probed"; 792 port2 = "not probed";
792 } else { 793 } else {
793 b = get_cmd640_reg(CNTRL); 794 b = get_cmd640_reg(CNTRL);
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index d0f7bb8b8adf..6357bb6269ab 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1570,10 +1570,12 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1570 if (rev < 3) 1570 if (rev < 3)
1571 info = &hpt36x; 1571 info = &hpt36x;
1572 else { 1572 else {
1573 static const struct hpt_info *hpt37x_info[] = 1573 switch (min_t(u8, rev, 6)) {
1574 { &hpt370, &hpt370a, &hpt372, &hpt372n }; 1574 case 3: info = &hpt370; break;
1575 1575 case 4: info = &hpt370a; break;
1576 info = hpt37x_info[min_t(u8, rev, 6) - 3]; 1576 case 5: info = &hpt372; break;
1577 case 6: info = &hpt372n; break;
1578 }
1577 idx++; 1579 idx++;
1578 } 1580 }
1579 break; 1581 break;
@@ -1626,7 +1628,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1626 return ide_setup_pci_device(dev, &d); 1628 return ide_setup_pci_device(dev, &d);
1627} 1629}
1628 1630
1629static const struct pci_device_id hpt366_pci_tbl[] = { 1631static const struct pci_device_id hpt366_pci_tbl[] __devinitconst = {
1630 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 }, 1632 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 },
1631 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 }, 1633 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 },
1632 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 }, 1634 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 },