Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Apr 2010 15:59:38 +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: r207282 - head/sys/cam/ata
Message-ID:  <201004271559.o3RFxckd054555@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Apr 27 15:59:38 2010
New Revision: 207282
URL: http://svn.freebsd.org/changeset/base/207282

Log:
  Update device identify data and serial number when device change detected.
  Reprobe immediately following this should have fresh data.

Modified:
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Tue Apr 27 15:50:25 2010	(r207281)
+++ head/sys/cam/ata/ata_xpt.c	Tue Apr 27 15:59:38 2010	(r207282)
@@ -768,6 +768,7 @@ noerror:
 	{
 		struct ccb_pathinq cpi;
 		int16_t *ptr;
+		int changed = 1;
 
 		ident_buf = &softc->ident_data;
 		for (ptr = (int16_t *)ident_buf;
@@ -809,9 +810,12 @@ noerror:
 			     sizeof(ident_buf->serial))) {
 				/* Device changed. */
 				xpt_async(AC_LOST_DEVICE, path, NULL);
-			} else
+			} else {
 				bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params));
-		} else {
+				changed = 0;
+			}
+		}
+		if (changed) {
 			bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params));
 			/* Clean up from previous instance of this device */
 			if (path->device->serial_num != NULL) {



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