Date: Mon, 30 Nov 2015 21:33:30 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291505 - stable/10/sys/dev/isp Message-ID: <201511302133.tAULXUke069719@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Mon Nov 30 21:33:30 2015 New Revision: 291505 URL: https://svnweb.freebsd.org/changeset/base/291505 Log: MFC r290507: Rework r290504. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Mon Nov 30 21:32:52 2015 (r291504) +++ stable/10/sys/dev/isp/isp.c Mon Nov 30 21:33:30 2015 (r291505) @@ -2774,7 +2774,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha */ lwfs = FW_CONFIG_WAIT; GET_NANOTIME(&hra); - do { + while (1) { isp_fw_state(isp, chan); if (lwfs != fcp->isp_fwstate) { isp_prt(isp, ISP_LOGCONFIG|ISP_LOG_SANCFG, "Chan %d Firmware State <%s->%s>", chan, isp_fc_fw_statename((int)lwfs), isp_fc_fw_statename((int)fcp->isp_fwstate)); @@ -2783,9 +2783,11 @@ isp_fclink_test(ispsoftc_t *isp, int cha if (fcp->isp_fwstate == FW_READY) { break; } - ISP_SLEEP(isp, 1000); GET_NANOTIME(&hrb); - } while (NANOTIME_SUB(&hrb, &hra) / 1000 < usdelay); + if ((NANOTIME_SUB(&hrb, &hra) / 1000 + 1000 >= usdelay)) + break; + ISP_SLEEP(isp, 1000); + } /* * If we haven't gone to 'ready' state, return. Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Mon Nov 30 21:32:52 2015 (r291504) +++ stable/10/sys/dev/isp/isp_freebsd.h Mon Nov 30 21:33:30 2015 (r291505) @@ -401,10 +401,10 @@ struct isposinfo { #define ISP_SNPRINTF snprintf #define ISP_DELAY(x) DELAY(x) #if __FreeBSD_version < 1000029 -#define ISP_SLEEP(isp, x) msleep(&(isp)->isp_osinfo.lock, \ +#define ISP_SLEEP(isp, x) msleep(&(isp)->isp_osinfo.is_exiting, \ &(isp)->isp_osinfo.lock, 0, "isp_sleep", ((x) + tick - 1) / tick) #else -#define ISP_SLEEP(isp, x) msleep_sbt(&(isp)->isp_osinfo.lock, \ +#define ISP_SLEEP(isp, x) msleep_sbt(&(isp)->isp_osinfo.is_exiting, \ &(isp)->isp_osinfo.lock, 0, "isp_sleep", (x) * SBT_1US, 0, 0) #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511302133.tAULXUke069719>