Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Dec 2020 00:58:03 +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-12@freebsd.org
Subject:   svn commit: r368426 - stable/12/sys/dev/isp
Message-ID:  <202012080058.0B80w3EO022945@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Dec  8 00:58:02 2020
New Revision: 368426
URL: https://svnweb.freebsd.org/changeset/base/368426

Log:
  MFC r367985: Remove unneeded locking around xpt_bus_[de]register().

Modified:
  stable/12/sys/dev/isp/isp_freebsd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/isp/isp_freebsd.c
==============================================================================
--- stable/12/sys/dev/isp/isp_freebsd.c	Tue Dec  8 00:49:31 2020	(r368425)
+++ stable/12/sys/dev/isp/isp_freebsd.c	Tue Dec  8 00:58:02 2020	(r368426)
@@ -121,17 +121,12 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq
 	if (sim == NULL)
 		return (ENOMEM);
 
-	ISP_LOCK(isp);
 	if (xpt_bus_register(sim, isp->isp_dev, chan) != CAM_SUCCESS) {
-		ISP_UNLOCK(isp);
 		cam_sim_free(sim, FALSE);
 		return (EIO);
 	}
-	ISP_UNLOCK(isp);
 	if (xpt_create_path(&path, NULL, cam_sim_path(sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
-		ISP_LOCK(isp);
 		xpt_bus_deregister(cam_sim_path(sim));
-		ISP_UNLOCK(isp);
 		cam_sim_free(sim, FALSE);
 		return (ENXIO);
 	}
@@ -167,7 +162,6 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq
 		struct sysctl_oid *tree = device_get_sysctl_tree(isp->isp_osinfo.dev);
 		char name[16];
 
-		ISP_LOCK(isp);
 		fc->sim = sim;
 		fc->path = path;
 		fc->isp = isp;
@@ -189,7 +183,6 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq
 			LIST_INIT(&fc->atused[i]);
 #endif
 		isp_loop_changed(isp, chan);
-		ISP_UNLOCK(isp);
 		if (kproc_create(isp_kthread, fc, &fc->kproc, 0, 0,
 		    "%s_%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) {
 			xpt_free_path(fc->path);
@@ -317,9 +310,7 @@ unwind:
 		ISP_GET_PC(isp, chan, sim, sim);
 		ISP_GET_PC(isp, chan, path, path);
 		xpt_free_path(path);
-		ISP_LOCK(isp);
 		xpt_bus_deregister(cam_sim_path(sim));
-		ISP_UNLOCK(isp);
 		cam_sim_free(sim, FALSE);
 	}
 	cam_simq_free(isp->isp_osinfo.devq);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012080058.0B80w3EO022945>