bus/pci: fix VFIO device reset
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Sat, 28 Oct 2017 06:22:55 +0000 (11:52 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 31 Oct 2017 18:23:36 +0000 (19:23 +0100)
commit6fb00f8baefa03b9cfd1b2dfc1787258b8459601
treec6aa9738bbca5464056f333a93eb3439d3baee9f
parentbc104bb853bddc048464e4d7b340cdedc3ad561f
bus/pci: fix VFIO device reset

If the device is not capable of resetting, then Linux kernel updates
the errno as EINVAL.
http://elixir.free-electrons.com/linux/v4.9/source/drivers/vfio/pci/vfio_pci.c#L887

Honor the EINVAL errno value to avoid pci vfio setup failure.

Fixes: f25f8f367644 ("bus/pci: check VFIO reset ioctl error")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Jonas Pfefferle <jpf@zurich.ibm.com>
drivers/bus/pci/linux/pci_vfio.c