aboutsummaryrefslogtreecommitdiffstats
path: root/sys/cam/nvme/nvme_da.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-12-06 23:05:15 +0000
committerWarner Losh <imp@FreeBSD.org>2017-12-06 23:05:15 +0000
commit2b31251a64777c01ede787691954d7d6fbda64c6 (patch)
tree15858e1a947f6ab7946878338cca6ee2af632087 /sys/cam/nvme/nvme_da.c
parentf93a843cd28089c6c4d53273b5a1adf7047c3d0b (diff)
downloadsrc-2b31251a64777c01ede787691954d7d6fbda64c6.tar.gz
src-2b31251a64777c01ede787691954d7d6fbda64c6.zip
Now that cam_periph_runccb() can be called from situations where the
kernel scheduler is stopped, replace the by hand calling of xpt_polled_action() with it. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13388
Notes
Notes: svn path=/head/; revision=326644
Diffstat (limited to 'sys/cam/nvme/nvme_da.c')
-rw-r--r--sys/cam/nvme/nvme_da.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index dfaccdcaaeb7..c8cf4937bd7a 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -404,17 +404,12 @@ ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP;
nda_nvme_write(softc, &nvmeio, virtual, lba, length, count);
- xpt_polled_action((union ccb *)&nvmeio);
-
- error = cam_periph_error((union ccb *)&nvmeio,
- 0, SF_NO_RECOVERY | SF_NO_RETRY);
- if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0,
- /*reduction*/0, /*timeout*/0, /*getcount_only*/0);
+ error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error,
+ 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL);
if (error != 0)
- printf("Aborting dump due to I/O error.\n");
-
+ printf("Aborting dump due to I/O error %d.\n", error);
cam_periph_unlock(periph);
+
return (error);
}
@@ -423,13 +418,8 @@ ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP;
nda_nvme_flush(softc, &nvmeio);
- xpt_polled_action((union ccb *)&nvmeio);
-
- error = cam_periph_error((union ccb *)&nvmeio,
- 0, SF_NO_RECOVERY | SF_NO_RETRY);
- if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0,
- /*reduction*/0, /*timeout*/0, /*getcount_only*/0);
+ error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error,
+ 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL);
if (error != 0)
xpt_print(periph->path, "flush cmd failed\n");
cam_periph_unlock(periph);