diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 3784a3e1fc5a..203df78dc13e 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -342,9 +342,11 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx, vbr->out_hdr.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); retval = virtblk_handle_ice(vblk, req); - if (retval != BLK_STS_OK) + if (retval != BLK_STS_OK) { + if (retval == BLK_STS_RESOURCE) + blk_mq_run_hw_queue(hctx, true); return retval; - + } blk_mq_start_request(req); num = blk_rq_map_sg(hctx->queue, req, vbr->sg); @@ -794,6 +796,8 @@ static int virtblk_probe(struct virtio_device *vdev) INIT_WORK(&vblk->config_work, virtblk_config_changed_work); #ifdef CONFIG_PFK_VIRTUALIZED + if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_ICE)) + return -ENOTTY; INIT_WORK(&vblk->ice_cfg_work, virtblk_ice_work); vblk->work_pending = false; #endif @@ -1038,6 +1042,9 @@ static unsigned int features[] = { VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, VIRTIO_BLK_F_MQ, +#ifdef CONFIG_PFK_VIRTUALIZED + VIRTIO_BLK_F_ICE, +#endif }; static struct virtio_driver virtio_blk = { diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 302b4c2de371..8869db94d25a 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/include/uapi/linux/virtio_blk.h @@ -38,6 +38,7 @@ #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ +#define VIRTIO_BLK_F_ICE 23 /* support ice virtualization */ /* Legacy feature bits */ #ifndef VIRTIO_BLK_NO_LEGACY