Skip to content

Commit

Permalink
Merge tag 'vfio-ccw-20181113' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/kvms390/vfio-ccw into fixes

Pull vfio-ccw from Cornelia Huck with the following changes:

 - Several bugfixes for vfio-ccw
  • Loading branch information
Martin Schwidefsky committed Nov 13, 2018
2 parents ccda4af + b89e242 commit 005af85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions drivers/s390/cio/vfio_ccw_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,10 @@ static int ccwchain_calc_length(u64 iova, struct channel_program *cp)
* orb specified one of the unsupported formats, we defer
* checking for IDAWs in unsupported formats to here.
*/
if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw))
if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw)) {
kfree(p);
return -EOPNOTSUPP;
}

if ((!ccw_is_chain(ccw)) && (!ccw_is_tic(ccw)))
break;
Expand Down Expand Up @@ -528,7 +530,7 @@ static int ccwchain_fetch_direct(struct ccwchain *chain,

ret = pfn_array_alloc_pin(pat->pat_pa, cp->mdev, ccw->cda, ccw->count);
if (ret < 0)
goto out_init;
goto out_unpin;

/* Translate this direct ccw to a idal ccw. */
idaws = kcalloc(ret, sizeof(*idaws), GFP_DMA | GFP_KERNEL);
Expand Down
10 changes: 5 additions & 5 deletions drivers/s390/cio/vfio_ccw_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "vfio_ccw_private.h"

struct workqueue_struct *vfio_ccw_work_q;
struct kmem_cache *vfio_ccw_io_region;
static struct kmem_cache *vfio_ccw_io_region;

/*
* Helpers
Expand Down Expand Up @@ -134,14 +134,14 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
if (ret)
goto out_free;

ret = vfio_ccw_mdev_reg(sch);
if (ret)
goto out_disable;

INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo);
atomic_set(&private->avail, 1);
private->state = VFIO_CCW_STATE_STANDBY;

ret = vfio_ccw_mdev_reg(sch);
if (ret)
goto out_disable;

return 0;

out_disable:
Expand Down

0 comments on commit 005af85

Please sign in to comment.