Skip to content

Commit

Permalink
libata-sff: fix ata_sff_post_internal_cmd()
Browse files Browse the repository at this point in the history
ata_sff_post_internal_cmd() needs to grab port lock before calling
ata_bmdma_stop() and also need to clear hsm_task_state.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Oct 23, 2008
1 parent f667fdb commit 570106d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,8 +2153,17 @@ void ata_sff_error_handler(struct ata_port *ap)
*/
void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc)
{
if (qc->ap->ioaddr.bmdma_addr)
struct ata_port *ap = qc->ap;
unsigned long flags;

spin_lock_irqsave(ap->lock, flags);

ap->hsm_task_state = HSM_ST_IDLE;

if (ap->ioaddr.bmdma_addr)
ata_bmdma_stop(qc);

spin_unlock_irqrestore(ap->lock, flags);
}

/**
Expand Down

0 comments on commit 570106d

Please sign in to comment.