From: Tejun Heo Date: Wed, 23 Apr 2008 11:48:36 +0000 (+0900) Subject: libata: make WARN_ON conditions in ata_sff_hsm_move() more strict X-Git-Tag: v2.6.26-rc1~1060^2~16 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=411cb3869afd91ed40e8f12df64cd9e315356305;p=linux-2.6-omap-h63xx.git libata: make WARN_ON conditions in ata_sff_hsm_move() more strict 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 Cc: Mark Lord Cc: Albert Lee Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 15499522e64..2ec65a8fda7 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -1208,7 +1208,7 @@ fsm_start: 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; @@ -1222,7 +1222,7 @@ fsm_start: /* 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;