Message ID | 159534744069.28840.5832146066812507209.stgit@djiang5-desk3.ch.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add VFIO mediated device support and DEV-MSI support for the idxd driver | expand |
diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h index 1f03019bb45d..cc0665335aee 100644 --- a/drivers/dma/idxd/idxd.h +++ b/drivers/dma/idxd/idxd.h @@ -60,6 +60,7 @@ struct idxd_group { enum idxd_wq_state { IDXD_WQ_DISABLED = 0, IDXD_WQ_ENABLED, + IDXD_WQ_LOCKED, }; enum idxd_wq_flag { diff --git a/drivers/dma/idxd/mdev.c b/drivers/dma/idxd/mdev.c index 744adfdc06cd..e3c32f9566b5 100644 --- a/drivers/dma/idxd/mdev.c +++ b/drivers/dma/idxd/mdev.c @@ -69,8 +69,10 @@ static void idxd_vdcm_init(struct vdcm_idxd *vidxd) vidxd_mmio_init(vidxd); - if (wq_dedicated(wq) && wq->state == IDXD_WQ_ENABLED) + if (wq_dedicated(wq) && wq->state == IDXD_WQ_ENABLED) { idxd_wq_disable(wq, NULL); + wq->state = IDXD_WQ_LOCKED; + } } static void __idxd_vdcm_release(struct vdcm_idxd *vidxd) diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index d3b0a95b0d1d..6344cc719897 100644 --- a/drivers/dma/idxd/sysfs.c +++ b/drivers/dma/idxd/sysfs.c @@ -822,6 +822,8 @@ static ssize_t wq_state_show(struct device *dev, return sprintf(buf, "disabled\n"); case IDXD_WQ_ENABLED: return sprintf(buf, "enabled\n"); + case IDXD_WQ_LOCKED: + return sprintf(buf, "locked\n"); } return sprintf(buf, "unknown\n");