From owner-svn-src-all@freebsd.org Tue Mar 14 07:06:07 2017 Return-Path: Delivered-To: svn-src-all@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 33231D0B5EF; Tue, 14 Mar 2017 07:06:07 +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 DDD501C84; Tue, 14 Mar 2017 07:06:06 +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 v2E766C7096003; Tue, 14 Mar 2017 07:06:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2E765J7096002; Tue, 14 Mar 2017 07:06:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703140706.v2E765J7096002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Mar 2017 07:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315231 - stable/11/sys/dev/firewire X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2017 07:06:07 -0000 Author: mav Date: Tue Mar 14 07:06:05 2017 New Revision: 315231 URL: https://svnweb.freebsd.org/changeset/base/315231 Log: MFC r314375: Remove some locking not needed for modern CAM. This driver is full of LORs. This change allows to reduce deadlock chance from 100% to level that allows some tests to be done. Modified: stable/11/sys/dev/firewire/sbp_targ.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/firewire/sbp_targ.c ============================================================================== --- stable/11/sys/dev/firewire/sbp_targ.c Tue Mar 14 07:00:22 2017 (r315230) +++ stable/11/sys/dev/firewire/sbp_targ.c Tue Mar 14 07:06:05 2017 (r315231) @@ -317,10 +317,8 @@ sbp_targ_post_busreset(void *arg) unit = &sc->unit; if ((sc->flags & F_FREEZED) == 0) { - SBP_LOCK(sc); sc->flags |= F_FREEZED; xpt_freeze_simq(sc->sim, /*count*/1); - SBP_UNLOCK(sc); } else { printf("%s: already freezed\n", __func__); } @@ -367,10 +365,8 @@ sbp_targ_post_explore(void *arg) struct sbp_targ_softc *sc; sc = (struct sbp_targ_softc *)arg; - SBP_LOCK(sc); sc->flags &= ~F_FREEZED; xpt_release_simq(sc->sim, /*run queue*/TRUE); - SBP_UNLOCK(sc); return; } @@ -869,18 +865,14 @@ sbp_targ_cam_done(struct fw_xfer *xfer) printf("%s: CAM_SEND_STATUS not set %0x\n", __func__, ccb->ccb_h.flags); ccb->ccb_h.status = CAM_REQ_CMP; } - SBP_LOCK(orbi->sc); xpt_done(ccb); - SBP_UNLOCK(orbi->sc); } else { orbi->status.len = 1; sbp_targ_status_FIFO(orbi, orbi->login->fifo_hi, orbi->login->fifo_lo, /*dequeue*/1); ccb->ccb_h.status = CAM_REQ_ABORTED; - SBP_LOCK(orbi->sc); xpt_done(ccb); - SBP_UNLOCK(orbi->sc); } } @@ -1456,9 +1448,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfe sbp_targ_remove_orb_info(orbi->login, orbi); free(orbi, M_SBP_TARG); atio->ccb_h.status = CAM_REQ_ABORTED; - SBP_LOCK(orbi->sc); xpt_done((union ccb*)atio); - SBP_UNLOCK(orbi->sc); goto done0; } orbi->state = ORBI_STATUS_ATIO; @@ -1530,9 +1520,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfe orbi->data_lo = orb[3]; orbi->orb4 = *orb4; - SBP_LOCK(orbi->sc); xpt_done((union ccb*)atio); - SBP_UNLOCK(orbi->sc); done0: fw_xfer_free(xfer); return; @@ -2023,8 +2011,8 @@ sbp_targ_detach(device_t dev) SBP_LOCK(sc); xpt_free_path(sc->path); xpt_bus_deregister(cam_sim_path(sc->sim)); - SBP_UNLOCK(sc); cam_sim_free(sc->sim, /*free_devq*/TRUE); + SBP_UNLOCK(sc); for (i = 0; i < MAX_LUN; i++) { lstate = sc->lstate[i];