From owner-svn-src-head@freebsd.org Mon Aug 13 19:59:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78EFB107BB97; Mon, 13 Aug 2018 19:59:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB55389E41; Mon, 13 Aug 2018 19:59:38 +0000 (UTC) (envelope-from imp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD2B011527; Mon, 13 Aug 2018 19:59:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DJxbWk047537; Mon, 13 Aug 2018 19:59:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DJxbV2047536; Mon, 13 Aug 2018 19:59:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808131959.w7DJxbV2047536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 13 Aug 2018 19:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337724 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 337724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2018 19:59:39 -0000 Author: imp Date: Mon Aug 13 19:59:37 2018 New Revision: 337724 URL: https://svnweb.freebsd.org/changeset/base/337724 Log: Call xpt_sim_poll in shutdown_final handler. When we're shutting down, we send a number of start/stop commands to the known targets. We have to wait for them to complete. During a panic, the interrupts are off, and using pause to wait for them to fire and complete won't work: we have to poll after pause returns so the completion routines of the CCBs run so we decrement work outstanding counts. Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D16663 Modified: head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Mon Aug 13 19:59:32 2018 (r337723) +++ head/sys/dev/mps/mps_sas_lsi.c Mon Aug 13 19:59:37 2018 (r337724) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1209,7 +1210,9 @@ mpssas_SSU_to_SATA_devices(struct mps_softc *sc, int h */ while (sc->SSU_refcount > 0) { pause("mpswait", hz/10); - + if (SCHEDULER_STOPPED()) + xpt_sim_poll(sassc->sim); + if (--timeout == 0) { mps_dprint(sc, MPS_FAULT, "Time has expired waiting " "for SSU commands to complete.\n");