aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/cam_periph.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-02-11 21:49:43 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-02-11 21:52:12 +0000
commit447b3557a9cc5f00a301be8404339f21a9a0faa8 (patch)
tree1f290d6a8ec6f264e9d4b6a2504b062178d17979 /sys/cam/cam_periph.c
parent6d2a10d96fb5d4ee42fd67b0b07a6d098db5d55a (diff)
downloadsrc-447b3557a9cc5f00a301be8404339f21a9a0faa8.tar.gz
src-447b3557a9cc5f00a301be8404339f21a9a0faa8.zip
cam: Permit non-pollable sims.
Some CAM sim drivers do not support polling (notably iscsi(4)). Rather than using a no-op poll routine that always times out requests, permit a SIM to set a NULL poll callback. cam_periph_runccb() will fail polled requests non-pollable sims immediately as if they had timed out. Reviewed by: scottl, mav (earlier version) Reviewed by: imp MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28453
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r--sys/cam/cam_periph.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 92f7c33cbc75..98b9264f1069 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <cam/cam_ccb.h>
#include <cam/cam_queue.h>
#include <cam/cam_xpt_periph.h>
+#include <cam/cam_xpt_internal.h>
#include <cam/cam_periph.h>
#include <cam/cam_debug.h>
#include <cam/cam_sim.h>
@@ -1247,7 +1248,10 @@ cam_periph_runccb(union ccb *ccb,
* in the do loop below.
*/
if (must_poll) {
- timeout = xpt_poll_setup(ccb);
+ if (cam_sim_pollable(ccb->ccb_h.path->bus->sim))
+ timeout = xpt_poll_setup(ccb);
+ else
+ timeout = 0;
}
if (timeout == 0) {