From: Joerg Roedel <jroedel@suse.de>
Date: Tue, 30 Sep 2014 13:02:02 +0200
Subject: driver core: Add BUS_NOTIFY_REMOVED_DEVICE event
Patch-mainline: Never, SUSE-Xen specific
References: bnc#962965

This event closes an important gap in the bus notifiers.
There is already the BUS_NOTIFY_DEL_DEVICE event, but that
is sent when the device is still bound to its device driver.

This is too early for the IOMMU code to destroy any mappings
for the device, as they might still be in use by the driver.

The new BUS_NOTIFY_REMOVED_DEVICE event introduced with this
patch closes this gap as it is sent when the device is
already unbound from its device driver and almost completly
removed from the driver core.

With this event the IOMMU code can safely destroy any
mappings and other data structures when a device is removed.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Jerry Hoemann <jerry.hoemann@hp.com>

Automatically created from "patches.drivers/0001-driver-core-add-bus_notify_removed_device-event" by xen-port-patches.py

--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -181,7 +181,7 @@ static int xen_pci_notifier(struct notif
 	case BUS_NOTIFY_ADD_DEVICE:
 		xen_add_device(dev);
 		break;
-	case BUS_NOTIFY_DEL_DEVICE:
+	case BUS_NOTIFY_REMOVED_DEVICE:
 		xen_remove_device(dev);
 		break;
 	default:
