Skip to content

Commit

Permalink
libata: make WARN_ON conditions in ata_sff_hsm_move() more strict
Browse files Browse the repository at this point in the history
WARN_ON()'s in ata_hsm_move() was too liberal and got triggerred when
it shouldn't (e.g. hotplug events at the right moment).  As the HSM
only deals with device errors and state machine violations, make it
check only against them.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Mark Lord <liml@rtr.ca>
Cc: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 25, 2008
1 parent 458622f commit 411cb38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
DPRINTK("ata%u: dev %u command complete, drv_stat 0x%x\n",
ap->print_id, qc->dev->devno, status);

WARN_ON(qc->err_mask);
WARN_ON(qc->err_mask & (AC_ERR_DEV | AC_ERR_HSM));

ap->hsm_task_state = HSM_ST_IDLE;

Expand All @@ -1222,7 +1222,7 @@ int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
/* make sure qc->err_mask is available to
* know what's wrong and recover
*/
WARN_ON(qc->err_mask == 0);
WARN_ON(!(qc->err_mask & (AC_ERR_DEV | AC_ERR_HSM)));

ap->hsm_task_state = HSM_ST_IDLE;

Expand Down

0 comments on commit 411cb38

Please sign in to comment.