svn commit: r358662 - head/sys/cam

Warner Losh imp at FreeBSD.org
Thu Mar 5 06:20:19 UTC 2020


Author: imp
Date: Thu Mar  5 06:20:17 2020
New Revision: 358662
URL: https://svnweb.freebsd.org/changeset/base/358662

Log:
  xpt_async is submitting a CCB, not finishing it up, so use xpt_action() instead
  of xpt_done(). Add the missing XPT_ASYNC case to xpt_action_default. xpt_async
  wants to use the side-effect of the xpt_done() routine to queue this to the
  camisr thread so it can be done in that context. However, this breaks the
  symmetry that you create a ccb and call xpt_action() for it to be
  dispatched. Restore that symmetry by having it go through that path. As far as I
  can tell, this is the only CCB that we create and call xpt_done() on directly.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Thu Mar  5 06:19:21 2020	(r358661)
+++ head/sys/cam/cam_xpt.c	Thu Mar  5 06:20:17 2020	(r358662)
@@ -3156,6 +3156,10 @@ call_sim:
 		start_ccb->ccb_h.status = CAM_REQ_CMP;
 		xpt_done(start_ccb);
 		break;
+	case XPT_ASYNC:
+		start_ccb->ccb_h.status = CAM_REQ_CMP;
+		xpt_done(start_ccb);
+		break;
 	default:
 	case XPT_SDEV_TYPE:
 	case XPT_TERM_IO:
@@ -4447,7 +4451,7 @@ xpt_async(u_int32_t async_code, struct cam_path *path,
 		xpt_freeze_devq(path, 1);
 	else
 		xpt_freeze_simq(path->bus->sim, 1);
-	xpt_done(ccb);
+	xpt_action(ccb);
 }
 
 static void


More information about the svn-src-all mailing list