From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:59:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C53BB1065679; Tue, 27 Apr 2010 15:59:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B304C8FC1B; Tue, 27 Apr 2010 15:59:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3RFxcvw054557; Tue, 27 Apr 2010 15:59:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RFxckd054555; Tue, 27 Apr 2010 15:59:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004271559.o3RFxckd054555@svn.freebsd.org> From: Alexander Motin Date: Tue, 27 Apr 2010 15:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207282 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 15:59:38 -0000 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) {