aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-cd.c2
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/ide/ide-io.c40
-rw-r--r--drivers/ide/ide-tape.c2
-rw-r--r--drivers/scsi/ide-scsi.c3
-rw-r--r--include/linux/ide.h12
6 files changed, 15 insertions, 46 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 0fbc2d8d0d53..043129c422fe 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -213,7 +213,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
213 /* NOTE! Save the failed command in "rq->buffer" */ 213 /* NOTE! Save the failed command in "rq->buffer" */
214 rq->buffer = (void *) failed_command; 214 rq->buffer = (void *) failed_command;
215 215
216 (void) ide_do_drive_cmd(drive, rq, ide_preempt); 216 ide_do_drive_cmd(drive, rq);
217} 217}
218 218
219static void cdrom_end_request(ide_drive_t *drive, int uptodate) 219static void cdrom_end_request(ide_drive_t *drive, int uptodate)
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 1852008d9ee4..53209a473937 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -291,7 +291,7 @@ static void idefloppy_queue_pc_head(ide_drive_t *drive, struct ide_atapi_pc *pc,
291 rq->cmd_type = REQ_TYPE_SPECIAL; 291 rq->cmd_type = REQ_TYPE_SPECIAL;
292 rq->cmd_flags |= REQ_PREEMPT; 292 rq->cmd_flags |= REQ_PREEMPT;
293 rq->rq_disk = floppy->disk; 293 rq->rq_disk = floppy->disk;
294 (void) ide_do_drive_cmd(drive, rq, ide_preempt); 294 ide_do_drive_cmd(drive, rq);
295} 295}
296 296
297static struct ide_atapi_pc *idefloppy_next_pc_storage(ide_drive_t *drive) 297static struct ide_atapi_pc *idefloppy_next_pc_storage(ide_drive_t *drive)
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c28fcdf0ee9e..28057747c1f8 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1520,49 +1520,27 @@ irqreturn_t ide_intr (int irq, void *dev_id)
1520 * ide_do_drive_cmd - issue IDE special command 1520 * ide_do_drive_cmd - issue IDE special command
1521 * @drive: device to issue command 1521 * @drive: device to issue command
1522 * @rq: request to issue 1522 * @rq: request to issue
1523 * @action: action for processing
1524 * 1523 *
1525 * This function issues a special IDE device request 1524 * This function issues a special IDE device request
1526 * onto the request queue. 1525 * onto the request queue.
1527 * 1526 *
1528 * If action is ide_wait, then the rq is queued at the end of the 1527 * the rq is queued at the head of the request queue, displacing
1529 * request queue, and the function sleeps until it has been processed. 1528 * the currently-being-processed request and this function
1530 * This is for use when invoked from an ioctl handler. 1529 * returns immediately without waiting for the new rq to be
1531 * 1530 * completed. This is VERY DANGEROUS, and is intended for
1532 * If action is ide_preempt, then the rq is queued at the head of 1531 * careful use by the ATAPI tape/cdrom driver code.
1533 * the request queue, displacing the currently-being-processed
1534 * request and this function returns immediately without waiting
1535 * for the new rq to be completed. This is VERY DANGEROUS, and is
1536 * intended for careful use by the ATAPI tape/cdrom driver code.
1537 *
1538 * If action is ide_end, then the rq is queued at the end of the
1539 * request queue, and the function returns immediately without waiting
1540 * for the new rq to be completed. This is again intended for careful
1541 * use by the ATAPI tape/cdrom driver code.
1542 */ 1532 */
1543 1533
1544int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t action) 1534void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
1545{ 1535{
1546 unsigned long flags; 1536 unsigned long flags;
1547 ide_hwgroup_t *hwgroup = HWGROUP(drive); 1537 ide_hwgroup_t *hwgroup = HWGROUP(drive);
1548 int where = ELEVATOR_INSERT_BACK;
1549
1550 rq->errors = 0;
1551
1552 if (action == ide_preempt)
1553 where = ELEVATOR_INSERT_FRONT;
1554 1538
1555 spin_lock_irqsave(&ide_lock, flags); 1539 spin_lock_irqsave(&ide_lock, flags);
1556 if (action == ide_preempt) 1540 hwgroup->rq = NULL;
1557 hwgroup->rq = NULL; 1541 __elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 1);
1558 __elv_add_request(drive->queue, rq, where, 1);
1559 __generic_unplug_device(drive->queue); 1542 __generic_unplug_device(drive->queue);
1560 /* the queue is stopped so it won't be plugged+unplugged */
1561 if (blk_pm_resume_request(rq))
1562 do_ide_request(drive->queue);
1563 spin_unlock_irqrestore(&ide_lock, flags); 1543 spin_unlock_irqrestore(&ide_lock, flags);
1564
1565 return 0;
1566} 1544}
1567 1545
1568EXPORT_SYMBOL(ide_do_drive_cmd); 1546EXPORT_SYMBOL(ide_do_drive_cmd);
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index cc7991c7c252..a562df820777 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -691,7 +691,7 @@ static void idetape_queue_pc_head(ide_drive_t *drive, struct ide_atapi_pc *pc,
691 rq->cmd_flags |= REQ_PREEMPT; 691 rq->cmd_flags |= REQ_PREEMPT;
692 rq->buffer = (char *) pc; 692 rq->buffer = (char *) pc;
693 rq->rq_disk = tape->disk; 693 rq->rq_disk = tape->disk;
694 (void) ide_do_drive_cmd(drive, rq, ide_preempt); 694 ide_do_drive_cmd(drive, rq);
695} 695}
696 696
697/* 697/*
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 58e30efe7a74..569ffde6d047 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -245,7 +245,8 @@ static int idescsi_check_condition(ide_drive_t *drive,
245 ide_scsi_hex_dump(pc->c, 6); 245 ide_scsi_hex_dump(pc->c, 6);
246 } 246 }
247 rq->rq_disk = scsi->disk; 247 rq->rq_disk = scsi->disk;
248 return ide_do_drive_cmd(drive, rq, ide_preempt); 248 ide_do_drive_cmd(drive, rq);
249 return 0;
249} 250}
250 251
251static int idescsi_end_request(ide_drive_t *, int, int); 252static int idescsi_end_request(ide_drive_t *, int, int);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index d8c86f0362c4..04267dc1edf2 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -851,17 +851,7 @@ int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
851 851
852extern ide_startstop_t ide_do_reset (ide_drive_t *); 852extern ide_startstop_t ide_do_reset (ide_drive_t *);
853 853
854/* 854extern void ide_do_drive_cmd(ide_drive_t *, struct request *);
855 * "action" parameter type for ide_do_drive_cmd() below.
856 */
857typedef enum {
858 ide_wait, /* insert rq at end of list, and wait for it */
859 ide_preempt, /* insert rq in front of current request */
860 ide_head_wait, /* insert rq in front of current request and wait for it */
861 ide_end /* insert rq at end of list, but don't wait for it */
862} ide_action_t;
863
864extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t);
865 855
866extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); 856extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
867 857