Skip to contentSkip to conversation

libata: make WARN_ON conditions in ata_sff_hsm_move() more strict

PATCH Applied Tejun Heo 2 participants 2 messages Apr 23, 2008 – Apr 25, 2008 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 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.

Cc Mark Lord <[email protected]>
Cc Albert Lee <[email protected]>

---
drivers/ata/libata-sff.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/libata-sff.c +0 -0
index 1549952..2ec65a8 100644
@@ -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;
Applied
#1 lore raw
Quoted 26 lines · Tejun Heo

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.

Cc Mark Lord <[email protected]>
Cc Albert Lee <[email protected]>

---
drivers/ata/libata-sff.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/libata-sff.c +1 -1
index 1549952..2ec65a8 100644
@@ -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;
 

drivers/ata/libata-sff.c fsm_start: · line 1227

Quoted 7 lines
drivers/ata/libata-sff.c +1 -1
@@ -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;

applied