Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 2020 14:05:53 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367985 - head/sys/dev/isp
Message-ID:  <202011241405.0AOE5rSf079052@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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