powerpc/pseries: Flush lazy kernel mappings after unplug operations

This ensures that the translations for unmapped IO mappings or
unmapped memory are properly removed from the MMU hash table
before such an unplug. Without this, the hypervisor refuses the
unplug operations due to those resources still being mapped by
the partition.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 4b83c330
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/lmb.h> #include <linux/lmb.h>
#include <linux/vmalloc.h>
#include <asm/firmware.h> #include <asm/firmware.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pSeries_reconfig.h> #include <asm/pSeries_reconfig.h>
...@@ -54,6 +55,12 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) ...@@ -54,6 +55,12 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
*/ */
start = (unsigned long)__va(base); start = (unsigned long)__va(base);
ret = remove_section_mapping(start, start + lmb_size); ret = remove_section_mapping(start, start + lmb_size);
/* Ensure all vmalloc mappings are flushed in case they also
* hit that section of memory
*/
vm_unmap_aliases();
return ret; return ret;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/vmalloc.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <linux/mutex.h> #include <linux/mutex.h>
...@@ -430,6 +431,8 @@ int dlpar_remove_slot(char *drc_name) ...@@ -430,6 +431,8 @@ int dlpar_remove_slot(char *drc_name)
rc = dlpar_remove_pci_slot(drc_name, dn); rc = dlpar_remove_pci_slot(drc_name, dn);
break; break;
} }
vm_unmap_aliases();
printk(KERN_INFO "%s: slot %s removed\n", DLPAR_MODULE_NAME, drc_name); printk(KERN_INFO "%s: slot %s removed\n", DLPAR_MODULE_NAME, drc_name);
exit: exit:
mutex_unlock(&rpadlpar_mutex); mutex_unlock(&rpadlpar_mutex);
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/pci_hotplug.h> #include <linux/pci_hotplug.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/vmalloc.h>
#include <asm/eeh.h> /* for eeh_add_device() */ #include <asm/eeh.h> /* for eeh_add_device() */
#include <asm/rtas.h> /* rtas_call */ #include <asm/rtas.h> /* rtas_call */
#include <asm/pci-bridge.h> /* for pci_controller */ #include <asm/pci-bridge.h> /* for pci_controller */
...@@ -418,6 +419,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) ...@@ -418,6 +419,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
return -EINVAL; return -EINVAL;
pcibios_remove_pci_devices(slot->bus); pcibios_remove_pci_devices(slot->bus);
vm_unmap_aliases();
slot->state = NOT_CONFIGURED; slot->state = NOT_CONFIGURED;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment