aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r--drivers/ide/ide-iops.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 52c1258ba9f4..5403e4a44be4 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -451,7 +451,7 @@ EXPORT_SYMBOL(ide_set_handler);
451/** 451/**
452 * ide_execute_command - execute an IDE command 452 * ide_execute_command - execute an IDE command
453 * @drive: IDE drive to issue the command against 453 * @drive: IDE drive to issue the command against
454 * @command: command byte to write 454 * @cmd: command
455 * @handler: handler for next phase 455 * @handler: handler for next phase
456 * @timeout: timeout for command 456 * @timeout: timeout for command
457 * 457 *
@@ -461,15 +461,18 @@ EXPORT_SYMBOL(ide_set_handler);
461 * should go via this function or do equivalent locking. 461 * should go via this function or do equivalent locking.
462 */ 462 */
463 463
464void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler, 464void ide_execute_command(ide_drive_t *drive, struct ide_cmd *cmd,
465 unsigned timeout) 465 ide_handler_t *handler, unsigned timeout)
466{ 466{
467 ide_hwif_t *hwif = drive->hwif; 467 ide_hwif_t *hwif = drive->hwif;
468 unsigned long flags; 468 unsigned long flags;
469 469
470 spin_lock_irqsave(&hwif->lock, flags); 470 spin_lock_irqsave(&hwif->lock, flags);
471 __ide_set_handler(drive, handler, timeout); 471 if ((cmd->protocol != ATAPI_PROT_DMA &&
472 hwif->tp_ops->exec_command(hwif, cmd); 472 cmd->protocol != ATAPI_PROT_PIO) ||
473 (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT))
474 __ide_set_handler(drive, handler, timeout);
475 hwif->tp_ops->exec_command(hwif, cmd->tf.command);
473 /* 476 /*
474 * Drive takes 400nS to respond, we must avoid the IRQ being 477 * Drive takes 400nS to respond, we must avoid the IRQ being
475 * serviced before that. 478 * serviced before that.
@@ -480,18 +483,6 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
480 spin_unlock_irqrestore(&hwif->lock, flags); 483 spin_unlock_irqrestore(&hwif->lock, flags);
481} 484}
482 485
483void ide_execute_pkt_cmd(ide_drive_t *drive)
484{
485 ide_hwif_t *hwif = drive->hwif;
486 unsigned long flags;
487
488 spin_lock_irqsave(&hwif->lock, flags);
489 hwif->tp_ops->exec_command(hwif, ATA_CMD_PACKET);
490 ndelay(400);
491 spin_unlock_irqrestore(&hwif->lock, flags);
492}
493EXPORT_SYMBOL_GPL(ide_execute_pkt_cmd);
494
495/* 486/*
496 * ide_wait_not_busy() waits for the currently selected device on the hwif 487 * ide_wait_not_busy() waits for the currently selected device on the hwif
497 * to report a non-busy status, see comments in ide_probe_port(). 488 * to report a non-busy status, see comments in ide_probe_port().