From owner-svn-src-stable-10@freebsd.org Tue May 3 08:04:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 733DFB292C7; Tue, 3 May 2016 08:04:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34CA312E1; Tue, 3 May 2016 08:04:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4384Y4c044979; Tue, 3 May 2016 08:04:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4384YHt044977; Tue, 3 May 2016 08:04:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030804.u4384YHt044977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298970 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2016 08:04:35 -0000 Author: mav Date: Tue May 3 08:04:34 2016 New Revision: 298970 URL: https://svnweb.freebsd.org/changeset/base/298970 Log: MFC r297915: Filter Port Database Changed notifications. For some reason firmware sends Port Database Changed notifications in case of explicit login requests from the driver when target port is unavailabe. Those notifications don't give driver any new information, but only cause infinite scan loop. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:03:51 2016 (r298969) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:04:34 2016 (r298970) @@ -2630,6 +2630,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); + FCPARAM(isp, chan)->isp_login_hdl = handle; ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) == EWOULDBLOCK) { @@ -2638,6 +2639,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } + FCPARAM(isp, chan)->isp_login_hdl = NIL_HANDLE; if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); @@ -6000,9 +6002,13 @@ isp_parse_async_fc(ispsoftc_t *isp, uint fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) continue; - if (fcp->isp_loopstate > LOOP_LTEST_DONE) + if (fcp->isp_loopstate > LOOP_LTEST_DONE) { + if (nphdl != NIL_HANDLE && + nphdl == fcp->isp_login_hdl && + reason == PDB24XX_AE_OPN_2) + continue; fcp->isp_loopstate = LOOP_LTEST_DONE; - else if (fcp->isp_loopstate < LOOP_HAVE_LINK) + } else if (fcp->isp_loopstate < LOOP_HAVE_LINK) fcp->isp_loopstate = LOOP_HAVE_LINK; isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); @@ -7818,6 +7824,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c fcp->isp_xfwoptions = 0; fcp->isp_zfwoptions = 0; fcp->isp_lasthdl = NIL_HANDLE; + fcp->isp_login_hdl = NIL_HANDLE; if (IS_24XX(isp)) { fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:51 2016 (r298969) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:04:34 2016 (r298970) @@ -449,6 +449,7 @@ typedef struct { uint16_t isp_lasthdl; /* only valid for channel 0 */ uint16_t isp_maxalloc; uint16_t isp_fabric_params; + uint16_t isp_login_hdl; /* Logging in handle */ uint8_t isp_retry_delay; uint8_t isp_retry_count;