svn commit: r367985 - head/sys/dev/isp

Alexander Motin mav at FreeBSD.org
Tue Nov 24 14:05:53 UTC 2020


Author: mav
Date: Tue Nov 24 14:05:52 2020
New Revision: 367985
URL: https://svnweb.freebsd.org/changeset/base/367985

Log:
  Remove unneeded locking around xpt_bus_[de]register().
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c	Tue Nov 24 14:05:35 2020	(r367984)
+++ head/sys/dev/isp/isp_freebsd.c	Tue Nov 24 14:05:52 2020	(r367985)
@@ -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);
 	}
@@ -168,9 +163,7 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq
 	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);
-		ISP_LOCK(isp);
 		xpt_bus_deregister(cam_sim_path(fc->sim));
-		ISP_UNLOCK(isp);
 		cam_sim_free(fc->sim, FALSE);
 		return (ENOMEM);
 	}
@@ -285,9 +278,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);


More information about the svn-src-head mailing list