Source
194
194
* @drive: target drive
195
195
* @rq: request
196
196
*
197
197
* This function cleans up the current PM request and stops the queue
198
198
* if necessary.
199
199
*/
200
200
void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq)
201
201
{
202
202
struct request_queue *q = drive->queue;
203
203
struct ide_pm_state *pm = ide_req(rq)->special;
204
-
unsigned long flags;
205
204
206
205
ide_complete_power_step(drive, rq);
207
206
if (pm->pm_step != IDE_PM_COMPLETED)
208
207
return;
209
208
210
209
#ifdef DEBUG_PM
211
210
printk("%s: completing PM request, %s\n", drive->name,
212
211
(ide_req(rq)->type == ATA_PRIV_PM_SUSPEND) ? "suspend" : "resume");
213
212
#endif
214
-
spin_lock_irqsave(&q->queue_lock, flags);
215
213
if (ide_req(rq)->type == ATA_PRIV_PM_SUSPEND)
216
214
blk_mq_stop_hw_queues(q);
217
215
else
218
216
drive->dev_flags &= ~IDE_DFLAG_BLOCKED;
219
-
spin_unlock_irqrestore(&q->queue_lock, flags);
220
217
221
218
drive->hwif->rq = NULL;
222
219
223
220
blk_mq_end_request(rq, BLK_STS_OK);
224
221
}
225
222
226
223
void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
227
224
{
228
225
struct ide_pm_state *pm = ide_req(rq)->special;
229
226