diff options
author | Tejun Heo <htejun@gmail.com> | 2006-11-01 04:39:27 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-01 22:41:31 -0500 |
commit | baa1e78a834c917984a4659fd282f712c17ee3bf (patch) | |
tree | 6c8035d6d49752f7ea81696fa6e61c424b29589c /drivers/ata/libata-core.c | |
parent | efdaedc443e935eda82e9e78a6e65d1f993d242f (diff) |
[PATCH] libata: implement ATA_EHI_SETMODE and ATA_EHI_POST_SETMODE
libata EH used to perform ata_set_mode() iff the EH session performed
reset as indicated by ATA_EHI_DID_RESET. This is incorrect because
->dev_config() called by revalidation is allowed to modify transfer
mode which ata_set_mode() should take care of. This patch implements
the following two flags.
* ATA_EHI_SETMODE: set during EH to schedule ata_set_mode(). Both new
device attachment and revalidation set this flag.
* ATA_EHI_POST_SETMODE: set while the device is revalidated after
ata_set_mode(). Post-setmode revalidation is different from initial
configuaration and EH revalidation in that ->dev_config() is not
allowed tune transfer mode. LLD can use this flag to determine
whether it's allowed to tune transfer mode. Note that POST_SETMODE
->dev_config() is guaranteed to be preceded by non-POST_SETMODE
->dev_config().
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e294731a7edd..5028396029b3 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2158,6 +2158,7 @@ int ata_down_xfermask_limit(struct ata_device *dev, int force_pio0) | |||
2158 | 2158 | ||
2159 | static int ata_dev_set_mode(struct ata_device *dev) | 2159 | static int ata_dev_set_mode(struct ata_device *dev) |
2160 | { | 2160 | { |
2161 | struct ata_eh_context *ehc = &dev->ap->eh_context; | ||
2161 | unsigned int err_mask; | 2162 | unsigned int err_mask; |
2162 | int rc; | 2163 | int rc; |
2163 | 2164 | ||
@@ -2172,7 +2173,9 @@ static int ata_dev_set_mode(struct ata_device *dev) | |||
2172 | return -EIO; | 2173 | return -EIO; |
2173 | } | 2174 | } |
2174 | 2175 | ||
2176 | ehc->i.flags |= ATA_EHI_POST_SETMODE; | ||
2175 | rc = ata_dev_revalidate(dev, 0); | 2177 | rc = ata_dev_revalidate(dev, 0); |
2178 | ehc->i.flags &= ~ATA_EHI_POST_SETMODE; | ||
2176 | if (rc) | 2179 | if (rc) |
2177 | return rc; | 2180 | return rc; |
2178 | 2181 | ||