aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c8
-rw-r--r--drivers/ide/ide-dma.c6
-rw-r--r--drivers/ide/ide-floppy.c12
-rw-r--r--drivers/ide/ide-io.c91
-rw-r--r--drivers/ide/ide-iops.c12
-rw-r--r--drivers/ide/ide-lib.c3
-rw-r--r--drivers/ide/ide-taskfile.c3
-rw-r--r--drivers/ide/ide.c8
-rw-r--r--drivers/ide/legacy/q40ide.c1
-rw-r--r--drivers/ide/pci/sgiioc4.c6
-rw-r--r--drivers/ide/pci/trm290.c3
11 files changed, 81 insertions, 72 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index b4a41d6d0714..6de3cd3d6e8e 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1451,9 +1451,12 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
1451 } else { 1451 } else {
1452confused: 1452confused:
1453 printk (KERN_ERR "%s: cdrom_pc_intr: The drive " 1453 printk (KERN_ERR "%s: cdrom_pc_intr: The drive "
1454 "appears confused (ireason = 0x%02x)\n", 1454 "appears confused (ireason = 0x%02x). "
1455 "Trying to recover by ending request.\n",
1455 drive->name, ireason); 1456 drive->name, ireason);
1456 rq->flags |= REQ_FAILED; 1457 rq->flags |= REQ_FAILED;
1458 cdrom_end_request(drive, 0);
1459 return ide_stopped;
1457 } 1460 }
1458 1461
1459 /* Now we wait for another interrupt. */ 1462 /* Now we wait for another interrupt. */
@@ -1722,8 +1725,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1722 } 1725 }
1723 } 1726 }
1724 1727
1725 if (HWGROUP(drive)->handler != NULL) 1728 BUG_ON(HWGROUP(drive)->handler != NULL);
1726 BUG();
1727 1729
1728 ide_set_handler(drive, cdrom_newpc_intr, rq->timeout, NULL); 1730 ide_set_handler(drive, cdrom_newpc_intr, rq->timeout, NULL);
1729 return ide_started; 1731 return ide_started;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index c481be8b807f..783a2475ee8b 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -206,8 +206,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
206 ide_hwif_t *hwif = HWIF(drive); 206 ide_hwif_t *hwif = HWIF(drive);
207 struct scatterlist *sg = hwif->sg_table; 207 struct scatterlist *sg = hwif->sg_table;
208 208
209 if ((rq->flags & REQ_DRIVE_TASKFILE) && rq->nr_sectors > 256) 209 BUG_ON((rq->flags & REQ_DRIVE_TASKFILE) && rq->nr_sectors > 256);
210 BUG();
211 210
212 ide_map_sg(drive, rq); 211 ide_map_sg(drive, rq);
213 212
@@ -947,8 +946,7 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
947 } 946 }
948 printk("\n"); 947 printk("\n");
949 948
950 if (!(hwif->dma_master)) 949 BUG_ON(!hwif->dma_master);
951 BUG();
952} 950}
953 951
954EXPORT_SYMBOL_GPL(ide_setup_dma); 952EXPORT_SYMBOL_GPL(ide_setup_dma);
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index a53e3ce4a142..a1179e924962 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -898,8 +898,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
898 "to send us more data than expected " 898 "to send us more data than expected "
899 "- discarding data\n"); 899 "- discarding data\n");
900 idefloppy_discard_data(drive,bcount.all); 900 idefloppy_discard_data(drive,bcount.all);
901 if (HWGROUP(drive)->handler != NULL) 901 BUG_ON(HWGROUP(drive)->handler != NULL);
902 BUG();
903 ide_set_handler(drive, 902 ide_set_handler(drive,
904 &idefloppy_pc_intr, 903 &idefloppy_pc_intr,
905 IDEFLOPPY_WAIT_CMD, 904 IDEFLOPPY_WAIT_CMD,
@@ -932,8 +931,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
932 pc->actually_transferred += bcount.all; 931 pc->actually_transferred += bcount.all;
933 pc->current_position += bcount.all; 932 pc->current_position += bcount.all;
934 933
935 if (HWGROUP(drive)->handler != NULL) 934 BUG_ON(HWGROUP(drive)->handler != NULL);
936 BUG();
937 ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); /* And set the interrupt handler again */ 935 ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); /* And set the interrupt handler again */
938 return ide_started; 936 return ide_started;
939} 937}
@@ -960,8 +958,7 @@ static ide_startstop_t idefloppy_transfer_pc (ide_drive_t *drive)
960 "issuing a packet command\n"); 958 "issuing a packet command\n");
961 return ide_do_reset(drive); 959 return ide_do_reset(drive);
962 } 960 }
963 if (HWGROUP(drive)->handler != NULL) 961 BUG_ON(HWGROUP(drive)->handler != NULL);
964 BUG();
965 /* Set the interrupt routine */ 962 /* Set the interrupt routine */
966 ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); 963 ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL);
967 /* Send the actual packet */ 964 /* Send the actual packet */
@@ -1017,8 +1014,7 @@ static ide_startstop_t idefloppy_transfer_pc1 (ide_drive_t *drive)
1017 * 40 and 50msec work well. idefloppy_pc_intr will not be actually 1014 * 40 and 50msec work well. idefloppy_pc_intr will not be actually
1018 * used until after the packet is moved in about 50 msec. 1015 * used until after the packet is moved in about 50 msec.
1019 */ 1016 */
1020 if (HWGROUP(drive)->handler != NULL) 1017 BUG_ON(HWGROUP(drive)->handler != NULL);
1021 BUG();
1022 ide_set_handler(drive, 1018 ide_set_handler(drive,
1023 &idefloppy_pc_intr, /* service routine for packet command */ 1019 &idefloppy_pc_intr, /* service routine for packet command */
1024 floppy->ticks, /* wait this long before "failing" */ 1020 floppy->ticks, /* wait this long before "failing" */
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c01615dec202..4f2f138de2ca 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -142,38 +142,41 @@ enum {
142 142
143static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error) 143static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error)
144{ 144{
145 struct request_pm_state *pm = rq->end_io_data;
146
145 if (drive->media != ide_disk) 147 if (drive->media != ide_disk)
146 return; 148 return;
147 149
148 switch (rq->pm->pm_step) { 150 switch (pm->pm_step) {
149 case ide_pm_flush_cache: /* Suspend step 1 (flush cache) complete */ 151 case ide_pm_flush_cache: /* Suspend step 1 (flush cache) complete */
150 if (rq->pm->pm_state == PM_EVENT_FREEZE) 152 if (pm->pm_state == PM_EVENT_FREEZE)
151 rq->pm->pm_step = ide_pm_state_completed; 153 pm->pm_step = ide_pm_state_completed;
152 else 154 else
153 rq->pm->pm_step = idedisk_pm_standby; 155 pm->pm_step = idedisk_pm_standby;
154 break; 156 break;
155 case idedisk_pm_standby: /* Suspend step 2 (standby) complete */ 157 case idedisk_pm_standby: /* Suspend step 2 (standby) complete */
156 rq->pm->pm_step = ide_pm_state_completed; 158 pm->pm_step = ide_pm_state_completed;
157 break; 159 break;
158 case idedisk_pm_idle: /* Resume step 1 (idle) complete */ 160 case idedisk_pm_idle: /* Resume step 1 (idle) complete */
159 rq->pm->pm_step = ide_pm_restore_dma; 161 pm->pm_step = ide_pm_restore_dma;
160 break; 162 break;
161 } 163 }
162} 164}
163 165
164static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) 166static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
165{ 167{
168 struct request_pm_state *pm = rq->end_io_data;
166 ide_task_t *args = rq->special; 169 ide_task_t *args = rq->special;
167 170
168 memset(args, 0, sizeof(*args)); 171 memset(args, 0, sizeof(*args));
169 172
170 if (drive->media != ide_disk) { 173 if (drive->media != ide_disk) {
171 /* skip idedisk_pm_idle for ATAPI devices */ 174 /* skip idedisk_pm_idle for ATAPI devices */
172 if (rq->pm->pm_step == idedisk_pm_idle) 175 if (pm->pm_step == idedisk_pm_idle)
173 rq->pm->pm_step = ide_pm_restore_dma; 176 pm->pm_step = ide_pm_restore_dma;
174 } 177 }
175 178
176 switch (rq->pm->pm_step) { 179 switch (pm->pm_step) {
177 case ide_pm_flush_cache: /* Suspend step 1 (flush cache) */ 180 case ide_pm_flush_cache: /* Suspend step 1 (flush cache) */
178 if (drive->media != ide_disk) 181 if (drive->media != ide_disk)
179 break; 182 break;
@@ -215,7 +218,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
215 drive->hwif->ide_dma_check(drive); 218 drive->hwif->ide_dma_check(drive);
216 break; 219 break;
217 } 220 }
218 rq->pm->pm_step = ide_pm_state_completed; 221 pm->pm_step = ide_pm_state_completed;
219 return ide_stopped; 222 return ide_stopped;
220} 223}
221 224
@@ -362,12 +365,13 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
362 } 365 }
363 } 366 }
364 } else if (blk_pm_request(rq)) { 367 } else if (blk_pm_request(rq)) {
368 struct request_pm_state *pm = rq->end_io_data;
365#ifdef DEBUG_PM 369#ifdef DEBUG_PM
366 printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n", 370 printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n",
367 drive->name, rq->pm->pm_step, stat, err); 371 drive->name, rq->pm->pm_step, stat, err);
368#endif 372#endif
369 ide_complete_power_step(drive, rq, stat, err); 373 ide_complete_power_step(drive, rq, stat, err);
370 if (rq->pm->pm_step == ide_pm_state_completed) 374 if (pm->pm_step == ide_pm_state_completed)
371 ide_complete_pm_request(drive, rq); 375 ide_complete_pm_request(drive, rq);
372 return; 376 return;
373 } 377 }
@@ -871,6 +875,39 @@ done:
871 return ide_stopped; 875 return ide_stopped;
872} 876}
873 877
878static void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
879{
880 struct request_pm_state *pm = rq->end_io_data;
881
882 if (blk_pm_suspend_request(rq) &&
883 pm->pm_step == ide_pm_state_start_suspend)
884 /* Mark drive blocked when starting the suspend sequence. */
885 drive->blocked = 1;
886 else if (blk_pm_resume_request(rq) &&
887 pm->pm_step == ide_pm_state_start_resume) {
888 /*
889 * The first thing we do on wakeup is to wait for BSY bit to
890 * go away (with a looong timeout) as a drive on this hwif may
891 * just be POSTing itself.
892 * We do that before even selecting as the "other" device on
893 * the bus may be broken enough to walk on our toes at this
894 * point.
895 */
896 int rc;
897#ifdef DEBUG_PM
898 printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name);
899#endif
900 rc = ide_wait_not_busy(HWIF(drive), 35000);
901 if (rc)
902 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
903 SELECT_DRIVE(drive);
904 HWIF(drive)->OUTB(8, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]);
905 rc = ide_wait_not_busy(HWIF(drive), 10000);
906 if (rc)
907 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
908 }
909}
910
874/** 911/**
875 * start_request - start of I/O and command issuing for IDE 912 * start_request - start of I/O and command issuing for IDE
876 * 913 *
@@ -909,33 +946,8 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
909 if (block == 0 && drive->remap_0_to_1 == 1) 946 if (block == 0 && drive->remap_0_to_1 == 1)
910 block = 1; /* redirect MBR access to EZ-Drive partn table */ 947 block = 1; /* redirect MBR access to EZ-Drive partn table */
911 948
912 if (blk_pm_suspend_request(rq) && 949 if (blk_pm_request(rq))
913 rq->pm->pm_step == ide_pm_state_start_suspend) 950 ide_check_pm_state(drive, rq);
914 /* Mark drive blocked when starting the suspend sequence. */
915 drive->blocked = 1;
916 else if (blk_pm_resume_request(rq) &&
917 rq->pm->pm_step == ide_pm_state_start_resume) {
918 /*
919 * The first thing we do on wakeup is to wait for BSY bit to
920 * go away (with a looong timeout) as a drive on this hwif may
921 * just be POSTing itself.
922 * We do that before even selecting as the "other" device on
923 * the bus may be broken enough to walk on our toes at this
924 * point.
925 */
926 int rc;
927#ifdef DEBUG_PM
928 printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name);
929#endif
930 rc = ide_wait_not_busy(HWIF(drive), 35000);
931 if (rc)
932 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
933 SELECT_DRIVE(drive);
934 HWIF(drive)->OUTB(8, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]);
935 rc = ide_wait_not_busy(HWIF(drive), 10000);
936 if (rc)
937 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
938 }
939 951
940 SELECT_DRIVE(drive); 952 SELECT_DRIVE(drive);
941 if (ide_wait_stat(&startstop, drive, drive->ready_stat, BUSY_STAT|DRQ_STAT, WAIT_READY)) { 953 if (ide_wait_stat(&startstop, drive, drive->ready_stat, BUSY_STAT|DRQ_STAT, WAIT_READY)) {
@@ -950,13 +962,14 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
950 else if (rq->flags & REQ_DRIVE_TASKFILE) 962 else if (rq->flags & REQ_DRIVE_TASKFILE)
951 return execute_drive_cmd(drive, rq); 963 return execute_drive_cmd(drive, rq);
952 else if (blk_pm_request(rq)) { 964 else if (blk_pm_request(rq)) {
965 struct request_pm_state *pm = rq->end_io_data;
953#ifdef DEBUG_PM 966#ifdef DEBUG_PM
954 printk("%s: start_power_step(step: %d)\n", 967 printk("%s: start_power_step(step: %d)\n",
955 drive->name, rq->pm->pm_step); 968 drive->name, rq->pm->pm_step);
956#endif 969#endif
957 startstop = ide_start_power_step(drive, rq); 970 startstop = ide_start_power_step(drive, rq);
958 if (startstop == ide_stopped && 971 if (startstop == ide_stopped &&
959 rq->pm->pm_step == ide_pm_state_completed) 972 pm->pm_step == ide_pm_state_completed)
960 ide_complete_pm_request(drive, rq); 973 ide_complete_pm_request(drive, rq);
961 return startstop; 974 return startstop;
962 } 975 }
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index b72dde70840a..97a49e77a8f1 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -939,8 +939,7 @@ void ide_execute_command(ide_drive_t *drive, task_ioreg_t cmd, ide_handler_t *ha
939 939
940 spin_lock_irqsave(&ide_lock, flags); 940 spin_lock_irqsave(&ide_lock, flags);
941 941
942 if(hwgroup->handler) 942 BUG_ON(hwgroup->handler);
943 BUG();
944 hwgroup->handler = handler; 943 hwgroup->handler = handler;
945 hwgroup->expiry = expiry; 944 hwgroup->expiry = expiry;
946 hwgroup->timer.expires = jiffies + timeout; 945 hwgroup->timer.expires = jiffies + timeout;
@@ -981,8 +980,7 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive)
981 printk("%s: ATAPI reset complete\n", drive->name); 980 printk("%s: ATAPI reset complete\n", drive->name);
982 } else { 981 } else {
983 if (time_before(jiffies, hwgroup->poll_timeout)) { 982 if (time_before(jiffies, hwgroup->poll_timeout)) {
984 if (HWGROUP(drive)->handler != NULL) 983 BUG_ON(HWGROUP(drive)->handler != NULL);
985 BUG();
986 ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL); 984 ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL);
987 /* continue polling */ 985 /* continue polling */
988 return ide_started; 986 return ide_started;
@@ -1021,8 +1019,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
1021 1019
1022 if (!OK_STAT(tmp = hwif->INB(IDE_STATUS_REG), 0, BUSY_STAT)) { 1020 if (!OK_STAT(tmp = hwif->INB(IDE_STATUS_REG), 0, BUSY_STAT)) {
1023 if (time_before(jiffies, hwgroup->poll_timeout)) { 1021 if (time_before(jiffies, hwgroup->poll_timeout)) {
1024 if (HWGROUP(drive)->handler != NULL) 1022 BUG_ON(HWGROUP(drive)->handler != NULL);
1025 BUG();
1026 ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL); 1023 ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
1027 /* continue polling */ 1024 /* continue polling */
1028 return ide_started; 1025 return ide_started;
@@ -1138,8 +1135,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
1138 hwgroup = HWGROUP(drive); 1135 hwgroup = HWGROUP(drive);
1139 1136
1140 /* We must not reset with running handlers */ 1137 /* We must not reset with running handlers */
1141 if(hwgroup->handler != NULL) 1138 BUG_ON(hwgroup->handler != NULL);
1142 BUG();
1143 1139
1144 /* For an ATAPI device, first try an ATAPI SRST. */ 1140 /* For an ATAPI device, first try an ATAPI SRST. */
1145 if (drive->media != ide_disk && !do_not_try_atapi) { 1141 if (drive->media != ide_disk && !do_not_try_atapi) {
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 41d46dbe6c24..16a143133f93 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -164,8 +164,7 @@ u8 ide_rate_filter (u8 mode, u8 speed)
164// printk("%s: mode 0x%02x, speed 0x%02x\n", __FUNCTION__, mode, speed); 164// printk("%s: mode 0x%02x, speed 0x%02x\n", __FUNCTION__, mode, speed);
165 165
166 /* So that we remember to update this if new modes appear */ 166 /* So that we remember to update this if new modes appear */
167 if (mode > 4) 167 BUG_ON(mode > 4);
168 BUG();
169 return min(speed, speed_max[mode]); 168 return min(speed, speed_max[mode]);
170#else /* !CONFIG_BLK_DEV_IDEDMA */ 169#else /* !CONFIG_BLK_DEV_IDEDMA */
171 return min(speed, (u8)XFER_PIO_4); 170 return min(speed, (u8)XFER_PIO_4);
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 9233b8109a0f..a839b2a8f6f4 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -196,8 +196,7 @@ ide_startstop_t set_geometry_intr (ide_drive_t *drive)
196 if (stat & (ERR_STAT|DRQ_STAT)) 196 if (stat & (ERR_STAT|DRQ_STAT))
197 return ide_error(drive, "set_geometry_intr", stat); 197 return ide_error(drive, "set_geometry_intr", stat);
198 198
199 if (HWGROUP(drive)->handler != NULL) 199 BUG_ON(HWGROUP(drive)->handler != NULL);
200 BUG();
201 ide_set_handler(drive, &set_geometry_intr, WAIT_WORSTCASE, NULL); 200 ide_set_handler(drive, &set_geometry_intr, WAIT_WORSTCASE, NULL);
202 return ide_started; 201 return ide_started;
203} 202}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 3fdab563fec2..59fe358048b3 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -726,6 +726,7 @@ void ide_setup_ports ( hw_regs_t *hw,
726{ 726{
727 int i; 727 int i;
728 728
729 memset(hw, 0, sizeof(hw_regs_t));
729 for (i = 0; i < IDE_NR_PORTS; i++) { 730 for (i = 0; i < IDE_NR_PORTS; i++) {
730 if (offsets[i] == -1) { 731 if (offsets[i] == -1) {
731 switch(i) { 732 switch(i) {
@@ -1225,7 +1226,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t state)
1225 memset(&args, 0, sizeof(args)); 1226 memset(&args, 0, sizeof(args));
1226 rq.flags = REQ_PM_SUSPEND; 1227 rq.flags = REQ_PM_SUSPEND;
1227 rq.special = &args; 1228 rq.special = &args;
1228 rq.pm = &rqpm; 1229 rq.end_io_data = &rqpm;
1229 rqpm.pm_step = ide_pm_state_start_suspend; 1230 rqpm.pm_step = ide_pm_state_start_suspend;
1230 rqpm.pm_state = state.event; 1231 rqpm.pm_state = state.event;
1231 1232
@@ -1244,7 +1245,7 @@ static int generic_ide_resume(struct device *dev)
1244 memset(&args, 0, sizeof(args)); 1245 memset(&args, 0, sizeof(args));
1245 rq.flags = REQ_PM_RESUME; 1246 rq.flags = REQ_PM_RESUME;
1246 rq.special = &args; 1247 rq.special = &args;
1247 rq.pm = &rqpm; 1248 rq.end_io_data = &rqpm;
1248 rqpm.pm_step = ide_pm_state_start_resume; 1249 rqpm.pm_step = ide_pm_state_start_resume;
1249 rqpm.pm_state = PM_EVENT_ON; 1250 rqpm.pm_state = PM_EVENT_ON;
1250 1251
@@ -1366,8 +1367,7 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1366 1367
1367 ide_abort(drive, "drive reset"); 1368 ide_abort(drive, "drive reset");
1368 1369
1369 if(HWGROUP(drive)->handler) 1370 BUG_ON(HWGROUP(drive)->handler);
1370 BUG();
1371 1371
1372 /* Ensure nothing gets queued after we 1372 /* Ensure nothing gets queued after we
1373 drop the lock. Reset will clear the busy */ 1373 drop the lock. Reset will clear the busy */
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 2a78b792f7fb..434a94faa3b7 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -80,6 +80,7 @@ void q40_ide_setup_ports ( hw_regs_t *hw,
80{ 80{
81 int i; 81 int i;
82 82
83 memset(hw, 0, sizeof(hw_regs_t));
83 for (i = 0; i < IDE_NR_PORTS; i++) { 84 for (i = 0; i < IDE_NR_PORTS; i++) {
84 /* BIG FAT WARNING: 85 /* BIG FAT WARNING:
85 assumption: only DATA port is ever used in 16 bit mode */ 86 assumption: only DATA port is ever used in 16 bit mode */
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 27c9eb989a9a..e125032bb403 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -723,6 +723,12 @@ static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
723int 723int
724ioc4_ide_attach_one(struct ioc4_driver_data *idd) 724ioc4_ide_attach_one(struct ioc4_driver_data *idd)
725{ 725{
726 /* PCI-RT does not bring out IDE connection.
727 * Do not attach to this particular IOC4.
728 */
729 if (idd->idd_variant == IOC4_VARIANT_PCI_RT)
730 return 0;
731
726 return pci_init_sgiioc4(idd->idd_pdev, 732 return pci_init_sgiioc4(idd->idd_pdev,
727 &sgiioc4_chipsets[idd->idd_pci_id->driver_data]); 733 &sgiioc4_chipsets[idd->idd_pci_id->driver_data]);
728} 734}
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index c26c8ca90dd4..fe80295974e1 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -183,8 +183,7 @@ static void trm290_ide_dma_exec_cmd(ide_drive_t *drive, u8 command)
183{ 183{
184 ide_hwif_t *hwif = HWIF(drive); 184 ide_hwif_t *hwif = HWIF(drive);
185 185
186 if (HWGROUP(drive)->handler != NULL) /* paranoia check */ 186 BUG_ON(HWGROUP(drive)->handler != NULL); /* paranoia check */
187 BUG();
188 ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); 187 ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL);
189 /* issue cmd to drive */ 188 /* issue cmd to drive */
190 hwif->OUTB(command, IDE_COMMAND_REG); 189 hwif->OUTB(command, IDE_COMMAND_REG);