From owner-p4-projects@FreeBSD.ORG Mon Jan 18 16:01:42 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F1F241065692; Mon, 18 Jan 2010 16:01:41 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B63681065676 for ; Mon, 18 Jan 2010 16:01:41 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 89F578FC13 for ; Mon, 18 Jan 2010 16:01:41 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IG1fn5077806 for ; Mon, 18 Jan 2010 16:01:41 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0IG1fjk077804 for perforce@freebsd.org; Mon, 18 Jan 2010 16:01:41 GMT (envelope-from mav@freebsd.org) Date: Mon, 18 Jan 2010 16:01:41 GMT Message-Id: <201001181601.o0IG1fjk077804@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 173324 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 16:01:42 -0000 http://p4web.freebsd.org/chv.cgi?CH=173324 Change 173324 by mav@mav_mavtest on 2010/01/18 16:01:07 Move settle time waiting after bus reset from common code to SCSI XPT. It is not needed on ATA. Same time, ATA needs devices to be reprobed after reset to renegotiate transfer parameters. Do it. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#71 edit .. //depot/projects/scottl-camlock/src/sys/cam/cam_periph.c#47 edit .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_xpt.c#28 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#71 (text+ko) ==== @@ -231,14 +231,6 @@ if (status != CAM_REQ_CMP) { return (status); } - - /* - * Ensure we've waited at least a bus settle - * delay before attempting to probe the device. - * For HBAs that don't do bus resets, this won't make a difference. - */ - cam_periph_freeze_after_event(periph, &periph->path->bus->last_reset, - scsi_delay); /* * Ensure nobody slip in until probe finish. */ @@ -1166,8 +1158,7 @@ struct cam_path *new_path; struct cam_periph *old_periph; - CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, - ("xpt_scan_lun\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_scan_lun\n")); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; @@ -1575,6 +1566,10 @@ */ ata_scan_lun(newpath.periph, &newpath, CAM_EXPECT_INQ_CHANGE, NULL); + } else { + /* We need to reinitialize device after reset. */ + ata_scan_lun(newpath.periph, &newpath, + 0, NULL); } xpt_release_path(&newpath); } else if (async_code == AC_LOST_DEVICE && ==== //depot/projects/scottl-camlock/src/sys/cam/cam_periph.c#47 (text+ko) ==== @@ -1249,12 +1249,6 @@ case AC_LOST_DEVICE: cam_periph_invalidate(periph); break; - case AC_SENT_BDR: - case AC_BUS_RESET: - { - cam_periph_bus_settle(periph, scsi_delay); - break; - } default: break; } ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_xpt.c#28 (text+ko) ==== @@ -1783,8 +1783,7 @@ struct cam_path *new_path; struct cam_periph *old_periph; - CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, - ("scsi_scan_lun\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("scsi_scan_lun\n")); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; @@ -2377,11 +2376,18 @@ /* * Allow transfer negotiation to occur in a - * tag free environment. + * tag free environment and after settle delay. */ if (async_code == AC_SENT_BDR - || async_code == AC_BUS_RESET) + || async_code == AC_BUS_RESET) { + cam_freeze_devq(&newpath); + cam_release_devq(&newpath, + RELSIM_RELEASE_AFTER_TIMEOUT, + /*reduction*/0, + /*timeout*/scsi_delay, + /*getcount_only*/0); scsi_toggle_tags(&newpath); + } if (async_code == AC_INQ_CHANGED) { /*