[PATCH] libata: implement per-dev EH action mask eh_info->dev_action[]

Currently, the only per-dev EH action is REVALIDATE.  EH used to
exploit ehi->dev to do selective revalidation on a ATA bus.  However,
this is a bit hacky and makes it impossible to request selective
revalidation from outside of EH or add another per-dev EH action.

This patch adds per-dev EH action mask eh_info->dev_action[] and
update EH to use this field for REVALIDATE.  Note that per-dev actions
can still be specified at port-level and it has the same effect of
specifying the action for all devices on the port.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
diff --git a/include/linux/libata.h b/include/linux/libata.h
index f03b866..6b3c3af 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -249,6 +249,7 @@
 	ATA_EH_HARDRESET	= (1 << 2),
 
 	ATA_EH_RESET_MASK	= ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
+	ATA_EH_PERDEV_MASK	= ATA_EH_REVALIDATE,
 
 	/* ata_eh_info->flags */
 	ATA_EHI_HOTPLUGGED	= (1 << 0),  /* could have been hotplugged */
@@ -462,6 +463,7 @@
 	u32			serror;		/* SError from LLDD */
 	unsigned int		err_mask;	/* port-wide err_mask */
 	unsigned int		action;		/* ATA_EH_* action mask */
+	unsigned int		dev_action[ATA_MAX_DEVICES]; /* dev EH action */
 	unsigned int		flags;		/* ATA_EHI_* flags */
 
 	unsigned long		hotplug_timestamp;