Date: Mon, 18 Jan 2010 16:01:41 GMT From: Alexander Motin <mav@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 173324 for review Message-ID: <201001181601.o0IG1fjk077804@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001181601.o0IG1fjk077804>