From 39d0099f94390eb7a677e1a5c9bb56a4daa242a1 Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler Date: Thu, 1 Apr 2021 18:13:25 -0600 Subject: powerpc/pseries: Add shutdown() to vio_driver and vio_bus Currently, neither the vio_bus or vio_driver structures provide support for a shutdown() routine. Add support for shutdown() by allowing drivers to provide a implementation via function pointer in their vio_driver struct and provide a proper implementation in the driver template for the vio_bus that calls a vio drivers shutdown() if defined. In the case that no shutdown() is defined by a vio driver and a kexec is in progress we implement a big hammer that calls remove() to ensure no further DMA for the devices is possible. Signed-off-by: Tyrel Datwyler Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210402001325.939668-1-tyreld@linux.ibm.com --- arch/powerpc/include/asm/vio.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/powerpc/include/asm/vio.h') diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h index 721c0d6715ac..e7479a4abf96 100644 --- a/arch/powerpc/include/asm/vio.h +++ b/arch/powerpc/include/asm/vio.h @@ -114,6 +114,7 @@ struct vio_driver { const struct vio_device_id *id_table; int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); void (*remove)(struct vio_dev *dev); + void (*shutdown)(struct vio_dev *dev); /* A driver must have a get_desired_dma() function to * be loaded in a CMO environment if it uses DMA. */ -- cgit v1.2.3