vfio: platform: call _RST method when using ACPI
authorSinan Kaya <okaya@codeaurora.org>
Tue, 19 Jul 2016 13:01:46 +0000 (09:01 -0400)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 19 Jul 2016 16:26:44 +0000 (10:26 -0600)
commitd30daa33ec1d035acfdfc7662d7a5360592af44c
tree1ce71778d5c55adade4c911258d797028359d35b
parent5afec27474fdc52e9d80b359ce10fab59c85d131
vfio: platform: call _RST method when using ACPI

The device tree code checks for the presence of a reset driver and calls
the of_reset function pointer by looking up the reset driver as a module.

ACPI defines _RST method to perform device level reset. After the _RST
method is executed, the OS can resume using the device. _RST method is
expected to stop DMA transfers and IRQs.

This patch introduces two functions as vfio_platform_acpi_has_reset and
vfio_platform_acpi_call_reset. The has reset method is used to declare
reset capability via the ioctl flag VFIO_DEVICE_FLAGS_RESET. The call
reset function is used to execute the _RST ACPI method.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/platform/vfio_platform_common.c