aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:47 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:47 -0400
commit35b5d0be3d8de9a5ac51471c12029fb115200cdc (patch)
treea9957b1952ad21c3313a39b3dc2ccdde3010035e /drivers/ide/ide-iops.c
parent22117d6eaac50d366d9013c88318a869ea4d8739 (diff)
ide: remove ide_execute_pkt_cmd() (v2)
* Pass command structure to ide_execute_command() and skip __ide_set_handler() for ATAPI protocols on non-DRQ devices. * Convert ide_issue_pc() to always use ide_execute_command() and remove no longer needed ide_execute_pkt_cmd(). v2: * Fix for non-DRQ devices (based on report from Borislav). There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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().