aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-io.c8
-rw-r--r--drivers/ide/ide-pm.c9
-rw-r--r--include/linux/ide.h2
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 7007c48e27ae..49b098de367c 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -178,11 +178,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
178 kfree(task); 178 kfree(task);
179 } 179 }
180 } else if (blk_pm_request(rq)) { 180 } else if (blk_pm_request(rq)) {
181 struct request_pm_state *pm = rq->data; 181 ide_complete_pm_rq(drive, rq);
182
183 ide_complete_power_step(drive, rq);
184 if (pm->pm_step == IDE_PM_COMPLETED)
185 ide_complete_pm_request(drive, rq);
186 return; 182 return;
187 } 183 }
188 184
@@ -438,7 +434,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
438 startstop = ide_start_power_step(drive, rq); 434 startstop = ide_start_power_step(drive, rq);
439 if (startstop == ide_stopped && 435 if (startstop == ide_stopped &&
440 pm->pm_step == IDE_PM_COMPLETED) 436 pm->pm_step == IDE_PM_COMPLETED)
441 ide_complete_pm_request(drive, rq); 437 ide_complete_pm_rq(drive, rq);
442 return startstop; 438 return startstop;
443 } else if (!rq->rq_disk && blk_special_request(rq)) 439 } else if (!rq->rq_disk && blk_special_request(rq))
444 /* 440 /*
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index 60538d9c84ee..74c7c2bbe0fd 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -169,18 +169,23 @@ out_do_tf:
169} 169}
170 170
171/** 171/**
172 * ide_complete_pm_request - end the current Power Management request 172 * ide_complete_pm_rq - end the current Power Management request
173 * @drive: target drive 173 * @drive: target drive
174 * @rq: request 174 * @rq: request
175 * 175 *
176 * This function cleans up the current PM request and stops the queue 176 * This function cleans up the current PM request and stops the queue
177 * if necessary. 177 * if necessary.
178 */ 178 */
179void ide_complete_pm_request(ide_drive_t *drive, struct request *rq) 179void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq)
180{ 180{
181 struct request_queue *q = drive->queue; 181 struct request_queue *q = drive->queue;
182 struct request_pm_state *pm = rq->data;
182 unsigned long flags; 183 unsigned long flags;
183 184
185 ide_complete_power_step(drive, rq);
186 if (pm->pm_step != IDE_PM_COMPLETED)
187 return;
188
184#ifdef DEBUG_PM 189#ifdef DEBUG_PM
185 printk("%s: completing PM request, %s\n", drive->name, 190 printk("%s: completing PM request, %s\n", drive->name,
186 blk_pm_suspend_request(rq) ? "suspend" : "resume"); 191 blk_pm_suspend_request(rq) ? "suspend" : "resume");
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 675d4363ece4..c5ac19e43fc0 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1081,7 +1081,7 @@ int generic_ide_resume(struct device *);
1081 1081
1082void ide_complete_power_step(ide_drive_t *, struct request *); 1082void ide_complete_power_step(ide_drive_t *, struct request *);
1083ide_startstop_t ide_start_power_step(ide_drive_t *, struct request *); 1083ide_startstop_t ide_start_power_step(ide_drive_t *, struct request *);
1084void ide_complete_pm_request(ide_drive_t *, struct request *); 1084void ide_complete_pm_rq(ide_drive_t *, struct request *);
1085void ide_check_pm_state(ide_drive_t *, struct request *); 1085void ide_check_pm_state(ide_drive_t *, struct request *);
1086 1086
1087/* 1087/*