summaryrefslogtreecommitdiffstats
path: root/sys/dev/ahci
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2011-04-18 16:00:46 +0000
committermav <mav@FreeBSD.org>2011-04-18 16:00:46 +0000
commitaf7a233f61f3d12b0c4702d5698416a738c825b6 (patch)
treec9ef739225da973ec53937890ff6a1b3201e4d3b /sys/dev/ahci
parent5beb62e535aad0c224c3d8fdd98f0f8ab6dc6f1f (diff)
downloadFreeBSD-src-af7a233f61f3d12b0c4702d5698416a738c825b6.zip
FreeBSD-src-af7a233f61f3d12b0c4702d5698416a738c825b6.tar.gz
Handle ready timeout during polled operation same as done in mvs(4) before.
Diffstat (limited to 'sys/dev/ahci')
-rw-r--r--sys/dev/ahci/ahci.c5
-rw-r--r--sys/dev/ahci/ahci.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 9cb2c66..e765a32 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -2856,4 +2856,9 @@ ahcipoll(struct cam_sim *sim)
struct ahci_channel *ch = (struct ahci_channel *)cam_sim_softc(sim);
ahci_ch_intr(ch->dev);
+ if (ch->resetting != 0 &&
+ (--ch->resetpolldiv <= 0 || !callout_pending(&ch->reset_timer))) {
+ ch->resetpolldiv = 1000;
+ ahci_reset_to(ch->dev);
+ }
}
diff --git a/sys/dev/ahci/ahci.h b/sys/dev/ahci/ahci.h
index cea01a1..4e62cbf 100644
--- a/sys/dev/ahci/ahci.h
+++ b/sys/dev/ahci/ahci.h
@@ -414,6 +414,7 @@ struct ahci_channel {
int lastslot; /* Last used slot */
int taggedtarget; /* Last tagged target */
int resetting; /* Hard-reset in progress. */
+ int resetpolldiv; /* Hard-reset poll divider. */
int listening; /* SUD bit is cleared. */
union ccb *frozen; /* Frozen command */
struct callout pm_timer; /* Power management events */
OpenPOWER on IntegriCloud