aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
committerJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
commitec98ce480ada787f2cfbd696980ff3564415505b (patch)
tree1a4d644b38f9f1e4b4e086fde0b195df4a92cf84 /drivers/ide/ide-io.c
parent3496f92beb9aa99ef21fccc154a36c7698e9c538 (diff)
parentfeaf3848a813a106f163013af6fcf6c4bfec92d9 (diff)
Merge branch 'master' into next
Conflicts: fs/nfsd/nfs4recover.c Manually fixed above to use new creds API functions, e.g. nfs4_save_creds(). Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 7162d67562a..7d275b2af3e 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -132,10 +132,14 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
132} 132}
133EXPORT_SYMBOL(ide_end_request); 133EXPORT_SYMBOL(ide_end_request);
134 134
135static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error) 135static void ide_complete_power_step(ide_drive_t *drive, struct request *rq)
136{ 136{
137 struct request_pm_state *pm = rq->data; 137 struct request_pm_state *pm = rq->data;
138 138
139#ifdef DEBUG_PM
140 printk(KERN_INFO "%s: complete_power_step(step: %d)\n",
141 drive->name, pm->pm_step);
142#endif
139 if (drive->media != ide_disk) 143 if (drive->media != ide_disk)
140 return; 144 return;
141 145
@@ -172,7 +176,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
172 /* Not supported? Switch to next step now. */ 176 /* Not supported? Switch to next step now. */
173 if (ata_id_flush_enabled(drive->id) == 0 || 177 if (ata_id_flush_enabled(drive->id) == 0 ||
174 (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) { 178 (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) {
175 ide_complete_power_step(drive, rq, 0, 0); 179 ide_complete_power_step(drive, rq);
176 return ide_stopped; 180 return ide_stopped;
177 } 181 }
178 if (ata_id_flush_ext_enabled(drive->id)) 182 if (ata_id_flush_ext_enabled(drive->id))
@@ -191,7 +195,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
191 if (drive->media != ide_disk) 195 if (drive->media != ide_disk)
192 pm->pm_step = IDE_PM_RESTORE_DMA; 196 pm->pm_step = IDE_PM_RESTORE_DMA;
193 else 197 else
194 ide_complete_power_step(drive, rq, 0, 0); 198 ide_complete_power_step(drive, rq);
195 return ide_stopped; 199 return ide_stopped;
196 case IDE_PM_IDLE: /* Resume step 2 (idle) */ 200 case IDE_PM_IDLE: /* Resume step 2 (idle) */
197 args->tf.command = ATA_CMD_IDLEIMMEDIATE; 201 args->tf.command = ATA_CMD_IDLEIMMEDIATE;
@@ -204,10 +208,8 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
204 */ 208 */
205 if (drive->hwif->dma_ops == NULL) 209 if (drive->hwif->dma_ops == NULL)
206 break; 210 break;
207 /* 211 if (drive->dev_flags & IDE_DFLAG_USING_DMA)
208 * TODO: respect IDE_DFLAG_USING_DMA 212 ide_set_dma(drive);
209 */
210 ide_set_dma(drive);
211 break; 213 break;
212 } 214 }
213 215
@@ -322,11 +324,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
322 } 324 }
323 } else if (blk_pm_request(rq)) { 325 } else if (blk_pm_request(rq)) {
324 struct request_pm_state *pm = rq->data; 326 struct request_pm_state *pm = rq->data;
325#ifdef DEBUG_PM 327
326 printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n", 328 ide_complete_power_step(drive, rq);
327 drive->name, rq->pm->pm_step, stat, err);
328#endif
329 ide_complete_power_step(drive, rq, stat, err);
330 if (pm->pm_step == IDE_PM_COMPLETED) 329 if (pm->pm_step == IDE_PM_COMPLETED)
331 ide_complete_pm_request(drive, rq); 330 ide_complete_pm_request(drive, rq);
332 return; 331 return;
@@ -804,7 +803,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
804 struct request_pm_state *pm = rq->data; 803 struct request_pm_state *pm = rq->data;
805#ifdef DEBUG_PM 804#ifdef DEBUG_PM
806 printk("%s: start_power_step(step: %d)\n", 805 printk("%s: start_power_step(step: %d)\n",
807 drive->name, rq->pm->pm_step); 806 drive->name, pm->pm_step);
808#endif 807#endif
809 startstop = ide_start_power_step(drive, rq); 808 startstop = ide_start_power_step(drive, rq);
810 if (startstop == ide_stopped && 809 if (startstop == ide_stopped &&
@@ -967,14 +966,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
967 ide_startstop_t startstop; 966 ide_startstop_t startstop;
968 int loops = 0; 967 int loops = 0;
969 968
970 /* for atari only: POSSIBLY BROKEN HERE(?) */
971 ide_get_lock(ide_intr, hwgroup);
972
973 /* caller must own ide_lock */ 969 /* caller must own ide_lock */
974 BUG_ON(!irqs_disabled()); 970 BUG_ON(!irqs_disabled());
975 971
976 while (!hwgroup->busy) { 972 while (!hwgroup->busy) {
977 hwgroup->busy = 1; 973 hwgroup->busy = 1;
974 /* for atari only */
975 ide_get_lock(ide_intr, hwgroup);
978 drive = choose_drive(hwgroup); 976 drive = choose_drive(hwgroup);
979 if (drive == NULL) { 977 if (drive == NULL) {
980 int sleeping = 0; 978 int sleeping = 0;