Skip to content

Commit

Permalink
Merge branch 'stable/for-jens-4.15' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/konrad/xen into for-linus

Pull a xen_blkfront fix from Konrad:

"It has one simple fix for the multi-queue support not showing up after
a block device was detached/re-attached."

* 'stable/for-jens-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen-blkfront: move negotiate_mq to cover all cases of new VBDs
  • Loading branch information
axboe committed Mar 8, 2018
2 parents 86755b7 + 7ed8ce1 commit 9296080
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ static DEFINE_SPINLOCK(minor_lock);

static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo);
static void blkfront_gather_backend_features(struct blkfront_info *info);
static int negotiate_mq(struct blkfront_info *info);

static int get_id_from_freelist(struct blkfront_ring_info *rinfo)
{
Expand Down Expand Up @@ -1774,11 +1775,18 @@ static int talk_to_blkback(struct xenbus_device *dev,
unsigned int i, max_page_order;
unsigned int ring_page_order;

if (!info)
return -ENODEV;

max_page_order = xenbus_read_unsigned(info->xbdev->otherend,
"max-ring-page-order", 0);
ring_page_order = min(xen_blkif_max_ring_order, max_page_order);
info->nr_ring_pages = 1 << ring_page_order;

err = negotiate_mq(info);
if (err)
goto destroy_blkring;

for (i = 0; i < info->nr_rings; i++) {
struct blkfront_ring_info *rinfo = &info->rinfo[i];

Expand Down Expand Up @@ -1978,11 +1986,6 @@ static int blkfront_probe(struct xenbus_device *dev,
}

info->xbdev = dev;
err = negotiate_mq(info);
if (err) {
kfree(info);
return err;
}

mutex_init(&info->mutex);
info->vdevice = vdevice;
Expand Down Expand Up @@ -2099,10 +2102,6 @@ static int blkfront_resume(struct xenbus_device *dev)

blkif_free(info, info->connected == BLKIF_STATE_CONNECTED);

err = negotiate_mq(info);
if (err)
return err;

err = talk_to_blkback(dev, info);
if (!err)
blk_mq_update_nr_hw_queues(&info->tag_set, info->nr_rings);
Expand Down

0 comments on commit 9296080

Please sign in to comment.