Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2011 16:00:46 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220789 - head/sys/dev/ahci
Message-ID:  <201104181600.p3IG0k5k076966@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Apr 18 16:00:46 2011
New Revision: 220789
URL: http://svn.freebsd.org/changeset/base/220789

Log:
  Handle ready timeout during polled operation same as done in mvs(4) before.

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci.h

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Mon Apr 18 15:55:02 2011	(r220788)
+++ head/sys/dev/ahci/ahci.c	Mon Apr 18 16:00:46 2011	(r220789)
@@ -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);
+	}
 }

Modified: head/sys/dev/ahci/ahci.h
==============================================================================
--- head/sys/dev/ahci/ahci.h	Mon Apr 18 15:55:02 2011	(r220788)
+++ head/sys/dev/ahci/ahci.h	Mon Apr 18 16:00:46 2011	(r220789)
@@ -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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104181600.p3IG0k5k076966>